]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
Trigger Event Log
[working/Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 -->
23
24 <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">
25
26         <!-- Virtual classes -->
27         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
28                 <fields>
29                         <field name="usr" oils_persist:virtual="true" />
30                         <field name="forgive_payment" oils_persist:virtual="true" />
31                         <field name="work_payment" oils_persist:virtual="true" />
32                         <field name="credit_payment" oils_persist:virtual="true" />
33                         <field name="goods_payment" oils_persist:virtual="true" />
34                 </fields>
35                 <links>
36                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
37                 </links>
38         </class>
39
40         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
41                 <fields>
42                         <field name="workstation" oils_persist:virtual="true" />
43                         <field name="cash_payment" oils_persist:virtual="true" />
44                         <field name="check_payment" oils_persist:virtual="true" />
45                         <field name="credit_card_payment" oils_persist:virtual="true" />
46                 </fields>
47                 <links>
48                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
49                 </links>
50         </class>
51
52         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
53                 <fields>
54                         <field name="id" oils_persist:virtual="true" />
55                         <field name="children" oils_persist:virtual="true" />
56                         <field name="owner_doc" oils_persist:virtual="true" />
57                         <field name="intra_doc_id" oils_persist:virtual="true" />
58                         <field name="parent_node" oils_persist:virtual="true" />
59                         <field name="node_type" oils_persist:virtual="true" />
60                         <field name="namespace_uri" oils_persist:virtual="true" />
61                         <field name="name" oils_persist:virtual="true" />
62                         <field name="value" oils_persist:virtual="true" />
63                 </fields>
64         </class>
65
66         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
67                 <fields>
68                         <field name="title" oils_persist:virtual="true" />
69                         <field name="author" oils_persist:virtual="true" />
70                         <field name="doc_id" oils_persist:virtual="true" />
71                         <field name="doc_type" oils_persist:virtual="true" />
72                         <field name="pubdate" oils_persist:virtual="true" />
73                         <field name="isbn" oils_persist:virtual="true" />
74                         <field name="publisher" oils_persist:virtual="true" />
75                         <field name="tcn" oils_persist:virtual="true" />
76                         <field name="subject" oils_persist:virtual="true" />
77                         <field name="types_of_resource" oils_persist:virtual="true" />
78                         <field name="call_numbers" oils_persist:virtual="true" />
79                         <field name="edition" oils_persist:virtual="true" />
80                         <field name="online_loc" oils_persist:virtual="true" />
81                         <field name="synopsis" oils_persist:virtual="true" />
82                         <field name="physical_description" oils_persist:virtual="true" />
83                         <field name="toc" oils_persist:virtual="true" />
84                         <field name="copy_count" oils_persist:virtual="true" />
85                         <field name="series" oils_persist:virtual="true" />
86                         <field name="serials" oils_persist:virtual="true" />
87                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
88                 </fields>
89         </class>
90
91         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
92                 <fields>
93                         <field name="err_msg" oils_persist:virtual="true" />
94                         <field name="type" oils_persist:virtual="true" />
95                 </fields>
96         </class>
97
98         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
99                 <fields>
100                         <field name="err_msg" oils_persist:virtual="true" />
101                         <field name="type" oils_persist:virtual="true" />
102                 </fields>
103         </class>
104
105         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
106                 <fields oils_persist:primary="matchpoint">
107                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
108                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
109                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
110                 </fields>
111                 <links>
112                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
113                 </links>
114         </class>
115
116         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
117         <!-- when the time is right, turn me into a view.  -->
118                 <fields>
119             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
120             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
121             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
122             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
123             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
124             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
125             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
126             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
127             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
128             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
129                 </fields>
130         </class>
131
132         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
133                 <fields>
134                         <field name="public_name" oils_persist:virtual="true" />
135                         <field name="target_url" oils_persist:virtual="true" />
136                         <field name="target_coverage" oils_persist:virtual="true" />
137                         <field name="target_embargo" oils_persist:virtual="true" />
138                 </fields>
139         </class>
140
141         <!-- Actually in the DB -->
142         <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">
143                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
144                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
145                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
146                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
147                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
148                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
149                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
150                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
151                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
152                 </fields>
153                 <links>
154                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
155                 </links>
156                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
157                         <actions>
158                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
159                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
160                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
161                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
162                         </actions>
163                 </permacrud>
164         </class>
165
166         <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">
167                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
168                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
169                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
170                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
171                 </fields>
172                 <links>
173                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
174                 </links>
175                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
176                         <actions>
177                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
178                                 <retrieve permission="CREATE_IMPORT_TRASH_FIELD UPDATE_IMPORT_TRASH_FIELD DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
179                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
180                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
181                         </actions>
182                 </permacrud>
183         </class>
184
185         <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">
186                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
187                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
188                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
189                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
190                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
191                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
192                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
193                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
194                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
195                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
196                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
197                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
198                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
199                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
200                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
201                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
202                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
203                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
204                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
205                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
206                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
207                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
208                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
209                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
210                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
211                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
212                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
213                 </fields>
214                 <links>
215                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
216                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
217                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
218                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
219                 </links>
220                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
221                         <actions>
222                                 <create permission="CREATE_IMPORT_ITEM">
223                     <context link="definition" field="owner"/>
224                                 </create>
225                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
226                     <context link="definition" field="owner"/>
227                                 </retrieve>
228                                 <update permission="UPDATE_IMPORT_ITEM">
229                     <context link="definition" field="owner"/>
230                                 </update>
231                                 <delete permission="DELETE_IMPORT_ITEM">
232                     <context link="definition" field="owner"/>
233                                 </delete>
234                         </actions>
235                 </permacrud>
236         </class>
237
238         <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">
239                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
240                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
241                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
242                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
243                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
244                         <field reporter:label="Keep" name="keep" reporter:datatype="bool"/>
245                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
246                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
247                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
248                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
249                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
250                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
251                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
252                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
253                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
254                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
255                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
256                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
257                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
258                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
259                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
260                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
261                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
262                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
263                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
264                 </fields>
265                 <links>
266                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
267                 </links>
268                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
269                         <actions>
270                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
271                                 <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"/>
272                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
273                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
274                         </actions>
275                 </permacrud>
276         </class>
277
278         <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">
279                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
280                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
281                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
282                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
283                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
284                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
285                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
286                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
287                 </fields>
288                 <links>
289                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
290                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
291                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
292                 </links>
293                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
294                         <actions>
295                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
296                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
297                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
298                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
299                         </actions>
300                 </permacrud>
301         </class>
302
303         <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">
304                 <fields oils_persist:primary="code">
305                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
306                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
307                 </fields>
308                 <links>
309                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
310                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
311                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
312                 </links>
313                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
314                         <actions>
315                                 <retrieve/>
316                         </actions>
317                 </permacrud>
318         </class>
319
320         <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">
321                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
322                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
323                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
324                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
325                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
326                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
327                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
328                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
329                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
330                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
331                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
332                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
333                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
334                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
335                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
336                 </fields>
337                 <links>
338                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
339                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
340                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
341                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
342             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
343             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
344             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
345                 </links>
346                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
347                         <actions>
348                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
349                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
350                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
351                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
352                         </actions>
353                 </permacrud>
354         </class>
355
356         <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">
357                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
358                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
359                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
360                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
361                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
362                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
363                 </fields>
364                 <links/>
365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
366                         <actions>
367                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
368                 <retrieve/>
369                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
370                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
371                         </actions>
372                 </permacrud>
373         </class>
374
375         <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">
376                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
377                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
378                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
379                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
380                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
381                 </fields>
382                 <links>
383                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
384                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
385                 </links>
386                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
387                         <actions>
388                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
389                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
390                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
391                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
392                         </actions>
393                 </permacrud>
394         </class>
395
396         <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">
397                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
398                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
399                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
400                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
401                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
402                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
403                 </fields>
404                 <links>
405                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
406                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
407                 </links>
408                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
409                         <actions>
410                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
411                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
412                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
413                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
414                         </actions>
415                 </permacrud>
416         </class>
417
418         <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">
419                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
420                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
421                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
422                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
423                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
424                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
425                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
426                 </fields>
427                 <links>
428                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
429                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
430                 </links>
431                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
432                         <actions>
433                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
434                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
435                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
436                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
437                         </actions>
438                 </permacrud>
439         </class>
440
441         <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">
442                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
443                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
444                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
445                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
446                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
447                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
448                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
449                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
450                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
451                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
452                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
453                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
454                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
455                 </fields>
456                 <links>
457                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
458                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
459                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
460             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
461             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
462                 </links>
463                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
464                         <actions>
465                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
466                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
467                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
468                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
469                         </actions>
470                 </permacrud>
471         </class>
472
473         <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">
474                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
475                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
476                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
477                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
478                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
479                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
480                 </fields>
481                 <links/>
482                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
483                         <actions>
484                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
485                 <retrieve/>
486                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
487                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
488                         </actions>
489                 </permacrud>
490         </class>
491
492         <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">
493                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
494                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
495                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
496                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
497                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
498                 </fields>
499                 <links>
500                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
501                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
502                 </links>
503                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
504                         <actions>
505                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
506                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
507                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
508                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
509                         </actions>
510                 </permacrud>
511         </class>
512
513         <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">
514                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
515                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
516                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
517                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
518                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
519                 </fields>
520                 <links>
521                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
522                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
523                 </links>
524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
525                         <actions>
526                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
527                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
528                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
529                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
530                         </actions>
531                 </permacrud>
532         </class>
533
534         <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">
535                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
536                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
537                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
538                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
539                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
540                 </fields>
541                 <links>
542                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
543                 </links>
544                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
545                         <actions>
546                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
547                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
548                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
549                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
550                         </actions>
551                 </permacrud>
552         </class>
553
554         <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">
555                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
556                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
557                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
558                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
559                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
560                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
561                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
562                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
563             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
564                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
565                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
566                 </fields>
567                 <links>
568                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
569                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
570                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
571                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
572                 </links>
573                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
574                         <actions>
575                                 <create permission="ADMIN_IMPORT_MATCH_SET">
576                     <context link="match_set" field="owner"/>
577                                 </create>
578                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
579                     <context link="match_set" field="owner"/>
580                                 </retrieve>
581                                 <update permission="ADMIN_IMPORT_MATCH_SET">
582                     <context link="match_set" field="owner"/>
583                                 </update>
584                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
585                     <context link="match_set" field="owner"/>
586                                 </delete>
587                         </actions>
588                 </permacrud>
589         </class>
590
591         <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">
592                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
593                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
594                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
595                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
596                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
597                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
598                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
599                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
600                 </fields>
601                 <links>
602                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
603                 </links>
604                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
605                         <actions>
606                                 <create permission="ADMIN_IMPORT_MATCH_SET">
607                     <context link="match_set" field="owner"/>
608                                 </create>
609                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
610                     <context link="match_set" field="owner"/>
611                                 </retrieve>
612                                 <update permission="ADMIN_IMPORT_MATCH_SET">
613                     <context link="match_set" field="owner"/>
614                                 </update>
615                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
616                     <context link="match_set" field="owner"/>
617                                 </delete>
618                         </actions>
619                 </permacrud>
620         </class>
621
622         <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">
623                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
624                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
625                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
626                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
627                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
628                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
629                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
630                 </fields>
631                 <links>
632                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
633                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
634                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
635                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
636                 </links>
637         </class>
638
639     <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">
640         <fields oils_persist:primary="name">
641             <field reporter:label="Name" name="name" reporter:datatype="text"/>
642             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
643             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
644             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
645         </fields>
646         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
647             <actions>
648                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
649                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
650                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
651                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
652             </actions>
653         </permacrud>
654     </class>
655
656     <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">
657         <fields oils_persist:primary="id">
658             <field reporter:label="ID" name="id" reporter:datatype="id"/>
659             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
660             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
661             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
662             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
663         </fields>
664         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
665             <actions>
666                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
667                 <retrieve/>
668                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
669                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
670             </actions>
671         </permacrud>
672     </class>
673
674         <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">
675                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
676                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
677                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
678                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
679                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
680                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
681                 </fields>
682                 <links>
683                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
684                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
685                 </links>
686         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
687             <actions>
688                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
689                 <retrieve/>
690                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
691                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
692             </actions>
693         </permacrud>
694         </class>
695
696         <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">
697                 <fields oils_persist:primary="name">
698                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
699                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true"/>
700                         <field reporter:label="Description" name="description" reporter:datatype="text" />
701                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
702                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
703                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
704                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
705                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
706                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
707                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
708                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
709                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
710                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
711                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
712                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
713                 </fields>
714                 <links>
715                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
716                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
717                 </links>
718         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
719             <actions>
720                 <create permission="ADMIN_SVF" global_required="true"/>
721                 <retrieve/>
722                 <update permission="ADMIN_SVF" global_required="true"/>
723                 <delete permission="ADMIN_SVF" global_required="true"/>
724             </actions>
725         </permacrud>
726         </class>
727
728         <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">
729                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
730                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
731                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
732                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
733             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
734                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
735                 </fields>
736                 <links/>
737         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
738             <actions>
739                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
740                 <retrieve/>
741                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
742                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
743             </actions>
744         </permacrud>
745         </class>
746
747         <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">
748                 <fields oils_persist:primary="id">
749                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
750                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
751                 </fields>
752                 <links>
753                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
754                 </links>
755         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
756             <actions>
757                 <retrieve/>
758             </actions>
759         </permacrud>
760         </class>
761
762         <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">
763                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
764                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
765                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
766                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
767                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
768                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
769                 </fields>
770                 <links>
771                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
772                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
773                 </links>
774         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
775             <actions>
776                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
777                 <retrieve/>
778                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
779                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
780             </actions>
781         </permacrud>
782         </class>
783
784         <class id="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">
785                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
786                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true"/>
787                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
788                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
789                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
790                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
791                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
792                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
793             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
794                 </fields>
795                 <links>
796                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
797                 </links>
798         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
799             <actions>
800                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
801                 <retrieve/>
802                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
803                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
804             </actions>
805         </permacrud>
806         </class>
807
808         <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">
809                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
810                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
811                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
812                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
813                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
814                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
815                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
816                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
817                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
818                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
819                 </fields>
820                 <links>
821                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
822                 </links>
823         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
824             <actions>
825                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
826                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
827                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
828                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
829             </actions>
830         </permacrud>
831         </class>
832
833     <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">
834         <fields oils_persist:primary="name">
835             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
836             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
837             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
838             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
839             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
840             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
841             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
842             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
843             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
844             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
845         </fields>
846         <links>
847             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
848             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
849         </links>
850         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
851             <actions>
852                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
853                 <retrieve/>
854                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
855                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
856             </actions>
857         </permacrud>
858     </class>
859
860     <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">
861         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
862             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id"/>
863             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
864             <field reporter:label="Name" name="name" reporter:datatype="text"/>
865             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
866             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
867             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
868             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
869         </fields>
870         <links>
871             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
872         </links>
873         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
874             <actions>
875                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
876                 <retrieve/>
877                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
878                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
879             </actions>
880         </permacrud>
881     </class>
882
883         <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">
884                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
885                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
886                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
887                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
888                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
889                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
890                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
891                 </fields>
892                 <links>
893             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
894             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
895                 </links>
896                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
897                         <actions>
898                                 <retrieve/>
899                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
900                         </actions>
901                 </permacrud>
902         </class>
903
904         <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">
905                 <fields oils_persist:primary="key">
906                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
907                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
908                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
909                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
910                 </fields>
911                 <links/>
912                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
913                         <actions>
914                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
915                                 <retrieve/>
916                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
917                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
918                         </actions>
919                 </permacrud>
920         </class>
921
922         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
923                 <fields oils_persist:primary="module">
924                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
925                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
926                 </fields>
927                 <links/>
928         </class>
929
930         <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">
931                 <fields oils_persist:primary="module">
932                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
933                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
934                 </fields>
935                 <links/>
936                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
937                         <actions>
938                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
939                                 <retrieve/>
940                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
941                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
942                         </actions>
943                 </permacrud>
944         </class>
945
946         <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">
947                 <fields oils_persist:primary="module">
948                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
949                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
950                 </fields>
951                 <links/>
952                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
953                         <actions>
954                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
955                                 <retrieve/>
956                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
957                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
958                         </actions>
959                 </permacrud>
960         </class>
961
962         <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">
963                 <fields oils_persist:primary="module">
964                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
965                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
966                 </fields>
967                 <links/>
968                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
969                         <actions>
970                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
971                                 <retrieve/>
972                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
973                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
974                         </actions>
975                 </permacrud>
976         </class>
977
978         <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">
979                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
980                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
981                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
982                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
983                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
984                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
985                 </fields>
986                 <links>
987                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
988                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
989                 </links>
990                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
991                         <actions>
992                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
993                     <context link="event_def" field="owner"/>
994                 </create>
995                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
996                     <context link="event_def" field="owner"/>
997                 </retrieve>
998                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
999                     <context link="event_def" field="owner"/>
1000                 </update>
1001                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1002                     <context link="event_def" field="owner"/>
1003                 </delete>
1004                         </actions>
1005                 </permacrud>
1006         </class>
1007
1008         <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">
1009                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1010                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1011                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1012                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1013                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1014                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1015                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1016                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1017                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1018                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1019                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1020                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1021                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1022                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1023                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1024                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1025                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1026                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1027                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1028                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1029                 </fields>
1030                 <links>
1031                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1032                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1033                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1034                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1035                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1036                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1037                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1038                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1039                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1040                 </links>
1041                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1042                         <actions>
1043                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1044                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1045                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1046                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1047                         </actions>
1048                 </permacrud>
1049         </class>
1050
1051         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1052                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1053                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1054                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1055                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1056                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1057                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1058                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1059                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1060                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1061                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1062                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1063                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1064                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1065                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1066                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1067                 </fields>
1068                 <links>
1069                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1070                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1071                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1072                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1073                 </links>
1074         </class>
1075
1076         <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">
1077                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1078                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1079                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1080                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1081                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1082                 </fields>
1083                 <links>
1084                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1085                 </links>
1086                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1087                         <actions>
1088                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1089                     <context link="event_def" field="owner"/>
1090                 </create>
1091                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1092                     <context link="event_def" field="owner"/>
1093                 </retrieve>
1094                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1095                     <context link="event_def" field="owner"/>
1096                 </update>
1097                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1098                     <context link="event_def" field="owner"/>
1099                 </delete>
1100                         </actions>
1101                 </permacrud>
1102         </class>
1103
1104         <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">
1105                 <oils_persist:source_definition><![CDATA[
1106                 SELECT  atevdef.hook,
1107                         atevdef.name,
1108                         atevdef.reactor,
1109                         atev.id,
1110                         atev.event_def,
1111                         atev.add_time,
1112                         atev.run_time,
1113                         atev.start_time,
1114                         atev.update_time,
1115                         atev.complete_time,
1116                         atev.update_process,
1117                         atev.state,
1118                         atev.user_data,
1119                         atev.template_output,
1120                         atev.error_output,
1121                         atev.async_output,
1122                         targ_circ.id AS target_circ,
1123                         targ_ahr.id AS target_hold,
1124                         COALESCE(
1125                                 targ_circ.circ_lib,
1126                                 targ_ahr.pickup_lib
1127                         ) AS perm_lib
1128                 FROM action_trigger.event atev
1129                 JOIN action_trigger.event_definition atevdef ON
1130                         (atevdef.id = atev.event_def)
1131                 JOIN action_trigger.hook ath ON
1132                         (ath.key = atevdef.hook)
1133                 LEFT JOIN action.circulation targ_circ ON
1134                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1135                 LEFT JOIN action.hold_request targ_ahr ON
1136                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1137                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1138                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1139                                 'circ.staff.max_visible_event_age',
1140                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1141                         ) UNION
1142                         SELECT '1000 YEARS'::INTERVAL AS value
1143                 ) ous)
1144                 ]]></oils_persist:source_definition>
1145                 <fields oils_persist:primary="id">
1146                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1147                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1148                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1149                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1150                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1151                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1152                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1153                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1154                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1155                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1156                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1157                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1158                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1159                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1160                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1161                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1162                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1163                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1164                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1165                 </fields>
1166                 <links>
1167                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1168                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1169                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1170                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1171                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1172                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1173                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1174                 </links>
1175                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1176                         <actions>
1177                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1178                         </actions>
1179                 </permacrud>
1180         </class>
1181
1182         <class id="aws" controller="open-ils.cstore" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1183                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1184                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1185                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1186                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1187                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1188                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1189                 </fields>
1190                 <links>
1191                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1192                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1193                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1194                 </links>
1195         </class>
1196
1197         <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">
1198                 <fields oils_persist:primary="code">
1199                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1200                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1201                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1202                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1203                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1204                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1205                 </fields>
1206                 <links/>
1207         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1208             <actions>
1209                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1210                 <retrieve/>
1211                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1212                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1213             </actions>
1214         </permacrud>
1215         </class>
1216
1217         <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">
1218                 <fields oils_persist:primary="code">
1219                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1220                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1221                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1222                 </fields>
1223                 <links/>
1224         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1225             <actions>
1226                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1227                 <retrieve/>
1228                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1229                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1230             </actions>
1231         </permacrud>
1232         </class>
1233
1234         <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">
1235                 <fields oils_persist:primary="code">
1236                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1237                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1238                 </fields>
1239                 <links/>
1240         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1241             <actions>
1242                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1243                 <retrieve/>
1244                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1245                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1246             </actions>
1247         </permacrud>
1248         </class>
1249
1250         <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">
1251                 <fields oils_persist:primary="code">
1252                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1253                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1254                 </fields>
1255                 <links/>
1256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1257             <actions>
1258                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1259                 <retrieve/>
1260                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1261                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1262             </actions>
1263         </permacrud>
1264         </class>
1265
1266         <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">
1267                 <fields oils_persist:primary="code">
1268                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1269                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1270                 </fields>
1271                 <links/>
1272         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1273             <actions>
1274                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1275                 <retrieve/>
1276                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1277                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1278             </actions>
1279         </permacrud>
1280         </class>
1281
1282         <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">
1283                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1284                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1285                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1286                 </fields>
1287                 <links/>
1288         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1289             <actions>
1290                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1291                 <retrieve/>
1292                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1293                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1294             </actions>
1295         </permacrud>
1296         </class>
1297
1298         <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">
1299                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1300                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1301                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1302                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1303                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1304                 </fields>
1305         <links>
1306             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1307             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1308             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1309         </links>
1310         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1311             <actions>
1312                 <create permission="UPDATE_COPY">
1313                     <context link="target_copy" field="circ_lib"/>
1314                 </create>
1315                 <retrieve/>
1316                 <update permission="UPDATE_COPY">
1317                     <context link="target_copy" field="circ_lib"/>
1318                 </update>
1319                 <delete permission="UPDATE_COPY">
1320                     <context link="target_copy" field="circ_lib"/>
1321                 </delete>
1322             </actions>
1323         </permacrud>
1324         </class>
1325
1326         <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">
1327                 <fields oils_persist:primary="code">
1328                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1329                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1330                 </fields>
1331                 <links/>
1332         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1333             <actions>
1334                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1335                 <retrieve/>
1336                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1337                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1338             </actions>
1339         </permacrud>
1340         </class>
1341
1342         <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">
1343                 <fields oils_persist:primary="code">
1344                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1345                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1346                 </fields>
1347                 <links/>
1348         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1349             <actions>
1350                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1351                 <retrieve/>
1352                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1353                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1354             </actions>
1355         </permacrud>
1356         </class>
1357
1358         <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">
1359                 <fields oils_persist:primary="code">
1360                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1361                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1362                 </fields>
1363                 <links/>
1364         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1365             <actions>
1366                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1367                 <retrieve/>
1368                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1369                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1370             </actions>
1371         </permacrud>
1372         </class>
1373
1374     <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">
1375         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1376             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1377             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1378             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1379             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1380             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1381             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1382             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1383             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1384             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1385             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1386             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1387             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1388             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1389             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1390             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1391             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1392             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1393         </fields>
1394         <links/>
1395         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1396             <actions>
1397                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1398                 <retrieve/>
1399                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1400                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1401             </actions>
1402         </permacrud>
1403     </class>
1404
1405     <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">
1406         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1407             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1408             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1409             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1410             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1411             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1412             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1413             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1414             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1415             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1416             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1417             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1418             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1419             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1420             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1421             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1422             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1423             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1424             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1425         </fields>
1426         <links/>
1427         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1428             <actions>
1429                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1430                 <retrieve/>
1431                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1432                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1433             </actions>
1434         </permacrud>
1435     </class>
1436
1437     <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">
1438         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1439             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1440             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1441             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1442             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1443             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1444         </fields>
1445         <links>
1446             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1447             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1448             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1449         </links>
1450         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1451             <actions>
1452                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1453                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1454                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1455                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1456             </actions>
1457         </permacrud>
1458     </class>
1459
1460         <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">
1461                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1462                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1463                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1464                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1465                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1466                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1467                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1468                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1469                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1470                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1471                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1472                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1473                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1474                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1475                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1476                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1477                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1478             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1479                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1480                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1481                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1482                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1483                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1484                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1485                 </fields>
1486                 <links>
1487                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1488                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1489                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1490                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1491                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1492                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1493                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1494                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1495                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1496                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1497                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1498                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1499                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1500             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1501                 </links>
1502         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1503             <actions>
1504                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1505                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1506                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1507                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1508             </actions>
1509         </permacrud>
1510         </class>
1511
1512         <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">
1513                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1514                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1515                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1516                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1517                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1518                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1519                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1520                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1521                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1522                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1523                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1524                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1525                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1526                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1527                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1528             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1529                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1530                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1531             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1532                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1533                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1534                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1535                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1536             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1537             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1538             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1539                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1540                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1541                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1542                 </fields>
1543                 <links>
1544                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1545                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1546                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1547                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1548                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1549                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1550                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1551                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1552                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1553                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1554                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1555                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1556                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1557             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1558                 </links>
1559         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1560             <actions>
1561                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1562                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1563                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1564                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1565             </actions>
1566         </permacrud>
1567         </class>
1568
1569     <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">
1570         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1571             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1572             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1573             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1574         </fields>
1575         <links/>
1576         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1577             <actions>
1578                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1579                 <retrieve/>
1580                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1581                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1582             </actions>
1583         </permacrud>
1584     </class>
1585
1586     <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">
1587         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1588             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1589             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1590             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1591             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1592             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1593             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1594             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1595         </fields>
1596         <links>
1597             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1598         </links>
1599         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1600             <actions>
1601                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1602                 <retrieve/>
1603                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1604                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1605             </actions>
1606         </permacrud>
1607     </class>
1608
1609     <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">
1610         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
1611             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1612             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
1613             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1614             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
1615             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1616         </fields>
1617         <links>
1618             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
1619             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1620         </links>
1621         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1622             <actions>
1623                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1624                     <context link="matchpoint" field="org_unit"/>
1625                 </create>
1626                 <retrieve/>
1627                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1628                     <context link="matchpoint" field="org_unit"/>
1629                 </update>
1630                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1631                     <context link="matchpoint" field="org_unit"/>
1632                 </delete>
1633             </actions>
1634         </permacrud>
1635     </class>
1636
1637     <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">
1638         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
1639             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1640             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1641             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
1642         </fields>
1643         <links>
1644             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1645             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
1646         </links>
1647         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1648             <actions>
1649                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1650                     <context link="limit_set" field="owning_lib"/>
1651                 </create>
1652                 <retrieve/>
1653                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1654                     <context link="limit_set" field="owning_lib"/>
1655                 </update>
1656                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1657                     <context link="limit_set" field="owning_lib"/>
1658                 </delete>
1659             </actions>
1660         </permacrud>
1661     </class>
1662
1663     <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">
1664         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
1665             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1666             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1667             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
1668             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
1669         </fields>
1670         <links>
1671             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1672             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
1673         </links>
1674         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1675             <actions>
1676                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1677                     <context link="limit_set" field="owning_lib"/>
1678                 </create>
1679                 <retrieve/>
1680                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1681                     <context link="limit_set" field="owning_lib"/>
1682                 </update>
1683                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1684                     <context link="limit_set" field="owning_lib"/>
1685                 </delete>
1686             </actions>
1687         </permacrud>
1688     </class>
1689
1690         <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">
1691                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
1692                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1693                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1694                 </fields>
1695                 <links/>
1696         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1697             <actions>
1698                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
1699                 <retrieve/>
1700                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
1701                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
1702             </actions>
1703         </permacrud>
1704         </class>
1705
1706         <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">
1707                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
1708                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
1709                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
1710                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
1711                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
1712                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
1713                 </fields>
1714                 <links>
1715                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
1716                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
1717                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
1718                 </links>
1719         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1720             <actions>
1721                 <create permission="ADMIN_SURVEY">
1722                     <context link="survey" field="owner"/>
1723                 </create>
1724                 <retrieve/>
1725                 <update permission="ADMIN_SURVEY">
1726                     <context link="survey" field="owner"/>
1727                 </update>
1728                 <delete permission="ADMIN_SURVEY">
1729                     <context link="survey" field="owner"/>
1730                 </delete>
1731             </actions>
1732         </permacrud>
1733         </class>
1734         <class id="mbts" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
1735                 <fields oils_persist:primary="id" oils_persist:sequence="">
1736                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
1737                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
1738                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
1739                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
1740                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
1741                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
1742                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
1743                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
1744                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
1745                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
1746                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
1747                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
1748                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
1749                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
1750                 </fields>
1751                 <links>
1752                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1753                 </links>
1754         </class>
1755         <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">
1756                 <fields oils_persist:primary="id" oils_persist:sequence="">
1757                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
1758                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
1759                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
1760                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
1761                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
1762                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
1763                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
1764                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
1765                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
1766                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
1767                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
1768                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
1769                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
1770                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
1771                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
1772                 </fields>
1773                 <links>
1774                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1775                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
1776                 </links>
1777         </class>
1778         <class id="aun" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_note" oils_persist:tablename="actor.usr_note" reporter:label="User Note">
1779                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
1780                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
1781                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
1782                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
1783                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
1784                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
1785                         <field reporter:label="User" name="usr" reporter:datatype="link" />
1786                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
1787                 </fields>
1788                 <links>
1789                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1790                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
1791                 </links>
1792         </class>
1793         <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">
1794                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
1795                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
1796                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
1797                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
1798                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
1799                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
1800                 </fields>
1801                 <links>
1802                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1803                 </links>
1804         </class>
1805         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
1806                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
1807                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
1808                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
1809                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
1810                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
1811                 </fields>
1812                 <links>
1813                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
1814                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1815                 </links>
1816         </class>
1817         <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">
1818                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
1819                         <field name="field" reporter:datatype="link"/>
1820                         <field name="id" reporter:datatype="id" />
1821                         <field name="source" reporter:datatype="link"/>
1822                         <field name="value" reporter:datatype="text"/>
1823                 </fields>
1824                 <links>
1825                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1826                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
1827                 </links>
1828         </class>
1829         <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">
1830                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
1831                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
1832                         <field reporter:label="Item" name="item" reporter:datatype="int" />
1833                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
1834                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
1835                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
1836                 </fields>
1837                 <links>
1838                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
1839                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
1840                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1841                 </links>
1842         </class>
1843         <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">
1844                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
1845                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
1846                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
1847                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
1848                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
1849                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
1850                 </fields>
1851                 <links>
1852                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
1853                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
1854                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1855                 </links>
1856         </class>
1857         <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">
1858                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
1859                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
1860                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
1861                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
1862                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
1863                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
1864                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
1865                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
1866                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
1867                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
1868                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
1869                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
1870                 </fields>
1871                 <links>
1872                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
1873                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
1874                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
1875                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
1876                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
1877                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1878                 </links>
1879         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1880             <actions>
1881                 <create permission="TRANSIT_COPY" context_field="owner">
1882                     <context link="target_copy" field="circ_lib"/>
1883                 </create>
1884                 <retrieve/>
1885                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
1886                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
1887             </actions>
1888         </permacrud>
1889         </class>
1890         <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">
1891                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
1892                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
1893                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
1894                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
1895                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
1896                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
1897                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
1898                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
1899                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
1900                 </fields>
1901                 <links>
1902                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
1903                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
1904                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
1905                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1906                 </links>
1907         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1908             <actions>
1909                 <create permission="ADMIN_SURVEY">
1910                     <context link="survey" field="owner"/>
1911                 </create>
1912                 <retrieve/>
1913                 <update permission="ADMIN_SURVEY">
1914                     <context link="survey" field="owner"/>
1915                 </update>
1916                 <delete permission="ADMIN_SURVEY">
1917                     <context link="survey" field="owner"/>
1918                 </delete>
1919             </actions>
1920         </permacrud>
1921         </class>
1922         <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">
1923                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
1924                         <field name="bucket" />
1925                         <field name="id" reporter:datatype="id" />
1926                         <field name="target_copy" reporter:datatype="link"/>
1927                         <field name="create_time" reporter:datatype="timestamp" />
1928                         <field name="pos" reporter:datatype="int" />
1929                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
1930                 </fields>
1931                 <links>
1932                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1933                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
1934             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
1935                 </links>
1936         </class>
1937         <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">
1938                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
1939                         <field name="id" reporter:datatype="id" />
1940                         <field name="item" reporter:datatype="link"/>
1941                         <field name="note" reporter:datatype="text" />
1942                 </fields>
1943                 <links>
1944                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
1945                 </links>
1946         </class>
1947
1948         <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">
1949                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
1950                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1951                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
1952                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1953                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
1954                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
1955                 </fields>
1956                 <links>
1957                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
1958                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
1959                 </links>
1960                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1961                         <actions>
1962                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
1963                                 <retrieve/>
1964                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
1965                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
1966                         </actions>
1967                 </permacrud>
1968         </class>
1969
1970         <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">
1971                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
1972                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1973                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
1974                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
1975                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
1976                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
1977                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
1978                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
1979                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1980                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
1981                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
1982                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
1983                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
1984                 </fields>
1985                 <links>
1986                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
1987                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
1988                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
1989                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
1990                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
1991                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
1992                 </links>
1993                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1994                         <actions>
1995                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
1996                                 <retrieve/>
1997                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
1998                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
1999                         </actions>
2000                 </permacrud>
2001         </class>
2002
2003         <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">
2004                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2005                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2006                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2007                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2008                 </fields>
2009                 <links>
2010                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2011                 </links>
2012                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2013                         <actions>
2014                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2015                                 <retrieve/>
2016                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2017                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2018                         </actions>
2019                 </permacrud>
2020         </class>
2021
2022         <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">
2023                 <fields oils_persist:primary="code">
2024                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2025                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2026                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2027                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2028                 </fields>
2029                 <links>
2030                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2031                 </links>
2032                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2033                         <actions>
2034                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2035                                 <retrieve/>
2036                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2037                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2038                         </actions>
2039                 </permacrud>
2040         </class>
2041
2042         <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">
2043                 <fields oils_persist:primary="code">
2044                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2045                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2046                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2047                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2048                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2049                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2050                 </fields>
2051                 <links>
2052                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2053                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2054                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2055                 </links>
2056                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2057                         <actions>
2058                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2059                                 <retrieve/>
2060                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2061                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2062                         </actions>
2063                 </permacrud>
2064         </class>
2065
2066     <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">
2067         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2068             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2069             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2070             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2071         </fields>
2072         <links>
2073             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2074             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2075         </links>
2076         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2077             <actions>
2078                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2079                 <retrieve/>
2080                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2081                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2082             </actions>
2083         </permacrud>
2084     </class>
2085
2086         <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">
2087                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2088                         <field name="active" reporter:datatype="bool"/>
2089                         <field name="create_date" reporter:datatype="timestamp"/>
2090                         <field name="creator" />
2091                         <field name="deleted" reporter:datatype="bool"/>
2092                         <field name="edit_date" reporter:datatype="timestamp"/>
2093                         <field name="editor" />
2094                         <field name="id" reporter:datatype="id" />
2095                         <field name="last_xact_id" />
2096                         <field name="marc" />
2097                         <field name="source" />
2098                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2099                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2100                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2101                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2102                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2103                 </fields>
2104                 <links>
2105                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2106                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2107                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2108                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2109                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2110                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2111                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2112                 </links>
2113                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2114                         <actions>
2115                                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2116                                 <retrieve/>
2117                                 <update permission="UPDATE_MARC" global_required="true"/>
2118                                 <delete permission="UPDATE_MARC" global_required="true"/>
2119                         </actions>
2120                 </permacrud>
2121         </class>
2122         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2123                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2124                         <field name="char_encoding" />
2125                         <field name="id" />
2126                         <field name="record" />
2127                         <field name="record_status" />
2128                         <field name="thesaurus" />
2129                 </fields>
2130                 <links>
2131                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2132                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2133                 </links>
2134         </class>
2135         <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">
2136                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2137                         <field name="id" reporter:datatype="id" />
2138                         <field name="bib" reporter:datatype="link" />
2139                         <field name="authority" reporter:datatype="link" />
2140                 </fields>
2141                 <links>
2142                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2143                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2144                 </links>
2145         </class>
2146         <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">
2147                 <fields oils_persist:primary="code" oils_persist:sequence="">
2148                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2149                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2150                 </fields>
2151                 <links/>
2152         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2153             <actions>
2154                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2155                 <retrieve/>
2156                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2157                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2158             </actions>
2159         </permacrud>
2160         </class>
2161         <class id="mccp" controller="open-ils.cstore" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
2162                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2163                         <field name="accepting_usr" />
2164                         <field name="amount" reporter:datatype="money" />
2165                         <field name="amount_collected" reporter:datatype="money" />
2166                         <field name="approval_code" reporter:datatype="text"/>
2167                         <field name="cash_drawer" reporter:datatype="link"/>
2168                         <field name="cc_first_name" reporter:datatype="text"/>
2169                         <field name="cc_last_name" reporter:datatype="text"/>
2170                         <field name="cc_number" reporter:datatype="text"/>
2171                         <field name="cc_order_number" reporter:datatype="text"/>
2172                         <field name="cc_type" reporter:datatype="text"/>
2173                         <field name="cc_processor" reporter:datatype="text"/>
2174                         <field name="expire_month" reporter:datatype="int" />
2175                         <field name="expire_year" reporter:datatype="int" />
2176                         <field name="id" reporter:datatype="id" />
2177                         <field name="note" reporter:datatype="text"/>
2178                         <field name="payment_ts" reporter:datatype="timestamp"/>
2179                         <field name="xact" reporter:datatype="link"/>
2180                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2181                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2182                 </fields>
2183                 <links>
2184                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2185                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2186                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2187                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2188                 </links>
2189         </class>
2190         <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">
2191                 <fields oils_persist:primary="name">
2192                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2193                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2194                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2195                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2196                 </fields>
2197                 <links/>
2198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2199             <actions>
2200                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2201                 <retrieve/>
2202                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2203                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2204             </actions>
2205         </permacrud>
2206         </class>
2207
2208         <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">
2209                 <fields oils_persist:primary="alias">
2210                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2211                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2212                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2213                 </fields>
2214                 <links>
2215                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2216                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2217                 </links>
2218         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2219             <actions>
2220                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2221                 <retrieve/>
2222                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2223                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2224             </actions>
2225         </permacrud>
2226         </class>
2227
2228         <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">
2229                 <fields oils_persist:primary="name">
2230                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2231                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2232                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2233                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2234                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2235                 </fields>
2236                 <links>
2237                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2238                 </links>
2239         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2240             <actions>
2241                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2242                 <retrieve/>
2243                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2244                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2245             </actions>
2246         </permacrud>
2247         </class>
2248
2249         <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">
2250                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2251                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2252                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2253                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2254                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2255                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2256                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2257                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2258                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2259                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2260                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2261                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2262                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2263                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2264                 </fields>
2265                 <links>
2266                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2267                 </links>
2268         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2269             <actions>
2270                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2271                 <retrieve/>
2272                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2273                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2274             </actions>
2275         </permacrud>
2276         </class>
2277         <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">
2278                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2279                         <field name="id" reporter:datatype="id" />
2280                         <field name="name" reporter:datatype="text"/>
2281                         <field name="xpath" reporter:datatype="text"/>
2282                         <field name="format" reporter:datatype="link"/>
2283                         <field name="first_word" reporter:datatype="bool" />
2284                 </fields>
2285                 <links/>
2286         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2287             <actions>
2288                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2289                 <retrieve/>
2290                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2291                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2292             </actions>
2293         </permacrud>
2294         </class>
2295         <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">
2296                 <fields oils_persist:primary="code" oils_persist:sequence="">
2297                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2298                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2299                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2300                 </fields>
2301                 <links/>
2302         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2303             <actions>
2304                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2305                 <retrieve/>
2306                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2307                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2308             </actions>
2309         </permacrud>
2310         </class>
2311         <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">
2312                 <fields oils_persist:primary="code" oils_persist:sequence="">
2313                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2314                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2315                 </fields>
2316                 <links/>
2317         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2318             <actions>
2319                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2320                 <retrieve/>
2321                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2322                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2323             </actions>
2324         </permacrud>
2325         </class>
2326     <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">
2327         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2328             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2329             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2330             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2331             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2332         </fields>
2333         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2334             <actions>
2335                 <retrieve/>
2336             </actions>
2337         </permacrud>
2338     </class>
2339         <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">
2340                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2341                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2342                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2343                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2344                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2345                 </fields>
2346                 <links>
2347                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2348                 </links>
2349         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2350             <actions>
2351                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2352                 <retrieve/>
2353                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2354                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2355             </actions>
2356         </permacrud>
2357         </class>
2358         <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">
2359                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2360                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2361                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2362                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2363                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2364                 </fields>
2365                 <links>
2366                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2367                 </links>
2368         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2369             <actions>
2370                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2371                 <retrieve/>
2372                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2373                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2374             </actions>
2375         </permacrud>
2376         </class>
2377         <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">
2378                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2379                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2380                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2381                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2382                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2383                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2384                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2385                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2386                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2387                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2388                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2389                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2390                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2391                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
2392                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
2393                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
2394                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
2395                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
2396                 </fields>
2397                 <links>
2398                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2399                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2400                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2401                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2402                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
2403                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
2404                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
2405                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
2406                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
2407                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
2408                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
2409                 </links>
2410         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2411             <actions>
2412                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
2413                 <retrieve/>
2414                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
2415                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
2416             </actions>
2417         </permacrud>
2418         </class>
2419         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
2420                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
2421                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
2422                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
2423                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2424                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
2425                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2426                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2427                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2428                 </fields>
2429                 <links>
2430                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
2431                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
2432         </links>
2433         </class>
2434         <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">
2435                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
2436                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2437                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
2438                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
2439                 </fields>
2440                 <links>
2441                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
2442                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
2443                 </links>
2444         </class>
2445         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
2446                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
2447                         <field name="id" reporter:datatype="id" />
2448                         <field name="value" oils_persist:i18n="true" />
2449                 </fields>
2450                 <links/>
2451         </class>
2452         <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">
2453                 <fields oils_persist:primary="usr" oils_persist:sequence="">
2454                         <field name="balance_owed" reporter:datatype="money" />
2455                         <field name="total_owed" reporter:datatype="money" />
2456                         <field name="total_paid" reporter:datatype="money" />
2457                         <field name="usr" reporter:datatype="link"/>
2458                 </fields>
2459                 <links>
2460                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2461         </links>
2462         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2463             <actions>
2464                 <retrieve permission="VIEW_USER">
2465                     <context link="usr" field="home_ou"/>
2466                 </retrieve>
2467             </actions>
2468         </permacrud>
2469         </class>
2470         <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">
2471                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
2472                         <field name="collector" />
2473                         <field name="enter_time" reporter:datatype="timestamp"/>
2474                         <field name="id" reporter:datatype="id" />
2475                         <field name="location" reporter:datatype="link"/>
2476                         <field name="usr" reporter:datatype="link"/>
2477                 </fields>
2478                 <links>
2479                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2480                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
2481                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
2482                 </links>
2483         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2484             <actions>
2485                 <create permission="money.collections_tracker.create" context_field="location"/>
2486                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
2487                 <delete permission="money.collections_tracker.create" context_field="location"/>
2488             </actions>
2489         </permacrud>
2490         </class>
2491         <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">
2492                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
2493                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2494                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2495                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
2496                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2497                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
2498                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
2499                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
2500                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2501                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
2502                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
2503                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
2504                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
2505                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
2506                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
2507                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
2508                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
2509                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2510                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
2511                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
2512                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
2513                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2514                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2515                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2516                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2517                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2518                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2519                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2520                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2521                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
2522                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
2523                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
2524                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
2525                 </fields>
2526                 <links>
2527                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2528                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2529                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2530                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
2531                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
2532                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
2533                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
2534                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
2535                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
2536                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
2537                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
2538                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
2539                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
2540                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
2541                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
2542                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
2543                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
2544                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
2545                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
2546                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
2547                 </links>
2548         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2549             <actions>
2550                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2551                 <retrieve/>
2552                 <update permission="UPDATE_MARC" global_required="true"/>
2553             </actions>
2554         </permacrud>
2555         </class>
2556         <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">
2557                 <fields oils_persist:primary="id">
2558                         <field name="dow_0_close" />
2559                         <field name="dow_0_open" />
2560                         <field name="dow_1_close" />
2561                         <field name="dow_1_open" />
2562                         <field name="dow_2_close" />
2563                         <field name="dow_2_open" />
2564                         <field name="dow_3_close" />
2565                         <field name="dow_3_open" />
2566                         <field name="dow_4_close" />
2567                         <field name="dow_4_open" />
2568                         <field name="dow_5_close" />
2569                         <field name="dow_5_open" />
2570                         <field name="dow_6_close" />
2571                         <field name="dow_6_open" />
2572                         <field name="id" reporter:datatype="id" />
2573                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
2574                 </fields>
2575                 <links>
2576                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
2577                 </links>
2578         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2579             <actions>
2580                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
2581                 <retrieve/>
2582                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
2583                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
2584             </actions>
2585         </permacrud>
2586         </class>
2587         <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">
2588                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
2589                         <field name="id" reporter:datatype="id" />
2590                         <field name="record" reporter:datatype="link"/>
2591                         <field name="label" reporter:datatype="text"/>
2592                         <field name="label_sortkey" reporter:datatype="text"/>
2593                 </fields>
2594                 <links>
2595                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2596                 </links>
2597         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2598             <actions>
2599                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
2600                 <retrieve/>
2601                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
2602                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
2603             </actions>
2604         </permacrud>
2605         </class>
2606         <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">
2607                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
2608                         <field name="id" reporter:datatype="id" />
2609                         <field name="target_copy" reporter:datatype="link" />
2610                         <field name="part" reporter:datatype="link"/>
2611                 </fields>
2612                 <links>
2613                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2614                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
2615                 </links>
2616         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2617             <actions>
2618                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
2619                 <retrieve/>
2620                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
2621                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
2622             </actions>
2623         </permacrud>
2624         </class>
2625         <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">
2626                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
2627                         <field name="close_end" reporter:datatype="timestamp" />
2628                         <field name="close_start" reporter:datatype="timestamp" />
2629                         <field name="id" reporter:datatype="id" />
2630                         <field name="org_unit" reporter:datatype="org_unit"/>
2631                         <field name="reason" reporter:datatype="text"/>
2632                 </fields>
2633                 <links>
2634                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2635                 </links>
2636         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2637             <actions>
2638                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2639                 <retrieve/>
2640                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2641                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2642             </actions>
2643         </permacrud>
2644         </class>
2645         <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">
2646                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
2647                         <field name="extended" reporter:datatype="interval"/>
2648                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
2649                         <field name="max_renewals" reporter:datatype="int" />
2650                         <field name="name" reporter:datatype="text"/>
2651                         <field name="normal" reporter:datatype="interval"/>
2652                         <field name="shrt" reporter:datatype="interval"/>
2653                 </fields>
2654                 <links>
2655                 </links>
2656         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2657             <actions>
2658                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
2659                 <retrieve/>
2660                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
2661                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
2662             </actions>
2663         </permacrud>
2664         </class>
2665
2666         <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">
2667                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
2668                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2669                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2670             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
2671                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
2672             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
2673                 </fields>
2674                 <links>
2675             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2676                 </links>
2677                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2678             <actions>
2679                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
2680                 <retrieve/>
2681                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
2682                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
2683             </actions>
2684                 </permacrud>
2685         </class>
2686
2687         <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">
2688                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
2689                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2690                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2691                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
2692             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
2693                 </fields>
2694                 <links>
2695                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2696                 </links>
2697                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2698             <actions>
2699                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
2700                 <retrieve/>
2701                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
2702                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
2703             </actions>
2704                 </permacrud>
2705         </class>
2706
2707         <class id="mobts" controller="open-ils.cstore" oils_obj:fieldmapper="money::open_billable_transaction_summary" oils_persist:tablename="money.open_billable_xact_summary" reporter:label="Open Billable Transaction Summary">
2708                 <fields oils_persist:primary="id" oils_persist:sequence="">
2709                         <field name="balance_owed" reporter:datatype="money"/>
2710                         <field name="id" reporter:datatype="id" />
2711                         <field name="last_billing_note" reporter:datatype="text"/>
2712                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
2713                         <field name="last_billing_type" reporter:datatype="text"/>
2714                         <field name="last_payment_note" reporter:datatype="text"/>
2715                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
2716                         <field name="last_payment_type" reporter:datatype="text"/>
2717                         <field name="total_owed" reporter:datatype="money"/>
2718                         <field name="total_paid" reporter:datatype="money"/>
2719                         <field name="usr" reporter:datatype="link"/>
2720                         <field name="xact_finish" reporter:datatype="timestamp" />
2721                         <field name="xact_start" reporter:datatype="timestamp" />
2722                         <field name="xact_type" reporter:datatype="text"/>
2723                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
2724                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
2725                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
2726                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
2727                         <field name="billing_location" reporter:datatype="link"/>
2728                 </fields>
2729                 <links>
2730                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2731                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
2732                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
2733                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
2734                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
2735                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2736                 </links>
2737         </class>
2738         <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">
2739                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
2740                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
2741                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
2742                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
2743                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
2744                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
2745                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
2746                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
2747                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2748                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
2749                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
2750                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
2751                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2752                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
2753                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
2754                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
2755                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
2756                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
2757                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
2758                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2759                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
2760                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
2761                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
2762                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
2763                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
2764                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
2765                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
2766                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
2767                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
2768                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
2769                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
2770                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
2771                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
2772                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
2773                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
2774                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
2775                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
2776                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
2777                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
2778                         <field reporter:label="Password" name="passwd"  reporter:datatype="text"/>
2779                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
2780                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
2781                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
2782                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
2783                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
2784                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
2785                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
2786                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
2787                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
2788                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
2789                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
2790                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
2791                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
2792                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2793                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2794                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
2795                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
2796                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
2797                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
2798                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
2799                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
2800                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
2801                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
2802                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
2803                 </fields>
2804                 <links>
2805                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
2806                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
2807                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
2808                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
2809                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
2810                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
2811                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
2812                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
2813                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
2814                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
2815                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
2816                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
2817                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
2818                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
2819                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="circ"/>
2820                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
2821                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
2822                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
2823                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
2824                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
2825                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
2826                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
2827                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
2828                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
2829                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
2830                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
2831                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
2832                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
2833                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
2834                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
2835                 </links>
2836                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2837                         <actions>
2838                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
2839                         </actions>
2840                 </permacrud>
2841         </class>
2842         <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">
2843                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
2844                         <field name="id" reporter:label="ID" reporter:datatype="id" />
2845                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
2846                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
2847                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
2848                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
2849                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
2850                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
2851                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
2852         </fields>
2853                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2854                         <actions>
2855                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
2856                                 <retrieve/>
2857                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
2858                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
2859                         </actions>
2860                 </permacrud>
2861         </class>
2862         <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">
2863                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
2864                         <field name="id" reporter:label="ID" reporter:datatype="id" />
2865                         <field name="usr" reporter:label="User" reporter:datatype="link" />
2866                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
2867                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
2868         </fields>
2869         <links>
2870                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2871                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
2872                 </links>
2873                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2874                         <actions>
2875                                 <retrieve permission="RUN_REPORTS">
2876                                         <context link="usr" field="home_ou" />
2877                                 </retrieve>
2878                         </actions>
2879                 </permacrud>
2880         </class>
2881         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
2882                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
2883                         <field name="id" reporter:label="ID" reporter:datatype="id" />
2884                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
2885                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
2886                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
2887                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
2888                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
2889         </fields>
2890         <links>
2891                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
2892                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
2893                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
2894                 </links>
2895                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2896                         <actions>
2897                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
2898                                         <context link="usr" field="home_ou" />
2899                                         <context link="ws" field="owning_lib" />
2900                                 </retrieve>
2901                                 <create permission="ADMIN_TOOLBAR" context_field="org">
2902                                         <context link="usr" field="home_ou" />
2903                                         <context link="ws" field="owning_lib" />
2904                                 </create>
2905                                 <update permission="ADMIN_TOOLBAR" context_field="org">
2906                                         <context link="usr" field="home_ou" />
2907                                         <context link="ws" field="owning_lib" />
2908                                 </update>
2909                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
2910                                         <context link="usr" field="home_ou" />
2911                                         <context link="ws" field="owning_lib" />
2912                                 </delete>
2913                         </actions>
2914                 </permacrud>
2915         </class>
2916         <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">
2917                 <fields oils_persist:primary="name">
2918                         <field name="name" reporter:datatype="text"/>
2919                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2920                 </fields>
2921                 <links/>
2922                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2923                         <actions>
2924                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
2925                                 <retrieve/>
2926                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
2927                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
2928                         </actions>
2929                 </permacrud>
2930         </class>
2931         <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">
2932                 <fields oils_persist:primary="name">
2933                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
2934                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
2935                         <field name="description" reporter:label="Description" reporter:datatype="text"/>
2936                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
2937                         <field name="fm_class" reporter:label="Fielmapper Class" reporter:datatype="text"/>
2938                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
2939                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
2940                 </fields>
2941                 <links>
2942                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
2943                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
2944                 </links>
2945                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2946                         <actions>
2947                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
2948                                 <retrieve/>
2949                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
2950                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
2951                         </actions>
2952                 </permacrud>
2953         </class>
2954         <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">
2955                 <fields oils_persist:primary="name">
2956                         <field name="name" reporter:datatype="text"/>
2957                         <field name="label" reporter:datatype="text"/>
2958                         <field name="description" reporter:datatype="text"/>
2959                         <field name="datatype" reporter:datatype="text"/>
2960                         <field name="view_perm" reporter:datatype="link"/>
2961                         <field name="update_perm" reporter:datatype="link"/>
2962                         <field name="fm_class" reporter:datatype="text"/>
2963                         <field name="grp" reporter:datatype="link"/>
2964                 </fields>
2965                 <links>
2966                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
2967                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
2968                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
2969                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
2970                 </links>
2971                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2972                         <actions>
2973                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
2974                                 <retrieve/>
2975                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
2976                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
2977                         </actions>
2978                 </permacrud>
2979         </class>
2980         <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">
2981                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
2982                         <field name="id" />
2983                         <field name="name"  reporter:datatype="text"/>
2984                         <field name="org_unit" reporter:datatype="org_unit"/>
2985                         <field name="value"  reporter:datatype="text"/>
2986                 </fields>
2987                 <links>
2988                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2989                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
2990                 </links>
2991         </class>
2992         <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">
2993                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
2994                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2995                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
2996                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2997                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
2998                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2999                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3000                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3001                 </fields>
3002                 <links>
3003                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3004                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3005                 </links>
3006         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3007             <actions>
3008                 <create permission="CREATE_COPY_NOTE">
3009                     <context link="owning_copy" field="circ_lib"/>
3010                 </create>
3011                 <retrieve permission="VIEW_COPY_NOTES">
3012                     <context link="owning_copy" field="circ_lib"/>
3013                 </retrieve>
3014                 <update permission="UPDATE_COPY_NOTE">
3015                     <context link="owning_copy" field="circ_lib"/>
3016                 </update>
3017                 <delete permission="DELETE_COPY_NOTE">
3018                     <context link="owning_copy" field="circ_lib"/>
3019                 </delete>
3020             </actions>
3021         </permacrud>
3022         </class>
3023         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3024                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3025                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3026                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3027                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3028                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3029                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3030                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3031                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3032                 </fields>
3033                 <links>
3034                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3035                 </links>
3036         </class>
3037         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3038                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3039                         <field name="fingerprint"  reporter:datatype="text"/>
3040                         <field name="id" reporter:datatype="id" />
3041                         <field name="master_record" reporter:datatype="link"/>
3042                         <field name="mods"  reporter:datatype="text"/>
3043                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3044                 </fields>
3045                 <links>
3046                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3047                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3048                 </links>
3049         </class>
3050         <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">
3051                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3052                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3053                         <field name="name"  reporter:datatype="text"/>
3054                 </fields>
3055                 <links/>
3056         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3057             <actions>
3058                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3059                 <retrieve/>
3060                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3061                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3062             </actions>
3063         </permacrud>
3064         </class>
3065         <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">
3066                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3067                         <field name="code"  reporter:datatype="text"/>
3068                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3069                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3070                 </fields>
3071                 <links/>
3072         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3073             <actions>
3074                 <create permission="CREATE_PERM" global_required="true"/>
3075                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3076                 <update permission="UPDATE_PERM" global_required="true"/>
3077                 <delete permission="DELETE_PERM" global_required="true"/>
3078             </actions>
3079         </permacrud>
3080         </class>
3081         <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">
3082                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3083                         <field name="id" reporter:datatype="id" />
3084                         <field name="metarecord" reporter:datatype="link"/>
3085                         <field name="source" reporter:datatype="link"/>
3086                 </fields>
3087                 <links>
3088                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3089                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3090                 </links>
3091         </class>
3092         <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">
3093                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3094                         <field name="id" reporter:datatype="id" />
3095                         <field name="field" reporter:datatype="link"/>
3096                         <field name="source" reporter:datatype="link"/>
3097                         <field name="value"  reporter:datatype="text"/>
3098                 </fields>
3099                 <links>
3100                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3101                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3102                 </links>
3103         </class>
3104         <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">
3105                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3106                         <field name="id" reporter:datatype="id" />
3107                         <field name="value" reporter:datatype="text"/>
3108                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3109                 </fields>
3110                 <links>
3111                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3112                 </links>
3113         </class>
3114         <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">
3115                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3116                         <field name="id" reporter:datatype="id" />
3117                         <field name="entry" reporter:datatype="link"/>
3118                         <field name="def" reporter:datatype="link"/>
3119                         <field name="source" reporter:datatype="link"/>
3120                 </fields>
3121                 <links>
3122                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3123                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3124                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3125                 </links>
3126         </class>
3127         <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">
3128                 <oils_persist:source_definition>
3129                         SELECT * FROM metabib.author_field_entry
3130                                                 UNION ALL
3131                         SELECT * FROM metabib.keyword_field_entry
3132                                                 UNION ALL
3133                         SELECT * FROM metabib.identifier_field_entry
3134                                                 UNION ALL
3135                         SELECT * FROM metabib.title_field_entry
3136                                                 UNION ALL
3137                         SELECT * FROM metabib.subject_field_entry
3138                                                 UNION ALL
3139                         SELECT * FROM metabib.series_field_entry
3140                 </oils_persist:source_definition>
3141                 <fields>
3142                         <field name="field" reporter:datatype="link"/>
3143                         <field name="id" reporter:datatype="id" />
3144                         <field name="source" reporter:datatype="link"/>
3145                         <field name="value"  reporter:datatype="text"/>
3146                 </fields>
3147                 <links>
3148                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3149                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3150                 </links>
3151         </class>
3152         <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">
3153                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3154                         <field name="field" reporter:datatype="link"/>
3155                         <field name="id" reporter:datatype="id" />
3156                         <field name="source" reporter:datatype="link"/>
3157                         <field name="value"  reporter:datatype="text"/>
3158                 </fields>
3159                 <links>
3160                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3161                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3162                 </links>
3163         </class>
3164         <class id="mcp" controller="open-ils.cstore" oils_obj:fieldmapper="money::cash_payment" oils_persist:tablename="money.cash_payment" reporter:label="Cash Payment">
3165                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3166                         <field name="accepting_usr" reporter:datatype="link"/>
3167                         <field name="amount" reporter:datatype="money" />
3168                         <field name="amount_collected" reporter:datatype="money" />
3169                         <field name="cash_drawer" reporter:datatype="link"/>
3170                         <field name="id" reporter:datatype="id" />
3171                         <field name="note"  reporter:datatype="text"/>
3172                         <field name="payment_ts" reporter:datatype="timestamp"/>
3173                         <field name="xact" reporter:datatype="link"/>
3174                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3175                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3176                 </fields>
3177                 <links>
3178                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3179                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3180                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3181                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3182                 </links>
3183         </class>
3184         <class id="mfp" controller="open-ils.cstore" oils_obj:fieldmapper="money::forgive_payment" oils_persist:tablename="money.forgive_payment" reporter:label="Forgive Payment">
3185                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3186                         <field name="accepting_usr" reporter:datatype="link"/>
3187                         <field name="amount" reporter:datatype="money" />
3188                         <field name="amount_collected" reporter:datatype="money" />
3189                         <field name="id" reporter:datatype="id" />
3190                         <field name="note"  reporter:datatype="text"/>
3191                         <field name="payment_ts" reporter:datatype="timestamp"/>
3192                         <field name="xact" reporter:datatype="link"/>
3193                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3194                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3195                 </fields>
3196                 <links>
3197                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3198                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3199                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3200                 </links>
3201         </class>
3202         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
3203                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
3204                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
3205                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3206                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3207                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
3208                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3209                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3210                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
3211                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3212                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
3213                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3214                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3215                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
3216                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3217                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
3218                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
3219                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
3220                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
3221                 </fields>
3222                 <links>
3223                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3224                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
3225                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
3226                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
3227                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
3228                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
3229                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
3230                 </links>
3231         </class>
3232
3233         <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">
3234                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
3235                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3236                         <field name="name"  reporter:datatype="text"/>
3237                         <field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
3238                         <field name="block_list" reporter:datatype="text"/>
3239                         <field name="staff_alert" reporter:datatype="bool"/>
3240                         <field name="org_depth" reporter:datatype="int"/>
3241                 </fields>
3242                 <links/>
3243         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3244             <actions>
3245                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3246                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
3247                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3248                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3249             </actions>
3250         </permacrud>
3251         </class>
3252         <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">
3253                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
3254                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
3255                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
3256                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
3257                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
3258                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
3259                 </fields>
3260                 <links>
3261                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
3262                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
3263                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3264         </links>
3265         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3266             <actions>
3267                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3268                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3269                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3270                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3271             </actions>
3272         </permacrud>
3273         </class>
3274         <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">
3275                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
3276                         <field name="holdable" reporter:datatype="bool"/>
3277                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3278                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3279                         <field name="opac_visible" reporter:datatype="bool"/>
3280             <field name="copy_active" reporter:datatype="bool"/>
3281             <field name="restrict_copy_delete" reporter:datatype="bool"/>
3282                 </fields>
3283                 <links/>
3284         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3285             <actions>
3286                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
3287                 <retrieve/>
3288                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
3289                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
3290             </actions>
3291         </permacrud>
3292         </class>
3293         <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">
3294                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
3295                         <field name="id" reporter:datatype="id" reporter:label="ID" />
3296                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
3297                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
3298                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
3299                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
3300                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
3301                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
3302                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
3303                 </fields>
3304                 <links>
3305                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3306                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3307                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
3308                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
3309                 </links>
3310                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3311                         <actions>
3312                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
3313                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
3314                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
3315                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
3316                         </actions>
3317                 </permacrud>
3318         </class>
3319         <class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
3320                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
3321                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
3322                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3323                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3324                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3325                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
3326                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3327                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3328                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3329                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3330                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3331                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
3332                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
3333                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
3334                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
3335                 </fields>
3336                 <links>
3337                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3338                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
3339                 </links>
3340         </class>
3341         <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">
3342                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
3343                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
3344                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3345                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3346                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
3347                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
3348                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3349                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3350                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3351                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3352                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3353                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3354                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3355                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
3356                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
3357                 </fields>
3358                 <links>
3359                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3360                 </links>
3361                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3362                         <actions>
3363                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3364                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
3365                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3366                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3367                         </actions>
3368                 </permacrud>
3369         </class>
3370
3371
3372         <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">
3373                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
3374                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3375                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
3376                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3377                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
3378                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
3379                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
3380                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
3381                 </fields>
3382                 <links>
3383                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
3384                 </links>
3385         </class>
3386
3387         <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">
3388                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
3389                         <field name="call_number" />
3390                         <field name="create_date" reporter:datatype="timestamp"/>
3391                         <field name="creator" reporter:datatype="link"/>
3392                         <field name="id" reporter:datatype="id" />
3393                         <field name="pub" reporter:datatype="bool"/>
3394                         <field name="title"  reporter:datatype="text"/>
3395                         <field name="value"  reporter:datatype="text"/>
3396                 </fields>
3397                 <links>
3398                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3399                 </links>
3400         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3401             <actions>
3402                 <create permission="CREATE_VOLUME_NOTE">
3403                     <context link="call_number" field="owning_lib"/>
3404                 </create>
3405                 <retrieve permission="VIEW_VOLUME_NOTES">
3406                     <context link="call_number" field="owning_lib"/>
3407                 </retrieve>
3408                 <update permission="UPDATE_VOLUME_NOTE">
3409                     <context link="call_number" field="owning_lib"/>
3410                 </update>
3411                 <delete permission="DELETE_VOLUME_NOTE">
3412                     <context link="call_number" field="owning_lib"/>
3413                 </delete>
3414             </actions>
3415         </permacrud>
3416         </class>
3417         <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">
3418                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
3419                         <field name="create_date" reporter:datatype="timestamp"/>
3420                         <field name="creator" reporter:datatype="link"/>
3421                         <field name="edit_date" reporter:datatype="timestamp"/>
3422                         <field name="editor" reporter:datatype="link"/>
3423                         <field name="id" reporter:datatype="id" />
3424                         <field name="record" reporter:datatype="link"/>
3425                         <field name="value" reporter:datatype="text"/>
3426                 </fields>
3427                 <links>
3428                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3429                 </links>
3430         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3431             <actions>
3432                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3433                 <retrieve/>
3434                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3435                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3436             </actions>
3437         </permacrud>
3438         </class>
3439         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
3440         <oils_persist:source_definition>
3441 SELECT  usr,
3442         SUM(
3443             CASE
3444                 WHEN (
3445                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3446                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3447                 ) THEN 1
3448                 ELSE 0
3449             END
3450         ) AS out,
3451
3452         SUM(
3453             CASE
3454                 WHEN (
3455                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3456                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3457                 ) THEN 1
3458                 ELSE 0
3459             END
3460         ) AS overdue,
3461
3462         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
3463         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'CLAIMSRETURNED') THEN 1 ELSE 0 END) AS claims_returned,
3464         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
3465   FROM  action.circulation
3466   WHERE checkin_time IS NULL
3467   GROUP BY 1
3468         </oils_persist:source_definition>
3469         <fields oils_persist:primary="usr">
3470             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3471             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3472             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3473             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3474             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3475             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3476         </fields>
3477         <links>
3478             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3479         </links>
3480         </class>
3481         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
3482         <oils_persist:source_definition>
3483 SELECT  usr,
3484         ARRAY_TO_STRING(ARRAY_ACCUM(
3485             CASE
3486                 WHEN (
3487                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3488                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3489                 ) THEN id
3490                 ELSE 0
3491             END
3492         ),',') AS out,
3493
3494         ARRAY_TO_STRING(ARRAY_ACCUM(
3495             CASE
3496                 WHEN (
3497                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3498                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3499                 ) THEN id
3500                 ELSE 0
3501             END
3502         ),',') AS overdue,
3503
3504         ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id ELSE 0 END),',') AS lost,
3505         ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'CLAIMSRETURNED') THEN id ELSE 0 END),',') AS claims_returned,
3506         ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id ELSE 0 END),',') AS long_overdue
3507   FROM  action.circulation
3508   WHERE checkin_time IS NULL
3509   GROUP BY 1
3510         </oils_persist:source_definition>
3511         <fields oils_persist:primary="usr">
3512             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3513             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3514             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3515             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3516             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3517             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3518         </fields>
3519         <links>
3520             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3521         </links>
3522         </class>
3523         <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">
3524                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3525                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3526                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3527                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3528                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3529                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3530                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3531                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3532                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3533                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3534                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3535                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3536                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3537                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3538                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3539                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3540                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3541                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3542                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3543                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3544                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3545                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3546                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3547                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
3548                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3549                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
3550                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3551                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
3552                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
3553                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
3554                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
3555                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3556                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3557                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3558                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3559                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3560                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3561                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
3562                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
3563                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3564                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3565                 </fields>
3566                 <links>
3567                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
3568                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
3569                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
3570                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3571                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
3572                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3573                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3574                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
3575                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
3576                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
3577                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
3578                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
3579                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
3580                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
3581                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
3582                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
3583                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
3584                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
3585                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
3586                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
3587                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
3588                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
3589                 </links>
3590                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3591                         <actions>
3592                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
3593                         </actions>
3594                 </permacrud>
3595         </class>
3596         <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">
3597                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3598                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3599                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3600                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3601                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3602                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3603                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3604                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3605                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3606                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3607                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3608                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3609                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3610                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3611                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3612                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3613                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3614                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3615                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3616                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3617                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3618                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3619                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3620                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
3621                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3622                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
3623                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3624                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3625                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3626                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3627                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3628                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3629                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3630                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
3631                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
3632                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
3633                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
3634                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
3635                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
3636                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
3637                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
3638                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3639                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3640                 </fields>
3641                 <links>
3642                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
3643                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
3644                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
3645                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3646                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
3647                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3648                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
3649                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
3650                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
3651                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
3652                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
3653                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
3654                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
3655                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
3656                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
3657                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
3658                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3659                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3660                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
3661                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
3662                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
3663                 </links>
3664         </class>
3665         <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">
3666                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3667                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3668                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3669                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3670                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3671                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3672                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3673                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3674                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3675                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3676                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3677                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3678                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3679                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3680                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3681                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3682                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3683                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3684                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3685                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3686                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3687                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3688                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3689                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
3690                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3691                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
3692                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3693                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
3694                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
3695                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
3696                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
3697                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3698                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3699                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3700                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3701                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3702                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3703                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
3704                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
3705                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
3706                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
3707                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
3708                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
3709                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
3710                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
3711                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3712                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3713                 </fields>
3714                 <links>
3715                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
3716                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
3717                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
3718                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3719                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
3720                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3721                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
3722                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
3723                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
3724                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
3725                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
3726                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
3727                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
3728                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
3729                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
3730                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
3731                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3732                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3733                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
3734                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
3735                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
3736                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
3737                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
3738                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
3739                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
3740                 </links>
3741         </class>
3742
3743         <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">
3744                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
3745                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3746                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
3747                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3748                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
3749                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
3750                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
3751                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
3752                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
3753                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
3754                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
3755                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
3756                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3757                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
3758                 </fields>
3759                 <links>
3760                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3761                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3762                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
3763                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
3764                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
3765                 </links>
3766                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3767                         <actions>
3768                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
3769                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
3770                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
3771                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
3772                         </actions>
3773                 </permacrud>
3774         </class>
3775
3776         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
3777                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
3778                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
3779                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
3780                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
3781                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
3782                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
3783                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
3784                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
3785                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
3786                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3787                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
3788                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
3789                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
3790                 </fields>
3791                 <links>
3792                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3793                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
3794                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
3795                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
3796                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
3797                 </links>
3798                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3799                         <actions>
3800                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
3801                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
3802                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
3803                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
3804                         </actions>
3805                 </permacrud>
3806         </class>
3807         
3808         <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">
3809                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
3810                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
3811                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
3812                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
3813                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
3814                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
3815                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
3816                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3817                 </fields>
3818                 <links>
3819                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3820                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
3821                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
3822                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
3823                 </links>
3824                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3825                         <actions>
3826                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
3827                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
3828                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
3829                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
3830                         </actions>
3831                 </permacrud>
3832         </class>
3833         
3834         <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">
3835                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
3836                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
3837                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
3838                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
3839                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
3840                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3841                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3842                 </fields>
3843                 <links>
3844                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3845                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
3846                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
3847                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
3848                 </links>
3849                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3850                         <actions>
3851                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
3852                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
3853                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
3854                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
3855                         </actions>
3856                 </permacrud>
3857         </class>
3858         
3859         <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">
3860                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
3861                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
3862                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
3863                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
3864                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
3865                 </fields>
3866                 <links>
3867                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
3868                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
3869                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
3870                 </links>
3871                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3872                         <actions>
3873                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
3874                     <context link="resource" field="owner" />
3875                 </create>
3876                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
3877                     <context link="resource" field="owner" />
3878                 </retrieve>
3879                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
3880                     <context link="resource" field="owner" />
3881                 </update>
3882                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
3883                     <context link="resource" field="owner" />
3884                 </delete>
3885                         </actions>
3886                 </permacrud>
3887         </class>
3888         
3889         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
3890                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3891                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
3892                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3893                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
3894                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
3895                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
3896                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3897                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3898                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3899                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3900                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
3901                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
3902                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
3903                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
3904                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
3905                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
3906                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
3907                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
3908                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
3909                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3910                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
3911                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
3912                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
3913                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
3914                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
3915                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
3916                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
3917                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
3918                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
3919                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3920                 </fields>
3921                 <links>
3922                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3923                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
3924                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
3925                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
3926                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
3927                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
3928                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
3929                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
3930                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
3931                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
3932                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
3933                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
3934                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
3935                 </links>
3936                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3937                         <actions>
3938                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
3939                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
3940                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
3941                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
3942                         </actions>
3943                 </permacrud>
3944         </class>
3945         
3946         <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">
3947                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
3948                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
3949                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
3950                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
3951                 </fields>
3952                 <links>
3953                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3954                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
3955                 </links>
3956                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3957                         <actions>
3958                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
3959                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
3960                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
3961                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
3962                         </actions>
3963                 </permacrud>
3964         </class>
3965
3966         <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">
3967                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
3968                         <field name="bucket" reporter:datatype="link"/>
3969                         <field name="id" reporter:datatype="id" />
3970                         <field name="target_call_number" reporter:datatype="link" />
3971                         <field name="create_time" reporter:datatype="timestamp" />
3972                         <field name="pos" reporter:datatype="int" />
3973                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
3974                 </fields>
3975                 <links>
3976                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
3977                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
3978             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
3979                 </links>
3980         </class>
3981         <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">
3982                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
3983                         <field name="id" reporter:datatype="id" />
3984                         <field name="item" reporter:datatype="link"/>
3985                         <field name="note" reporter:datatype="text" />
3986                 </fields>
3987                 <links>
3988                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
3989                 </links>
3990         </class>
3991         <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">
3992                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
3993                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
3994                         <field name="btype" reporter:datatype="text"/>
3995                         <field name="id" reporter:datatype="id" />
3996                         <field name="name" reporter:datatype="text"/>
3997                         <field name="description" reporter:datatype="text"/>
3998                         <field name="owner" reporter:datatype="link"/>
3999                         <field name="pub" reporter:datatype="bool"/>
4000                         <field name="create_time" reporter:datatype="timestamp" />
4001                 </fields>
4002                 <links>
4003                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4004                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4005                 </links>
4006         </class>
4007         <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">
4008                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4009                         <field name="id" reporter:datatype="id" />
4010                         <field name="bucket" reporter:datatype="link"/>
4011                         <field name="note" reporter:datatype="text" />
4012                 </fields>
4013                 <links>
4014                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4015                 </links>
4016         </class>
4017         <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">
4018                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4019                         <field name="hold" reporter:datatype="link"/>
4020                         <field name="id" reporter:datatype="id" />
4021                         <field name="target_copy" reporter:datatype="link"/>
4022                 </fields>
4023                 <links>
4024                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4025                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4026                 </links>
4027         </class>
4028         <class id="ahn" controller="open-ils.cstore" oils_obj:fieldmapper="action::hold_notification" oils_persist:tablename="action.hold_notification" reporter:label="Hold Notification">
4029                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4030                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4031                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4032                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4033                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4034                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4035                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4036                 </fields>
4037                 <links>
4038                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4039                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4040                 </links>
4041         </class>
4042         <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">
4043                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4044                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4045                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4046                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4047                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4048                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4049                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4050                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4051                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4052                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4053                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4054                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4055                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4056                 </fields>
4057                 <links>
4058                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4059                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4060                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4061                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4062                 </links>
4063         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4064             <actions>
4065                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4066                 <retrieve/>
4067                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4068                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4069             </actions>
4070         </permacrud>
4071         </class>
4072         <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">
4073                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4074                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4075                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4076                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4077                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4078             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4079             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4080             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4081                 </fields>
4082                 <links>
4083                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4084                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4085                 </links>
4086         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4087             <actions>
4088                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4089                 <retrieve/>
4090                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4091                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4092             </actions>
4093         </permacrud>
4094         </class>
4095         <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">
4096                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4097                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4098             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4099             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4100                 </fields>
4101                 <links>
4102                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4103                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4104                 </links>
4105         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4106             <actions>
4107                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4108                                         <context link="lgroup" field="owner" />
4109                 </create>
4110                 <retrieve/>
4111                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4112                                         <context link="lgroup" field="owner" />
4113                 </update>
4114                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4115                                         <context link="lgroup" field="owner" />
4116                 </delete>
4117             </actions>
4118         </permacrud>
4119         </class>
4120
4121     <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">
4122         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4123             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4124             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4125             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4126             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4127         </fields>
4128         <links>
4129             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4130             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4131         </links>
4132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4133             <actions>
4134                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4135                 <retrieve/>
4136                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4137                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4138             </actions>
4139         </permacrud>
4140     </class>
4141
4142         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4143                 <fields>
4144                         <field name="sre_id" oils_persist:virtual="true" />
4145                         <field name="location" oils_persist:virtual="true" />
4146                         <field name="owning_lib" oils_persist:virtual="true" />
4147                         <field name="basic_holdings" oils_persist:virtual="true" />
4148                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4149                         <field name="supplement_holdings" oils_persist:virtual="true" />
4150                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4151                         <field name="index_holdings" oils_persist:virtual="true" />
4152                         <field name="index_holdings_add" oils_persist:virtual="true" />
4153                         <field name="online" oils_persist:virtual="true" />
4154                         <field name="missing" oils_persist:virtual="true" />
4155                         <field name="incomplete" oils_persist:virtual="true" />
4156                 </fields>
4157         </class>
4158
4159         <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">
4160                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4161                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4162                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4163                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4164                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4165                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4166                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4167                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4168                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4169                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4170                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4171                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4172                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4173                 </fields>
4174                 <links>
4175                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4176                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4177                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4178                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4179                 </links>
4180                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4181                         <actions>
4182                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4183                                 <retrieve/>
4184                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4185                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4186                         </actions>
4187                 </permacrud>
4188         </class>
4189
4190         <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">
4191                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4192                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4193                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4194                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4195                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4196                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4197                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4198                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4199                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4200                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4201                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4202                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4203                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4204                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4205                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4206                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4207                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4208                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4209                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4210                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4211                 </fields>
4212                 <links>
4213                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4214                 </links>
4215                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4216                         <actions>
4217                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4218                                         <context link="subscription" field="owning_lib" />
4219                                 </create>
4220                                 <retrieve />
4221                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4222                                         <context link="subscription" field="owning_lib" />
4223                                 </update>
4224                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4225                                         <context link="subscription" field="owning_lib" />
4226                                 </delete>
4227                         </actions>
4228                 </permacrud>
4229         </class>
4230
4231         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4232                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4233                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4234                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4235                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4236                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4237                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4238                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4239                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4240                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4241                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4242                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4243                 </fields>
4244                 <links>
4245                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4246                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4247                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4248                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4249                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4250                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4251                 </links>
4252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4253                         <actions>
4254                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4255                                 <retrieve />
4256                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4257                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4258                         </actions>
4259                 </permacrud>
4260         </class>
4261
4262         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4263                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4264                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4265                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4266                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4267                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4268                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4269                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4270                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4271                 </fields>
4272                 <links>
4273                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4274                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4275                 </links>
4276         </class>
4277
4278         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4279                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4280                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4281                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4282                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4283                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4284                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4285                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4286                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4287                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4288                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4289                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4290                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4291                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
4292                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
4293                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
4294                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4295                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4296                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4297                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4298                 </fields>
4299                 <links>
4300                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
4301                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4302                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
4303                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
4304                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
4305                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
4306                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
4307                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
4308                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
4309                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
4310                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
4311                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
4312                 </links>
4313                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4314                         <actions>
4315                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4316                                 <retrieve />
4317                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4318                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4319                         </actions>
4320                 </permacrud>
4321         </class>
4322
4323         <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">
4324                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
4325                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4326                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4327                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4328                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4329                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4330                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4331                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4332                 </fields>
4333                 <links>
4334                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4335                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4336                 </links>
4337                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4338                         <actions>
4339                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4340                                         <context link="distribution" field="holding_lib" />
4341                                 </create>
4342                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
4343                                         <context link="distribution" field="holding_lib" />
4344                                 </retrieve>
4345                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4346                                         <context link="distribution" field="holding_lib" />
4347                                 </update>
4348                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4349                                         <context link="distribution" field="holding_lib" />
4350                                 </delete>
4351                         </actions>
4352                 </permacrud>
4353         </class>
4354
4355         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
4356                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
4357                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4358                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4359                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
4360                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4361                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
4362                 </fields>
4363                 <links>
4364                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4365                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
4366                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
4367                 </links>
4368                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4369                         <actions>
4370                                 <create permission="ADMIN_SERIAL_STREAM">
4371                                         <context link="distribution" field="holding_lib" />
4372                                 </create>
4373                                 <retrieve />
4374                                 <update permission="ADMIN_SERIAL_STREAM">
4375                                         <context link="distribution" field="holding_lib" />
4376                                 </update>
4377                                 <delete permission="ADMIN_SERIAL_STREAM">
4378                                         <context link="distribution" field="holding_lib" />
4379                                 </delete>
4380                         </actions>
4381                 </permacrud>
4382         </class>
4383
4384         <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">
4385                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
4386                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4387                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4388                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4389                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
4390                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
4391                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
4392                 </fields>
4393                 <links>
4394                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4395                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
4396                 </links>
4397                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4398                         <actions>
4399                                 <create permission="ADMIN_SERIAL_STREAM">
4400                                         <context link="stream" jump="distribution" field="holding_lib" />
4401                                 </create>
4402                                 <retrieve permission="RECEIVE_SERIAL">
4403                                         <context link="stream" jump="distribution" field="holding_lib" />
4404                                 </retrieve>
4405                                 <update permission="ADMIN_SERIAL_STREAM">
4406                                         <context link="stream" jump="distribution" field="holding_lib" />
4407                                 </update>
4408                                 <delete permission="ADMIN_SERIAL_STREAM">
4409                                         <context link="stream" jump="distribution" field="holding_lib" />
4410                                 </delete>
4411                         </actions>
4412                 </permacrud>
4413         </class>
4414
4415         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
4416                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
4417                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4418                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4419                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4420                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4421                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4422                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4423                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
4424                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4425                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
4426                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
4427                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
4428                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
4429                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4430                 </fields>
4431                 <links>
4432                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4433                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4434                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4435                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
4436                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
4437                 </links>
4438                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4439                         <actions>
4440                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
4441                                         <context link="subscription" field="owning_lib" />
4442                                 </create>
4443                                 <retrieve/>
4444                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
4445                                         <context link="subscription" field="owning_lib" />
4446                                 </update>
4447                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
4448                                         <context link="subscription" field="owning_lib" />
4449                                 </delete>
4450                         </actions>
4451                 </permacrud>
4452         </class>
4453
4454         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
4455                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
4456                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4457                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
4458                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
4459                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4460                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
4461                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
4462                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4463                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
4464                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
4465                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
4466                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4467                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
4468                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
4469                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4470                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
4471                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4472                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
4473                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
4474                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
4475                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
4476                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
4477                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
4478                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
4479                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
4480                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
4481                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
4482                         <field reporter:label="Price" name="price" reporter:datatype="money" />
4483                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
4484                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
4485                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
4486                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
4487                         <field reporter:label="Is Floating" name="floating" reporter:datatype="bool"/>
4488                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
4489                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
4490                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
4491                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
4492                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4493                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4494                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4495                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
4496                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
4497                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4498                 </fields>
4499                 <links>
4500                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
4501                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4502                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4503                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4504                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4505                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
4506                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4507                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
4508                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
4509                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
4510                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
4511                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
4512                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
4513                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
4514                 </links>
4515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4516                         <actions>
4517                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4518                                 <retrieve/>
4519                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4520                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4521                         </actions>
4522                 </permacrud>
4523         </class>
4524
4525         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
4526                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
4527                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4528                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4529                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4530                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4531                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4532                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
4533                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4534                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
4535                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
4536                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
4537                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
4538                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
4539                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4540                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
4541                 </fields>
4542                 <links>
4543                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4544                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4545                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
4546                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4547                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
4548                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
4549                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
4550                 </links>
4551                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4552                         <actions>
4553                                 <create permission="ADMIN_SERIAL_ITEM">
4554                                         <context link="stream" jump="distribution" field="holding_lib" />
4555                                 </create>
4556                                 <retrieve permission="ADMIN_SERIAL_ITEM">
4557                                         <context link="stream" jump="distribution" field="holding_lib" />
4558                                 </retrieve>
4559                                 <update permission="ADMIN_SERIAL_ITEM">
4560                                         <context link="stream" jump="distribution" field="holding_lib" />
4561                                 </update>
4562                                 <delete permission="ADMIN_SERIAL_ITEM">
4563                                         <context link="stream" jump="distribution" field="holding_lib" />
4564                                 </delete>
4565                         </actions>
4566                 </permacrud>
4567         </class>
4568
4569         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
4570                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
4571                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4572                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
4573                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4574                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4575                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4576                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4577                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4578                 </fields>
4579                 <links>
4580                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
4581                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4582                 </links>
4583                 <!-- Not available via PCRUD at this time -->
4584         </class>
4585         <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">
4586                 <fields>
4587                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
4588                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
4589                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
4590                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
4591                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
4592                 </fields>
4593                 <links>
4594                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4595                 </links>
4596         </class>
4597         <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">
4598                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
4599                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4600                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
4601                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
4602                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
4603                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
4604                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
4605                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
4606                 </fields>
4607                 <links>
4608                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
4609                 </links>
4610         </class>
4611         <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">
4612                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
4613                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4614                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4615                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
4616                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
4617                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
4618                 </fields>
4619                 <links>
4620                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4621                 </links>
4622                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4623                         <actions>
4624                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4625                                         <context link="distribution" field="holding_lib" />
4626                                 </create>
4627                                 <retrieve/>
4628                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4629                                         <context link="distribution" field="holding_lib" />
4630                                 </update>
4631                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4632                                         <context link="distribution" field="holding_lib" />
4633                                 </delete>
4634                         </actions>
4635                 </permacrud>
4636         </class>
4637
4638         <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">
4639                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
4640                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4641                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4642                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
4643                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
4644                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
4645                 </fields>
4646                 <links>
4647                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4648                 </links>
4649                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4650                         <actions>
4651                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4652                                         <context link="distribution" field="holding_lib" />
4653                                 </create>
4654                                 <retrieve/>
4655                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4656                                         <context link="distribution" field="holding_lib" />
4657                                 </update>
4658                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4659                                         <context link="distribution" field="holding_lib" />
4660                                 </delete>
4661                         </actions>
4662                 </permacrud>
4663         </class>
4664
4665         <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">
4666                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
4667                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4668                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4669                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
4670                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
4671                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
4672                 </fields>
4673                 <links>
4674                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4675                 </links>
4676                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4677                         <actions>
4678                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4679                                         <context link="distribution" field="holding_lib" />
4680                                 </create>
4681                                 <retrieve/>
4682                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4683                                         <context link="distribution" field="holding_lib" />
4684                                 </update>
4685                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4686                                         <context link="distribution" field="holding_lib" />
4687                                 </delete>
4688                         </actions>
4689                 </permacrud>
4690         </class>
4691
4692         <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">
4693                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
4694                         <field name="id" reporter:datatype="id" />
4695                         <field name="owning_copy" reporter:datatype="link"/>
4696                         <field name="stat_cat" reporter:datatype="link"/>
4697                         <field name="stat_cat_entry" reporter:datatype="link"/>
4698                 </fields>
4699                 <links>
4700                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4701                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
4702                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
4703                 </links>
4704         </class>
4705         <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">
4706                 <fields oils_persist:primary="code">
4707                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
4708                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
4709                 </fields>
4710                 <links/>
4711         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4712             <actions>
4713                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
4714                 <retrieve/>
4715                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
4716                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
4717             </actions>
4718         </permacrud>
4719         </class>
4720         <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">
4721                 <fields oils_persist:primary="code">
4722                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
4723                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
4724                 </fields>
4725                 <links/>
4726         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4727             <actions>
4728                 <create permission="CREATE_MARC_CODE" global_required="true"/>
4729                 <retrieve/>
4730                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
4731                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
4732             </actions>
4733         </permacrud>
4734         </class>
4735         <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">
4736                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
4737                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
4738                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
4739                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
4740                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
4741                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
4742                 </fields>
4743                 <links>
4744             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4745         </links>
4746         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4747             <actions>
4748                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
4749                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
4750                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
4751                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
4752             </actions>
4753         </permacrud>
4754         </class>
4755         <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">
4756                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
4757                         <field name="id" reporter:datatype="id" />
4758                         <field name="name" reporter:datatype="text"/>
4759                 </fields>
4760                 <links/>
4761         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4762             <actions>
4763                 <create permission="CREATE_LASSO" global_required="true"/>
4764                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
4765                 <update permission="UPDATE_LASSO" global_required="true"/>
4766                 <delete permission="DELETE_LASSO" global_required="true"/>
4767             </actions>
4768         </permacrud>
4769         </class>
4770         <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">
4771                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
4772                         <field name="id" reporter:datatype="id" />
4773                         <field name="lasso" reporter:datatype="link"/>
4774                         <field name="org_unit" reporter:datatype="org_unit"/>
4775                 </fields>
4776                 <links>
4777                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
4778                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4779                 </links>
4780         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4781             <actions>
4782                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
4783                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
4784                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
4785                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
4786             </actions>
4787         </permacrud>
4788         </class>
4789         <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">
4790                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
4791                         <field name="id" reporter:datatype="id" />
4792                         <field name="from_org" reporter:datatype="org_unit"/>
4793                         <field name="to_org" reporter:datatype="org_unit"/>
4794                         <field name="prox" reporter:datatype="int" />
4795                 </fields>
4796                 <links>
4797                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
4798                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
4799                 </links>
4800         </class>
4801         <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">
4802                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
4803                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4804                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
4805                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
4806                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
4807                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
4808                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
4809                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
4810                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
4811                 </fields>
4812                 <links/>
4813         </class>
4814         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
4815                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
4816                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
4817                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
4818                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
4819                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
4820                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
4821                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4822                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
4823                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4824                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
4825                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
4826                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
4827                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
4828                 </fields>
4829                 <links>
4830                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4831                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
4832                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
4833                 </links>
4834         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4835             <actions>
4836                 <create permission="ADMIN_SURVEY" context_field="owner"/>
4837                 <retrieve/>
4838                 <update permission="ADMIN_SURVEY" context_field="owner"/>
4839                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
4840             </actions>
4841         </permacrud>
4842         </class>
4843         <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">
4844                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
4845                         <field name="address_type"  reporter:datatype="text"/>
4846                         <field name="city"  reporter:datatype="text"/>
4847                         <field name="country"  reporter:datatype="text"/>
4848                         <field name="county"  reporter:datatype="text"/>
4849                         <field name="id" reporter:datatype="id" />
4850                         <field name="org_unit" reporter:datatype="org_unit"/>
4851                         <field name="post_code"  reporter:datatype="text"/>
4852                         <field name="state"  reporter:datatype="text"/>
4853                         <field name="street1"  reporter:datatype="text"/>
4854                         <field name="street2"  reporter:datatype="text"/>
4855                         <field name="valid" reporter:datatype="bool"/>
4856                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
4857                 </fields>
4858                 <links>
4859                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4860                 </links>
4861         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4862             <actions>
4863                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
4864                 <retrieve/>
4865                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
4866                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
4867             </actions>
4868         </permacrud>
4869         </class>
4870         <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">
4871                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
4872                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
4873                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4874                         <field name="query_text" reporter:datatype="text"/>
4875                 </fields>
4876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4877             <actions>
4878                 <retrieve/>
4879             </actions>
4880         </permacrud>
4881         </class>
4882
4883         <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">
4884                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
4885                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
4886                         <field name="owner" reporter:datatype="org_unit"/>
4887                         <field name="code" reporter:datatype="text"/>
4888                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4889                         <field name="create_date" reporter:datatype="timestamp"/>
4890                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
4891                 </fields>
4892                 <links>
4893                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4894                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
4895                 </links>
4896         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4897             <actions>
4898                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
4899                 <retrieve/>
4900                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
4901                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
4902             </actions>
4903         </permacrud>
4904         </class>
4905         <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">
4906                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
4907                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
4908                         <field name="grp" reporter:datatype="link"/>
4909                         <field name="pos" reporter:datatype="int"/>
4910                         <field name="query" reporter:datatype="link"/>
4911                 </fields>
4912                 <links>
4913                         <link field="grp" reltype="has_a" key="id" map="" class="asfge"/>
4914                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
4915                 </links>
4916         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4917             <actions>
4918                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
4919                     <context link="grp" field="owner"/>
4920                 </create>
4921                 <retrieve/>
4922                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
4923                     <context link="grp" field="owner"/>
4924                 </update>
4925                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
4926                     <context link="grp" field="owner"/>
4927                 </delete>
4928             </actions>
4929         </permacrud>
4930         </class>
4931
4932         <!-- A note: Please update alhr and ahopl when updating ahr -->
4933         <class id="ahr" controller="open-ils.cstore" oils_obj:fieldmapper="action::hold_request" oils_persist:tablename="action.hold_request" reporter:core="true" reporter:label="Hold Request">
4934                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
4935                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
4936                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
4937                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
4938                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
4939                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4940                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
4941                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
4942                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
4943                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
4944                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
4945                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
4946                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
4947                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
4948                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
4949                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
4950                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
4951                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
4952                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
4953                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
4954                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
4955                         <field reporter:label="Item Selection Depth" name="selection_depth" />
4956                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
4957                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
4958                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
4959                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
4960                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
4961                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
4962                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
4963                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
4964                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
4965                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
4966                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
4967                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
4968                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
4969                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
4970                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
4971                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
4972                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
4973                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
4974                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
4975                 </fields>
4976                 <links>
4977                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
4978                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
4979                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
4980                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
4981                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
4982                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
4983                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4984                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4985                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
4986                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
4987                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
4988                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
4989                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
4990                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
4991                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
4992                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
4993                 </links>
4994         </class>
4995         <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">
4996                 <oils_persist:source_definition><![CDATA[
4997                 SELECT
4998                         ahr.*,
4999                         COALESCE(acplo.position, 999) AS
5000                                 copy_location_order_position,
5001                         CASE WHEN au.alias IS NOT NULL THEN
5002                                 au.alias
5003                         ELSE
5004                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5005                                         COALESCE(au.family_name, ''),
5006                                         COALESCE(au.suffix, ''),
5007                                         ', ',
5008                                         COALESCE(au.prefix, ''),
5009                                         COALESCE(au.first_given_name, ''),
5010                                         COALESCE(au.second_given_name, '')
5011                                 ], ' '), E'\\s+,', ',')
5012                         END AS usr_display_name,
5013                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5014                                 AS call_number_label,
5015                         siss.label AS issuance_label,
5016                         (ahr.usr <> ahr.requestor) AS is_staff_hold
5017                 FROM action.hold_request ahr
5018                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5019                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5020                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5021                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5022                 JOIN actor.usr au ON (au.id = ahr.usr)
5023                 LEFT JOIN serial.issuance siss
5024                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5025                 LEFT JOIN asset.copy_location_order acplo
5026                         ON (acp.location = acplo.location AND
5027                                 acp.circ_lib = acplo.org)
5028                 WHERE
5029                         ahr.capture_time IS NULL AND
5030                         ahr.cancel_time IS NULL AND
5031                         (ahr.expire_time is NULL OR ahr.expire_time > NOW())
5032                 ]]></oils_persist:source_definition>
5033                 <fields oils_persist:primary="id">
5034                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5035                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5036                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5037                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5038                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5039                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5040                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5041                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5042                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5043                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5044                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5045                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5046                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5047                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5048                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5049                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5050                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5051                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5052                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5053                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5054                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5055                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5056                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5057                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5058                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5059                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5060                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5061                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5062                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5063                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5064                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5065                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5066                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5067                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5068                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5069                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5070                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5071                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5072                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5073                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5074                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5075                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5076                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5077                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5078                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5079                 </fields>
5080                 <links>
5081                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5082                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5083                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5084                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5085                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5086                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5087                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5088                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5089                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5090                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5091                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5092                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5093                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5094                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5095                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5096                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5097                 </links>
5098                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5099                         <actions>
5100                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5101                         </actions>
5102                 </permacrud>
5103         </class>
5104         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5105                 <oils_persist:source_definition>
5106                         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)
5107                 </oils_persist:source_definition>
5108                 <fields oils_persist:primary="id">
5109                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5110                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5111                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5112                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5113                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5114                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5115                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5116                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5117                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5118                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5119                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5120                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5121                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5122                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5123                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5124                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5125                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5126                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5127                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5128                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5129                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5130                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5131                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5132                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5133                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5134                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5135                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5136                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5137                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5138                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5139                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5140                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5141                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5142                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5143                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5144                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5145                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5146                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5147                 </fields>
5148                 <links>
5149                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5150                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5151                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5152                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5153                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5154                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5155                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5156                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5157                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5158                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5159                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5160                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5161                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5162                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5163                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5164                 </links>
5165         </class>
5166
5167         <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">
5168                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5169                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5170                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5171                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5172                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5173                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5174                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5175                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5176                 </fields>
5177                 <links>
5178                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5179                 </links>
5180                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5181                         <actions>
5182                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5183                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5184                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5185                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5186                         </actions>
5187                 </permacrud>
5188         </class>
5189         <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">
5190                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
5191                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
5192                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
5193                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
5194                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
5195                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
5196                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
5197                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5198                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
5199                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
5200                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
5201                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
5202                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
5203                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5204                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
5205                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
5206                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
5207                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5208                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
5209                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
5210                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
5211                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
5212                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
5213                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
5214                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
5215                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
5216                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
5217                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5218                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5219                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5220                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
5221                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
5222                 </fields>
5223                 <links>
5224                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
5225                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
5226                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
5227                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
5228                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
5229                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
5230                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
5231                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
5232                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
5233                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
5234                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
5235                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
5236                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
5237                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
5238                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
5239                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
5240                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
5241                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
5242                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
5243                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
5244                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
5245                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
5246                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
5247                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
5248                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
5249                 </links>
5250         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5251             <actions>
5252                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
5253                 <retrieve permission="CREATE_ORG_UNIT UPDATE_ORG_UNIT DELETE_ORG_UNIT">
5254                     <context field="id"/>
5255                     <context field="parent_ou"/>
5256                                 </retrieve>
5257                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
5258                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
5259             </actions>
5260         </permacrud>
5261         </class>
5262         <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">
5263                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
5264                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5265                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
5266                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
5267                 </fields>
5268                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5269                         <actions>
5270                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5271                                 <retrieve/>
5272                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5273                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5274                         </actions>
5275                 </permacrud>
5276         </class>
5277         <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">
5278                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
5279                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5280                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
5281                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
5282                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
5283                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
5284                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
5285                 </fields>
5286                 <links>
5287                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
5288                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5289                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
5290                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
5291                 </links>
5292                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5293                         <actions>
5294                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5295                                 <retrieve/>
5296                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5297                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5298                         </actions>
5299                 </permacrud>
5300         </class>
5301         <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">
5302                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
5303                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5304                         <field name="btype" reporter:datatype="text"/>
5305                         <field name="id" reporter:datatype="id" />
5306                         <field name="name"  reporter:datatype="text"/>
5307                         <field name="description" reporter:datatype="text"/>
5308                         <field name="owner" reporter:datatype="link"/>
5309                         <field name="pub" reporter:datatype="bool"/>
5310                         <field name="create_time" reporter:datatype="timestamp" />
5311                 </fields>
5312                 <links>
5313                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5314                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
5315                 </links>
5316         </class>
5317         <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">
5318                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
5319                         <field name="id" reporter:datatype="id" />
5320                         <field name="bucket" reporter:datatype="link"/>
5321                         <field name="note" reporter:datatype="text" />
5322                 </fields>
5323                 <links>
5324                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5325                 </links>
5326         </class>
5327         <class id="asc" controller="open-ils.cstore" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
5328                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
5329                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5330                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5331                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5332                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5333                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5334                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5335                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5336                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5337                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5338                 </fields>
5339                 <links>
5340                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5341                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
5342                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
5343                 </links>
5344         </class>
5345         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
5346                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
5347                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
5348                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5349                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
5350                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5351                 </fields>
5352                 <links>
5353                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5354                 </links>
5355                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5356                         <actions>
5357                                 <retrieve permission="VIEW_USER">
5358                                         <context link="usr" field="home_ou" />
5359                                 </retrieve>
5360                         </actions>
5361                 </permacrud>
5362         </class>
5363     <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">
5364         <fields oils_persist:primary="field">
5365             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
5366             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
5367             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
5368         </fields>
5369         <links/>
5370         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5371             <actions>
5372                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
5373                 <retrieve />
5374                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
5375                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
5376             </actions>
5377         </permacrud>
5378     </class>
5379         <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">
5380                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
5381                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5382                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5383                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5384                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5385                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5386                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5387                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
5388                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5389                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5390                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5391                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5392                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
5393                 </fields>
5394                 <links>
5395                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5396                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
5397                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
5398                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
5399                 </links>
5400         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5401             <actions>
5402                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
5403                 <retrieve />
5404                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
5405                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
5406             </actions>
5407         </permacrud>
5408         </class>
5409         <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">
5410                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
5411                         <field name="field" reporter:datatype="link"/>
5412                         <field name="id" reporter:datatype="id" />
5413                         <field name="source" reporter:datatype="link"/>
5414                         <field name="value"  reporter:datatype="text"/>
5415                 </fields>
5416                 <links>
5417                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
5418                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5419                 </links>
5420         </class>
5421         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
5422                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
5423                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5424                         <field name="btype" reporter:datatype="text"/>
5425                         <field name="id" reporter:datatype="id" />
5426                         <field name="name"  reporter:datatype="text"/>
5427                         <field name="description" reporter:datatype="text"/>
5428                         <field name="owner" reporter:datatype="link"/>
5429                         <field name="pub" reporter:datatype="bool"/>
5430                         <field name="create_time" reporter:datatype="timestamp" />
5431                 </fields>
5432                 <links>
5433                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5434                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
5435                 </links>
5436         </class>
5437         <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">
5438                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
5439                         <field name="id" reporter:datatype="id" />
5440                         <field name="bucket" reporter:datatype="link"/>
5441                         <field name="note" reporter:datatype="text" />
5442                 </fields>
5443                 <links>
5444                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
5445                 </links>
5446         </class>
5447         <class id="mcrp" controller="open-ils.cstore" oils_obj:fieldmapper="money::credit_payment" oils_persist:tablename="money.credit_payment" reporter:label="House Credit Payment">
5448                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
5449                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
5450                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
5451                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
5452                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
5453                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
5454                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
5455                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
5456                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
5457                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
5458                 </fields>
5459                 <links>
5460                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
5461                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
5462                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
5463                 </links>
5464         </class>
5465         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
5466                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
5467                         <field name="id" reporter:datatype="id" />
5468                         <field name="ind1" />
5469                         <field name="ind2" />
5470                         <field name="record" />
5471                         <field name="subfield" />
5472                         <field name="tag" />
5473                         <field name="value" />
5474                 </fields>
5475                 <links>
5476                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
5477                 </links>
5478         </class>
5479         <class id="cnct" controller="open-ils.cstore" oils_obj:fieldmapper="config::non_cataloged_type" oils_persist:tablename="config.non_cataloged_type" reporter:label="Non-cataloged Type">
5480                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
5481                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
5482                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5483                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
5484                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5485                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
5486                 </fields>
5487                 <links>
5488                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5489                 </links>
5490         </class>
5491         <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">
5492                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
5493                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
5494                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
5495                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
5496                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
5497                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5498                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5499                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
5500                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
5501                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
5502                 </fields>
5503                 <links>
5504                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
5505                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
5506                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
5507                 </links>
5508         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5509             <actions>
5510                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
5511                 <retrieve/>
5512                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
5513                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
5514             </actions>
5515         </permacrud>
5516         </class>
5517         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
5518                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
5519                         <field name="create_date" reporter:datatype="timestamp"/>
5520                         <field name="creator" reporter:datatype="link"/>
5521                         <field name="edit_date" reporter:datatype="timestamp"/>
5522                         <field name="editor" reporter:datatype="link"/>
5523                         <field name="id" reporter:datatype="id" />
5524                         <field name="pub" reporter:datatype="bool"/>
5525                         <field name="record" reporter:datatype="link"/>
5526                         <field name="value"  reporter:datatype="text"/>
5527                 </fields>
5528                 <links>
5529                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5530                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5531                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5532                 </links>
5533         </class>
5534         <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">
5535                 <fields oils_persist:primary="usr" oils_persist:sequence="">
5536                         <field name="balance_owed" reporter:datatype="money" />
5537                         <field name="total_owed" reporter:datatype="money" />
5538                         <field name="total_paid" reporter:datatype="money" />
5539                         <field name="usr" reporter:datatype="link"/>
5540                 </fields>
5541                 <links>
5542                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5543                 </links>
5544         </class>
5545         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
5546                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5547                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
5548                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5549                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
5550                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5551                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
5552                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
5553                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5554                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5555                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5556                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5557                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5558                 </fields>
5559                 <links>
5560                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5561                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5562                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5563                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5564                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
5565                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5566                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5567                 </links>
5568         </class>
5569         <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">
5570                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
5571                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
5572                         <field name="quality" reporter:datatype="int" />
5573                         <field name="source" reporter:datatype="text"/>
5574                         <field name="transcendant" reporter:datatype="bool"/>
5575                         <field name="can_have_copies" reporter:datatype="bool"/>
5576                 </fields>
5577                 <links/>
5578         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5579             <actions>
5580                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
5581                 <retrieve/>
5582                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
5583                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
5584             </actions>
5585         </permacrud>
5586         </class>
5587         <class id="mbt" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction" oils_persist:tablename="money.billable_xact" reporter:label="Billable Transaction">
5588                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5589                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5590                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5591                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5592                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5593                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5594                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
5595                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
5596                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5597                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5598                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5599                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5600                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5601                 </fields>
5602                 <links>
5603                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
5604                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
5605                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5606                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5607                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5608                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5609                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5610                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5611                 </links>
5612         </class>
5613         <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">
5614                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
5615                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
5616                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
5617                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
5618                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
5619                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5620                 </fields>
5621                 <links>
5622                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
5623                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5624                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
5625                 </links>
5626         </class>
5627         <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">
5628                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
5629                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
5630                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
5631                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
5632                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
5633                 </fields>
5634                 <links>
5635                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
5636                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5637                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
5638                 </links>
5639         </class>
5640         <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">
5641                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
5642                         <field name="bucket" reporter:datatype="link"/>
5643                         <field name="id" reporter:datatype="id" />
5644                         <field name="target_user" reporter:datatype="link"/>
5645                         <field name="create_time" reporter:datatype="timestamp" />
5646                         <field name="pos" reporter:datatype="int" />
5647                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5648                 </fields>
5649                 <links>
5650                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
5651                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
5652             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
5653                 </links>
5654         </class>
5655         <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">
5656                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
5657                         <field name="id" reporter:datatype="id" />
5658                         <field name="item" reporter:datatype="link"/>
5659                         <field name="note" reporter:datatype="text" />
5660                 </fields>
5661                 <links>
5662                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
5663                 </links>
5664         </class>
5665         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
5666                 <fields oils_persist:primary="usr" oils_persist:sequence="">
5667                         <field name="balance_owed" reporter:datatype="money" />
5668                         <field name="total_owed" reporter:datatype="money" />
5669                         <field name="total_paid" reporter:datatype="money" />
5670                         <field name="usr" reporter:datatype="link"/>
5671                 </fields>
5672                 <links>
5673                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5674                 </links>
5675         </class>
5676         <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">
5677                 <fields oils_persist:primary="code" oils_persist:sequence="">
5678                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
5679                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
5680                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
5681                 </fields>
5682                 <links/>
5683         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5684             <actions>
5685                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5686                 <retrieve/>
5687                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5688                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5689             </actions>
5690         </permacrud>
5691         </class>
5692         <class id="mwp" controller="open-ils.cstore" oils_obj:fieldmapper="money::work_payment" oils_persist:tablename="money.work_payment" reporter:label="Work Payment">
5693                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
5694                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
5695                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
5696                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
5697                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
5698                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5699                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
5700                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
5701                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
5702                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
5703                 </fields>
5704                 <links>
5705                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
5706                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
5707                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
5708                 </links>
5709         </class>
5710         <class id="mgp" controller="open-ils.cstore" oils_obj:fieldmapper="money::goods_payment" oils_persist:tablename="money.goods_payment" reporter:label="Goods Payment">
5711                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
5712                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
5713                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
5714                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
5715                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
5716                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5717                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
5718                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
5719                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
5720                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
5721                 </fields>
5722                 <links>
5723                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
5724                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
5725                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
5726                 </links>
5727         </class>
5728         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
5729                 <fields oils_persist:primary="id" oils_persist:sequence="">
5730                         <field name="checkin_lib" reporter:datatype="link"/>
5731                         <field name="checkin_staff" reporter:datatype="link"/>
5732                         <field name="checkin_time" reporter:datatype="timestamp"/>
5733                         <field name="circ_lib"  reporter:datatype="org_unit"/>
5734                         <field name="circ_staff" reporter:datatype="link"/>
5735                         <field name="desk_renewal" reporter:datatype="bool"/>
5736                         <field name="due_date" reporter:datatype="timestamp"/>
5737                         <field name="duration" reporter:datatype="interval"/>
5738                         <field name="duration_rule" reporter:datatype="link"/>
5739                         <field name="fine_interval" reporter:datatype="interval"/>
5740                         <field name="id" reporter:datatype="id" />
5741                         <field name="max_fine" reporter:datatype="money" />
5742                         <field name="max_fine_rule" reporter:datatype="link"/>
5743                         <field name="opac_renewal" reporter:datatype="bool"/>
5744                         <field name="phone_renewal" reporter:datatype="bool"/>
5745                         <field name="recurring_fine" reporter:datatype="money" />
5746                         <field name="recurring_fine_rule" reporter:datatype="link"/>
5747                         <field name="renewal_remaining" reporter:datatype="int" />
5748             <field name="grace_period" reporter:datatype="interval" />
5749                         <field name="stop_fines" reporter:datatype="text"/>
5750                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
5751                         <field name="target_copy" reporter:datatype="link"/>
5752                         <field name="usr" reporter:datatype="link"/>
5753                         <field name="xact_finish" reporter:datatype="timestamp" />
5754                         <field name="xact_start" reporter:datatype="timestamp" />
5755                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
5756                 </fields>
5757                 <links>
5758                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
5759                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5760                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5761                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5762                 </links>
5763         </class>
5764         <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">
5765                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
5766                         <field name="field" reporter:datatype="link"/>
5767                         <field name="id" reporter:datatype="id" />
5768                         <field name="source" reporter:datatype="link"/>
5769                         <field name="value" reporter:datatype="text"/>
5770                 </fields>
5771                 <links>
5772                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
5773                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5774                 </links>
5775         </class>
5776         <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">
5777                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
5778                         <field name="high" reporter:datatype="money" />
5779                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
5780                         <field name="low" reporter:datatype="money" />
5781                         <field name="name" reporter:datatype="text"/>
5782                         <field name="normal" reporter:datatype="money" />
5783                         <field name="recurrence_interval" reporter:datatype="interval"/>
5784             <field name="grace_period" reporter:datatype="interval" />
5785                 </fields>
5786                 <links/>
5787         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5788             <actions>
5789                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
5790                 <retrieve/>
5791                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
5792                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
5793             </actions>
5794         </permacrud>
5795         </class>
5796         <class id="mckp" controller="open-ils.cstore" oils_obj:fieldmapper="money::check_payment" oils_persist:tablename="money.check_payment" reporter:label="Check Payment">
5797                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
5798                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
5799                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
5800                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
5801                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
5802                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
5803                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
5804                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5805                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
5806                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
5807                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
5808                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
5809                 </fields>
5810                 <links>
5811                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
5812                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
5813                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
5814                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
5815                 </links>
5816         </class>
5817         <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">
5818                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
5819                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
5820                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5821                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5822                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
5823                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
5824                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5825                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
5826                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
5827                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
5828                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
5829                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
5830                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
5831                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5832                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
5833                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5834                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
5835                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
5836                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
5837                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
5838                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
5839                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5840                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
5841                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
5842                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5843                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
5844                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
5845                         <field reporter:label="Price" name="price" reporter:datatype="money" />
5846                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
5847                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
5848                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
5849                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
5850                         <field reporter:label="Is Floating" name="floating" reporter:datatype="bool"/>
5851                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
5852                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5853                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5854                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5855                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
5856                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5857                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
5858                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5859                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
5860                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5861                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
5862                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
5863                 </fields>
5864                 <links>
5865                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
5866                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
5867                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5868                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5869                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5870                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5871                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5872                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
5873                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
5874                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
5875                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
5876                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
5877                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
5878                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
5879                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5880                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
5881                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
5882                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
5883                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
5884                 </links>
5885         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5886             <actions>
5887                 <create permission="CREATE_COPY">
5888                     <context link="call_number" field="owning_lib"/>
5889                 </create>
5890                 <retrieve/>
5891                 <update permission="UPDATE_COPY">
5892                     <context link="call_number" field="owning_lib"/>
5893                 </update>
5894                 <delete permission="DELETE_COPY">
5895                     <context link="call_number" field="owning_lib"/>
5896                 </delete>
5897             </actions>
5898         </permacrud>
5899         </class>
5900
5901         <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">
5902                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
5903                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
5904                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
5905                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5906                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5907                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5908                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5909                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5910                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
5911                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
5912                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
5913                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5914                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5915                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
5916                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
5917                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
5918                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
5919                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
5920                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5921                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
5922                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
5923                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
5924                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5925                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5926                         <field reporter:label="Floating?" name="floating" reporter:datatype="bool"/>
5927                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
5928                 </fields>
5929                 <links>
5930                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5931                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5932                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5933                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5934                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5935                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5936                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5937                 </links>
5938                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5939                         <actions>
5940                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
5941                                 <retrieve />
5942                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
5943                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
5944                         </actions>
5945                 </permacrud>
5946         </class>
5947
5948         <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">
5949                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
5950                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
5951                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5952                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
5953                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
5954                 </fields>
5955                 <links/>
5956         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5957             <actions>
5958                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
5959                 <retrieve/>
5960                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
5961                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
5962             </actions>
5963         </permacrud>
5964         </class>
5965         <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">
5966                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
5967                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
5968                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5969                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
5970                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
5971                 </fields>
5972                 <links/>
5973         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5974             <actions>
5975                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
5976                 <retrieve/>
5977                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
5978                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
5979             </actions>
5980         </permacrud>
5981         </class>
5982         <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">
5983                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
5984                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
5985                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
5986                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5987                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5988                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
5989                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
5990                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
5991                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
5992                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
5993                 </fields>
5994                 <links>
5995                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
5996                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
5997                 </links>
5998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5999             <actions>
6000                 <create permission="CREATE_PERM" global_required="true"/>
6001                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6002                 <update permission="UPDATE_PERM" global_required="true"/>
6003                 <delete permission="DELETE_PERM" global_required="true"/>
6004             </actions>
6005         </permacrud>
6006         </class>
6007         <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">
6008                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
6009                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6010                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
6011                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
6012                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
6013                 </fields>
6014                 <links>
6015                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
6016                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
6017                 </links>
6018         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6019             <actions>
6020                 <create permission="ADMIN_SURVEY">
6021                     <context link="question" jump="survey" field="owner"/>
6022                 </create>
6023                 <retrieve/>
6024                 <update permission="ADMIN_SURVEY">
6025                     <context link="question" jump="survey" field="owner"/>
6026                 </update>
6027                 <delete permission="ADMIN_SURVEY">
6028                     <context link="question" jump="survey" field="owner"/>
6029                 </delete>
6030             </actions>
6031         </permacrud>
6032         </class>
6033         <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">
6034                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
6035                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6036                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
6037                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
6038                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
6039                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
6040                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
6041                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
6042                 </fields>
6043                 <links>
6044                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
6045                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
6046                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
6047                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6048                 </links>
6049         </class>
6050         <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">
6051                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6052                         <field name="balance_owed" reporter:datatype="money" />
6053                         <field name="total_owed" reporter:datatype="money" />
6054                         <field name="total_paid" reporter:datatype="money" />
6055                         <field name="usr" reporter:datatype="link"/>
6056                 </fields>
6057                 <links>
6058                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6059                 </links>
6060         </class>
6061         <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">
6062                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
6063                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
6064                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
6065                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
6066                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
6067                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
6068                 </fields>
6069                 <links>
6070                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6071                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6072                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6073                 </links>
6074         </class>
6075         <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">
6076                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
6077                         <field name="field" reporter:datatype="link"/>
6078                         <field name="id" reporter:datatype="id" />
6079                         <field name="source" reporter:datatype="link"/>
6080                         <field name="value" reporter:datatype="text"/>
6081                 </fields>
6082                 <links>
6083                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6084                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6085                 </links>
6086         </class>
6087         <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">
6088                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
6089                         <field name="field" reporter:datatype="link"/>
6090                         <field name="id" reporter:datatype="id" />
6091                         <field name="source" reporter:datatype="link"/>
6092                         <field name="value" reporter:datatype="text"/>
6093                 </fields>
6094                 <links>
6095                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6096                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6097                 </links>
6098         </class>
6099         <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">
6100                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
6101                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6102                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
6103                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
6104                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
6105                 </fields>
6106                 <links>
6107                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
6108                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6109                 </links>
6110         </class>
6111         <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">
6112                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
6113                         <field name="depth" reporter:datatype="int" />
6114                         <field name="grantable" reporter:datatype="bool"/>
6115                         <field name="grp" reporter:datatype="link"/>
6116                         <field name="id" reporter:datatype="id" />
6117                         <field name="perm" reporter:datatype="link"/>
6118                 </fields>
6119                 <links>
6120                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
6121                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6122                 </links>
6123         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6124             <actions>
6125                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
6126                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
6127                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
6128                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
6129             </actions>
6130         </permacrud>
6131         </class>
6132         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
6133                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
6134                         <field name="items" oils_persist:virtual="true" />
6135                         <field name="btype" reporter:datatype="text"/>
6136                         <field name="id" reporter:datatype="id" />
6137                         <field name="name" reporter:datatype="text"/>
6138                         <field name="description" reporter:datatype="text"/>
6139                         <field name="owner" reporter:datatype="link"/>
6140                         <field name="pub" reporter:datatype="bool"/>
6141                         <field name="create_time" reporter:datatype="timestamp" />
6142                 </fields>
6143                 <links>
6144                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6145                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
6146                 </links>
6147         </class>
6148         <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">
6149                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
6150                         <field name="id" reporter:datatype="id" />
6151                         <field name="bucket" reporter:datatype="link"/>
6152                         <field name="note" reporter:datatype="text" />
6153                 </fields>
6154                 <links>
6155                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
6156                 </links>
6157         </class>
6158         <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">
6159                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
6160                         <field name="id" reporter:datatype="int" />
6161                         <field name="usr" reporter:datatype="link"/>
6162                         <field name="work_ou" reporter:datatype="link"/>
6163                 </fields>
6164                 <links>
6165                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6166                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
6167                 </links>
6168         </class>
6169         <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">
6170                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
6171                         <field name="depth" reporter:datatype="int"/>
6172                         <field name="grantable" reporter:datatype="bool"/>
6173                         <field name="id" reporter:datatype="id" />
6174                         <field name="perm" reporter:datatype="link"/>
6175                         <field name="usr" reporter:datatype="link"/>
6176                 </fields>
6177                 <links>
6178                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6179                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6180                 </links>
6181         </class>
6182         <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">
6183                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
6184                         <field name="object_id" reporter:datatype="text"/>
6185                         <field name="grantable" reporter:datatype="bool"/>
6186                         <field name="id" reporter:datatype="id" />
6187                         <field name="perm" reporter:datatype="link"/>
6188                         <field name="usr" reporter:datatype="link"/>
6189                         <field name="object_type" reporter:datatype="text"/>
6190                 </fields>
6191                 <links>
6192                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6193                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6194                 </links>
6195         </class>
6196         <class id="mp" controller="open-ils.cstore" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:core="true" reporter:label="Payments: All">
6197                 <fields oils_persist:primary="id" oils_persist:sequence="">
6198                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6199                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6200                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6201                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6202                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6203                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6204                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6205                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6206                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6207                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6208                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6209                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6210                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6211                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6212                 </fields>
6213                 <links>
6214                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6215                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6216                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6217                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6218                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6219                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6220                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6221                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6222                 </links>
6223         </class>
6224         <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">
6225                 <fields oils_persist:primary="id" oils_persist:sequence="">
6226                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6227                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6228                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6229                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6230                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6231                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6232                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6233                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6234                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6235                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6236                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6237                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6238                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6239                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6240                 </fields>
6241                 <links>
6242                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6243                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6244                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6245                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6246                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6247                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6248                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6249                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6250                 </links>
6251         </class>
6252         <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">
6253                 <fields oils_persist:primary="id" oils_persist:sequence="">
6254                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6255                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6256                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6257                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6258                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6259                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6260                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6261                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6262                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6263                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6264                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6265                 </fields>
6266                 <links>
6267                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6268                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6269                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6270                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6271                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6272                 </links>
6273         </class>
6274         <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">
6275                 <fields oils_persist:primary="id" oils_persist:sequence="">
6276                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6277                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6278                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6279                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6280                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6281                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6282                         <field reporter:label="Accepting User" name="accepting_usr" />
6283                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
6284                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6285                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6286                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6287                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6288                 </fields>
6289                 <links>
6290                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6291                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6292                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6293                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6294                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6295                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6296                 </links>
6297         </class>
6298         <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">
6299                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
6300                         <field name="bucket" reporter:datatype="link"/>
6301                         <field name="id" reporter:datatype="id" />
6302                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
6303                         <field name="create_time" reporter:datatype="timestamp" />
6304                         <field name="pos" reporter:datatype="int" />
6305                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6306                 </fields>
6307                 <links>
6308                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
6309                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
6310             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
6311                 </links>
6312         </class>
6313         <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">
6314                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
6315                         <field name="id" reporter:datatype="id" />
6316                         <field name="item" reporter:datatype="link"/>
6317                         <field name="note" reporter:datatype="text" />
6318                 </fields>
6319                 <links>
6320                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
6321                 </links>
6322         </class>
6323         <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">
6324                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
6325                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
6326                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6327                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6328                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6329                 </fields>
6330                 <links>
6331                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6332                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6333                 </links>
6334         </class>
6335     <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">
6336         <fields oils_persist:primary="field">
6337             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
6338             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
6339             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
6340         </fields>
6341         <links/>
6342         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6343             <actions>
6344                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
6345                 <retrieve />
6346                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
6347                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
6348             </actions>
6349         </permacrud>
6350     </class>
6351         <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">
6352                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
6353                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
6354                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
6355                 </fields>
6356                 <links/>
6357         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6358             <actions>
6359                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
6360                 <retrieve/>
6361                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
6362                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
6363             </actions>
6364         </permacrud>
6365         </class>
6366
6367
6368         <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">
6369                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
6370                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
6371                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
6372                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
6373                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
6374                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
6375                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
6376                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
6377                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
6378                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
6379                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
6380                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
6381                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
6382                 </fields>
6383                 <links>
6384                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
6385                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
6386                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
6387                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
6388                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
6389                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
6390                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
6391                 </links>
6392         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6393             <actions>
6394                 <create permission="TRANSIT_COPY">
6395                     <context link="target_copy" field="owner"/>
6396                 </create>
6397                 <retrieve/>
6398                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
6399                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
6400             </actions>
6401         </permacrud>
6402         </class>
6403         <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">
6404                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
6405                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
6406                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
6407                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
6408                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
6409                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
6410                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
6411                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
6412                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
6413                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
6414                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
6415                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
6416                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
6417                 </fields>
6418                 <links>
6419                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
6420                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
6421                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
6422                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
6423                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
6424                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
6425                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6426                 </links>
6427         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6428             <actions>
6429                 <create permission="TRANSIT_COPY" context_field="owner">
6430                     <context link="target_copy" field="circ_lib"/>
6431                 </create>
6432                 <retrieve/>
6433                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
6434                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
6435             </actions>
6436         </permacrud>
6437         </class>
6438         <class id="mb" controller="open-ils.cstore" oils_obj:fieldmapper="money::billing" oils_persist:tablename="money.billing" reporter:label="Billing Line Item">
6439                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
6440                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6441                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
6442                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
6443                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
6444                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6445                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
6446                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6447                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
6448                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6449                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
6450                 </fields>
6451                 <links>
6452                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6453                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
6454                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
6455                 </links>
6456         </class>
6457         <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">
6458                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
6459                         <field name="grp" />
6460                         <field name="id" reporter:datatype="id" />
6461                         <field name="usr" />
6462                 </fields>
6463                 <links>
6464                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
6465                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6466                 </links>
6467         </class>
6468         <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">
6469                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
6470                         <field name="id" reporter:datatype="id" />
6471                         <field name="fq_field" reporter:datatype="text"/>
6472                         <field name="identity_value" reporter:datatype="text"/>
6473                         <field name="translation" reporter:datatype="text"/>
6474                         <field name="string" reporter:datatype="text"/>
6475                 </fields>
6476                 <links>
6477                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
6478                 </links>
6479         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6480             <actions>
6481                 <create permission="CREATE_TRANSLATION" global_required="true"/>
6482                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
6483                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
6484                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
6485             </actions>
6486         </permacrud>
6487         </class>
6488         <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">
6489                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
6490                         <field name="id" reporter:datatype="id" />
6491                         <field name="fm_class" reporter:datatype="text"/>
6492                         <field name="field" reporter:datatype="text"/>
6493                         <field name="owner" reporter:datatype="org_unit"/>
6494                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
6495                 </fields>
6496                 <links>
6497                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6498                 </links>
6499         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6500             <actions>
6501                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
6502                 <retrieve/>
6503                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
6504                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
6505             </actions>
6506         </permacrud>
6507         </class>
6508         <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">
6509                 <fields oils_persist:primary="code">
6510                         <field name="code" reporter:datatype="id" />
6511                         <field name="marc_code" reporter:datatype="text"/>
6512                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6513                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6514                 </fields>
6515                 <links/>
6516         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6517             <actions>
6518                 <create permission="CREATE_LOCALE" global_required="true"/>
6519                 <retrieve/>
6520                 <update permission="UPDATE_LOCALE" global_required="true"/>
6521                 <delete permission="DELETE_LOCALE" global_required="true"/>
6522             </actions>
6523         </permacrud>
6524         </class>
6525         <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">
6526                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
6527                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
6528                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
6529                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
6530             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
6531                 </fields>
6532                 <links>
6533                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6534                 </links>
6535         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6536             <actions>
6537                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
6538                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
6539                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
6540                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
6541             </actions>
6542         </permacrud>
6543         </class>
6544
6545         <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">
6546                 <fields oils_persist:primary="id">
6547                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
6548                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
6549                 </fields>
6550                 <links/>
6551         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6552             <actions>
6553                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
6554                 <retrieve/>
6555                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
6556                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
6557             </actions>
6558         </permacrud>
6559         </class>
6560
6561         <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">
6562                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
6563                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
6564                         <field reporter:label="User" name="usr" reporter:datatype="link" />
6565                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
6566                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
6567                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
6568                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
6569                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
6570                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
6571                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
6572                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
6573                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
6574                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
6575                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
6576                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
6577                         <field reporter:label="Title" name="title" reporter:datatype="text" />
6578                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
6579                         <field reporter:label="Author" name="author" reporter:datatype="text" />
6580                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
6581                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
6582                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
6583                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
6584                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
6585                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
6586                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
6587                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
6588                 </fields>
6589                 <links>
6590                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6591                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6592                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
6593                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
6594                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
6595                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
6596                 </links>
6597         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6598             <actions>
6599                 <create permission="user_request.create">
6600                     <context link="usr" field="home_ou"/>
6601                                 </create>
6602                 <retrieve permission="user_request.view">
6603                     <context link="usr" field="home_ou"/>
6604                                 </retrieve>
6605                 <update permission="user_request.update">
6606                     <context link="usr" field="home_ou"/>
6607                                 </update>
6608                 <delete permission="user_request.delete">
6609                     <context link="usr" field="home_ou"/>
6610                                 </delete>
6611             </actions>
6612         </permacrud>
6613         </class>
6614
6615         <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">
6616                 <fields oils_persist:primary="code">
6617                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
6618                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
6619                 </fields>
6620                 <links/>
6621         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6622             <actions>
6623                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
6624                 <retrieve/>
6625                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
6626                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
6627             </actions>
6628         </permacrud>
6629         </class>
6630
6631         <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">
6632                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
6633                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
6634                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
6635                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
6636                         <field reporter:label="Ratio" name="ratio" />
6637                 </fields>
6638                 <links>
6639                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
6640                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
6641                 </links>
6642                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6643                         <actions>
6644                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
6645                                 <retrieve/>
6646                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
6647                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
6648                         </actions>
6649                 </permacrud>
6650         </class>
6651
6652         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
6653                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
6654                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
6655                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
6656                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
6657                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
6658                         <field reporter:label="Code" name="code" reporter:datatype="text" />
6659                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
6660                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
6661                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
6662                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
6663                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
6664                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
6665                         <field reporter:label="URL" name="url" reporter:datatype="text" />
6666                         <field reporter:label="Email" name="email" reporter:datatype="text" />
6667                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
6668                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
6669                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
6670                 </fields>
6671                 <links>
6672                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
6673                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6674             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
6675             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
6676             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
6677                 </links>
6678         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6679             <actions>
6680                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
6681                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
6682                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
6683                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
6684             </actions>
6685         </permacrud>
6686         </class>
6687
6688         <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">
6689                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
6690                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
6691                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
6692                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
6693                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
6694                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
6695                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
6696                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
6697                 </fields>
6698                 <links>
6699                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6700                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6701                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
6702                 </links>
6703         </class>
6704
6705         <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">
6706                 <fields oils_persist:primary="code">
6707                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
6708                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6709                 </fields>
6710                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6711             <actions>
6712                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
6713                 <retrieve/>
6714                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
6715                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
6716             </actions>
6717                 </permacrud>
6718         </class>
6719
6720         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
6721                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
6722                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
6723                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
6724                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
6725                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
6726                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
6727                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
6728                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
6729                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
6730                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
6731                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
6732                         <field reporter:label="Note" name="note" reporter:datatype="text" />
6733                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
6734                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
6735                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
6736                 </fields>
6737                 <links>
6738                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
6739                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
6740                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
6741                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
6742                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
6743                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
6744                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
6745                 </links>
6746         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6747             <actions>
6748                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
6749                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
6750                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
6751                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
6752             </actions>
6753         </permacrud>
6754         </class>
6755
6756         <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">
6757                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
6758                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6759                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
6760                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
6761                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
6762                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
6763                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
6764                         <field reporter:label="Note" name="note" reporter:datatype="text" />
6765                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
6766                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
6767                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
6768                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
6769                 </fields>
6770                 <links>
6771                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
6772                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
6773                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
6774                 </links>
6775         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6776             <actions>
6777                 <create   permission="ADMIN_INVOICE">
6778                                         <context link="invoice" field="receiver"/>
6779                                 </create>
6780                 <retrieve permission="ADMIN_INVOICE">
6781                                         <context link="invoice" field="receiver"/>
6782                                 </retrieve>
6783                 <update   permission="ADMIN_INVOICE">
6784                                         <context link="invoice" field="receiver"/>
6785                                 </update>
6786                                 <delete   permission="ADMIN_INVOICE">
6787                                         <context link="invoice" field="receiver"/>
6788                                 </delete>
6789             </actions>
6790         </permacrud>
6791         </class>
6792
6793         <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">
6794                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
6795                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6796                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
6797                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
6798                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
6799                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
6800                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
6801                         <field reporter:label="Author" name="author" reporter:datatype="text" />
6802                         <field reporter:label="Note" name="note" reporter:datatype="text" />
6803                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
6804                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
6805                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
6806                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
6807                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
6808                         <field reporter:label="Target" name="target" reporter:datatype="int" />
6809                 </fields>
6810                 <links>
6811                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
6812                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
6813                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
6814                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
6815                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
6816                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
6817                 </links>
6818         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6819             <actions>
6820                 <create   permission="ADMIN_INVOICE">
6821                                         <context link="invoice" field="receiver"/>
6822                                 </create>
6823                 <retrieve permission="ADMIN_INVOICE">
6824                                         <context link="invoice" field="receiver"/>
6825                                 </retrieve>
6826                 <update   permission="ADMIN_INVOICE">
6827                                         <context link="invoice" field="receiver"/>
6828                                 </update>
6829                                 <delete   permission="ADMIN_INVOICE">
6830                                         <context link="invoice" field="receiver"/>
6831                                 </delete>
6832             </actions>
6833         </permacrud>
6834         </class>
6835
6836         <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">
6837                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
6838                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
6839                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
6840                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
6841                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
6842                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6843                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
6844                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
6845                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
6846                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
6847                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
6848                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
6849                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
6850                 </fields>
6851                 <links>
6852                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
6853                 </links>
6854         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6855             <actions>
6856                 <create permission="ADMIN_PROVIDER">
6857                     <context link="provider" field="owner"/>
6858                 </create>
6859                 <retrieve permission="ADMIN_PROVIDER">
6860                     <context link="provider" field="owner"/>
6861                 </retrieve>
6862                 <update permission="ADMIN_PROVIDER">
6863                     <context link="provider" field="owner"/>
6864                 </update>
6865                 <delete permission="ADMIN_PROVIDER">
6866                     <context link="provider" field="owner"/>
6867                 </delete>
6868             </actions>
6869         </permacrud>
6870         </class>
6871
6872         <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">
6873                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
6874                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6875                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
6876                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6877                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
6878                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
6879                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
6880         </fields>
6881                 <links>
6882                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
6883                 </links>
6884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6885             <actions>
6886                 <create permission="ADMIN_PROVIDER">
6887                     <context link="provider" field="owner"/>
6888                 </create>
6889                 <retrieve permission="ADMIN_PROVIDER">
6890                     <context link="provider" field="owner"/>
6891                 </retrieve>
6892                 <update permission="ADMIN_PROVIDER">
6893                     <context link="provider" field="owner"/>
6894                 </update>
6895                 <delete permission="ADMIN_PROVIDER">
6896                     <context link="provider" field="owner"/>
6897                 </delete>
6898             </actions>
6899         </permacrud>
6900     </class>
6901         <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">
6902                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
6903                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
6904                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
6905                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
6906                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
6907                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
6908                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
6909                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
6910                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
6911                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
6912                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
6913                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
6914                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
6915                 </fields>
6916                 <links>
6917                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
6918                 </links>
6919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6920             <actions>
6921                 <create permission="ADMIN_PROVIDER">
6922                     <context link="contact" jump='provider' field="owner"/>
6923                 </create>
6924                 <retrieve permission="ADMIN_PROVIDER">
6925                     <context link="contact" jump='provider' field="owner"/>
6926                 </retrieve>
6927                 <update permission="ADMIN_PROVIDER">
6928                     <context link="contact" jump='provider' field="owner"/>
6929                 </update>
6930                 <delete permission="ADMIN_PROVIDER">
6931                     <context link="contact" jump='provider' field="owner"/>
6932                 </delete>
6933             </actions>
6934         </permacrud>
6935         </class>
6936
6937         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
6938                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
6939                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
6940                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
6941                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
6942                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
6943                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
6944                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
6945                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
6946                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6947                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
6948                 </fields>
6949                 <links>
6950                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
6951                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
6952                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
6953                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
6954                 </links>
6955         </class>
6956
6957         <class id="acqfc" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fiscal_calendar" oils_persist:tablename="acq.fiscal_calendar" reporter:label="Fiscal Calendar">
6958                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
6959                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
6960                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
6961                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
6962                 </fields>
6963                 <links>
6964             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
6965                 </links>
6966                 <!--
6967                         For now, we don't have pcrud as one of the controllers, so the permacrud section is moot.
6968                         But here's what it should look like if we ever do use pcrud.
6969                 -->
6970                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6971                         <actions>
6972                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
6973                                 <retrieve permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
6974                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
6975                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
6976                         </actions>
6977                 </permacrud>
6978         </class>
6979
6980         <class id="acqfy" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fiscal_year" oils_persist:tablename="acq.fiscal_year" reporter:label="Fiscal Year">
6981                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
6982                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
6983                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
6984                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
6985                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
6986                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
6987                 </fields>
6988                 <links>
6989                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
6990                 </links>
6991                 <!--
6992                         For now, we don't have pcrud as one of the controllers, so the permacrud section is moot.
6993                         But here's what it should look like if we ever do use pcrud.
6994                 -->
6995                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6996                         <actions>
6997                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
6998                                 <retrieve permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
6999                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7000                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7001                         </actions>
7002                 </permacrud>
7003         </class>
7004
7005         <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">
7006                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
7007                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7008                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7009                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7010                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7011                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7012                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7013                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7014                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
7015                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7016                 </fields>
7017                 <links>
7018                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7019                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7020             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
7021             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
7022                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
7023                 </links>
7024         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7025             <actions>
7026                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7027                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
7028                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7029                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7030             </actions>
7031         </permacrud>
7032         </class>
7033
7034         <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">
7035                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
7036                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
7037                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
7038                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7039                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7040                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
7041                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
7042                 </fields>
7043                 <links>
7044                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7045                 </links>
7046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7047                         <actions>
7048                                 <create permission="ADMIN_FUNDING_SOURCE">
7049                     <context link="funding_source" field="owner"/>
7050                 </create>
7051                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
7052                     <context link="funding_source" field="owner"/>
7053                 </retrieve>
7054                                 <update permission="ADMIN_FUNDING_SOURCE">
7055                     <context link="funding_source" field="owner"/>
7056                 </update>
7057                                 <delete permission="ADMIN_FUNDING_SOURCE">
7058                     <context link="funding_source" field="owner"/>
7059                 </delete>
7060                         </actions>
7061                 </permacrud>
7062         </class>
7063
7064         <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">
7065                 <fields oils_persist:primary="id">
7066                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
7067                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
7068                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
7069                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
7070                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
7071                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7072                 </fields>
7073                 <links>
7074                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7075                 </links>
7076         </class>
7077
7078         <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">
7079                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
7080                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
7081                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7082                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
7083                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
7084                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7085                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
7086                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
7087                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
7088                 </fields>
7089                 <links>
7090                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7091                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7092                 </links>
7093                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7094                         <actions>
7095                                 <create permission="ADMIN_ACQ_FUND">
7096                     <context link="fund" field="org"/>
7097                 </create>
7098                                 <retrieve permission="ADMIN_ACQ_FUND">
7099                     <context link="fund" field="org"/>
7100                 </retrieve>
7101                                 <update permission="ADMIN_ACQ_FUND">
7102                     <context link="fund" field="org"/>
7103                 </update>
7104                                 <delete permission="ADMIN_ACQ_FUND">
7105                     <context link="fund" field="org"/>
7106                 </delete>
7107                         </actions>
7108                 </permacrud>
7109         </class>
7110
7111         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
7112                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
7113                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7114                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
7115                         <field reporter:label="Name" name="name" reporter:datatype="text" />
7116                         <field reporter:label="Year" name="year" reporter:datatype="int" />
7117                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
7118                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7119                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
7120                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
7121                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7122                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
7123                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
7124                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7125                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7126                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
7127                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7128                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
7129                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
7130                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
7131                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
7132                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7133                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7134                 </fields>
7135                 <links>
7136                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7137                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7138             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
7139             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
7140             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
7141             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
7142             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
7143             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
7144             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
7145             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
7146             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
7147                 </links>
7148         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7149             <actions>
7150                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
7151                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
7152                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
7153                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
7154             </actions>
7155         </permacrud>
7156         </class>
7157
7158         <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">
7159                 <fields oils_persist:primary="fund">
7160                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7161                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7162                 </fields>
7163                 <links>
7164                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7165                 </links>
7166         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7167             <actions>
7168                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7169                                         <context link="fund" field="org" />
7170                 </retrieve>
7171             </actions>
7172         </permacrud>
7173         </class>
7174
7175         <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">
7176                 <fields oils_persist:primary="fund">
7177                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7178                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
7179                 </fields>
7180                 <links>
7181                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7182                 </links>
7183         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7184             <actions>
7185                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7186                                         <context link="fund" field="org" />
7187                 </retrieve>
7188             </actions>
7189         </permacrud>
7190         </class>
7191
7192         <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">
7193                 <fields oils_persist:primary="fund">
7194                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7195                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
7196                 </fields>
7197                 <links>
7198                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7199                 </links>
7200         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7201             <actions>
7202                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7203                                         <context link="fund" field="org" />
7204                 </retrieve>
7205             </actions>
7206         </permacrud>
7207         </class>
7208
7209         <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">
7210                 <fields oils_persist:primary="fund">
7211                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7212                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7213                 </fields>
7214                 <links>
7215                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7216                 </links>
7217         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7218             <actions>
7219                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7220                                         <context link="fund" field="org" />
7221                 </retrieve>
7222             </actions>
7223         </permacrud>
7224         </class>
7225
7226         <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">
7227                 <fields oils_persist:primary="fund">
7228                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7229                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
7230                 </fields>
7231                 <links>
7232                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7233                 </links>
7234         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7235             <actions>
7236                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7237                                         <context link="fund" field="org" />
7238                 </retrieve>
7239             </actions>
7240         </permacrud>
7241         </class>
7242
7243    <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">
7244         <fields oils_persist:primary="fund">
7245             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7246             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7247         </fields>
7248         <links>
7249             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7250         </links>
7251     </class>
7252
7253    <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">
7254         <fields oils_persist:primary="fund">
7255             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7256             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
7257         </fields>
7258         <links>
7259             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7260         </links>
7261     </class>
7262
7263    <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">
7264         <fields oils_persist:primary="fund">
7265             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7266             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7267         </fields>
7268         <links>
7269             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7270         </links>
7271     </class>
7272
7273    <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">
7274         <fields oils_persist:primary="fund">
7275             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7276             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
7277         </fields>
7278         <links>
7279             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7280         </links>
7281     </class>
7282
7283    <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">
7284         <fields oils_persist:primary="fund">
7285             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7286             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
7287         </fields>
7288         <links>
7289             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7290         </links>
7291     </class>
7292
7293         <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">
7294                 <fields oils_persist:primary="funding_source">
7295                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7296                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
7297                 </fields>
7298                 <links>
7299                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7300                 </links>
7301         </class>
7302
7303         <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">
7304                 <fields oils_persist:primary="funding_source">
7305                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7306                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
7307                 </fields>
7308                 <links>
7309                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7310                 </links>
7311         </class>
7312
7313         <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">
7314                 <fields oils_persist:primary="funding_source">
7315                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7316                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
7317                 </fields>
7318                 <links>
7319                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7320                 </links>
7321         </class>
7322
7323         <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">
7324                 <fields oils_persist:primary="fund">
7325                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7326                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
7327                 </fields>
7328                 <links>
7329                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7330                 </links>
7331         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7332             <actions>
7333                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7334                                         <context link="fund" field="org" />
7335                 </retrieve>
7336             </actions>
7337         </permacrud>
7338     </class>
7339
7340         <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">
7341                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
7342                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
7343                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7344                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7345                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7346                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
7347                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7348                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
7349                 </fields>
7350                 <links>
7351                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
7352                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7353                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7354                 </links>
7355                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7356                         <actions>
7357                                 <create permission="ADMIN_ACQ_FUND">
7358                     <context link="fund" field="org"/>
7359                 </create>
7360                                 <retrieve permission="ADMIN_ACQ_FUND">
7361                     <context link="fund" field="org"/>
7362                 </retrieve>
7363                                 <update permission="ADMIN_ACQ_FUND">
7364                     <context link="fund" field="org"/>
7365                 </update>
7366                                 <delete permission="ADMIN_ACQ_FUND">
7367                     <context link="fund" field="org"/>
7368                 </delete>
7369                         </actions>
7370                 </permacrud>
7371         </class>
7372
7373     <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">
7374         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
7375             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
7376             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7377             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
7378             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
7379             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
7380             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
7381             <field reporter:label="Note" name="note" reporter:datatype="text" />
7382             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
7383         </fields>
7384         <links>
7385             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
7386             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7387             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7388         </links>
7389                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7390                         <actions>
7391                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
7392                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
7393                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
7394                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
7395                         </actions>
7396                 </permacrud>
7397     </class>
7398
7399         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
7400                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
7401                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
7402                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
7403                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
7404                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7405                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7406                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7407                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
7408                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
7409                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7410                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7411                 </fields>
7412                 <links>
7413                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7414                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7415                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7416                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7417                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
7418                 </links>
7419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7420                         <actions>
7421                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
7422                         </actions>
7423                 </permacrud>
7424         </class>
7425
7426         <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">
7427                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
7428                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7429                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
7430                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
7431                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
7432                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
7433                 </fields>
7434                 <links>
7435                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7436                 </links>
7437                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7438                         <actions>
7439                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
7440                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
7441                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
7442                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
7443                         </actions>
7444                 </permacrud>
7445         </class>
7446
7447         <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">
7448                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
7449                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7450                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
7451                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7452                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7453                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7454                         <field reporter:label="State" name="state" reporter:datatype="text" />
7455                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
7456                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7457                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7458                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
7459                         <field reporter:label="Name" name="name" reporter:datatype="text" />
7460                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7461                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7462                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
7463                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7464                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
7465                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
7466                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
7467                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
7468                 </fields>
7469                 <links>
7470                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7471                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7472                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7473                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
7474                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7475                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
7476                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
7477                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
7478                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
7479                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7480                 </links>
7481                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7482                         <actions>
7483                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
7484                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
7485                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
7486                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
7487                         </actions>
7488                 </permacrud>
7489         </class>
7490
7491         <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">
7492                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
7493                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
7494                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
7495                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
7496                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
7497                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
7498                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7499                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7500                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
7501                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
7502                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
7503                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7504                         <field reporter:label="State" name="state" reporter:datatype="text"/>
7505                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
7506                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7507                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
7508                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7509                 </fields>
7510                 <links>
7511                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
7512                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7513                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7514                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7515                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
7516                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7517                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7518                 </links>
7519                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7520             <actions>
7521                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
7522             </actions>
7523                 </permacrud>
7524         </class>
7525
7526         <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">
7527                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
7528                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7529                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
7530                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7531                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7532                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7533                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7534                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
7535                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
7536                 </fields>
7537                 <links>
7538                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7539                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7540                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7541                 </links>
7542                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7543             <actions>
7544                 <create permission="CREATE_PURCHASE_ORDER">
7545                     <context link="purchase_order" field="ordering_agency"/>
7546                 </create>
7547                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
7548                     <context link="purchase_order" field="ordering_agency"/>
7549                 </retrieve>
7550                 <update permission="CREATE_PURCHASE_ORDER">
7551                     <context link="purchase_order" field="ordering_agency"/>
7552                 </update>
7553                 <delete permission="CREATE_PURCHASE_ORDER">
7554                     <context link="purchase_order" field="ordering_agency"/>
7555                 </delete>
7556             </actions>
7557                 </permacrud>
7558         </class>
7559
7560         <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">
7561                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
7562                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7563                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7564                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7565                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
7566                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7567                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
7568                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7569                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
7570                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
7571                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7572                 </fields>
7573                 <links>
7574                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7575                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7576                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7577                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7578                 </links>
7579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7580             <actions>
7581                 <create permission="CREATE_PURCHASE_ORDER">
7582                     <context link="purchase_order" field="ordering_agency"/>
7583                 </create>
7584                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
7585                     <context link="purchase_order" field="ordering_agency"/>
7586                 </retrieve>
7587                 <update permission="CREATE_PURCHASE_ORDER">
7588                     <context link="purchase_order" field="ordering_agency"/>
7589                 </update>
7590                 <delete permission="CREATE_PURCHASE_ORDER">
7591                     <context link="purchase_order" field="ordering_agency"/>
7592                 </delete>
7593             </actions>
7594                 </permacrud>
7595         </class>
7596
7597         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
7598                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
7599                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
7600                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
7601                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
7602                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
7603                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7604                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7605                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7606                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
7607                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
7608                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
7609                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
7610                         <field reporter:label="State" name="state" reporter:datatype="text" />
7611                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7612                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7613                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
7614                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7615                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
7616                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
7617                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
7618                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
7619                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
7620                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
7621                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
7622                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
7623                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
7624                 </fields>
7625                 <links>
7626                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
7627                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7628                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7629                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7630                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7631                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
7632                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
7633                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
7634                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
7635                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
7636                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7637                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
7638                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
7639                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
7640                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
7641                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
7642                 </links>
7643                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7644                         <actions>
7645                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
7646                                         <context link="purchase_order" field="ordering_agency"/>
7647                                         <context link="picklist" field="org_unit"/>
7648                                 </retrieve>
7649                         </actions>
7650                 </permacrud>
7651         </class>
7652
7653         <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">
7654                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
7655                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
7656                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
7657                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
7658                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
7659                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7660                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7661                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
7662                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7663                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7664                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
7665                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
7666                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
7667                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
7668                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
7669                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
7670                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
7671                         <field reporter:label="State" name="state" reporter:datatype="text"/>
7672                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
7673                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
7674                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
7675                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
7676                 </fields>
7677                 <links>
7678                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
7679                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7680                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7681                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
7682                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7683                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7684                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
7685                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
7686                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7687                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
7688                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
7689                 </links>
7690                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7691                         <actions>
7692                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
7693                                         <context link="purchase_order" field="ordering_agency"/>
7694                                         <context link="picklist" field="org_unit"/>
7695                                 </retrieve>
7696                         </actions>
7697                 </permacrud>
7698         </class>
7699
7700         <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">
7701                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
7702                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
7703                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
7704                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
7705                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
7706                 </fields>
7707                 <links>
7708                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7709                 </links>
7710                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7711                         <actions>
7712                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
7713                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
7714                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
7715                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
7716                         </actions>
7717                 </permacrud>
7718         </class>
7719
7720         <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">
7721                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
7722                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
7723                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
7724                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7725                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7726                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7727                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7728                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7729                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
7730                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
7731                 </fields>
7732                 <links>
7733                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7734                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7735                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7736                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
7737                 </links>
7738         </class>
7739
7740         <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">
7741                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
7742                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
7743                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
7744                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
7745                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
7746                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
7747                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
7748                 </fields>
7749                 <links>
7750                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7751                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
7752                 </links>
7753         </class>
7754
7755         <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">
7756                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
7757                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
7758                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7759                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
7760                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
7761                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
7762                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
7763                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
7764                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7765                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
7766                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
7767                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link" />
7768                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
7769                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7770                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
7771                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7772                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
7773                 </fields>
7774                 <links>
7775                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7776                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
7777                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7778                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7779                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7780                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
7781                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
7782                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7783                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
7784                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
7785                 </links>
7786         </class>
7787
7788         <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">
7789                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
7790                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
7791                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7792                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
7793                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
7794                 </fields>
7795                 <links/>
7796                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7797                         <actions>
7798                                 <retrieve />
7799                         </actions>
7800                 </permacrud>
7801         </class>
7802
7803         <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">
7804                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
7805                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
7806                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7807                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
7808                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
7809                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
7810             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
7811                 </fields>
7812                 <links/>
7813         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7814             <actions>
7815                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
7816                 <retrieve />
7817                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
7818                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
7819             </actions>
7820         </permacrud>
7821         </class>
7822
7823         <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">
7824                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
7825                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
7826                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7827                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
7828                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
7829                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
7830                 </fields>
7831                 <links/>
7832         </class>
7833         <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">
7834                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
7835                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
7836                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7837                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
7838                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7839                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
7840                 </fields>
7841                 <links>
7842                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7843                 </links>
7844         </class>
7845
7846         <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">
7847             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
7848                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
7849                 <field reporter:label="Code" name="code" reporter:datatype="text" />
7850                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
7851                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
7852                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7853                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
7854         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
7855
7856             </fields>
7857             <links>
7858                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7859             </links>
7860             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7861                 <actions>
7862                     <create permission="ADMIN_PROVIDER">
7863                         <context link="provider" field="owner"/>
7864                     </create>
7865                     <retrieve permission="ADMIN_PROVIDER">
7866                         <context link="provider" field="owner"/>
7867                     </retrieve>
7868                     <update permission="ADMIN_PROVIDER">
7869                         <context link="provider" field="owner"/>
7870                     </update>
7871                     <delete permission="ADMIN_PROVIDER">
7872                         <context link="provider" field="owner"/>
7873                     </delete>
7874                 </actions>
7875             </permacrud>
7876         </class>
7877         
7878         <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">
7879             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
7880                 <field reporter:label="ID" name="id" reporter:datatype="id" />
7881                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7882                 <field reporter:label="Name" name="name" reporter:datatype="text" />
7883                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
7884             </fields>
7885             <links>
7886                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7887             </links>
7888             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7889                 <actions>
7890                     <create permission="ADMIN_PROVIDER">
7891                         <context link="provider" field="owner"/>
7892                     </create>
7893                     <retrieve permission="ADMIN_PROVIDER">
7894                         <context link="provider" field="owner"/>
7895                     </retrieve>
7896                     <update permission="ADMIN_PROVIDER">
7897                         <context link="provider" field="owner"/>
7898                     </update>
7899                     <delete permission="ADMIN_PROVIDER">
7900                         <context link="provider" field="owner"/>
7901                     </delete>
7902                 </actions>
7903             </permacrud>
7904         </class>
7905         
7906         <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">
7907             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
7908                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
7909                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7910                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
7911                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
7912                 </fields>
7913                 <links/>
7914         </class>
7915
7916         <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">
7917                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
7918                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
7919                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
7920                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
7921                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
7922                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
7923                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
7924                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
7925                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
7926                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
7927                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
7928                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
7929                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
7930                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
7931                 </fields>
7932                 <links>
7933                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7934                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7935                 </links>
7936         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7937             <actions>
7938                 <create permission="ADMIN_PROVIDER">
7939                     <context link="provider" field="owner"/>
7940                 </create>
7941                 <retrieve permission="ADMIN_PROVIDER">
7942                     <context link="provider" field="owner"/>
7943                 </retrieve>
7944                 <update permission="ADMIN_PROVIDER">
7945                     <context link="provider" field="owner"/>
7946                 </update>
7947                 <delete permission="ADMIN_PROVIDER">
7948                     <context link="provider" field="owner"/>
7949                 </delete>
7950             </actions>
7951         </permacrud>
7952         </class>
7953
7954         <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">
7955                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
7956                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
7957                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
7958                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
7959                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
7960                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
7961                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
7962                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
7963                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
7964                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
7965                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
7966                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
7967                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
7968                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
7969                 </fields>
7970                 <links>
7971                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
7972                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7973                 </links>
7974         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7975             <actions>
7976                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
7977                     <context link="account" jump="provider" field="owner"/>
7978                 </retrieve>
7979                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
7980                     <context link="account" jump="provider" field="owner"/>
7981                 </update>
7982                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
7983                     <context link="account" jump="provider" field="owner"/>
7984                 </delete>
7985             </actions>
7986         </permacrud>
7987         </class>
7988
7989
7990         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
7991                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
7992                         <field name="id" reporter:datatype="id" />
7993                         <field name="parent" reporter:datatype="link"/>
7994                         <field name="owner" reporter:datatype="link"/>
7995                         <field name="create_time" reporter:datatype="timestamp"/>
7996                         <field name="name" reporter:datatype="text"/>
7997                         <field name="shared" reporter:datatype="bool"/>
7998                         <field name="share_with" reporter:datatype="link"/>
7999                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8000                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
8001                 </fields>
8002                 <links>
8003                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8004                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
8005                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
8006                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8007                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
8008                 </links>
8009         </class>
8010         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
8011                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
8012                         <field name="id" reporter:datatype="id" />
8013                         <field name="parent" reporter:datatype="link"/>
8014                         <field name="owner" reporter:datatype="link"/>
8015                         <field name="create_time" reporter:datatype="timestamp"/>
8016                         <field name="name" reporter:datatype="text"/>
8017                         <field name="shared" reporter:datatype="bool"/>
8018                         <field name="share_with" reporter:datatype="link"/>
8019                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8020                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
8021                 </fields>
8022                 <links>
8023                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8024                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
8025                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
8026                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8027                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
8028                 </links>
8029         </class>
8030         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
8031                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
8032                         <field name="id" reporter:datatype="id" />
8033                         <field name="parent" reporter:datatype="link"/>
8034                         <field name="owner" reporter:datatype="link"/>
8035                         <field name="create_time" reporter:datatype="timestamp"/>
8036                         <field name="name" reporter:datatype="text"/>
8037                         <field name="shared" reporter:datatype="bool"/>
8038                         <field name="share_with" reporter:datatype="link"/>
8039                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8040                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8041                 </fields>
8042                 <links>
8043                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8044                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
8045                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
8046                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8047                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
8048                 </links>
8049         </class>
8050         <class id="rt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
8051                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
8052                         <field name="id" reporter:datatype="id" />
8053                         <field name="owner" reporter:datatype="link"/>
8054                         <field name="create_time" reporter:datatype="timestamp"/>
8055                         <field name="name" reporter:datatype="text"/>
8056                         <field name="data" reporter:datatype="text"/>
8057                         <field name="folder" reporter:datatype="link"/>
8058                         <field name="description" reporter:datatype="text"/>
8059                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8060                 </fields>
8061                 <links>
8062                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8063                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
8064                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
8065                 </links>
8066         </class>
8067         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
8068                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
8069                         <field name="id" reporter:datatype="id" />
8070                         <field name="owner" reporter:datatype="link"/>
8071                         <field name="create_time" reporter:datatype="timestamp"/>
8072                         <field name="template" reporter:datatype="link"/>
8073                         <field name="data" reporter:datatype="text"/>
8074                         <field name="folder" reporter:datatype="link"/>
8075                         <field name="recur" reporter:datatype="bool"/>
8076                         <field name="recurrence" reporter:datatype="interval"/>
8077                         <field name="name" reporter:datatype="text"/>
8078                         <field name="description" reporter:datatype="text"/>
8079                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
8080                 </fields>
8081                 <links>
8082                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8083                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
8084                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
8085                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
8086                 </links>
8087         </class>
8088         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
8089                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
8090                         <field name="id" reporter:datatype="id" />
8091                         <field name="runner" reporter:datatype="link"/>
8092                         <field name="start_time" reporter:datatype="timestamp"/>
8093                         <field name="complete_time" reporter:datatype="timestamp"/>
8094                         <field name="run_time" reporter:datatype="timestamp"/>
8095                         <field name="email" reporter:datatype="text"/>
8096                         <field name="excel_format" reporter:datatype="bool"/>
8097                         <field name="csv_format" reporter:datatype="bool"/>
8098                         <field name="html_format" reporter:datatype="bool"/>
8099                         <field name="error_code" reporter:datatype="int"/>
8100                         <field name="error_text" reporter:datatype="text"/>
8101                         <field name="report" reporter:datatype="link"/>
8102                         <field name="folder" reporter:datatype="link"/>
8103                         <field name="chart_pie" reporter:datatype="bool"/>
8104                         <field name="chart_bar" reporter:datatype="bool"/>
8105                         <field name="chart_line" reporter:datatype="bool"/>
8106                 </fields>
8107                 <links>
8108                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
8109                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
8110                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
8111                 </links>
8112         </class>
8113         <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">
8114                 <fields oils_persist:primary="id">
8115                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8116                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8117                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8118                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8119                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8120                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8121                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8122                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8123                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8124                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8125                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8126                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8127                 </fields>
8128                 <links>
8129                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8130                 </links>
8131                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8132                         <actions>
8133                                 <retrieve />
8134                         </actions>
8135                 </permacrud>
8136         </class>
8137         <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">
8138                 <fields oils_persist:primary="id">
8139                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8140                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8141                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8142                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8143                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8144                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8145                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8146                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8147                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8148                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8149                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8150                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8151                 </fields>
8152                 <links>
8153                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8154                 </links>
8155         </class>
8156         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
8157                 <fields oils_persist:primary="id">
8158                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8159                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
8160                         <field reporter:label="Fingerprint" name="fingerprint" />
8161                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8162                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8163                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8164                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8165                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
8166                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8167                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8168                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8169                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
8170                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
8171                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
8172                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8173                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8174                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
8175                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
8176                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
8177                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
8178                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
8179                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
8180                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8181                 </fields>
8182                 <links>
8183                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
8184                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8185                 </links>
8186         </class>
8187         <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">
8188                 <fields oils_persist:primary="id">
8189                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
8190                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
8191                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
8192                 </fields>
8193                 <links>
8194                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
8195                 </links>
8196         </class>
8197         <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">
8198                 <fields oils_persist:primary="id">
8199                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
8200                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
8201                 </fields>
8202                 <links>
8203                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
8204                 </links>
8205         </class>
8206         <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">
8207                 <fields oils_persist:primary="id">
8208                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
8209                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
8210                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
8211                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
8212                 </fields>
8213                 <links>
8214                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
8215                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
8216                 </links>
8217         </class>
8218         <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">
8219                 <fields oils_persist:primary="xact">
8220                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8221                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
8222                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
8223                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
8224                 </fields>
8225                 <links>
8226                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8227                 </links>
8228         </class>
8229         <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">
8230                 <fields oils_persist:primary="xact">
8231                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8232                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
8233                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
8234                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
8235                 </fields>
8236                 <links>
8237                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8238                 </links>
8239         </class>
8240         <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)">
8241                 <fields oils_persist:primary="id">
8242                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
8243                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
8244                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
8245                 </fields>
8246                 <links>
8247                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
8248                 </links>
8249         </class>
8250         <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">
8251                 <fields oils_persist:primary="id">
8252                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
8253                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
8254                 </fields>
8255                 <links>
8256                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
8257                 </links>
8258         </class>
8259         <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">
8260                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
8261                         <field reporter:label="Formula ID" name="id" reporter:datatype="id"/>
8262                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
8263                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
8264                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
8265                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
8266                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
8267                 </fields>
8268                 <links>
8269                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8270                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
8271                 </links>
8272                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8273                         <actions>
8274                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8275                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8276                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8277                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8278                         </actions>
8279                 </permacrud>
8280         </class>
8281         <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">
8282                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
8283                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
8284                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
8285                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8286                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
8287                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
8288                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8289                 </fields>
8290                 <links>
8291                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
8292                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8293                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8294                 </links>
8295                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8296                         <actions>
8297                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
8298                                         <context link="formula" field="owner"/>
8299                                 </create>
8300                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
8301                                         <context link="formula" field="owner"/>
8302                                 </retrieve>
8303                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
8304                                         <context link="formula" field="owner"/>
8305                                 </update>
8306                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
8307                                         <context link="formula" field="owner"/>
8308                                 </delete>
8309                         </actions>
8310                 </permacrud>
8311         </class>
8312
8313         <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">
8314                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
8315                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8316                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8317                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8318                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
8319                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
8320                 </fields>
8321                 <links>
8322                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8323                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
8324                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8325                 </links>
8326                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8327                         <actions>
8328                                 <create permission="CREATE_PURCHASE_ORDER">
8329                                         <context link="formula" field="owner"/>
8330                 </create>
8331                                 <retrieve permission="CREATE_PURCHASE_ORDER">
8332                                         <context link="formula" field="owner"/>
8333                 </retrieve>
8334                                 <update permission="CREATE_PURCHASE_ORDER">
8335                                         <context link="formula" field="owner"/>
8336                 </update>
8337                                 <delete permission="CREATE_PURCHASE_ORDER">
8338                                         <context link="formula" field="owner"/>
8339                 </delete>
8340                         </actions>
8341                 </permacrud>
8342         </class>
8343
8344         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
8345                 <fields oils_persist:primary="id">
8346                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
8347                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8348                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
8349                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
8350                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
8351                 </fields>
8352                 <links>
8353                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8354                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
8355                 </links>
8356         </class>
8357
8358         <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">
8359                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
8360                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
8361                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
8362                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8363                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8364                 </fields>
8365                 <links>
8366                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8367                 </links>
8368                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8369                         <actions>
8370                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
8371                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
8372                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
8373                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
8374                         </actions>
8375                 </permacrud>
8376         </class>
8377
8378         <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">
8379                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
8380                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
8381                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
8382                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8383                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8384                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
8385                 </fields>
8386                 <links>
8387                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8388                 </links>
8389                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8390                         <actions>
8391                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
8392                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
8393                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
8394                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
8395                         </actions>
8396                 </permacrud>
8397         </class>
8398
8399         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
8400                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
8401                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
8402                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
8403                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
8404                 </fields>
8405                 <links>
8406                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
8407                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
8408                 </links>
8409         </class>
8410
8411         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
8412                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
8413                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
8414                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
8415                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
8416                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
8417                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8418                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8419                 </fields>
8420                 <links>
8421                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
8422                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
8423                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8424                 </links>
8425         </class>
8426
8427         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
8428                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
8429                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
8430                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
8431                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
8432                 </fields>
8433                 <links>
8434                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
8435                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
8436                 </links>
8437         </class>
8438
8439         <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">
8440                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
8441                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
8442                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
8443                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
8444                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
8445                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8446                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8447                 </fields>
8448                 <links>
8449                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
8450                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
8451                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8452                 </links>
8453         </class>
8454
8455         <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">
8456                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
8457                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
8458                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
8459                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
8460                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8461                 </fields>
8462                 <links>
8463                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8464                 </links>
8465                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8466             <actions>
8467                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
8468                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
8469                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
8470                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
8471             </actions>
8472                 </permacrud>
8473         </class>
8474
8475         <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">
8476                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
8477                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
8478                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
8479                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
8480                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
8481                 </fields>
8482                 <links>
8483                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8484                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
8485                 </links>
8486                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8487                         <actions>
8488                                 <create permission="ADMIN_CLAIM_POLICY">
8489                                         <context link="claim_policy" field="org_unit"/>
8490                 </create>
8491                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
8492                                         <context link="claim_policy" field="org_unit"/>
8493                 </retrieve>
8494                                 <update permission="ADMIN_CLAIM_POLICY">
8495                                         <context link="claim_policy" field="org_unit"/>
8496                 </update>
8497                                 <delete permission="ADMIN_CLAIM_POLICY">
8498                                         <context link="claim_policy" field="org_unit"/>
8499                 </delete>
8500                         </actions>
8501                 </permacrud>
8502         </class>
8503
8504     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
8505         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.usr_stage_row_id_seq">
8506             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
8507             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
8508             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
8509             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
8510             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
8511             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
8512             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
8513             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
8514             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
8515             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
8516             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
8517             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
8518             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
8519             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
8520             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
8521         </fields>
8522     </class>
8523
8524     <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">
8525         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
8526             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
8527             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
8528             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
8529             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8530             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
8531         </fields>
8532     </class>
8533
8534     <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">
8535         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
8536             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
8537             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
8538             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
8539             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
8540             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
8541             <field reporter:label="City" name="city" reporter:datatype="text"/>
8542             <field reporter:label="State" name="state" reporter:datatype="text"/>
8543             <field reporter:label="Country" name="country" reporter:datatype="text"/>
8544             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
8545             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
8546         </fields>
8547     </class>
8548
8549     <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">
8550         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.billing_address_stage_row_id_seq">
8551             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
8552             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
8553             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
8554             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
8555             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
8556             <field reporter:label="City" name="city" reporter:datatype="text"/>
8557             <field reporter:label="State" name="state" reporter:datatype="text"/>
8558             <field reporter:label="Country" name="country" reporter:datatype="text"/>
8559             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
8560             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
8561         </fields>
8562     </class>
8563
8564     <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">
8565         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
8566             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
8567             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
8568             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
8569             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
8570             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
8571             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
8572         </fields>
8573     </class>
8574
8575         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
8576                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
8577                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
8578                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8579                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8580                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
8581                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
8582                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
8583                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
8584                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
8585                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
8586                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
8587                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
8588                 </fields>
8589                 <links>
8590                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8591                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8592                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
8593                 </links>
8594         </class>
8595
8596         <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">
8597                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
8598                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
8599                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
8600                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
8601                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
8602                 </fields>
8603                 <links>
8604                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
8605                 </links>
8606         </class>
8607
8608     <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">
8609         <fields>
8610             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
8611             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
8612             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
8613         </fields>
8614                 <links>
8615                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8616                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8617                 </links>
8618     </class>
8619
8620     <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">
8621         <fields>
8622             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
8623             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
8624         </fields>
8625                 <links>
8626                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8627                 </links>
8628     </class>
8629
8630     <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">
8631         <fields>
8632             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
8633             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
8634             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
8635         </fields>
8636                 <links>
8637                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8638                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8639                 </links>
8640     </class>
8641
8642     <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">
8643         <fields>
8644             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
8645             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
8646         </fields>
8647                 <links>
8648                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8649                 </links>
8650     </class>
8651
8652     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
8653                 <oils_persist:source_definition>
8654
8655             SELECT  DISTINCT l.*
8656               FROM  action.unfulfilled_hold_loops l
8657                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
8658               WHERE l.count = m.max
8659
8660                 </oils_persist:source_definition>
8661         <fields>
8662             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
8663             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
8664             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
8665         </fields>
8666                 <links>
8667                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8668                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8669                 </links>
8670     </class>
8671
8672         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
8673                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
8674                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
8675                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
8676                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
8677                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
8678                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
8679                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
8680                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
8681                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
8682                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
8683                 </fields>
8684                 <links>
8685                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
8686                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
8687                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
8688                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
8689                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
8690                 </links>
8691         </class>
8692
8693         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
8694                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
8695                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
8696                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
8697                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8698                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
8699                 </fields>
8700                 <links>
8701                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
8702                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
8703                 </links>
8704         </class>
8705
8706         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
8707                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
8708                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
8709                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
8710                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
8711                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
8712                 </fields>
8713                 <links>
8714                 </links>
8715         </class>
8716
8717         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
8718                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
8719                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
8720                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
8721                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8722                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
8723                 </fields>
8724                 <links>
8725                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
8726                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
8727                 </links>
8728         </class>
8729         
8730         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
8731                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
8732                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
8733                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
8734                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
8735                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
8736                 </fields>
8737                 <links>
8738                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
8739                 </links>
8740         </class>
8741         
8742         <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">
8743                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
8744                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
8745                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
8746                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8747                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
8748                 </fields>
8749                 <links>
8750                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
8751                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
8752                 </links>
8753         </class>
8754
8755         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
8756                 <fields oils_persist:primary="name">
8757                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
8758                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8759                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
8760                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8761                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
8762                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
8763                 </fields>
8764                 <links>
8765                 </links>
8766         </class>
8767
8768         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
8769                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8770                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8771                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
8772                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8773                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8774                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8775                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
8776                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
8777                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
8778                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
8779                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
8780                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
8781                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
8782                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
8783                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
8784                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8785                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
8786                 </fields>
8787                 <links>
8788                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8789                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
8790                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
8791                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
8792                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
8793                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
8794                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
8795                 </links>
8796         </class>
8797
8798         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
8799                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
8800                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
8801                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8802                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8803                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
8804                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
8805                 </fields>
8806                 <links>
8807                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8808                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
8809                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
8810                 </links>
8811         </class>
8812
8813         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
8814                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
8815                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
8816                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
8817                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
8818                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
8819                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
8820                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
8821                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
8822                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
8823                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8824                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
8825                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
8826                 </fields>
8827                 <links>
8828                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
8829                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
8830                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
8831                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
8832                 </links>
8833         </class>
8834
8835         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
8836                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
8837                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
8838                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
8839                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8840                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
8841                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
8842                 </fields>
8843                 <links>
8844                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
8845                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
8846                 </links>
8847         </class>
8848
8849         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
8850                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
8851                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
8852                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
8853                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8854                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
8855                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
8856                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
8857                 </fields>
8858                 <links>
8859                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
8860                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
8861                 </links>
8862         </class>
8863
8864         <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">
8865                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
8866                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
8867                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
8868                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8869                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
8870                 </fields>
8871                 <links>
8872                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
8873                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
8874                 </links>
8875         </class>
8876
8877         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
8878                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8879                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8880                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8881                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8882                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8883                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
8884                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8885                 </fields>
8886                 <links>
8887                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8888                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
8889                 </links>
8890         </class>
8891
8892         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
8893                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8894                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8895                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8896                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8897                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8898                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
8899                 </fields>
8900                 <links>
8901                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8902                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
8903                 </links>
8904         </class>
8905
8906         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
8907                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8908                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8909                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8910                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8911                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8912                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
8913                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8914                 </fields>
8915                 <links>
8916                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8917                 </links>
8918         </class>
8919
8920         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
8921                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8922                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8923                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8924                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8925                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8926                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
8927                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8928                 </fields>
8929                 <links>
8930                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8931                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
8932                 </links>
8933         </class>
8934
8935         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
8936                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8937                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8938                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8939                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8940                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8941                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
8942                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
8943                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8944                 </fields>
8945                 <links>
8946                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8947                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
8948                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
8949                 </links>
8950         </class>
8951
8952         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
8953                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8954                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8955                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8956                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8957                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8958                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
8959                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
8960                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8961                 </fields>
8962                 <links>
8963                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8964                 </links>
8965         </class>
8966
8967         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
8968                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8969                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8970                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8971                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8972                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8973                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
8974                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8975                 </fields>
8976                 <links>
8977                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8978                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
8979                 </links>
8980         </class>
8981
8982         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
8983                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
8984                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
8985                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
8986                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
8987                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
8988                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
8989                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
8990                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
8991                 </fields>
8992                 <links>
8993                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
8994                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
8995                 </links>
8996         </class>
8997
8998         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
8999                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9000                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9001                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9002                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9003                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9004                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9005                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9006                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9007                 </fields>
9008                 <links>
9009                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9010                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9011                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9012                 </links>
9013         </class>
9014
9015         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
9016                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9017                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9018                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9019                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9020                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9021                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9022                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9023                 </fields>
9024                 <links>
9025                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9026                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9027                 </links>
9028         </class>
9029
9030         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
9031                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9032                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9033                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9034                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9035                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9036                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9037                 </fields>
9038                 <links>
9039                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9040                 </links>
9041         </class>
9042
9043         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
9044                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9045                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9046                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9047                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9048                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9049                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9050                 </fields>
9051                 <links>
9052                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9053                 </links>
9054         </class>
9055
9056         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
9057                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9058                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9059                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9060                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9061                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9062                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9063                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9064                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9065                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9066                 </fields>
9067                 <links>
9068                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9069                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9070                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9071                 </links>
9072         </class>
9073
9074         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
9075                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9076                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9077                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9078                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9079                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9080                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9081                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9082                 </fields>
9083                 <links>
9084                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9085                 </links>
9086         </class>
9087
9088         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
9089                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9090                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9091                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9092                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9093                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9094                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9095                 </fields>
9096                 <links>
9097                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9098                 </links>
9099         </class>
9100
9101         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
9102                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9103                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9104                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9105                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9106                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9107                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9108                 </fields>
9109                 <links>
9110                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9111                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9112                 </links>
9113         </class>
9114
9115         <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">
9116                 <fields oils_persist:primary="id">
9117                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
9118                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
9119                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
9120                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
9121                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
9122                 </fields>
9123                 <links>
9124                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
9125                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9126                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
9127                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
9128                 </links>
9129         </class>
9130
9131         <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">
9132                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
9133                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9134                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
9135                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
9136                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
9137                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9138                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9139                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
9140                 </fields>
9141                 <links/>
9142                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9143                         <actions>
9144                                 <retrieve/>
9145                         </actions>
9146                 </permacrud>
9147         </class>
9148
9149         <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">
9150                 <fields oils_persist:primary="ptype_key">
9151                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
9152                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9153                 </fields>
9154                 <links/>
9155                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9156                         <actions>
9157                                 <retrieve/>
9158                         </actions>
9159                 </permacrud>
9160         </class>
9161
9162         <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">
9163                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
9164                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9165                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
9166                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
9167                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9168                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9169                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9170                 </fields>
9171                 <links>
9172                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
9173                 </links>
9174                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9175                         <actions>
9176                                 <retrieve/>
9177                         </actions>
9178                 </permacrud>
9179         </class>
9180
9181         <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">
9182                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
9183                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9184                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
9185                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
9186                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9187                 </fields>
9188                 <links>
9189                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9190                 </links>
9191                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9192                         <actions>
9193                                 <retrieve/>
9194                         </actions>
9195                 </permacrud>
9196         </class>
9197
9198         <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">
9199                 <fields oils_persist:primary="code">
9200                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
9201                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
9202                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
9203                 </fields>
9204                 <links/>
9205                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9206                         <actions>
9207                                 <retrieve/>
9208                         </actions>
9209                 </permacrud>
9210         </class>
9211
9212         <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">
9213                 <oils_persist:source_definition>
9214
9215             SELECT  b.id,
9216                     MAX(dcp.edit_date) AS last_delete_date
9217              FROM   biblio.record_entry b
9218                     JOIN asset.call_number cn ON (cn.record = b.id)
9219                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
9220              WHERE  NOT b.deleted
9221              GROUP BY b.id
9222              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
9223
9224                 </oils_persist:source_definition>
9225                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
9226                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
9227                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
9228                 </fields>
9229                 <links>
9230                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9231                 </links>
9232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9233                         <actions>
9234                                 <retrieve/>
9235                         </actions>
9236                 </permacrud>
9237         </class>
9238
9239         <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">
9240                 <oils_persist:source_definition>
9241
9242             -- -- 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.
9243             -- -- 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
9244             -- -- may not.
9245             -- SELECT
9246             --     bre.id AS "bib_id",
9247             --     COALESCE( z.copy_count, 0 ) AS "copy_count",
9248             --     COALESCE( z.hold_count, 0 ) AS "hold_count",
9249             --     COALESCE( z.copy_hold_ratio, 0 ) AS "hold_copy_ratio"
9250             -- FROM (
9251                 SELECT
9252                     y.bre AS "id",
9253                     COALESCE( x.copy_count, 0 ) AS "copy_count",
9254                     y.hold_count AS "hold_count",
9255                     (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"
9256                 FROM (
9257                         SELECT
9258                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS "bre",
9259                             COUNT(*) AS "hold_count"
9260                         FROM action.hold_request h
9261                         WHERE
9262                             cancel_time IS NULL
9263                             AND fulfillment_time IS NULL
9264                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
9265                         GROUP BY 1
9266                     )y LEFT JOIN (
9267                         SELECT 
9268                             (SELECT id
9269                                 FROM biblio.record_entry 
9270                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number)
9271                             ) AS "bre", 
9272                             COUNT(*) AS "copy_count"
9273                         FROM asset.copy
9274                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
9275                         WHERE copy.holdable 
9276                             AND NOT copy.deleted 
9277                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
9278                         GROUP BY 1
9279                     )x ON x.bre = y.bre
9280                 -- )z RIGHT JOIN (
9281                 --     SELECT id
9282                 --     FROM biblio.record_entry
9283                 --     WHERE NOT deleted
9284                 -- )bre ON (z.bib_id = bre.id)
9285                 
9286
9287                 </oils_persist:source_definition>
9288                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
9289                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
9290                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
9291                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
9292                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
9293                 </fields>
9294                 <links>
9295                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9296                 </links>
9297                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9298                         <actions>
9299                                 <retrieve/>
9300                         </actions>
9301                 </permacrud>
9302         </class>
9303
9304         <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">
9305                 <oils_persist:source_definition>
9306             SELECT *,
9307                 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,
9308                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
9309             FROM
9310                 (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
9311                     FROM
9312                         action.hold_request ahr
9313                         JOIN reporter.hold_request_record rhrr USING (id)
9314                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
9315                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
9316                     WHERE
9317                         ahr.cancel_time IS NULL
9318                         AND ahr.fulfillment_time IS NULL
9319                     GROUP BY bib_record, pickup_lib
9320                 )x
9321                 JOIN
9322                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
9323                     FROM
9324                         action.hold_request ahr
9325                         JOIN reporter.hold_request_record rhrr USING (id)
9326                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
9327                     WHERE
9328                         ahr.cancel_time IS NULL
9329                         AND ahr.fulfillment_time IS NULL
9330                     GROUP BY bib_record
9331                 )y
9332                 USING (id)
9333                 </oils_persist:source_definition>
9334                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
9335                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
9336                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
9337                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
9338                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
9339                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
9340                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
9341                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
9342                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
9343                 </fields>
9344                 <links>
9345                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9346                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9347                 </links>
9348                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9349                         <actions>
9350                                 <retrieve/>
9351                         </actions>
9352                 </permacrud>
9353         </class>
9354
9355         <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">
9356                 <oils_persist:source_definition>
9357             SELECT
9358                 ac.id,
9359                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
9360                 MAX(actac.xact_start) AS last_circ
9361             FROM asset.copy ac
9362                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
9363             GROUP BY ac.id
9364
9365             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
9366             --SELECT
9367             --    ac.id,
9368             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
9369             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
9370             --FROM asset.copy ac
9371             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
9372             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
9373             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
9374                 </oils_persist:source_definition>
9375                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
9376                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
9377                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
9378                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
9379                 </fields>
9380                 <links>
9381                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
9382                 </links>
9383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9384                         <actions>
9385                                 <retrieve/>
9386                         </actions>
9387                 </permacrud>
9388         </class>
9389
9390         <!-- ********************************************************************************************************************* -->
9391         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
9392         <!-- ********************************************************************************************************************* -->
9393         <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">
9394                 <fields oils_persist:primary="id">
9395                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
9396                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
9397                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
9398                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
9399                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
9400                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
9401                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
9402                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
9403                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
9404                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
9405                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
9406                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
9407                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
9408                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
9409                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
9410                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
9411                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
9412                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
9413                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
9414                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
9415                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
9416                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
9417                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
9418                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
9419                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
9420                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
9421                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
9422                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
9423                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
9424                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
9425                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
9426                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
9427                 </fields>
9428                 <links>
9429                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
9430                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
9431                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
9432                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
9433                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
9434                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
9435                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
9436                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
9437                 </links>
9438         </class>
9439
9440         <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">
9441                 <fields oils_persist:primary="id">
9442                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
9443                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
9444                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
9445                 </fields>
9446                 <links>
9447                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9448                 </links>
9449         </class>
9450
9451         <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">
9452                 <fields oils_persist:primary="id">
9453                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
9454                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
9455                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
9456                 </fields>
9457                 <links>
9458                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9459                 </links>
9460         </class>
9461
9462         <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">
9463                 <fields oils_persist:primary="id">
9464                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
9465
9466                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
9467                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
9468                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
9469
9470                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
9471                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
9472                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
9473
9474                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
9475                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
9476
9477                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
9478                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
9479                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
9480
9481                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
9482                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
9483
9484                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
9485                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
9486                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
9487
9488                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
9489                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
9490                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
9491
9492                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
9493                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
9494                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
9495                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
9496
9497                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
9498                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
9499
9500                 </fields>
9501                 <links>
9502                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
9503                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9504                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
9505                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
9506                 </links>
9507         </class>
9508
9509         <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">
9510                 <oils_persist:source_definition>
9511
9512             SELECT
9513                 po.ordering_agency AS ordering_agency,
9514                 po.id AS purchase_order,
9515                 li.id AS lineitem,
9516                 lid.id AS lineitem_detail,
9517                 cpa.id AS claim_policy_action
9518             FROM
9519                 acq.lineitem_detail lid
9520                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
9521                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
9522                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
9523                 JOIN acq.claim_policy_action cpa ON (
9524                     cpa.claim_policy = cp.id
9525
9526                     -- we only care about claim policy actions whose claim
9527                     -- interval we'd reached or exceeded
9528                     AND (NOW() - cpa.action_interval) &gt; po.order_date
9529
9530                     -- filter out all claim policy actions where claim events
9531                     -- have occurred on or after the action's action_interval
9532                     AND NOT EXISTS (
9533                         SELECT 1
9534                         FROM
9535                             acq.claim_event evt
9536                             JOIN acq.claim claim ON (
9537                                 claim.id = evt.claim
9538                                 AND claim.lineitem_detail = lid.id
9539                             )
9540                         WHERE
9541                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
9542                     )
9543                 )
9544             WHERE
9545                 lid.cancel_reason IS NULL
9546                 AND li.cancel_reason IS NULL -- belt/suspenders
9547                 AND po.cancel_reason IS NULL -- belt/suspenders
9548                 AND lid.recv_time IS NULL
9549                 AND po.state = 'on-order'
9550             ORDER BY 1, 2, 3, 4, 5
9551
9552                 </oils_persist:source_definition>
9553                 <fields>
9554                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
9555                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9556                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9557                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9558                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
9559                 </fields>
9560                 <links>
9561                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
9562                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9563                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9564                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9565                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
9566                 </links>
9567         </class>
9568
9569         <class id="acqlisum" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary" oils_persist:readonly="true" reporter:label="Lineitem Summary">
9570                 <oils_persist:source_definition>
9571
9572             SELECT 
9573                 li.id AS lineitem, 
9574                 (
9575                     SELECT COUNT(lid.id) 
9576                     FROM acq.lineitem_detail lid
9577                     WHERE lineitem = li.id
9578                 ) AS item_count,
9579                 (
9580                     SELECT COUNT(lid.id) 
9581                     FROM acq.lineitem_detail lid
9582                     WHERE recv_time IS NOT NULL AND lineitem = li.id
9583                 ) AS recv_count,
9584                 (
9585                     SELECT COUNT(lid.id) 
9586                     FROM acq.lineitem_detail lid
9587                     WHERE cancel_reason IS NOT NULL AND lineitem = li.id
9588                 ) AS cancel_count,
9589                 (
9590                     SELECT COUNT(lid.id) 
9591                     FROM acq.lineitem_detail lid
9592                         JOIN acq.fund_debit debit ON (lid.fund_debit = debit.id)
9593                     WHERE NOT debit.encumbrance AND lineitem = li.id
9594                 ) AS invoice_count,
9595                 (
9596                     SELECT COUNT(DISTINCT(lid.id)) 
9597                     FROM acq.lineitem_detail lid
9598                         JOIN acq.claim claim ON (claim.lineitem_detail = lid.id)
9599                     WHERE lineitem = li.id
9600                 ) AS claim_count,
9601                 (
9602                     SELECT (COUNT(lid.id) * li.estimated_unit_price)::NUMERIC(8,2)
9603                     FROM acq.lineitem_detail lid
9604                     WHERE lid.cancel_reason IS NULL AND lineitem = li.id
9605                 ) AS estimated_amount,
9606                 (
9607                     SELECT SUM(debit.amount)::NUMERIC(8,2)
9608                     FROM acq.lineitem_detail lid
9609                         JOIN acq.fund_debit debit ON (lid.fund_debit = debit.id)
9610                     WHERE debit.encumbrance AND lineitem = li.id
9611                 ) AS encumbrance_amount,
9612                 (
9613                     SELECT SUM(debit.amount)::NUMERIC(8,2)
9614                     FROM acq.lineitem_detail lid
9615                         JOIN acq.fund_debit debit ON (lid.fund_debit = debit.id)
9616                     WHERE NOT debit.encumbrance AND lineitem = li.id
9617                 ) AS paid_amount
9618
9619                 FROM acq.lineitem AS li
9620         </oils_persist:source_definition>
9621                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
9622                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9623                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9624                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
9625                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
9626                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
9627                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
9628                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
9629                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
9630                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
9631                 </fields>
9632                 <links>
9633                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9634                 </links>
9635     </class>
9636
9637
9638         <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">
9639                 <oils_persist:source_definition>
9640
9641                         SELECT  t.*
9642                           FROM  action.transit_copy t
9643                                 JOIN actor.org_unit AS s ON (t.source = s.id)
9644                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
9645                           WHERE s.parent_ou &lt;&gt; d.parent_ou
9646
9647                 </oils_persist:source_definition>
9648                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
9649                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
9650                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
9651                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
9652                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
9653                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
9654                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
9655                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
9656                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
9657                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
9658                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
9659                 </fields>
9660                 <links>
9661                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
9662                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
9663                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
9664                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
9665                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
9666                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
9667                 </links>
9668         </class>
9669
9670     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
9671                 <oils_persist:source_definition>
9672
9673         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
9674                 SELECT
9675                         cp.id as copy,
9676                         COUNT(circ.id),
9677                         EXTRACT(YEAR FROM circ.xact_start) AS year,
9678                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
9679                 FROM
9680                         asset.copy cp
9681                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
9682                 GROUP BY 1, 3, 4
9683                 UNION
9684                 SELECT
9685                         cp.id as copy,
9686                         COUNT(circ.id),
9687                         EXTRACT(YEAR FROM circ.xact_start) AS year,
9688                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
9689                 FROM
9690                         asset.copy cp
9691                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
9692                 GROUP BY 1, 3, 4
9693                 UNION
9694                 SELECT
9695                         id as copy,
9696                         circ_count,
9697                         -1 AS year,
9698                         false as is_renewal
9699                 FROM
9700                         extend_reporter.legacy_circ_count
9701         )x GROUP BY 1, 3, 4
9702
9703                 </oils_persist:source_definition>
9704         <fields>
9705             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
9706             <field reporter:label="Count" name="count" reporter:datatype="int"/>
9707             <field reporter:label="Year" name="year" reporter:datatype="int"/>
9708             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
9709         </fields>
9710                 <links>
9711                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
9712                 </links>
9713                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9714                         <actions>
9715                                 <retrieve/>
9716                         </actions>
9717                 </permacrud>
9718     </class>
9719
9720         <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">
9721                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
9722                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
9723                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
9724                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
9725                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
9726                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
9727                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
9728                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
9729                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
9730                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
9731                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
9732                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
9733                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
9734                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
9735                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
9736                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
9737                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
9738                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
9739                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
9740                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
9741                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
9742                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
9743                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
9744                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
9745                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
9746                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
9747                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
9748                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
9749                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
9750                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
9751                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
9752                 </fields>
9753                 <links>
9754                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
9755                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
9756                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
9757                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
9758                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
9759                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9760                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9761                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
9762                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
9763                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
9764                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
9765                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
9766                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
9767                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
9768                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
9769                 </links>
9770         </class>
9771
9772     <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">
9773         <fields oils_persist:primary="id">
9774             <field reporter:label="Title" name="title" reporter:datatype="text"/>
9775             <field reporter:label="Author" name="author" reporter:datatype="text"/>
9776             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="int"/>
9777             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
9778             <field reporter:label="Price" name="price" reporter:datatype="money"/>
9779             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
9780             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
9781             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
9782             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
9783             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
9784             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
9785             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
9786             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="text"/>
9787             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="text"/>
9788             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
9789             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
9790             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
9791             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9792             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
9793             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
9794             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
9795             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
9796             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9797             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
9798             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
9799             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
9800             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
9801             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
9802             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
9803             <field reporter:label="Status" name="status" reporter:datatype="link"/>
9804             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
9805             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
9806             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
9807             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
9808         </fields>
9809         <links>
9810             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9811             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9812             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9813             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
9814             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
9815         </links>
9816     </class>
9817
9818     <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">
9819         <fields oils_persist:primary="id">
9820             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
9821             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9822             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
9823             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
9824         </fields>
9825         <links>
9826             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
9827             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9828         </links>
9829     </class>
9830
9831     <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">
9832         <fields oils_persist:primary="owning_lib">
9833             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9834             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
9835             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
9836         </fields>
9837         <links>
9838             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9839         </links>
9840     </class>
9841
9842     <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">
9843         <fields oils_persist:primary="id">
9844             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
9845             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
9846             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9847             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
9848             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
9849         </fields>
9850         <links>
9851             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
9852             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9853             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9854         </links>
9855     </class>
9856
9857     <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">
9858         <fields oils_persist:primary="circ_lib">
9859             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
9860             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9861             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
9862             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
9863         </fields>
9864         <links>
9865             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9866             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9867         </links>
9868     </class>
9869
9870     <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">
9871         <fields oils_persist:primary="id">
9872             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
9873             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
9874             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9875             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
9876             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
9877         </fields>
9878         <links>
9879             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
9880             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9881             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9882         </links>
9883     </class>
9884
9885     <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">
9886         <fields oils_persist:primary="home_ou">
9887             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
9888             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9889             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
9890             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
9891         </fields>
9892         <links>
9893             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9894             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9895         </links>
9896     </class>
9897         <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">
9898                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
9899                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
9900                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
9901                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
9902                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
9903                 </fields>
9904                 <links>
9905                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9906                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
9907                 </links>
9908                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9909                         <actions>
9910                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
9911                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
9912                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
9913                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
9914                         </actions>
9915                 </permacrud>
9916         </class>
9917         <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">
9918                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
9919                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
9920                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9921                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
9922                 </fields>
9923                 <links>
9924                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9925                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
9926                         </links>
9927                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9928                 <actions>
9929                                 <create permission="ADMIN_ACQ_FUND_TAG">
9930                                         <context link="tag" field="owner"/>
9931                                 </create>
9932                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9933                                         <context link="tag" field="owner"/>
9934                                 </retrieve>
9935                                 <update permission="ADMIN_ACQ_FUND_TAG">
9936                                         <context link="tag" field="owner"/>
9937                                 </update>
9938                                 <delete permission="ADMIN_ACQ_FUND_TAG">
9939                                         <context link="tag" field="owner"/>
9940                                 </delete>
9941                         </actions>
9942                 </permacrud>
9943         </class>
9944         <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">
9945                 <oils_persist:source_definition><![CDATA[
9946                 SELECT
9947                         poi.purchase_order AS purchase_order,
9948                         ii.invoice AS invoice,
9949                         NULL AS lineitem,
9950                         poi.id AS po_item,
9951                         NULL AS picklist
9952                 FROM
9953                         acq.po_item poi
9954                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
9955                 UNION SELECT
9956                         jub.purchase_order AS purchase_order,
9957                         ie.invoice AS invoice,
9958                         jub.id AS lineitem,
9959                         NULL AS po_item,
9960                         jub.picklist AS picklist
9961                 FROM
9962                         acq.lineitem jub
9963                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
9964                 UNION SELECT
9965                         ii.purchase_order AS purchase_order,
9966                         ii.invoice AS invoice,
9967                         NULL AS lineitem,
9968                         NULL AS po_item,
9969                         NULL AS picklist
9970                 FROM
9971                         acq.invoice_item ii
9972                 WHERE ii.po_item IS NULL
9973                 UNION SELECT
9974                         ie.purchase_order AS purchase_order,
9975                         ie.invoice AS invoice,
9976                         NULL AS lineitem,
9977                         NULL AS po_item,
9978                         NULL AS picklist
9979                 FROM
9980                         acq.invoice_entry ie
9981                 WHERE ie.lineitem IS NULL
9982                 UNION SELECT
9983                         NULL AS purchase_order,
9984                         NULL AS invoice,
9985                         jub.id AS lineitem,
9986                         NULL AS po_item,
9987                         jub.picklist AS picklist
9988                 FROM
9989                         acq.lineitem jub
9990                 WHERE jub.purchase_order IS NULL
9991                 ]]></oils_persist:source_definition>
9992                 <fields>
9993                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
9994                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
9995                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
9996                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
9997                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
9998                 </fields>
9999                 <links>
10000                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
10001                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
10002                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
10003                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
10004                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
10005                 </links>
10006         </class>
10007         <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">
10008                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
10009                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10010                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
10011                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
10012                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
10013                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
10014                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10015                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
10016                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
10017                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
10018                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
10019                 </fields>
10020                 <links>
10021                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10022                 </links>
10023                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10024                         <actions>
10025                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
10026                                 <retrieve/>
10027                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
10028                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
10029                         </actions>
10030                 </permacrud>
10031         </class>
10032
10033         <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">
10034                 <fields oils_persist:primary="date_applied" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
10035                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10036                         <field name="date_applied" reporter:datatype="timestamp"/>
10037                         <field name="org" reporter:datatype="org_unit"/>
10038                         <field name="original_value" reporter:datatype="text"/>
10039                         <field name="new_value" reporter:datatype="text"/>
10040                         <field name="field_name" reporter:datatype="link"/>
10041                 </fields>
10042                 <links>
10043                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
10044                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10045                 </links>
10046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10047                         <actions>
10048                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
10049                                 <retrieve/>
10050                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
10051                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
10052                         </actions>
10053                 </permacrud>
10054         </class>
10055         <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">
10056                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
10057                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10058                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
10059                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
10060                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10061                 </fields>
10062                 <links>
10063                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
10064                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
10065                 </links>
10066         </class>
10067         <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">
10068                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
10069                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10070                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
10071                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
10072                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10073                 </fields>
10074                 <links>
10075                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
10076                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
10077                 </links>
10078         </class>
10079
10080
10081         <!-- ********************************************************************************************************************* -->
10082
10083 </IDL>
10084
10085 <!--
10086     vim:noet:ts=4:sw=4:
10087 -->