]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP1615805 No inputs after submit in patron search (AngularJS)
[Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73
74 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
75
76         <!-- Virtual classes -->
77         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
78                 <fields>
79                         <field name="usr" oils_persist:virtual="true" />
80                         <field name="forgive_payment" oils_persist:virtual="true" />
81                         <field name="work_payment" oils_persist:virtual="true" />
82                         <field name="credit_payment" oils_persist:virtual="true" />
83                         <field name="goods_payment" oils_persist:virtual="true" />
84                         <field name="account_adjustment" oils_persist:virtual="true" />
85                 </fields>
86                 <links>
87                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
88                 </links>
89         </class>
90
91         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
92                 <fields>
93                         <field name="workstation" oils_persist:virtual="true" />
94                         <field name="cash_payment" oils_persist:virtual="true" />
95                         <field name="check_payment" oils_persist:virtual="true" />
96                         <field name="credit_card_payment" oils_persist:virtual="true" />
97                         <field name="debit_card_payment" oils_persist:virtual="true" />
98                 </fields>
99                 <links>
100                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
101                 </links>
102         </class>
103
104         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
105                 <fields>
106                         <field name="id" oils_persist:virtual="true" />
107                         <field name="children" oils_persist:virtual="true" />
108                         <field name="owner_doc" oils_persist:virtual="true" />
109                         <field name="intra_doc_id" oils_persist:virtual="true" />
110                         <field name="parent_node" oils_persist:virtual="true" />
111                         <field name="node_type" oils_persist:virtual="true" />
112                         <field name="namespace_uri" oils_persist:virtual="true" />
113                         <field name="name" oils_persist:virtual="true" />
114                         <field name="value" oils_persist:virtual="true" />
115                 </fields>
116         </class>
117
118         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
119                 <fields>
120                         <field name="title" oils_persist:virtual="true" />
121                         <field name="author" oils_persist:virtual="true" />
122                         <field name="doc_id" oils_persist:virtual="true" />
123                         <field name="doc_type" oils_persist:virtual="true" />
124                         <field name="pubdate" oils_persist:virtual="true" />
125                         <field name="isbn" oils_persist:virtual="true" />
126                         <field name="publisher" oils_persist:virtual="true" />
127                         <field name="tcn" oils_persist:virtual="true" />
128                         <field name="subject" oils_persist:virtual="true" />
129                         <field name="types_of_resource" oils_persist:virtual="true" />
130                         <field name="call_numbers" oils_persist:virtual="true" />
131                         <field name="edition" oils_persist:virtual="true" />
132                         <field name="online_loc" oils_persist:virtual="true" />
133                         <field name="synopsis" oils_persist:virtual="true" />
134                         <field name="physical_description" oils_persist:virtual="true" />
135                         <field name="toc" oils_persist:virtual="true" />
136                         <field name="copy_count" oils_persist:virtual="true" />
137                         <field name="series" oils_persist:virtual="true" />
138                         <field name="serials" oils_persist:virtual="true" />
139                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
140                 </fields>
141         </class>
142
143         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
144                 <fields>
145                         <field name="err_msg" oils_persist:virtual="true" />
146                         <field name="type" oils_persist:virtual="true" />
147                 </fields>
148         </class>
149
150         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
151                 <fields>
152                         <field name="err_msg" oils_persist:virtual="true" />
153                         <field name="type" oils_persist:virtual="true" />
154                 </fields>
155         </class>
156
157         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
158                 <fields oils_persist:primary="matchpoint">
159                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
160                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
161                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
162                 </fields>
163                 <links>
164                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
165                 </links>
166         </class>
167
168         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
169         <!-- when the time is right, turn me into a view.  -->
170                 <fields>
171             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
172             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
173             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
174             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
175             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
176             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
177             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
178             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
179             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
180             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
181                 </fields>
182         </class>
183
184         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
185                 <fields>
186                         <field name="public_name" oils_persist:virtual="true" />
187                         <field name="target_url" oils_persist:virtual="true" />
188                         <field name="target_coverage" oils_persist:virtual="true" />
189                         <field name="target_embargo" oils_persist:virtual="true" />
190                 </fields>
191         </class>
192
193         <!-- Actually in the DB -->
194         <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">
195                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
196                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
197                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
198                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
199                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
200                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
201                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
202                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
203                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
204                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
205                 </fields>
206                 <links>
207                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
208                 </links>
209                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
210                         <actions>
211                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
212                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
213                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
214                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
215                         </actions>
216                 </permacrud>
217         </class>
218
219         <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">
220                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
221                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
222                         <field reporter:label="Group" name="grp" reporter:datatype="link"/>
223                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
224                 </fields>
225                 <links>
226                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
227                 </links>
228                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
229                         <actions>
230                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
231                     <context link="grp" field="owner"/>
232                 </create>
233                                 <retrieve/>
234                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
235                     <context link="grp" field="owner"/>
236                 </update>
237                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
238                     <context link="grp" field="owner"/>
239                 </delete>
240                         </actions>
241                 </permacrud>
242         </class>
243
244         <class  id="rrbs" 
245             controller="open-ils.cstore open-ils.pcrud" 
246             oils_obj:fieldmapper="rating::record_badge_score" 
247             oils_persist:tablename="rating.record_badge_score" 
248             reporter:label="Statistical Popularity Badge">
249                 <fields oils_persist:primary="id" 
250                 oils_persist:sequence="rating.record_badge_score_id_seq">
251                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
252                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
253                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
254                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
255                 </fields>
256         <links>
257             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
258             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
259         </links>
260                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
261                         <actions>
262                                 <retrieve/>
263                         </actions>
264                 </permacrud>
265         </class>
266
267         <class  id="rp" 
268             controller="open-ils.cstore open-ils.pcrud" 
269             oils_obj:fieldmapper="rating::popularity_parameter" 
270             oils_persist:tablename="rating.popularity_parameter" 
271             reporter:label="Statistical Popularity Parameter">
272                 <fields oils_persist:primary="id" 
273                 oils_persist:sequence="rating.popularity_parameter_id_seq">
274                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
275                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
276                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
277                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
278                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
279                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
280                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
281                 </fields>
282                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
283                         <actions>
284                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
285                                 <retrieve/>
286                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
287                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
288                         </actions>
289                 </permacrud>
290         </class>
291
292         <class  id="rb" 
293             controller="open-ils.cstore open-ils.pcrud" 
294             oils_obj:fieldmapper="rating::badge" 
295             oils_persist:tablename="rating.badge" 
296             reporter:label="Statistical Popularity Badge">
297                 <fields oils_persist:primary="id" 
298                 oils_persist:sequence="rating.badge_id_seq">
299                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
300                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
301                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
302                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
303                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
304                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
305                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
306                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
307                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
308                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
309                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
310                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
311                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
312                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
313                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
314                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
315                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
316                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
317                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
318                 </fields>
319                 <links>
320                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
321                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
322                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
323                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
324                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
325                 </links>
326                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
327                         <actions>
328                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
329                                 <retrieve/>
330                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
331                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
332                         </actions>
333                 </permacrud>
334         </class>
335
336         <class  id="vibtg" 
337             controller="open-ils.cstore open-ils.pcrud" 
338             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
339             oils_persist:tablename="vandelay.import_bib_trash_group" 
340             reporter:label="Import/Overlay Field Groups for Removal">
341                 <fields oils_persist:primary="id" 
342                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
343                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
344                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
345                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
346                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
347                 </fields>
348                 <links>
349                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
350                 </links>
351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
352                         <actions>
353                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
354                                 <retrieve/>
355                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
356                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
357                         </actions>
358                 </permacrud>
359         </class>
360
361
362         <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">
363                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
364                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
365                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
366                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
367                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
368                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
369                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
370                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
371                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
372                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
373                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
374                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
375                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
376                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
377                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
378                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
379                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
380                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
381                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
382                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
383                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
384                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
385                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
386                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
387                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
388                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
389                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
390                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
391                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
392                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
393                 </fields>
394                 <links>
395                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
396                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
397                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
398                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
399                 </links>
400                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
401                         <actions>
402                                 <create permission="CREATE_IMPORT_ITEM">
403                     <context link="definition" field="owner"/>
404                                 </create>
405                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
406                     <context link="definition" field="owner"/>
407                                 </retrieve>
408                                 <update permission="UPDATE_IMPORT_ITEM">
409                     <context link="definition" field="owner"/>
410                                 </update>
411                                 <delete permission="DELETE_IMPORT_ITEM">
412                     <context link="definition" field="owner"/>
413                                 </delete>
414                         </actions>
415                 </permacrud>
416         </class>
417
418         <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">
419                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
420                         <field reporter:label="Definition ID" name="id" 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="Tag" name="tag" reporter:datatype="text"/>
424                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
425                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
426                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
427                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
428                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
429                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
430                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
431                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
432                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
433                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
434                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
435                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
436                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
437                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
438                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
439                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
440                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
441                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
442                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
443                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
444                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
445                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
446                 </fields>
447                 <links>
448                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
449                 </links>
450                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
451                         <actions>
452                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
453                                 <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"/>
454                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
455                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
456                         </actions>
457                 </permacrud>
458         </class>
459
460         <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">
461                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
462                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
463                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
464                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
465                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
466                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
467                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
468                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
469                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
470                 </fields>
471                 <links>
472                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
473                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
474                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
475                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
476                 </links>
477                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
478                         <actions>
479                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
480                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
481                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
482                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
483                         </actions>
484                 </permacrud>
485         </class>
486
487         <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">
488                 <fields oils_persist:primary="code">
489                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
490                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
491                 </fields>
492                 <links>
493                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
494                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
495                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
496                 </links>
497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
498                         <actions>
499                                 <retrieve/>
500                         </actions>
501                 </permacrud>
502         </class>
503
504         <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">
505                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
506                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
507                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
508                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
509                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
510                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
511                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
512                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
513                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
514                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
515                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
516                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
517                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
518                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
519                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
520                 </fields>
521                 <links>
522                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
523                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
524                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
525                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
526             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
527             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
528             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
529                 </links>
530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
531                         <actions>
532                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
533                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
534                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
535                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
536                         </actions>
537                 </permacrud>
538         </class>
539
540         <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">
541                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
542                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
543                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
544                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
545                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
546                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
547                 </fields>
548                 <links/>
549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
550                         <actions>
551                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
552                 <retrieve/>
553                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
554                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
555                         </actions>
556                 </permacrud>
557         </class>
558
559         <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">
560                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
561                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
562                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
563                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
564                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
565                 </fields>
566                 <links>
567                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
568                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
569                 </links>
570                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
571                         <actions>
572                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
573                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
574                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
575                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
576                         </actions>
577                 </permacrud>
578         </class>
579
580         <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">
581                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
582                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
583                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
584                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
585                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
586                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
587                 </fields>
588                 <links>
589                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
590                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
591                 </links>
592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
593                         <actions>
594                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
595                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
596                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
597                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
598                         </actions>
599                 </permacrud>
600         </class>
601
602         <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">
603                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
604                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
605                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
606                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
607                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
608                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
609                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
610                 </fields>
611                 <links>
612                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
613                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
614                 </links>
615                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
616                         <actions>
617                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
618                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
619                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
620                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
621                         </actions>
622                 </permacrud>
623         </class>
624
625         <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">
626                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
627                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
628                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
629                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
630                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
631                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
632                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
633                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
634                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
635                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
636                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
637                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
638                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
639                 </fields>
640                 <links>
641                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
642                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
643                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
644             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
645             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
646                 </links>
647                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
648                         <actions>
649                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
650                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
651                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
652                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
653                         </actions>
654                 </permacrud>
655         </class>
656
657         <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">
658                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
659                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
660                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
661                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
662                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
663                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
664                 </fields>
665                 <links/>
666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
667                         <actions>
668                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
669                 <retrieve/>
670                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
671                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
672                         </actions>
673                 </permacrud>
674         </class>
675
676         <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">
677                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
678                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
679                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
680                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
681                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
682                 </fields>
683                 <links>
684                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
685                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
686                 </links>
687                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
688                         <actions>
689                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
690                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
691                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
692                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
693                         </actions>
694                 </permacrud>
695         </class>
696
697         <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">
698                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
699                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
700                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
701                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
702                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
703                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
704                 </fields>
705                 <links>
706                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
707                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
708                 </links>
709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
710                         <actions>
711                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
712                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
713                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
714                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                         </actions>
716                 </permacrud>
717         </class>
718
719         <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">
720                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
721                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
722                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
723                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
724                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
725                 </fields>
726                 <links>
727                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
728                 </links>
729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
730                         <actions>
731                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
732                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
733                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
734                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
735                         </actions>
736                 </permacrud>
737         </class>
738
739         <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">
740                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
741                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
742                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
743                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
744                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
745                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
746                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
747                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
748             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
749                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
750                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
751                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
752                 </fields>
753                 <links>
754                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
755                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
756                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
757                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
758                 </links>
759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
760                         <actions>
761                                 <create permission="ADMIN_IMPORT_MATCH_SET">
762                     <context link="match_set" field="owner"/>
763                                 </create>
764                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
765                     <context link="match_set" field="owner"/>
766                                 </retrieve>
767                                 <update permission="ADMIN_IMPORT_MATCH_SET">
768                     <context link="match_set" field="owner"/>
769                                 </update>
770                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
771                     <context link="match_set" field="owner"/>
772                                 </delete>
773                         </actions>
774                 </permacrud>
775         </class>
776
777         <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">
778                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
779                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
780                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
781                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
782                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
783                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
784                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
785                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
786                 </fields>
787                 <links>
788                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
789                 </links>
790                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
791                         <actions>
792                                 <create permission="ADMIN_IMPORT_MATCH_SET">
793                     <context link="match_set" field="owner"/>
794                                 </create>
795                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </retrieve>
798                                 <update permission="ADMIN_IMPORT_MATCH_SET">
799                     <context link="match_set" field="owner"/>
800                                 </update>
801                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
802                     <context link="match_set" field="owner"/>
803                                 </delete>
804                         </actions>
805                 </permacrud>
806         </class>
807
808         <class id="vst" controller="open-ils.cstore open-ils.pcrud" 
809                 oils_obj:fieldmapper="vandelay::session_tracker" 
810                 oils_persist:tablename="vandelay.session_tracker" 
811                 reporter:label="Vandelay Session Tracker">
812                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
813                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
814                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text"/>
815                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
816                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
817                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
818                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
819                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
820                                          queue or an auth queue and there's no IDL class for vandelay.queue .
821                                          parent table.
822                         -->
823                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int"/>
824                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestsamp"/>
825                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestsamp"/>
826                         <field reporter:label="State" name="state" reporter:datatype="text"/>
827                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
828                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
829                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
830                 </fields>
831                 <links>
832                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
833                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
834                 </links>
835                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
836                         <actions>
837                                 <!-- created by the API -->
838                                 <retrieve global_required="true"
839                                         permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
840                                 <update global_required="true"
841                                         permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
842                                         <context link="workstation" field="owning_lib"/>
843                                 </update>
844                                 <delete 
845                                         permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
846                                         <context link="workstation" field="owning_lib"/>
847                                 </delete>
848                         </actions>
849                 </permacrud>
850         </class>
851
852         <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">
853                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
854                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
855                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
856                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
857                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
858                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
859                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
860                 </fields>
861                 <links>
862                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
863                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
864                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
865                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
866                 </links>
867         </class>
868
869     <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">
870         <fields oils_persist:primary="name">
871             <field reporter:label="Name" name="name" reporter:datatype="text"/>
872             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
873             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
874             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
875         </fields>
876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
877             <actions>
878                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
879                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
880                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
881                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
882             </actions>
883         </permacrud>
884     </class>
885
886     <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">
887         <fields oils_persist:primary="id">
888             <field reporter:label="ID" name="id" reporter:datatype="id"/>
889             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
890             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
891             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
892             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
893         </fields>
894         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
895             <actions>
896                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
897                 <retrieve/>
898                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
899                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
900             </actions>
901         </permacrud>
902     </class>
903
904         <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">
905                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
906                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
907                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
908                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
909                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
910                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
911                 </fields>
912                 <links>
913                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
914                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
915                 </links>
916         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
917             <actions>
918                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
919                 <retrieve/>
920                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
921                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
922             </actions>
923         </permacrud>
924         </class>
925
926         <class id="cmrcfmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_format" oils_persist:tablename="config.marc_format" reporter:label="MARC Formats" oils_persist:field_safe="true">
927                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
928                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
929                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
930                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
931         </fields>
932         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
933             <actions>
934                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
935                 <retrieve/>
936                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
937                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
938             </actions>
939         </permacrud>
940         </class>
941
942         <class id="cmrcfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_field" oils_persist:tablename="config.marc_field" reporter:label="MARC Fields" oils_persist:field_safe="true">
943                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
944                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
945                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
946                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
947                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
948                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
949                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
950                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
951                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
952                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
953                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
954                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
955         </fields>
956                 <links>
957                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
958                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
959         </links>
960         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
961             <actions>
962                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
963                 <retrieve/>
964                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
965                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
966             </actions>
967         </permacrud>
968         </class>
969
970         <class id="cmrcsubfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_subfield" oils_persist:tablename="config.marc_subfield" reporter:label="MARC Subfields" oils_persist:subfield_safe="true">
971                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
972                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
973                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
974                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
975                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
976                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
977                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
978                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
979                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
980                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
981                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
982         </fields>
983                 <links>
984                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
985                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
986         </links>
987         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
988             <actions>
989                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
990                 <retrieve/>
991                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
992                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
993             </actions>
994         </permacrud>
995         </class>
996
997         <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">
998                 <fields oils_persist:primary="name">
999                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
1000                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1001                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1002                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
1003                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
1004                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
1005                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1006                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1007                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1008                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1009                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1010                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1011                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1012                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1013                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1014                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1015                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1016                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1017                 </fields>
1018                 <links>
1019                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1020                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1021                 </links>
1022         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1023             <actions>
1024                 <create permission="ADMIN_SVF" global_required="true"/>
1025                 <retrieve/>
1026                 <update permission="ADMIN_SVF" global_required="true"/>
1027                 <delete permission="ADMIN_SVF" global_required="true"/>
1028             </actions>
1029         </permacrud>
1030         </class>
1031
1032         <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">
1033                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1034                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1035                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1036                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1037             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
1038                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1039                 </fields>
1040                 <links/>
1041         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1042             <actions>
1043                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1044                 <retrieve/>
1045                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1046                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1047             </actions>
1048         </permacrud>
1049         </class>
1050
1051         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
1052                 <fields oils_persist:primary="coded_value">
1053                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1054                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1055                 </fields>
1056                 <links>
1057                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1058                 </links>
1059         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1060             <actions>
1061                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1062                 <retrieve/>
1063                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1064                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1065             </actions>
1066         </permacrud>
1067         </class>
1068
1069         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
1070                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1071                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1072                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1073                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1074                 </fields>
1075                 <links>
1076                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1077                 </links>
1078         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1079             <actions>
1080                 <retrieve/>
1081             </actions>
1082         </permacrud>
1083         </class>
1084
1085
1086         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
1087                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1088                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1089                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1090                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1091                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1092                 </fields>
1093                 <links>
1094                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1095                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1096                 </links>
1097         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1098             <actions>
1099                 <retrieve/>
1100             </actions>
1101         </permacrud>
1102         </class>
1103
1104
1105         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
1106                 <fields oils_persist:primary="source">
1107                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1108                         <field reporter:label="Vector" name="vlist" reporter:datatype="text"  oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
1109                 </fields>
1110                 <links>
1111                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1112                 </links>
1113         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1114             <actions>
1115                 <retrieve/>
1116             </actions>
1117         </permacrud>
1118         </class>
1119
1120         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
1121                 <fields>
1122                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1123                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1124                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1125                 </fields>
1126                 <links>
1127                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1128                 </links>
1129         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1130             <actions>
1131                 <retrieve/>
1132             </actions>
1133         </permacrud>
1134         </class>
1135
1136         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
1137                 <fields oils_persist:primary="id">
1138                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1139                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1140                 </fields>
1141                 <links>
1142                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1143                 </links>
1144         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1145             <actions>
1146                 <retrieve/>
1147             </actions>
1148         </permacrud>
1149         </class>
1150
1151         <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">
1152                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1153                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1154                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1155                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1156                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1157                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1158                 </fields>
1159                 <links>
1160                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1161                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1162                 </links>
1163         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1164             <actions>
1165                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1166                 <retrieve/>
1167                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1168                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1169             </actions>
1170         </permacrud>
1171         </class>
1172
1173         <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">
1174                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1175                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1176                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1177                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1178                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1179                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1180                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1181                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1182             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1183             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1184             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1185                 </fields>
1186                 <links>
1187                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1188                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1189                 </links>
1190         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1191             <actions>
1192                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1193                 <retrieve/>
1194                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1195                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1196             </actions>
1197         </permacrud>
1198         </class>
1199
1200         <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">
1201                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1202                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1203                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1204                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1205                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1206                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1207                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1208                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1209                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1210                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1211                 </fields>
1212                 <links>
1213                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1214                 </links>
1215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1216             <actions>
1217                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1218                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1219                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1220                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1221             </actions>
1222         </permacrud>
1223         </class>
1224
1225     <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">
1226         <fields oils_persist:primary="name">
1227             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1228             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1229             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1230             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1231             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1232             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1233             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1234             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1235             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1236             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1237         </fields>
1238         <links>
1239             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1240             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1241         </links>
1242         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1243             <actions>
1244                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1245                 <retrieve/>
1246                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1247                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1248             </actions>
1249         </permacrud>
1250     </class>
1251
1252     <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">
1253         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1254             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1255             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1256             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1257             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1258             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1259             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1260             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1261         </fields>
1262         <links>
1263             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1264         </links>
1265         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1266             <actions>
1267                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1268                 <retrieve/>
1269                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1270                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1271             </actions>
1272         </permacrud>
1273     </class>
1274
1275     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1276                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1277                         oils_persist:tablename="config.z3950_index_field_map" 
1278                         reporter:label="Z39.50 Index Field Map">
1279         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1280             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1281             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1282             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1283             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1284             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1285             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1286         </fields>
1287         <links>
1288             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1289             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1290             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1291         </links>
1292         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1293             <actions>
1294                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1295                 <retrieve/>
1296                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1297                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1298             </actions>
1299         </permacrud>
1300     </class>
1301
1302
1303         <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">
1304                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1305                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1306                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1307                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1308                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1309                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1310                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1311                 </fields>
1312                 <links>
1313             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1314             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1315                 </links>
1316                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1317                         <actions>
1318                                 <retrieve/>
1319                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1320                         </actions>
1321                 </permacrud>
1322         </class>
1323
1324         <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">
1325                 <fields oils_persist:primary="key">
1326                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1327                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1328                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1329                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1330                 </fields>
1331                 <links/>
1332                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1333                         <actions>
1334                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1335                                 <retrieve/>
1336                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1337                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1338                         </actions>
1339                 </permacrud>
1340         </class>
1341
1342         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1343                 <fields oils_persist:primary="module">
1344                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1345                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1346                 </fields>
1347                 <links/>
1348         </class>
1349
1350         <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">
1351                 <fields oils_persist:primary="module">
1352                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1353                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1354                 </fields>
1355                 <links/>
1356                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1357                         <actions>
1358                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1359                                 <retrieve/>
1360                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1361                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1362                         </actions>
1363                 </permacrud>
1364         </class>
1365
1366         <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">
1367                 <fields oils_persist:primary="module">
1368                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1369                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1370                 </fields>
1371                 <links/>
1372                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1373                         <actions>
1374                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1375                                 <retrieve/>
1376                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1377                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1378                         </actions>
1379                 </permacrud>
1380         </class>
1381
1382         <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">
1383                 <fields oils_persist:primary="module">
1384                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1385                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1386                 </fields>
1387                 <links/>
1388                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1389                         <actions>
1390                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1391                                 <retrieve/>
1392                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1393                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1394                         </actions>
1395                 </permacrud>
1396         </class>
1397
1398         <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">
1399                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1400                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1401                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1402                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1403                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1404                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1405                 </fields>
1406                 <links>
1407                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1408                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1409                 </links>
1410                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1411                         <actions>
1412                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1413                     <context link="event_def" field="owner"/>
1414                 </create>
1415                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1416                     <context link="event_def" field="owner"/>
1417                 </retrieve>
1418                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1419                     <context link="event_def" field="owner"/>
1420                 </update>
1421                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1422                     <context link="event_def" field="owner"/>
1423                 </delete>
1424                         </actions>
1425                 </permacrud>
1426         </class>
1427
1428         <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">
1429                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1430                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1431                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1432                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1433                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1434                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1435                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1436                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1437                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1438                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1439                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1440                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1441                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1442                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1443                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1444                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1445                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1446                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1447                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1448                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1449                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1450                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1451                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1452                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1453                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1454                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1455                 </fields>
1456                 <links>
1457                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1458                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1459                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1460                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1461                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1462                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1463                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1464                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1465                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1466                 </links>
1467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1468                         <actions>
1469                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1470                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1471                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1472                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1473                         </actions>
1474                 </permacrud>
1475         </class>
1476
1477         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1478                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1479                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1480                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1481                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1482                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1483                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1484                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1485                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1486                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1487                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1488                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1489                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1490                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1491                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1492                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1493                 </fields>
1494                 <links>
1495                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1496                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1497                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1498                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1499                 </links>
1500         </class>
1501
1502         <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">
1503                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1504                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1505                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1506                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1507                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1508                 </fields>
1509                 <links>
1510                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1511                 </links>
1512                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1513                         <actions>
1514                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1515                     <context link="event_def" field="owner"/>
1516                 </create>
1517                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1518                     <context link="event_def" field="owner"/>
1519                 </retrieve>
1520                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1521                     <context link="event_def" field="owner"/>
1522                 </update>
1523                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1524                     <context link="event_def" field="owner"/>
1525                 </delete>
1526                         </actions>
1527                 </permacrud>
1528         </class>
1529
1530         <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">
1531                 <oils_persist:source_definition><![CDATA[
1532                 SELECT  atevdef.hook,
1533                         atevdef.name,
1534                         atevdef.reactor,
1535                         atev.id,
1536                         atev.event_def,
1537                         atev.add_time,
1538                         atev.run_time,
1539                         atev.start_time,
1540                         atev.update_time,
1541                         atev.complete_time,
1542                         atev.update_process,
1543                         atev.state,
1544                         atev.user_data,
1545                         atev.template_output,
1546                         atev.error_output,
1547                         atev.async_output,
1548                         targ_circ.id AS target_circ,
1549                         targ_ahr.id AS target_hold,
1550                         COALESCE(
1551                                 targ_circ.circ_lib,
1552                                 targ_ahr.pickup_lib
1553                         ) AS perm_lib
1554                 FROM action_trigger.event atev
1555                 JOIN action_trigger.event_definition atevdef ON
1556                         (atevdef.id = atev.event_def)
1557                 JOIN action_trigger.hook ath ON
1558                         (ath.key = atevdef.hook)
1559                 LEFT JOIN action.circulation targ_circ ON
1560                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1561                 LEFT JOIN action.hold_request targ_ahr ON
1562                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1563                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1564                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1565                                 'circ.staff.max_visible_event_age',
1566                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1567                         ) UNION
1568                         SELECT '1000 YEARS'::INTERVAL AS value
1569                 ) ous)
1570                 ]]></oils_persist:source_definition>
1571                 <fields oils_persist:primary="id">
1572                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1573                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1574                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1575                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1576                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1577                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1578                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1579                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1580                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1581                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1582                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1583                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1584                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1585                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1586                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1587                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1588                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1589                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1590                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1591                 </fields>
1592                 <links>
1593                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1594                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1595                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1596                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1597                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1598                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1599                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1600                 </links>
1601                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1602                         <actions>
1603                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1604                         </actions>
1605                 </permacrud>
1606         </class>
1607
1608         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1609                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1610                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1611                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1612                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1613                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1614                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1615                 </fields>
1616                 <links>
1617                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1618                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1619                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1620                 </links>
1621                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1622                         <actions>
1623                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1624                         </actions>
1625                 </permacrud>
1626         </class>
1627
1628         <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">
1629                 <fields oils_persist:primary="code">
1630                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1631                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1632                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1633                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1634                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1635                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1636                 </fields>
1637                 <links/>
1638         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1639             <actions>
1640                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1641                 <retrieve/>
1642                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1643                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1644             </actions>
1645         </permacrud>
1646         </class>
1647
1648         <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">
1649                 <fields oils_persist:primary="code">
1650                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1651                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1652                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1653                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1654                 </fields>
1655                 <links/>
1656         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1657             <actions>
1658                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1659                 <retrieve/>
1660                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1661                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1662             </actions>
1663         </permacrud>
1664         </class>
1665
1666         <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">
1667                 <fields oils_persist:primary="code">
1668                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1669                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1670                 </fields>
1671                 <links/>
1672         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1673             <actions>
1674                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1675                 <retrieve/>
1676                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1677                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1678             </actions>
1679         </permacrud>
1680         </class>
1681
1682         <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">
1683                 <fields oils_persist:primary="code">
1684                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1685                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1686                 </fields>
1687                 <links/>
1688         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1689             <actions>
1690                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1691                 <retrieve/>
1692                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1693                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1694             </actions>
1695         </permacrud>
1696         </class>
1697
1698         <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">
1699                 <fields oils_persist:primary="code">
1700                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1701                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1702                 </fields>
1703                 <links/>
1704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1705             <actions>
1706                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1707                 <retrieve/>
1708                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1709                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1710             </actions>
1711         </permacrud>
1712         </class>
1713
1714         <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">
1715                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1716                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1717                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1718                 </fields>
1719                 <links/>
1720         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1721             <actions>
1722                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1723                 <retrieve/>
1724                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1725                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1726             </actions>
1727         </permacrud>
1728         </class>
1729
1730         <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">
1731                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1732                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1733                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1734                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1735                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1736                 </fields>
1737         <links>
1738             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1739             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1740             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1741         </links>
1742         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1743             <actions>
1744                 <create permission="UPDATE_COPY">
1745                     <context link="target_copy" field="circ_lib"/>
1746                 </create>
1747                 <retrieve/>
1748                 <update permission="UPDATE_COPY">
1749                     <context link="target_copy" field="circ_lib"/>
1750                 </update>
1751                 <delete permission="UPDATE_COPY">
1752                     <context link="target_copy" field="circ_lib"/>
1753                 </delete>
1754             </actions>
1755         </permacrud>
1756         </class>
1757
1758         <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">
1759                 <fields oils_persist:primary="code">
1760                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1761                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1762                 </fields>
1763                 <links/>
1764         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1765             <actions>
1766                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1767                 <retrieve/>
1768                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1769                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1770             </actions>
1771         </permacrud>
1772         </class>
1773
1774         <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">
1775                 <fields oils_persist:primary="code">
1776                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1777                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1778                 </fields>
1779                 <links/>
1780         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1781             <actions>
1782                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1783                 <retrieve/>
1784                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1785                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1786             </actions>
1787         </permacrud>
1788         </class>
1789
1790         <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">
1791                 <fields oils_persist:primary="code">
1792                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1793                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1794                 </fields>
1795                 <links/>
1796         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1797             <actions>
1798                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1799                 <retrieve/>
1800                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1801                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1802             </actions>
1803         </permacrud>
1804         </class>
1805
1806     <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">
1807         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1808             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1809             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1810             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1811             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1812             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1813             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1814             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1815             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1816             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1817             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1818             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1819             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1820             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1821             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1822             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1823             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1824             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1825         </fields>
1826         <links/>
1827         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1828             <actions>
1829                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1830                 <retrieve/>
1831                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1832                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1833             </actions>
1834         </permacrud>
1835     </class>
1836
1837     <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">
1838         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1839             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1840             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1841             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1842             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1843             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1844             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1845             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1846             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1847             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1848             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1849             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1850             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1851             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1852             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1853             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1854             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1855             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1856             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1857             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1858         </fields>
1859         <links/>
1860         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1861             <actions>
1862                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1863                 <retrieve/>
1864                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1865                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1866             </actions>
1867         </permacrud>
1868     </class>
1869
1870     <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">
1871         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1872             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1873             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1874             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1875             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1876             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1877         </fields>
1878         <links>
1879             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1880             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1881             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1882         </links>
1883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1884             <actions>
1885                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1886                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1887                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1888                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1889             </actions>
1890         </permacrud>
1891     </class>
1892
1893         <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">
1894                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1895                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1896                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1897                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1898                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1899                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1900                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1901                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1902                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1903                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1904                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1905                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1906                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1907                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1908                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1909                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1910                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1911             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1912                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1913                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1914                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1915                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1916                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1917                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1918                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1919                 </fields>
1920                 <links>
1921                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1922                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1923                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1924                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1925                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1926                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1927                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1928                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1929                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1930                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1931                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1932                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1933                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1934             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1935                 </links>
1936         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1937             <actions>
1938                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1939                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1940                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1941                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1942             </actions>
1943         </permacrud>
1944         </class>
1945
1946         <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">
1947                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1948                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1949                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1950                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1951                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1952                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1953                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1954                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1955                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1956                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1957                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1958                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1959                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1960                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1961                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1962                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1963             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1964                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1965                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1966             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1967                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1968                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1969                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1970                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1971             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1972             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1973             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1974                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1975                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1976                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1977                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1978                 </fields>
1979                 <links>
1980                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1981                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1982                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1983                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1984                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1985                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1986                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1987                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1988                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1989                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1990                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1991                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1992                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1993                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1994             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1995                 </links>
1996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1997             <actions>
1998                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1999                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2000                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2001                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2002             </actions>
2003         </permacrud>
2004         </class>
2005
2006     <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">
2007         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2008             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2009             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2010             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2011         </fields>
2012         <links/>
2013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2014             <actions>
2015                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2016                 <retrieve/>
2017                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2018                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2019             </actions>
2020         </permacrud>
2021     </class>
2022
2023     <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">
2024         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2025             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2026             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2027             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2028             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2029             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2030             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2031             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2032         </fields>
2033         <links>
2034             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2035         </links>
2036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2037             <actions>
2038                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2039                 <retrieve/>
2040                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2041                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2042             </actions>
2043         </permacrud>
2044     </class>
2045
2046     <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">
2047         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2048             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2049             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2050             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2051             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2052             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2053         </fields>
2054         <links>
2055             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2056             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2057         </links>
2058         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2059             <actions>
2060                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2061                     <context link="matchpoint" field="org_unit"/>
2062                 </create>
2063                 <retrieve/>
2064                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2065                     <context link="matchpoint" field="org_unit"/>
2066                 </update>
2067                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2068                     <context link="matchpoint" field="org_unit"/>
2069                 </delete>
2070             </actions>
2071         </permacrud>
2072     </class>
2073
2074     <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">
2075         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2076             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2077             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2078             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2079         </fields>
2080         <links>
2081             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2082             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2083         </links>
2084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2085             <actions>
2086                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2087                     <context link="limit_set" field="owning_lib"/>
2088                 </create>
2089                 <retrieve/>
2090                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2091                     <context link="limit_set" field="owning_lib"/>
2092                 </update>
2093                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2094                     <context link="limit_set" field="owning_lib"/>
2095                 </delete>
2096             </actions>
2097         </permacrud>
2098     </class>
2099     <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
2100         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2101             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2102             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2103             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2104         </fields>
2105         <links>
2106             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2107             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2108         </links>
2109         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2110             <actions>
2111                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2112                     <context link="limit_set" field="owning_lib"/>
2113                 </create>
2114                 <retrieve/>
2115                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2116                     <context link="limit_set" field="owning_lib"/>
2117                 </update>
2118                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2119                     <context link="limit_set" field="owning_lib"/>
2120                 </delete>
2121             </actions>
2122         </permacrud>
2123     </class>
2124
2125     <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">
2126         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2127             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2128             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2129             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2130             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2131         </fields>
2132         <links>
2133             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2134             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2135         </links>
2136         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2137             <actions>
2138                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2139                     <context link="limit_set" field="owning_lib"/>
2140                 </create>
2141                 <retrieve/>
2142                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2143                     <context link="limit_set" field="owning_lib"/>
2144                 </update>
2145                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2146                     <context link="limit_set" field="owning_lib"/>
2147                 </delete>
2148             </actions>
2149         </permacrud>
2150     </class>
2151
2152         <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">
2153                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2154                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2155                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2156                 </fields>
2157                 <links/>
2158         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2159             <actions>
2160                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2161                 <retrieve/>
2162                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2163                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2164             </actions>
2165         </permacrud>
2166         </class>
2167
2168         <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">
2169                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2170                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2171                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2172                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2173                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2174                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2175                 </fields>
2176                 <links>
2177                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2178                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2179                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2180                 </links>
2181         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2182             <actions>
2183                 <create permission="ADMIN_SURVEY">
2184                     <context link="survey" field="owner"/>
2185                 </create>
2186                 <retrieve/>
2187                 <update permission="ADMIN_SURVEY">
2188                     <context link="survey" field="owner"/>
2189                 </update>
2190                 <delete permission="ADMIN_SURVEY">
2191                     <context link="survey" field="owner"/>
2192                 </delete>
2193             </actions>
2194         </permacrud>
2195         </class>
2196         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
2197                 <fields oils_persist:primary="id" oils_persist:sequence="">
2198                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2199                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2200                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2201                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2202                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2203                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2204                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2205                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2206                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2207                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2208                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2209                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2210                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2211                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2212                 </fields>
2213                 <links>
2214                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2215                 </links>
2216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2217                         <actions>
2218                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2219                                         <context link="usr" field="home_ou" />
2220                                 </retrieve>
2221                         </actions>
2222                 </permacrud>
2223         </class>
2224         <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">
2225                 <fields oils_persist:primary="id" oils_persist:sequence="">
2226                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2227                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2228                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2229                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2230                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2231                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2232                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2233                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2234                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2235                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2236                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2237                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2238                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2239                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2240                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2241                 </fields>
2242                 <links>
2243                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2244                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2245                 </links>
2246         </class>
2247         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2248                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2249                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2250                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2251                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2252                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2253                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2254                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2255                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2256                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2257                 </fields>
2258                 <links>
2259                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2260                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2261                 </links>
2262                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2263                         <actions> <!-- created magically, so no create action -->
2264                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2265                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2266                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2267                         </actions>
2268                 </permacrud>
2269         </class>
2270         <class id="auml" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_limited" oils_persist:tablename="actor.usr_message_limited" reporter:label="User Message (Limited Access)">
2271                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2272                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2273                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2274                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2275                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2276                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2277                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2278                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2279                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2280                 </fields>
2281                 <links>
2282                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2283                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2284                 </links>
2285                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2286                         <actions> <!-- created magically, so no create action -->
2287                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2288                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2289                         </actions>
2290                 </permacrud>
2291         </class>
2292         <class id="aun" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_note" oils_persist:tablename="actor.usr_note" reporter:label="User Note">
2293                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2294                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2295                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2296                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2297                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2298                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2299                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2300                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2301                 </fields>
2302                 <links>
2303                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2304                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2305                 </links>
2306         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2307             <actions>
2308                 <create permission="UPDATE_USER" context_field="owner">
2309                     <context link="usr" field="home_ou"/>
2310                 </create>
2311                                 <!-- note: public notes are still accessible via API -->
2312                 <retrieve permission="UPDATE_USER">
2313                     <context link="usr" field="home_ou"/>
2314                                 </retrieve>
2315                 <update permission="UPDATE_USER">
2316                     <context link="usr" field="home_ou"/>
2317                                 </update>
2318                 <delete permission="UPDATE_USER">
2319                     <context link="usr" field="home_ou"/>
2320                                 </delete>
2321             </actions>
2322         </permacrud>
2323         </class>
2324         <class id="aupw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_privacy_waiver" oils_persist:tablename="actor.usr_privacy_waiver" reporter:label="Privacy Waiver">
2325                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2326                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2327                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2328                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2329                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2330                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2331                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2332                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2333                 </fields>
2334                 <links>
2335                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2336                 </links>
2337                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2338                         <actions>
2339                                 <create permission="UPDATE_USER">
2340                                         <context link="usr" field="home_ou"/>
2341                                 </create>
2342                                 <retrieve permission="VIEW_USER">
2343                                         <context link="usr" field="home_ou"/>
2344                                 </retrieve>
2345                                 <update permission="UPDATE_USER">
2346                                         <context link="usr" field="home_ou"/>
2347                                 </update>
2348                                 <delete permission="UPDATE_USER">
2349                                         <context link="usr" field="home_ou"/>
2350                                 </delete>
2351                         </actions>
2352                 </permacrud>
2353         </class>
2354         <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">
2355                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2356                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2357                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2358                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2359                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2360                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2361                 </fields>
2362                 <links>
2363                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2364                 </links>
2365         </class>
2366         <class id="aus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2367                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2368                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2369                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2370                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2371                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2372                 </fields>
2373                 <links>
2374                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2375                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2376                 </links>
2377                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2378                         <actions>
2379                                 <retrieve permission="VIEW_USER">
2380                                         <context link="usr" field="home_ou" />
2381                                 </retrieve>
2382                         </actions>
2383                 </permacrud>
2384         </class>
2385         <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">
2386                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2387                         <field name="field" reporter:datatype="link"/>
2388                         <field name="id" reporter:datatype="id" />
2389                         <field name="source" reporter:datatype="link"/>
2390                         <field name="value" reporter:datatype="text"/>
2391                 </fields>
2392                 <links>
2393                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2394                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2395                 </links>
2396         </class>
2397         <class id="aihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2398                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2399                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2400                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2401                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2402                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2403                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2404                 </fields>
2405                 <links>
2406                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2407                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2408                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2409                 </links>
2410                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2411                         <actions>
2412                                 <retrieve/>
2413                         </actions>
2414                 </permacrud>
2415         </class>
2416         <class id="ancihu" controller="open-ils.cstore open-ils.pcrud" 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">
2417                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2418                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2419                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2420                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2421                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2422                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2423                 </fields>
2424                 <links>
2425                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2426                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2427                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2428                 </links>
2429                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2430                         <actions>
2431                                 <retrieve/>
2432                         </actions>
2433                 </permacrud>
2434         </class>
2435         <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">
2436                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2437                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2438                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2439                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2440                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2441                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2442                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2443                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2444                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2445                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2446                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2447                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2448                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2449                 </fields>
2450                 <links>
2451                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2452                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2453                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2454                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2455                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2456                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2457                 </links>
2458         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2459             <actions>
2460                 <create permission="TRANSIT_COPY" context_field="owner">
2461                     <context link="target_copy" field="circ_lib"/>
2462                 </create>
2463                 <retrieve/>
2464                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2465                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2466             </actions>
2467         </permacrud>
2468         </class>
2469         <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">
2470                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2471                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2472                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2473                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2474                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2475                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2476                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2477                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2478                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2479                 </fields>
2480                 <links>
2481                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2482                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2483                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2484                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2485                 </links>
2486         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2487             <actions>
2488                 <create permission="ADMIN_SURVEY">
2489                     <context link="survey" field="owner"/>
2490                 </create>
2491                 <retrieve permission="VIEW_USER">
2492                     <context link="usr" field="home_ou"/>
2493                 </retrieve>
2494                 <update permission="ADMIN_SURVEY">
2495                     <context link="survey" field="owner"/>
2496                 </update>
2497                 <delete permission="ADMIN_SURVEY">
2498                     <context link="survey" field="owner"/>
2499                 </delete>
2500             </actions>
2501         </permacrud>
2502         </class>
2503         <class id="ccbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2504                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2505                         <field name="bucket" />
2506                         <field name="id" reporter:datatype="id" />
2507                         <field name="target_copy" reporter:datatype="link"/>
2508                         <field name="create_time" reporter:datatype="timestamp" />
2509                         <field name="pos" reporter:datatype="int" />
2510                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2511                 </fields>
2512                 <links>
2513                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2514                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2515             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2516                 </links>
2517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2518                         <actions>
2519                                 <retrieve permission="ADMIN_COPY_BUCKET">
2520                     <context link="bucket" owning_lib="owning_lib"/>
2521                 </retrieve>
2522             </actions>
2523         </permacrud>
2524         </class>
2525         <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">
2526                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2527                         <field name="id" reporter:datatype="id" />
2528                         <field name="item" reporter:datatype="link"/>
2529                         <field name="note" reporter:datatype="text" />
2530                 </fields>
2531                 <links>
2532                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2533                 </links>
2534         </class>
2535
2536         <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">
2537                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2538                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2539                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2540                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2541                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2542                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2543                 </fields>
2544                 <links>
2545                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2546                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2547                 </links>
2548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2549                         <actions>
2550                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2551                                 <retrieve/>
2552                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2553                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2554                         </actions>
2555                 </permacrud>
2556         </class>
2557
2558         <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">
2559                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2560                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2561                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2562                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2563                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2564                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2565                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2566                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2567                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2568                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2569                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2570                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2571                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2572                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2573                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2574                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2575                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2576                 </fields>
2577                 <links>
2578                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2579                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2580                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2581                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2582                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2583                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2584                         <link field="heading" reltype="has_a" key="id" map="" class="ahf"/>
2585                 </links>
2586                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2587                         <actions>
2588                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2589                                 <retrieve/>
2590                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2591                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2592                         </actions>
2593                 </permacrud>
2594         </class>
2595
2596         <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">
2597                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2598                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2599                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2600                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2601                 </fields>
2602                 <links>
2603                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2604                 </links>
2605                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2606                         <actions>
2607                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2608                                 <retrieve/>
2609                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2610                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2611                         </actions>
2612                 </permacrud>
2613         </class>
2614
2615         <class id="acsbfmfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field_metabib_field_map" oils_persist:tablename="authority.control_set_bib_field_metabib_field_map" reporter:label="Authority Control Set Bib Field to Metabib Field Map" oils_persist:field_safe="true">
2616                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2617                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2618                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2619                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2620                 </fields>
2621                 <links>
2622                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2623                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2624                 </links>
2625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2626                         <actions>
2627                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2628                                 <retrieve/>
2629                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2630                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2631                         </actions>
2632                 </permacrud>
2633         </class>
2634
2635         <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">
2636                 <fields oils_persist:primary="code">
2637                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2638                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2639                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2640                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2641                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2642                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2643                 </fields>
2644                 <links>
2645                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2646                 </links>
2647                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2648                         <actions>
2649                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2650                                 <retrieve/>
2651                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2652                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2653                         </actions>
2654                 </permacrud>
2655         </class>
2656
2657         <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">
2658                 <fields oils_persist:primary="code">
2659                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2660                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2661                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2662                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2663                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2664                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2665                 </fields>
2666                 <links>
2667                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2668                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2669                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2670                 </links>
2671                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2672                         <actions>
2673                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2674                                 <retrieve/>
2675                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2676                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2677                         </actions>
2678                 </permacrud>
2679         </class>
2680
2681     <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">
2682         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2683             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2684             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2685             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2686         </fields>
2687         <links>
2688             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2689             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2690         </links>
2691         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2692             <actions>
2693                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2694                 <retrieve/>
2695                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2696                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2697             </actions>
2698         </permacrud>
2699     </class>
2700
2701         <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">
2702                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2703                         <field name="active" reporter:datatype="bool"/>
2704                         <field name="create_date" reporter:datatype="timestamp"/>
2705                         <field name="creator" />
2706                         <field name="deleted" reporter:datatype="bool"/>
2707                         <field name="edit_date" reporter:datatype="timestamp"/>
2708                         <field name="editor" />
2709                         <field name="id" reporter:datatype="id" />
2710                         <field name="last_xact_id" />
2711                         <field name="marc" />
2712                         <field name="source" />
2713                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2714                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2715                         <field name="heading" />
2716                         <field name="simple_heading" />
2717                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2718                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2719                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2720                 </fields>
2721                 <links>
2722                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2723                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2724                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2725                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2726                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2727                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2728                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2729                 </links>
2730                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2731                         <actions>
2732                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2733                                 <retrieve/>
2734                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2735                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2736                         </actions>
2737                 </permacrud>
2738         </class>
2739         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2740                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2741                         <field name="char_encoding" />
2742                         <field name="id" />
2743                         <field name="record" />
2744                         <field name="record_status" />
2745                         <field name="thesaurus" />
2746                 </fields>
2747                 <links>
2748                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2749                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2750                 </links>
2751         </class>
2752         <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">
2753                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2754                         <field name="id" reporter:datatype="id" />
2755                         <field name="bib" reporter:datatype="link" />
2756                         <field name="authority" reporter:datatype="link" />
2757                 </fields>
2758                 <links>
2759                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2760                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2761                 </links>
2762         </class>
2763         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2764                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2765                         <field name="id" reporter:datatype="id" />
2766                         <field name="record" reporter:datatype="link" />
2767                         <field name="atag" reporter:datatype="link" />
2768                         <field name="value" reporter:datatype="text" />
2769                 </fields>
2770                 <links>
2771                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2772                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2773                 </links>
2774         </class>
2775
2776         <class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
2777                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
2778                         <field name="id" reporter:datatype="id" />
2779                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
2780                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
2781                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
2782                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
2783                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
2784                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
2785                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
2786                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
2787                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
2788                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
2789                 </fields>
2790                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2791                         <actions>
2792                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2793                                 <retrieve/>
2794                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2795                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2796                         </actions>
2797                 </permacrud>
2798         </class>
2799
2800         <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">
2801                 <fields oils_persist:primary="code" oils_persist:sequence="">
2802                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2803                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2804                 </fields>
2805                 <links/>
2806         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2807             <actions>
2808                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2809                 <retrieve/>
2810                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2811                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2812             </actions>
2813         </permacrud>
2814         </class>
2815         <class id="mccp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
2816                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2817                         <field name="accepting_usr" />
2818                         <field name="amount" reporter:datatype="money" />
2819                         <field name="amount_collected" reporter:datatype="money" />
2820                         <field name="approval_code" reporter:datatype="text"/>
2821                         <field name="cash_drawer" reporter:datatype="link"/>
2822                         <field name="cc_number" reporter:datatype="text"/>
2823                         <field name="cc_order_number" reporter:datatype="text"/>
2824                         <field name="cc_processor" reporter:datatype="text"/>
2825                         <field name="id" reporter:datatype="id" />
2826                         <field name="note" reporter:datatype="text"/>
2827                         <field name="payment_ts" reporter:datatype="timestamp"/>
2828                         <field name="xact" reporter:datatype="link"/>
2829                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2830                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2831                 </fields>
2832                 <links>
2833                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2834                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2835                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2836                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2837                 </links>
2838         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2839             <actions>
2840                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2841                     <context link="xact" jump="usr" field="home_ou"/>
2842                 </retrieve>
2843                         </actions>
2844                 </permacrud>
2845         </class>
2846         <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" oils_persist:field_safe="true">
2847                 <fields oils_persist:primary="name">
2848                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2849                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2850                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2851                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2852                 </fields>
2853                 <links/>
2854         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2855             <actions>
2856                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2857                 <retrieve/>
2858                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2859                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2860             </actions>
2861         </permacrud>
2862         </class>
2863
2864         <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">
2865                 <fields oils_persist:primary="alias">
2866                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2867                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2868                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2869                 </fields>
2870                 <links>
2871                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2872                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2873                 </links>
2874         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2875             <actions>
2876                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2877                 <retrieve/>
2878                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2879                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2880             </actions>
2881         </permacrud>
2882         </class>
2883
2884         <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">
2885                 <fields oils_persist:primary="name">
2886                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
2887                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2888                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2889                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2890                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2891                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2892                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2893                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2894                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2895                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2896                 </fields>
2897                 <links>
2898                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2899                 </links>
2900         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2901             <actions>
2902                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2903                 <retrieve/>
2904                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2905                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2906             </actions>
2907         </permacrud>
2908         </class>
2909
2910         <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">
2911                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2912                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2913                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2914                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2915                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2916                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2917                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2918                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
2919                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2920                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2921                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2922                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2923                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
2924                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
2925                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2926                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2927                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
2928                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
2929                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2930                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
2931                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link"/>
2932                 </fields>
2933                 <links>
2934                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
2935                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2936                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
2937                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
2938                 </links>
2939         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2940             <actions>
2941                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2942                 <retrieve/>
2943                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2944                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2945             </actions>
2946         </permacrud>
2947         </class>
2948
2949         <class id="cmfvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_virtual_map" oils_persist:tablename="config.metabib_field_virtual_map" reporter:label="Metabib Field Virtual Map" oils_persist:field_safe="true">
2950                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
2951                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2952                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
2953                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link"/>
2954                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
2955                 </fields>
2956                 <links>
2957                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
2958                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
2959                 </links>
2960         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2961             <actions>
2962                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
2963                 <retrieve/>
2964                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
2965                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
2966             </actions>
2967         </permacrud>
2968         </class>
2969
2970         <class id="cbho" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::best_hold_order" oils_persist:tablename="config.best_hold_order" reporter:label="Best-Hold Sort Order">
2971                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2972                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2973                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2974                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2975                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2976                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2977                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2978                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2979                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2980                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2981                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2982                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2983                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2984                 </fields>
2985                 <links>
2986                 </links>
2987                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2988                         <actions>
2989                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2990                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2991                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2992                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2993                         </actions>
2994                 </permacrud>
2995         </class>
2996         <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">
2997                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2998                         <field name="id" reporter:datatype="id" />
2999                         <field name="name" reporter:datatype="text"/>
3000                         <field name="xpath" reporter:datatype="text"/>
3001                         <field name="format" reporter:datatype="link"/>
3002                         <field name="first_word" reporter:datatype="bool" />
3003                 </fields>
3004                 <links/>
3005         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3006             <actions>
3007                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3008                 <retrieve/>
3009                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3010                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3011             </actions>
3012         </permacrud>
3013         </class>
3014         <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">
3015                 <fields oils_persist:primary="code" oils_persist:sequence="">
3016                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3017                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3018                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3019                 </fields>
3020                 <links/>
3021         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3022             <actions>
3023                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3024                 <retrieve/>
3025                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3026                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3027             </actions>
3028         </permacrud>
3029         </class>
3030         <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">
3031                 <fields oils_persist:primary="code" oils_persist:sequence="">
3032                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3033                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3034                 </fields>
3035                 <links/>
3036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3037             <actions>
3038                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3039                 <retrieve/>
3040                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3041                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3042             </actions>
3043         </permacrud>
3044         </class>
3045     <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">
3046         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3047             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3048             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3049             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3050             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3051         </fields>
3052         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3053             <actions>
3054                 <retrieve/>
3055             </actions>
3056         </permacrud>
3057     </class>
3058         <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">
3059                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3060                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3061                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3062                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3063                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3064                 </fields>
3065                 <links>
3066                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3067                 </links>
3068         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3069             <actions>
3070                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3071                 <retrieve/>
3072                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3073                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3074             </actions>
3075         </permacrud>
3076         </class>
3077         <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">
3078                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3079                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3080                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3081                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3082                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3083                 </fields>
3084                 <links>
3085                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3086                 </links>
3087         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3088             <actions>
3089                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3090                 <retrieve/>
3091                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3092                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3093             </actions>
3094         </permacrud>
3095         </class>
3096         <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">
3097                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3098                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3099                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3100                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3101                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3102                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3103                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3104                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3105                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3106                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3107                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3108                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3109                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3110                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3111                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3112                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3113                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3114                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3115                 </fields>
3116                 <links>
3117                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3118                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3119                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3120                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3121                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3122                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3123                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3124                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3125                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3126                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3127                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3128                 </links>
3129         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3130             <actions>
3131                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3132                 <retrieve/>
3133                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3134                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3135             </actions>
3136         </permacrud>
3137         </class>
3138         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3139                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3140                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3141                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3142                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3143                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3144                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3145                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3146                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3147                 </fields>
3148                 <links>
3149                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3150                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3151         </links>
3152         </class>
3153         <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">
3154                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3155                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3156                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3157                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3158                 </fields>
3159                 <links>
3160                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3161                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3162                 </links>
3163         </class>
3164         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3165                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3166                         <field name="id" reporter:datatype="id" />
3167                         <field name="value" oils_persist:i18n="true" />
3168                 </fields>
3169                 <links/>
3170         </class>
3171         <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">
3172                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3173                         <field name="balance_owed" reporter:datatype="money" />
3174                         <field name="total_owed" reporter:datatype="money" />
3175                         <field name="total_paid" reporter:datatype="money" />
3176                         <field name="usr" reporter:datatype="link"/>
3177                 </fields>
3178                 <links>
3179                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3180         </links>
3181         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3182             <actions>
3183                 <retrieve permission="VIEW_USER">
3184                     <context link="usr" field="home_ou"/>
3185                 </retrieve>
3186             </actions>
3187         </permacrud>
3188         </class>
3189         <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">
3190                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3191                         <field name="collector" />
3192                         <field name="enter_time" reporter:datatype="timestamp"/>
3193                         <field name="id" reporter:datatype="id" />
3194                         <field name="location" reporter:datatype="link"/>
3195                         <field name="usr" reporter:datatype="link"/>
3196                 </fields>
3197                 <links>
3198                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3199                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3200                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3201                 </links>
3202         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3203             <actions>
3204                 <create permission="money.collections_tracker.create" context_field="location"/>
3205                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3206                 <delete permission="money.collections_tracker.create" context_field="location"/>
3207             </actions>
3208         </permacrud>
3209         </class>
3210         <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">
3211                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3212                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3213                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3214                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3215                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3216                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3217                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3218                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3219                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3220                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3221                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3222                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3223                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3224                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3225                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3226                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3227                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3228                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3229                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3230                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3231                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3232                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3233                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3234                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3235                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3236                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3237                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3238                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3239                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3240                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3241                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3242                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3243                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3244                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3245                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3246                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3247                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3248                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3249                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3250                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3251                 </fields>
3252                 <links>
3253                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3254                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3255                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3256                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3257                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3258                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3259                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3260                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3261                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3262                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3263                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3264                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3265                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3266                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3267                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3268                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3269                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3270                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3271                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3272                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3273                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3274                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3275                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3276                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3277                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3278                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3279                 </links>
3280         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3281             <actions>
3282                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3283                 <retrieve/>
3284                 <update permission="UPDATE_MARC" global_required="true"/>
3285                 <!-- WARNING: Deleting records via PCRUD does NOT check that any prerequisite conditions have been handled first. It is your responsibility to check for those conditions before deleting bib records. -->
3286                 <delete permission="DELETE_RECORD" global_required="true"/>
3287             </actions>
3288         </permacrud>
3289         </class>
3290         <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">
3291                 <fields oils_persist:primary="id">
3292                         <field name="dow_0_close" />
3293                         <field name="dow_0_open" />
3294                         <field name="dow_1_close" />
3295                         <field name="dow_1_open" />
3296                         <field name="dow_2_close" />
3297                         <field name="dow_2_open" />
3298                         <field name="dow_3_close" />
3299                         <field name="dow_3_open" />
3300                         <field name="dow_4_close" />
3301                         <field name="dow_4_open" />
3302                         <field name="dow_5_close" />
3303                         <field name="dow_5_open" />
3304                         <field name="dow_6_close" />
3305                         <field name="dow_6_open" />
3306                         <field name="id" reporter:datatype="id" />
3307                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3308                 </fields>
3309                 <links>
3310                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3311                 </links>
3312         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3313             <actions>
3314                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3315                 <retrieve/>
3316                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3317                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3318             </actions>
3319         </permacrud>
3320         </class>
3321         <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">
3322                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3323                         <field name="id" reporter:datatype="id" />
3324                         <field name="record" reporter:datatype="link"/>
3325                         <field name="label" reporter:datatype="text"/>
3326                         <field name="label_sortkey" reporter:datatype="text"/>
3327                         <field name="deleted" reporter:datatype="bool"/>
3328                 </fields>
3329                 <links>
3330                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3331                 </links>
3332         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3333             <actions>
3334                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3335                 <retrieve/>
3336                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3337                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3338             </actions>
3339         </permacrud>
3340         </class>
3341         <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">
3342                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3343                         <field name="id" reporter:datatype="id" />
3344                         <field name="target_copy" reporter:datatype="link" />
3345                         <field name="part" reporter:datatype="link"/>
3346                 </fields>
3347                 <links>
3348                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3349                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3350                 </links>
3351         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3352             <actions>
3353                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3354                 <retrieve/>
3355                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3356                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3357             </actions>
3358         </permacrud>
3359         </class>
3360     <class  id="aecc"
3361             controller="open-ils.cstore open-ils.pcrud"
3362             oils_obj:fieldmapper="action::emergency_closing_circulation"
3363             oils_persist:tablename="action.emergency_closing_circulation"
3364             reporter:label="Emergency Closing Circulation Entry"
3365             oils_persist:readonly="true"
3366     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3367         <fields oils_persist:primary="id">
3368             <field name="id" reporter:datatype="id" />
3369             <field name="circulation" reporter:datatype="link" />
3370                         <field name="emergency_closing" reporter:datatype="link"/>
3371             <field name="original_due_date" reporter:datatype="timestamp" />
3372             <field name="process_time" reporter:datatype="timestamp" />
3373         </fields>
3374         <links>
3375             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3376             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3377         </links>
3378         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3379             <actions>
3380                 <retrieve/>
3381             </actions>
3382         </permacrud>
3383     </class>
3384     <class  id="aecr"
3385             controller="open-ils.cstore open-ils.pcrud"
3386             oils_obj:fieldmapper="action::emergency_closing_reservation"
3387             oils_persist:tablename="action.emergency_closing_reservation"
3388             reporter:label="Emergency Closing Reservation Entry"
3389             oils_persist:readonly="true"
3390     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3391         <fields oils_persist:primary="id">
3392             <field name="id" reporter:datatype="id" />
3393             <field name="reservation" reporter:datatype="link" />
3394                         <field name="emergency_closing" reporter:datatype="link"/>
3395             <field name="original_end_time" reporter:datatype="timestamp" />
3396             <field name="process_time" reporter:datatype="timestamp" />
3397         </fields>
3398         <links>
3399             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3400             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3401         </links>
3402         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3403             <actions>
3404                 <retrieve/>
3405             </actions>
3406         </permacrud>
3407     </class>
3408     <class  id="aech"
3409             controller="open-ils.cstore open-ils.pcrud"
3410             oils_obj:fieldmapper="action::emergency_closing_hold"
3411             oils_persist:tablename="action.emergency_closing_hold"
3412             reporter:label="Emergency Closing Hold Entry"
3413             oils_persist:readonly="true"
3414     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3415         <fields oils_persist:primary="id">
3416             <field name="id" reporter:datatype="id" />
3417             <field name="hold" reporter:datatype="link" />
3418                         <field name="emergency_closing" reporter:datatype="link"/>
3419             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3420             <field name="process_time" reporter:datatype="timestamp" />
3421         </fields>
3422         <links>
3423             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3424             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3425         </links>
3426         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3427             <actions>
3428                 <retrieve/>
3429             </actions>
3430         </permacrud>
3431     </class>
3432     <class  id="aecs"
3433             controller="open-ils.cstore open-ils.pcrud"
3434             oils_obj:fieldmapper="action::emergency_closing_status"
3435             oils_persist:tablename="action.emergency_closing_status"
3436             reporter:label="Emergency Closing Status"
3437             oils_persist:readonly="true"
3438     >
3439         <fields oils_persist:primary="id">
3440             <field name="id" reporter:datatype="id" />
3441             <field name="creator" reporter:datatype="link" />
3442             <field name="create_time" reporter:datatype="timestamp" />
3443             <field name="process_start_time" reporter:datatype="timestamp" />
3444             <field name="process_end_time" reporter:datatype="timestamp" />
3445             <field name="last_update_time" reporter:datatype="timestamp" />
3446             <field name="circulations" reporter:datatype="int" />
3447             <field name="circulations_complete" reporter:datatype="int" />
3448             <field name="reservations" reporter:datatype="int" />
3449             <field name="reservations_complete" reporter:datatype="int" />
3450             <field name="holds" reporter:datatype="int" />
3451             <field name="holds_complete" reporter:datatype="int" />
3452         </fields>
3453         <links>
3454             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3455         </links>
3456         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3457             <actions>
3458                 <retrieve/>
3459             </actions>
3460         </permacrud>
3461     </class>
3462     <class id="aec" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing" oils_persist:tablename="action.emergency_closing" reporter:label="Emergency Closing">
3463         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3464             <field name="id" reporter:datatype="id" />
3465             <field name="creator" reporter:datatype="link" />
3466             <field name="create_time" reporter:datatype="timestamp" />
3467             <field name="process_start_time" reporter:datatype="timestamp" />
3468             <field name="process_end_time" reporter:datatype="timestamp" />
3469             <field name="last_update_time" reporter:datatype="timestamp" />
3470             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3471             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3472             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3473             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3474             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3475         </fields>
3476         <links>
3477             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3478             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3479             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3480             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3481             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3482             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3483         </links>
3484         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3485             <actions>
3486                 <create permission="EMERGENCY_CLOSING">
3487                     <context link="closing" field="org_unit" />
3488                 </create>
3489                 <retrieve/>
3490                 <update permission="EMERGENCY_CLOSING">
3491                     <context link="closing" field="org_unit" />
3492                 </update>
3493                 <delete permission="EMERGENCY_CLOSING">
3494                     <context link="closing" field="org_unit" />
3495                 </delete>
3496             </actions>
3497         </permacrud>
3498     </class>
3499         <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">
3500                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3501                         <field name="close_end" reporter:datatype="timestamp" />
3502                         <field name="close_start" reporter:datatype="timestamp" />
3503                         <field name="id" reporter:datatype="id" />
3504                         <field name="org_unit" reporter:datatype="org_unit"/>
3505                         <field name="reason" reporter:datatype="text"/>
3506                         <field name="full_day" reporter:datatype="bool"/>
3507                         <field name="multi_day" reporter:datatype="bool"/>
3508                         <field name="emergency_closing" reporter:datatype="link"/>
3509                 </fields>
3510                 <links>
3511                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3512                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3513                 </links>
3514         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3515             <actions>
3516                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3517                 <retrieve/>
3518                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3519                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3520             </actions>
3521         </permacrud>
3522         </class>
3523         <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">
3524                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3525                         <field name="extended" reporter:datatype="interval"/>
3526                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3527                         <field name="max_renewals" reporter:datatype="int" />
3528                         <field name="name" reporter:datatype="text"/>
3529                         <field name="normal" reporter:datatype="interval"/>
3530                         <field name="shrt" reporter:datatype="interval"/>
3531                         <field name="max_auto_renewals" reporter:datatype="int" />
3532                 </fields>
3533                 <links>
3534                 </links>
3535         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3536             <actions>
3537                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3538                 <retrieve/>
3539                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3540                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3541             </actions>
3542         </permacrud>
3543         </class>
3544
3545         <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">
3546                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3547                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3548                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3549             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3550                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3551             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3552                 </fields>
3553                 <links>
3554             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3555                 </links>
3556                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3557             <actions>
3558                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3559                 <retrieve/>
3560                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3561                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3562             </actions>
3563                 </permacrud>
3564         </class>
3565
3566         <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">
3567                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3568                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3569                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3570                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3571             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3572                 </fields>
3573                 <links>
3574                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3575                 </links>
3576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3577             <actions>
3578                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3579                 <retrieve/>
3580                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3581                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3582             </actions>
3583                 </permacrud>
3584         </class>
3585
3586         <class id="mobts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_billable_transaction_summary" oils_persist:tablename="money.open_billable_xact_summary" reporter:label="Open Billable Transaction Summary">
3587                 <fields oils_persist:primary="id" oils_persist:sequence="">
3588                         <field name="balance_owed" reporter:datatype="money"/>
3589                         <field name="id" reporter:datatype="id" />
3590                         <field name="last_billing_note" reporter:datatype="text"/>
3591                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3592                         <field name="last_billing_type" reporter:datatype="text"/>
3593                         <field name="last_payment_note" reporter:datatype="text"/>
3594                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3595                         <field name="last_payment_type" reporter:datatype="text"/>
3596                         <field name="total_owed" reporter:datatype="money"/>
3597                         <field name="total_paid" reporter:datatype="money"/>
3598                         <field name="usr" reporter:datatype="link"/>
3599                         <field name="xact_finish" reporter:datatype="timestamp" />
3600                         <field name="xact_start" reporter:datatype="timestamp" />
3601                         <field name="xact_type" reporter:datatype="text"/>
3602                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3603                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3604                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3605                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3606                         <field name="billing_location" reporter:datatype="link"/>
3607                 </fields>
3608                 <links>
3609                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3610                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3611                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3612                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3613                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3614                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3615                 </links>
3616                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3617                         <actions>
3618                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3619                                         <context link="usr" field="home_ou" />
3620                                 </retrieve>
3621                         </actions>
3622                 </permacrud>
3623         </class>
3624         <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">
3625                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3626                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3627                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3628                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3629                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3630                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3631                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3632                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3633                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3634                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3635                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3636                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3637                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3638                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3639                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3640                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3641                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3642                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3643                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3644                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3645                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3646                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3647                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3648                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3649                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3650                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3651                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3652                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3653                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3654                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3655                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
3656                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3657                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3658                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3659                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3660                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3661                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3662                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3663                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3664                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3665                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3666                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3667                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3668                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3669                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3670                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3671                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3672                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3673                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3674                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3675                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3676                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3677                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3678                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
3679                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
3680                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
3681                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
3682                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
3683                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
3684                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
3685                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3686                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3687                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3688                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3689                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3690                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3691                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3692                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3693                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3694                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3695                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3696                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3697                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
3698                 </fields>
3699                 <links>
3700                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3701                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3702                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3703                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3704                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3705                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3706                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3707                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3708                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3709                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3710                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3711                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
3712                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3713                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3714                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3715                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3716                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3717                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3718                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3719                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3720                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3721                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3722                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3723                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3724                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3725                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3726                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3727                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3728                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3729                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3730                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3731                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
3732                 </links>
3733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3734                         <actions>
3735                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
3736                         </actions>
3737                 </permacrud>
3738         </class>
3739         <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">
3740                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3741                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
3742                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3743                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3744                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3745                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3746                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3747                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3748                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3749         </fields>
3750                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3751                         <actions>
3752                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3753                                 <retrieve/>
3754                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3755                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3756                         </actions>
3757                 </permacrud>
3758         </class>
3759         <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">
3760                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3761                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3762                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3763                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3764                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3765         </fields>
3766         <links>
3767                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3768                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3769                 </links>
3770                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3771                         <actions>
3772                                 <retrieve permission="RUN_REPORTS">
3773                                         <context link="usr" field="home_ou" />
3774                                 </retrieve>
3775                         </actions>
3776                 </permacrud>
3777         </class>
3778         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3779                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3780                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3781                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3782                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3783                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3784                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3785                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3786         </fields>
3787         <links>
3788                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3789                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3790                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3791                 </links>
3792                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3793                         <actions>
3794                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3795                                         <context link="usr" field="home_ou" />
3796                                         <context link="ws" field="owning_lib" />
3797                                 </retrieve>
3798                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3799                                         <context link="usr" field="home_ou" />
3800                                         <context link="ws" field="owning_lib" />
3801                                 </create>
3802                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3803                                         <context link="usr" field="home_ou" />
3804                                         <context link="ws" field="owning_lib" />
3805                                 </update>
3806                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3807                                         <context link="usr" field="home_ou" />
3808                                         <context link="ws" field="owning_lib" />
3809                                 </delete>
3810                         </actions>
3811                 </permacrud>
3812         </class>
3813         <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">
3814                 <fields oils_persist:primary="name">
3815                         <field name="name" reporter:datatype="text"/>
3816                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3817                 </fields>
3818                 <links/>
3819                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3820                         <actions>
3821                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3822                                 <retrieve/>
3823                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3824                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3825                         </actions>
3826                 </permacrud>
3827         </class>
3828         <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">
3829                 <fields oils_persist:primary="name">
3830                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3831                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3832                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3833                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3834                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3835                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3836                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3837                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3838                 </fields>
3839                 <links>
3840                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3841                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3842                 </links>
3843                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3844                         <actions>
3845                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3846                                 <retrieve/>
3847                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3848                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3849                         </actions>
3850                 </permacrud>
3851         </class>
3852         <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">
3853                 <fields oils_persist:primary="name">
3854                         <field name="name" reporter:datatype="text"/>
3855                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3856                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3857                         <field name="datatype" reporter:datatype="text"/>
3858                         <field name="view_perm" reporter:datatype="link"/>
3859                         <field name="update_perm" reporter:datatype="link"/>
3860                         <field name="fm_class" reporter:datatype="text"/>
3861                         <field name="grp" reporter:datatype="link"/>
3862                 </fields>
3863                 <links>
3864                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3865                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3866                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3867                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3868                 </links>
3869                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3870                         <actions>
3871                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3872                                 <retrieve/>
3873                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3874                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3875                         </actions>
3876                 </permacrud>
3877         </class>
3878         <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">
3879                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3880                         <field name="id" />
3881                         <field name="name"  reporter:datatype="text"/>
3882                         <field name="org_unit" reporter:datatype="org_unit"/>
3883                         <field name="value"  reporter:datatype="text"/>
3884                 </fields>
3885                 <links>
3886                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3887                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3888                 </links>
3889         </class>
3890         <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">
3891                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3892                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3893                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3894                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3895                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3896                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3897                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3898                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3899                 </fields>
3900                 <links>
3901                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3902                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3903                 </links>
3904         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3905             <actions>
3906                 <create permission="CREATE_COPY_NOTE">
3907                     <context link="owning_copy" field="circ_lib"/>
3908                 </create>
3909                 <retrieve permission="VIEW_COPY_NOTES">
3910                     <context link="owning_copy" field="circ_lib"/>
3911                 </retrieve>
3912                 <update permission="UPDATE_COPY_NOTE">
3913                     <context link="owning_copy" field="circ_lib"/>
3914                 </update>
3915                 <delete permission="DELETE_COPY_NOTE">
3916                     <context link="owning_copy" field="circ_lib"/>
3917                 </delete>
3918             </actions>
3919         </permacrud>
3920         </class>
3921         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3922                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3923                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3924                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3925                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3926                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3927                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3928                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3929                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3930                 </fields>
3931                 <links>
3932                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3933                 </links>
3934         </class>
3935         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3936                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3937                         <field name="fingerprint"  reporter:datatype="text"/>
3938                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
3939                         <field name="master_record" reporter:datatype="link"/>
3940                         <field name="mods"  reporter:datatype="text"/>
3941                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3942                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3943                 </fields>
3944                 <links>
3945                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3946                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3947                         <link field="source_maps" reltype="has_many" key="metarecord" class="mmrsm"/>
3948                 </links>
3949                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3950                         <actions>
3951                                 <retrieve/>
3952                         </actions>
3953                 </permacrud>
3954         </class>
3955         <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">
3956                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3957                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3958                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3959                 </fields>
3960                 <links/>
3961         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3962             <actions>
3963                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3964                 <retrieve/>
3965                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3966                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3967             </actions>
3968         </permacrud>
3969         </class>
3970         <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">
3971                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3972                         <field name="code"  reporter:datatype="text"/>
3973                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3974                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3975                 </fields>
3976                 <links/>
3977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3978             <actions>
3979                 <create permission="CREATE_PERM" global_required="true"/>
3980                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3981                 <update permission="UPDATE_PERM" global_required="true"/>
3982                 <delete permission="DELETE_PERM" global_required="true"/>
3983             </actions>
3984         </permacrud>
3985         </class>
3986         <class id="mmrsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord_source_map" oils_persist:tablename="metabib.metarecord_source_map" oils_persist:field_safe="true" reporter:label="Metarecord Source Map">
3987                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3988                         <field name="id" reporter:datatype="id" />
3989                         <field name="metarecord" reporter:datatype="link"/>
3990                         <field name="source" reporter:datatype="link"/>
3991                 </fields>
3992                 <links>
3993                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3994                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3995                 </links>
3996                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3997                         <actions>
3998                                 <retrieve/>
3999                         </actions>
4000                 </permacrud>
4001         </class>
4002         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4003                         oils_obj:fieldmapper="metabib::display_entry" 
4004                         oils_persist:tablename="metabib.display_entry" 
4005                         oils_persist:field_safe="true"
4006                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4007                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4008                         <field name="id" reporter:datatype="id" />
4009                         <field name="field" reporter:datatype="link"/>
4010                         <field name="source" reporter:datatype="link"/>
4011                         <field name="value"  reporter:datatype="text"/>
4012                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4013                 </fields>
4014                 <links>
4015                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4016                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4017                 </links>
4018                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4019                         <actions>
4020                                 <retrieve/>
4021                         </actions>
4022                 </permacrud>
4023         </class>
4024         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4025                 oils_persist:tablename="metabib.flat_display_entry"
4026                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4027                 oils_persist:field_safe="true"
4028                 reporter:label="Flat Display Entry" 
4029                 oils_persist:readonly="true">
4030                 <fields>
4031                         <field name="source" reporter:datatype="id" />
4032                         <field name="name" reporter:datatype="text"/>
4033                         <field name="multi" reporter:datatype="bool"/>
4034                         <field name="label" reporter:datatype="text"/>
4035                         <field name="field" reporter:datatype="link"/>
4036                         <field name="value" reporter:datatype="text"/>
4037                 </fields>
4038                 <links>
4039                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4040                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4041                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4042                 </links>
4043                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4044                         <actions>
4045                                 <retrieve/>
4046                         </actions>
4047                 </permacrud>
4048         </class>
4049         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4050                 oils_persist:tablename="metabib.compressed_display_entry"
4051                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4052                 oils_persist:field_safe="true"
4053                 reporter:label="Compressed Display Entry" 
4054                 oils_persist:readonly="true">
4055                 <fields>
4056                         <field name="source" reporter:datatype="id" />
4057                         <field name="name" reporter:datatype="text"/>
4058                         <field name="multi" reporter:datatype="bool"/>
4059                         <field name="label" reporter:datatype="text"/>
4060                         <field name="field" reporter:datatype="link"/>
4061                         <field name="value" reporter:datatype="text"/>
4062                 </fields>
4063                 <links>
4064                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4065                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4066                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4067                 </links>
4068                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4069                         <actions>
4070                                 <retrieve/>
4071                         </actions>
4072                 </permacrud>
4073         </class>
4074         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4075                 oils_persist:tablename="metabib.wide_display_entry"
4076                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4077                 oils_persist:field_safe="true"
4078                 reporter:label="Wide Display Entry" 
4079                 oils_persist:readonly="true">
4080                 <fields oils_persist:primary="source">
4081                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4082                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4083                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4084                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4085                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4086                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4087                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4088                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4089                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4090                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4091                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4092                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4093                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4094                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4095                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4096                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4097                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4098                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4099                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4100                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4101                 </fields>
4102                 <links>
4103                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4104                 </links>
4105                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4106                         <actions>
4107                                 <retrieve/>
4108                         </actions>
4109                 </permacrud>
4110         </class>
4111
4112         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4113                 oils_persist:tablename="config.display_field_map"
4114                 oils_obj:fieldmapper="config::display_field_map"
4115                 oils_persist:field_safe="true"
4116                 reporter:label="Display Field Map">
4117                 <fields oils_persist:primary="name">
4118                         <field name="name" reporter:datatype="text"/>
4119                         <field name="field" reporter:datatype="link"/>
4120                         <field name="multi" reporter:datatype="bool"/>
4121                 </fields>
4122                 <links>
4123                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4124                 </links>
4125                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4126                         <actions>
4127                                 <retrieve/>
4128                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4129                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4130                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4131                         </actions>
4132                 </permacrud>
4133         </class>
4134
4135         <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">
4136                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4137                         <field name="id" reporter:datatype="id" />
4138                         <field name="field" reporter:datatype="link"/>
4139                         <field name="source" reporter:datatype="link"/>
4140                         <field name="value"  reporter:datatype="text"/>
4141                 </fields>
4142                 <links>
4143                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4144                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4145                 </links>
4146         </class>
4147         <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">
4148                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4149                         <field name="id" reporter:datatype="id" />
4150                         <field name="value" reporter:datatype="text"/>
4151                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4152                 </fields>
4153                 <links>
4154                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4155                 </links>
4156                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4157                         <actions>
4158                                 <retrieve/>
4159                         </actions>
4160                 </permacrud>
4161         </class>
4162         <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">
4163                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4164                         <field name="id" reporter:datatype="id" />
4165                         <field name="entry" reporter:datatype="link"/>
4166                         <field name="def" reporter:datatype="link"/>
4167                         <field name="source" reporter:datatype="link"/>
4168                 </fields>
4169                 <links>
4170                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4171                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4172                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4173                 </links>
4174         </class>
4175         <class id="mbeshm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry_simple_heading_map" oils_persist:tablename="metabib.browse_entry_simple_heading_map" reporter:label="Combined Browse Entry Simple Authority Heading Map" oils_persist:readonly="true">
4176                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4177                         <field name="id" reporter:datatype="id" />
4178                         <field name="entry" reporter:datatype="link"/>
4179                         <field name="simple_heading" reporter:datatype="link"/>
4180                 </fields>
4181                 <links>
4182                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4183                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4184                 </links>
4185         </class>
4186         <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">
4187                 <oils_persist:source_definition><![CDATA[
4188                         SELECT * FROM metabib.author_field_entry
4189                                                 UNION ALL
4190                         SELECT * FROM metabib.keyword_field_entry
4191                                                 UNION ALL
4192                         SELECT * FROM metabib.identifier_field_entry
4193                                                 UNION ALL
4194                         SELECT * FROM metabib.title_field_entry
4195                                                 UNION ALL
4196                         SELECT * FROM metabib.subject_field_entry
4197                                                 UNION ALL
4198                         SELECT * FROM metabib.series_field_entry
4199                 ]]></oils_persist:source_definition>
4200                 <fields>
4201                         <field name="field" reporter:datatype="link"/>
4202                         <field name="id" reporter:datatype="id" />
4203                         <field name="source" reporter:datatype="link"/>
4204                         <field name="value"  reporter:datatype="text"/>
4205                 </fields>
4206                 <links>
4207                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4208                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4209                 </links>
4210         </class>
4211         <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">
4212                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4213                         <field name="field" reporter:datatype="link"/>
4214                         <field name="id" reporter:datatype="id" />
4215                         <field name="source" reporter:datatype="link"/>
4216                         <field name="value"  reporter:datatype="text"/>
4217                 </fields>
4218                 <links>
4219                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4220                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4221                 </links>
4222         </class>
4223         <class id="mcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::cash_payment" oils_persist:tablename="money.cash_payment" reporter:label="Cash Payment">
4224                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4225                         <field name="accepting_usr" reporter:datatype="link"/>
4226                         <field name="amount" reporter:datatype="money" />
4227                         <field name="amount_collected" reporter:datatype="money" />
4228                         <field name="cash_drawer" reporter:datatype="link"/>
4229                         <field name="id" reporter:datatype="id" />
4230                         <field name="note"  reporter:datatype="text"/>
4231                         <field name="payment_ts" reporter:datatype="timestamp"/>
4232                         <field name="xact" reporter:datatype="link"/>
4233                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4234                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4235                 </fields>
4236                 <links>
4237                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4238                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4239                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4240                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4241                 </links>
4242         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4243             <actions>
4244                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4245                     <context link="xact" jump="usr" field="home_ou"/>
4246                 </retrieve>
4247                         </actions>
4248                 </permacrud>
4249         </class>
4250         <class id="mfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::forgive_payment" oils_persist:tablename="money.forgive_payment" reporter:label="Forgive Payment">
4251                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4252                         <field name="accepting_usr" reporter:datatype="link"/>
4253                         <field name="amount" reporter:datatype="money" />
4254                         <field name="amount_collected" reporter:datatype="money" />
4255                         <field name="id" reporter:datatype="id" />
4256                         <field name="note"  reporter:datatype="text"/>
4257                         <field name="payment_ts" reporter:datatype="timestamp"/>
4258                         <field name="xact" reporter:datatype="link"/>
4259                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4260                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4261                 </fields>
4262                 <links>
4263                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4264                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4265                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4266                 </links>
4267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4268             <actions>
4269                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4270                     <context link="xact" jump="usr" field="home_ou"/>
4271                 </retrieve>
4272                         </actions>
4273                 </permacrud>
4274         </class>
4275         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4276                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4277                         <field name="accepting_usr" reporter:datatype="link"/>
4278                         <field name="amount" reporter:datatype="money" />
4279                         <field name="amount_collected" reporter:datatype="money" />
4280                         <field name="id" reporter:datatype="id" />
4281                         <field name="note"  reporter:datatype="text"/>
4282                         <field name="payment_ts" reporter:datatype="timestamp"/>
4283                         <field name="xact" reporter:datatype="link"/>
4284                         <field name="billing" reporter:datatype="link"/>
4285                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4286                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4287                 </fields>
4288                 <links>
4289                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4290                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4291                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4292                         <link field="billing" reltype="might_have" key="id" class="mb"/>
4293                 </links>
4294         </class>
4295         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4296                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4297                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4298                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4299                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4300                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4301                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4302                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4303                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4304                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4305                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4306                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4307                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4308                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4309                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4310                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4311                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4312                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4313                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4314                 </fields>
4315                 <links>
4316                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4317                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4318                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4319                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4320                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4321                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4322                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4323                 </links>
4324         </class>
4325
4326         <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">
4327                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4328                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4329                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4330                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4331                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4332                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4333                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4334                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4335                 </fields>
4336                 <links/>
4337         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4338             <actions>
4339                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4340                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
4341                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4342                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4343             </actions>
4344         </permacrud>
4345         </class>
4346         <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">
4347                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4348                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4349                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4350                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4351                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4352                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4353                 </fields>
4354                 <links>
4355                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4356                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4357                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4358         </links>
4359         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4360             <actions>
4361                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4362                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4363                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4364                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4365             </actions>
4366         </permacrud>
4367         </class>
4368         <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">
4369                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4370                         <field name="holdable" reporter:datatype="bool"/>
4371                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4372                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4373                         <field name="opac_visible" reporter:datatype="bool"/>
4374             <field name="copy_active" reporter:datatype="bool"/>
4375             <field name="restrict_copy_delete" reporter:datatype="bool"/>
4376             <field name="is_available" reporter:datatype="bool"/>
4377                 </fields>
4378                 <links/>
4379         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4380             <actions>
4381                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4382                 <retrieve/>
4383                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4384                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4385             </actions>
4386         </permacrud>
4387         </class>
4388         <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">
4389                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
4390                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4391                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4392                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4393                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4394                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4395                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4396                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4397                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
4398                 </fields>
4399                 <links>
4400                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4401                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4402                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4403                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4404                 </links>
4405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4406                         <actions>
4407                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4408                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4409                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4410                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4411                         </actions>
4412                 </permacrud>
4413         </class>
4414         <class id="aua" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
4415                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4416                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4417                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4418                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4419                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4420                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4421                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4422                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4423                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4424                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4425                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4426                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4427                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4428                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4429                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4430                 </fields>
4431                 <links>
4432                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4433                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4434                 </links>
4435                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4436                         <actions>
4437                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4438                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4439                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4440                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4441                         </actions>
4442                 </permacrud>
4443         </class>
4444         <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">
4445                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4446                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4447                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4448                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4449                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4450                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4451                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4452                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4453                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4454                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4455                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4456                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4457                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4458                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4459                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4460                 </fields>
4461                 <links>
4462                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4463                 </links>
4464                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4465                         <actions>
4466                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4467                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4468                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4469                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4470                         </actions>
4471                 </permacrud>
4472         </class>
4473
4474
4475         <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">
4476                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4477                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4478                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4479                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4480                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4481                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4482                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4483                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4484                 </fields>
4485                 <links>
4486                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4487                 </links>
4488         </class>
4489
4490         <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">
4491                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4492                         <field name="call_number" />
4493                         <field name="create_date" reporter:datatype="timestamp"/>
4494                         <field name="creator" reporter:datatype="link"/>
4495                         <field name="id" reporter:datatype="id" />
4496                         <field name="pub" reporter:datatype="bool"/>
4497                         <field name="title"  reporter:datatype="text"/>
4498                         <field name="value"  reporter:datatype="text"/>
4499                 </fields>
4500                 <links>
4501                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4502                 </links>
4503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4504             <actions>
4505                 <create permission="CREATE_VOLUME_NOTE">
4506                     <context link="call_number" field="owning_lib"/>
4507                 </create>
4508                 <retrieve permission="VIEW_VOLUME_NOTES">
4509                     <context link="call_number" field="owning_lib"/>
4510                 </retrieve>
4511                 <update permission="UPDATE_VOLUME_NOTE">
4512                     <context link="call_number" field="owning_lib"/>
4513                 </update>
4514                 <delete permission="DELETE_VOLUME_NOTE">
4515                     <context link="call_number" field="owning_lib"/>
4516                 </delete>
4517             </actions>
4518         </permacrud>
4519         </class>
4520         <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">
4521                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4522                         <field name="create_date" reporter:datatype="timestamp"/>
4523                         <field name="creator" reporter:datatype="link"/>
4524                         <field name="edit_date" reporter:datatype="timestamp"/>
4525                         <field name="editor" reporter:datatype="link"/>
4526                         <field name="id" reporter:datatype="id" />
4527                         <field name="record" reporter:datatype="link"/>
4528                         <field name="value" reporter:datatype="text"/>
4529                 </fields>
4530                 <links>
4531                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4532                 </links>
4533         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4534             <actions>
4535                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4536                 <retrieve/>
4537                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4538                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4539             </actions>
4540         </permacrud>
4541         </class>
4542         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4543         <oils_persist:source_definition><![CDATA[
4544 SELECT  usr,
4545         SUM(
4546             CASE
4547                 WHEN (
4548                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4549                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4550                 ) THEN 1
4551                 ELSE 0
4552             END
4553         ) AS out,
4554
4555         SUM(
4556             CASE
4557                 WHEN (
4558                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4559                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4560                 ) THEN 1
4561                 ELSE 0
4562             END
4563         ) AS overdue,
4564
4565         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4566         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4567         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4568   FROM  action.circulation
4569   WHERE checkin_time IS NULL
4570   GROUP BY 1
4571         ]]></oils_persist:source_definition>
4572         <fields oils_persist:primary="usr">
4573             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4574             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4575             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4576             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4577             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4578             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4579         </fields>
4580         <links>
4581             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4582         </links>
4583         </class>
4584         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4585         <oils_persist:source_definition><![CDATA[
4586 SELECT  usr,
4587         STRING_AGG(
4588             CASE
4589                 WHEN (
4590                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4591                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4592                 ) THEN id::TEXT
4593                 ELSE '0'
4594             END
4595         ,',') AS out,
4596
4597         STRING_AGG(
4598             CASE
4599                 WHEN (
4600                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4601                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4602                 ) THEN id::TEXT
4603                 ELSE '0'
4604             END
4605         ,',') AS overdue,
4606
4607         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
4608         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
4609         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
4610   FROM  action.circulation
4611   WHERE checkin_time IS NULL
4612   GROUP BY 1
4613         ]]></oils_persist:source_definition>
4614         <fields oils_persist:primary="usr">
4615             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4616             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4617             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4618             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4619             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4620             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4621         </fields>
4622         <links>
4623             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4624         </links>
4625         </class>
4626         <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">
4627                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4628                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4629                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4630                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4631                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
4632                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4633                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4634                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4635                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4636                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4637                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4638                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4639                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4640                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4641                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4642                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4643                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4644                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4645                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4646                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4647                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4648                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4649                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4650                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4651                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4652                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4653                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4654                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4655                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4656                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4657                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4658                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4659                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4660                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4661                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4662                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4663                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4664                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4665                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4666                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4667                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4668                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
4669                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
4670                 </fields>
4671                 <links>
4672                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4673                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4674                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4675                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4676                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4677                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4678                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4679                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4680                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4681                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4682                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4683                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4684                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4685                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4686                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4687                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4688                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4689                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
4690                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4691                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4692                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4693                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4694                 </links>
4695                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4696                         <actions>
4697                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4698                         </actions>
4699                 </permacrud>
4700         </class>
4701         <class id="aacct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_combined_types" oils_persist:tablename="action.all_circulation_combined_types" reporter:core="true" reporter:label="All Circulation Combined Types" oils_persist:readonly="true">
4702                 <fields>
4703                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
4704                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4705                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
4706                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4707                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
4708                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
4709                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
4710                 </fields>
4711                 <links>
4712                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4713                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4714                 </links>
4715                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4716                         <actions>
4717                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4718                         </actions>
4719                 </permacrud>
4720         </class>
4721         <class id="aacs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_slim" oils_persist:tablename="action.all_circulation_slim" reporter:core="true" reporter:label="Combined Aged and Active circulations" oils_persist:readonly="true">
4722                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4723                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4724                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4725                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4726                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4727                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4728                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4729                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4730                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4731                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4732                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4733                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4734                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4735                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4736                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4737                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4738                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4739                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4740                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4741                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4742                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4743                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4744                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4745                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4746                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4747                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4748                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4749                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4750                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4751                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4752                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4753                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4754                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4755                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4756                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4757                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4758                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4759                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4760                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4761                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4762                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4763                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
4764                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
4765                 </fields>
4766                 <links>
4767                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4768                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4769                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4770                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4771                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4772                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4773                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
4774                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
4775                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4776                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4777                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4778                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4779                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4780                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4781                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4782                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4783                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4784                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4785                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4786                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4787                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4788                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4789                 </links>
4790                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4791                         <actions>
4792                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4793                         </actions>
4794                 </permacrud>
4795         </class>
4796
4797         <class id="combcirc" controller="open-ils.cstore open-ils.pcrud" 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">
4798                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4799                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4800                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4801                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4802                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4803                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4804                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4805                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4806                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4807                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4808                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4809                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4810                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4811                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4812                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4813                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4814                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4815                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4816                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4817                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4818                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4819                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4820                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4821                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4822                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4823                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4824                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4825                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4826                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4827                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4828                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4829                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4830                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4831                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4832                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4833                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4834                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4835                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4836                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4837                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4838                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4839                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4840                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4841                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4842                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4843                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4844                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4845                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4846                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4847                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4848                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
4849                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
4850                 </fields>
4851                 <links>
4852                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4853                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4854                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4855                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4856                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4857                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4858                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
4859                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
4860                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4861                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4862                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4863                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4864                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4865                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4866                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4867                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4868                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4869                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4870                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4871                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4872                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4873                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4874                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4875                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
4876                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
4877                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4878                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4879                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4880                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4881                 </links>
4882                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4883                         <actions>
4884                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4885                         </actions>
4886                 </permacrud>
4887         </class>
4888         <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">
4889                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4890                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4891                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4892                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4893                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4894                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4895                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4896                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4897                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4898                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4899                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4900                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4901                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4902                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4903                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4904                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4905                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4906                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4907                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4908                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4909                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4910                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4911                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4912                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4913                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4914                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4915                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4916                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4917                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4918                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4919                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4920                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4921                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4922                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4923                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4924                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4925                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4926                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4927                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4928                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4929                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4930                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4931                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4932                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4933                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4934                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4935                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4936                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
4937                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
4938                 </fields>
4939                 <links>
4940                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4941                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4942                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4943                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4944                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4945                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4946                         <link field="payments" reltype="has_many" key="xact" map="" class="map"/>
4947                         <link field="billings" reltype="has_many" key="xact" map="" class="mab"/>
4948                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4949                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4950                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4951                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4952                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4953                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4954                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4955                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4956                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4957                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4958                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4959                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4960                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4961                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4962                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4963                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4964                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4965                 </links>
4966         </class>
4967         <class id="auch" 
4968                 controller="open-ils.cstore" 
4969                 oils_obj:fieldmapper="action::user_circ_history" 
4970                 oils_persist:tablename="action.usr_circ_history" 
4971                 reporter:label="User Checkout History">
4972                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
4973                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4974                         <!-- prevent reporting on the user that owns the checkout history -->
4975                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
4976                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4977                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
4978                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
4979                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
4980                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
4981                 </fields>
4982                 <links>
4983                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4984                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4985                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
4986                 </links>
4987         </class>
4988         <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">
4989                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4990                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4991                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
4992                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4993                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4994                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4995                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4996                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4997                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4998                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4999                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5000                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5001                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5002                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5003                 </fields>
5004                 <links>
5005                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5006                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5007                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5008                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5009                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5010                 </links>
5011                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5012                         <actions>
5013                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5014                                 <retrieve/>
5015                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5016                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5017                         </actions>
5018                 </permacrud>
5019         </class>
5020
5021         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5022                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5023                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5024                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5025                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5026                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5027                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5028                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5029                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5030                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5031                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5032                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5033                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5034                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5035                 </fields>
5036                 <links>
5037                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5038                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5039                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5040                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5041                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5042                 </links>
5043                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5044                         <actions>
5045                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5046                                 <retrieve/>
5047                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5048                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5049                         </actions>
5050                 </permacrud>
5051         </class>
5052         
5053         <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">
5054                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5055                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5056                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5057                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5058                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5059                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5060                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5061                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5062                 </fields>
5063                 <links>
5064                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5065                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5066                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5067                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5068                 </links>
5069                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5070                         <actions>
5071                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5072                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5073                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5074                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5075                         </actions>
5076                 </permacrud>
5077         </class>
5078         
5079         <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">
5080                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5081                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5082                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5083                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5084                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5085                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5086                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5087                 </fields>
5088                 <links>
5089                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5090                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5091                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5092                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5093                 </links>
5094                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5095                         <actions>
5096                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5097                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5098                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5099                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5100                         </actions>
5101                 </permacrud>
5102         </class>
5103         
5104         <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">
5105                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5106                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5107                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5108                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5109                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5110                 </fields>
5111                 <links>
5112                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5113                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5114                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5115                 </links>
5116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5117                         <actions>
5118                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5119                     <context link="resource" field="owner" />
5120                 </create>
5121                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5122                     <context link="resource" field="owner" />
5123                 </retrieve>
5124                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5125                     <context link="resource" field="owner" />
5126                 </update>
5127                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5128                     <context link="resource" field="owner" />
5129                 </delete>
5130                         </actions>
5131                 </permacrud>
5132         </class>
5133         
5134         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5135                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5136                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5137                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5138                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5139                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5140                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5141                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5142                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5143                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5144                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5145                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5146                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5147                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5148                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5149                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5150                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5151                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5152                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5153                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5154                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5155                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5156                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5157                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5158                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5159                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5160                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5161                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5162                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5163                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5164                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5165                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5166                 </fields>
5167                 <links>
5168                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5169                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5170                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5171                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5172                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5173                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5174                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5175                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5176                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5177                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5178                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5179                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5180                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5181                 </links>
5182                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5183                         <actions>
5184                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
5185                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
5186                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
5187                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
5188                         </actions>
5189                 </permacrud>
5190         </class>
5191         
5192         <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">
5193                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5194                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5195                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5196                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5197                 </fields>
5198                 <links>
5199                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5200                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5201                 </links>
5202                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5203                         <actions>
5204                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
5205                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
5206                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
5207                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
5208                         </actions>
5209                 </permacrud>
5210         </class>
5211
5212         <class id="ccnbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_item" oils_persist:tablename="container.call_number_bucket_item" reporter:label="Call Number Bucket Item">
5213                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5214                         <field name="bucket" reporter:datatype="link"/>
5215                         <field name="id" reporter:datatype="id" />
5216                         <field name="target_call_number" reporter:datatype="link" />
5217                         <field name="create_time" reporter:datatype="timestamp" />
5218                         <field name="pos" reporter:datatype="int" />
5219                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5220                 </fields>
5221                 <links>
5222                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5223                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5224             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5225                 </links>
5226                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5227                         <actions>
5228                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5229                     <context link="bucket" owning_lib="owning_lib"/>
5230                 </retrieve>
5231             </actions>
5232         </permacrud>
5233         </class>
5234         <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">
5235                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5236                         <field name="id" reporter:datatype="id" />
5237                         <field name="item" reporter:datatype="link"/>
5238                         <field name="note" reporter:datatype="text" />
5239                 </fields>
5240                 <links>
5241                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5242                 </links>
5243         </class>
5244         <class id="cbreb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket" oils_persist:tablename="container.biblio_record_entry_bucket" reporter:label="Bibliographic Record Entry Bucket">
5245                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5246                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5247                         <field name="btype" reporter:datatype="text"/>
5248                         <field name="id" reporter:datatype="id" />
5249                         <field name="name" reporter:datatype="text"/>
5250                         <field name="description" reporter:datatype="text"/>
5251                         <field name="owner" reporter:datatype="link"/>
5252                         <field name="pub" reporter:datatype="bool"/>
5253                         <field name="create_time" reporter:datatype="timestamp" />
5254                         <field name="owning_lib" reporter:datatype="org_unit" />
5255                 </fields>
5256                 <links>
5257                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5258                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5259                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5260                 </links>
5261                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5262                         <actions>
5263                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
5264                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
5265                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
5266                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
5267                         </actions>
5268                 </permacrud>
5269         </class>
5270         <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">
5271                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5272                         <field name="id" reporter:datatype="id" />
5273                         <field name="bucket" reporter:datatype="link"/>
5274                         <field name="note" reporter:datatype="text" />
5275                 </fields>
5276                 <links>
5277                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5278                 </links>
5279         </class>
5280         <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">
5281                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5282                         <field name="hold" reporter:datatype="link"/>
5283                         <field name="id" reporter:datatype="id" />
5284                         <field name="target_copy" reporter:datatype="link"/>
5285                         <field name="proximity" reporter:datatype="number"/>
5286                 </fields>
5287                 <links>
5288                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5289                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5290                 </links>
5291         </class>
5292         <class id="ahn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_notification" oils_persist:tablename="action.hold_notification" reporter:label="Hold Notification">
5293                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5294                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5295                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5296                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5297                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5298                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5299                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5300                 </fields>
5301                 <links>
5302                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5303                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5304                 </links>
5305         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5306             <actions>
5307                 <create permission="CREATE_HOLD_NOTIFICATION">
5308                                         <context link="hold" jump="usr" field="home_ou" />
5309                                 </create>
5310                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5311                                         <context link="hold" jump="usr" field="home_ou" />
5312                                 </retrieve>
5313                 <update permission="CREATE_HOLD_NOTIFICATION">
5314                                         <context link="hold" jump="usr" field="home_ou" />
5315                                 </update>
5316                 <delete permission="CREATE_HOLD_NOTIFICATION">
5317                                         <context link="hold" jump="usr" field="home_ou" />
5318                                 </delete>
5319             </actions>
5320         </permacrud>
5321         </class>
5322         <class id="acpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location" oils_persist:tablename="asset.copy_location" reporter:label="Copy/Shelving Location"  oils_persist:field_safe="true">
5323                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5324                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5325                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5326                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5327                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5328                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5329                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5330                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5331                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5332                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5333                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5334                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5335                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5336                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5337                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5338                 </fields>
5339                 <links>
5340                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5341                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5342                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5343                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5344                 </links>
5345         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5346             <actions>
5347                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5348                 <retrieve/>
5349                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5350                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5351             </actions>
5352         </permacrud>
5353         </class>
5354         <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">
5355                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5356                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5357                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5358                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5359                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
5360             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5361             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5362             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5363                 </fields>
5364                 <links>
5365                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5366                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5367                 </links>
5368         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5369             <actions>
5370                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5371                 <retrieve/>
5372                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5373                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5374             </actions>
5375         </permacrud>
5376         </class>
5377         <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">
5378                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5379                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5380             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5381             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5382                 </fields>
5383                 <links>
5384                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5385                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5386                 </links>
5387         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5388             <actions>
5389                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5390                                         <context link="lgroup" field="owner" />
5391                 </create>
5392                 <retrieve/>
5393                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5394                                         <context link="lgroup" field="owner" />
5395                 </update>
5396                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5397                                         <context link="lgroup" field="owner" />
5398                 </delete>
5399             </actions>
5400         </permacrud>
5401         </class>
5402
5403     <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">
5404         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5405             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5406             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5407             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5408             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5409         </fields>
5410         <links>
5411             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5412             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5413         </links>
5414         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5415             <actions>
5416                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5417                 <retrieve/>
5418                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5419                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5420             </actions>
5421         </permacrud>
5422     </class>
5423
5424         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5425                 <fields>
5426                         <field name="sre_id" oils_persist:virtual="true" />
5427                         <field name="location" oils_persist:virtual="true" />
5428                         <field name="owning_lib" oils_persist:virtual="true" />
5429                         <field name="basic_holdings" oils_persist:virtual="true" />
5430                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5431                         <field name="supplement_holdings" oils_persist:virtual="true" />
5432                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5433                         <field name="index_holdings" oils_persist:virtual="true" />
5434                         <field name="index_holdings_add" oils_persist:virtual="true" />
5435                         <field name="online" oils_persist:virtual="true" />
5436                         <field name="missing" oils_persist:virtual="true" />
5437                         <field name="incomplete" oils_persist:virtual="true" />
5438                 </fields>
5439         </class>
5440
5441         <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">
5442                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5443                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5444                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5445                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5446                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5447                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5448                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5449                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5450                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5451                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5452                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5453                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5454                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5455                 </fields>
5456                 <links>
5457                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5458                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5459                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5460                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5461                 </links>
5462                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5463                         <actions>
5464                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5465                                 <retrieve/>
5466                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5467                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5468                         </actions>
5469                 </permacrud>
5470         </class>
5471
5472         <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">
5473                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5474                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5475                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5476                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5477                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5478                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5479                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5480                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5481                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5482                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5483                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5484                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5485                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5486                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5487                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5488                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5489                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5490                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5491                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5492                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5493                 </fields>
5494                 <links>
5495                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5496                 </links>
5497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5498                         <actions>
5499                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5500                                         <context link="subscription" field="owning_lib" />
5501                                 </create>
5502                                 <retrieve />
5503                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5504                                         <context link="subscription" field="owning_lib" />
5505                                 </update>
5506                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5507                                         <context link="subscription" field="owning_lib" />
5508                                 </delete>
5509                         </actions>
5510                 </permacrud>
5511         </class>
5512
5513         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5514                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5515                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5516                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5517                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5518                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5519                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
5520                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
5521                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
5522                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
5523                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
5524                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5525                 </fields>
5526                 <links>
5527                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5528                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
5529                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
5530                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
5531                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
5532                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
5533                 </links>
5534                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5535                         <actions>
5536                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5537                                 <retrieve />
5538                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5539                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5540                         </actions>
5541                 </permacrud>
5542         </class>
5543
5544         <class id="ssubn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
5545                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
5546                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5547                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5548                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5549                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5550                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5551                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5552                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5553                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5554                 </fields>
5555                 <links>
5556                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5557                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5558                 </links>
5559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5560                         <actions>
5561                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5562                     <context link="subscription" field="owning_lib"/>
5563                 </create>
5564                                 <retrieve />
5565                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5566                     <context link="subscription" field="owning_lib"/>
5567                 </update>
5568                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5569                     <context link="subscription" field="owning_lib"/>
5570                 </delete>
5571                         </actions>
5572                 </permacrud>
5573         </class>
5574
5575         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
5576                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
5577                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5578                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
5579                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
5580                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5581                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
5582                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5583                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
5584                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
5585                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
5586                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
5587                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
5588                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
5589                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
5590                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
5591                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5592                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5593                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5594                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5595                 </fields>
5596                 <links>
5597                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
5598                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5599                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
5600                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
5601                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
5602                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
5603                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
5604                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
5605                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
5606                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
5607                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
5608                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
5609                 </links>
5610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5611                         <actions>
5612                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5613                                 <retrieve />
5614                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5615                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5616                         </actions>
5617                 </permacrud>
5618         </class>
5619
5620         <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">
5621                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
5622                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5623                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5624                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5625                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5626                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5627                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5628                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5629                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5630                 </fields>
5631                 <links>
5632                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5633                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5634                 </links>
5635                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5636                         <actions>
5637                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5638                                         <context link="distribution" field="holding_lib" />
5639                                 </create>
5640                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
5641                                         <context link="distribution" field="holding_lib" />
5642                                 </retrieve>
5643                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5644                                         <context link="distribution" field="holding_lib" />
5645                                 </update>
5646                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5647                                         <context link="distribution" field="holding_lib" />
5648                                 </delete>
5649                         </actions>
5650                 </permacrud>
5651         </class>
5652
5653         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
5654                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
5655                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5656                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5657                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
5658                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5659                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
5660                 </fields>
5661                 <links>
5662                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5663                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
5664                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
5665                 </links>
5666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5667                         <actions>
5668                                 <create permission="ADMIN_SERIAL_STREAM">
5669                                         <context link="distribution" field="holding_lib" />
5670                                 </create>
5671                                 <retrieve />
5672                                 <update permission="ADMIN_SERIAL_STREAM">
5673                                         <context link="distribution" field="holding_lib" />
5674                                 </update>
5675                                 <delete permission="ADMIN_SERIAL_STREAM">
5676                                         <context link="distribution" field="holding_lib" />
5677                                 </delete>
5678                         </actions>
5679                 </permacrud>
5680         </class>
5681
5682         <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">
5683                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
5684                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5685                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5686                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5687                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
5688                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
5689                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5690                 </fields>
5691                 <links>
5692                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5693                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
5694                 </links>
5695                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5696                         <actions>
5697                                 <create permission="ADMIN_SERIAL_STREAM">
5698                                         <context link="stream" jump="distribution" field="holding_lib" />
5699                                 </create>
5700                                 <retrieve permission="RECEIVE_SERIAL">
5701                                         <context link="stream" jump="distribution" field="holding_lib" />
5702                                 </retrieve>
5703                                 <update permission="ADMIN_SERIAL_STREAM">
5704                                         <context link="stream" jump="distribution" field="holding_lib" />
5705                                 </update>
5706                                 <delete permission="ADMIN_SERIAL_STREAM">
5707                                         <context link="stream" jump="distribution" field="holding_lib" />
5708                                 </delete>
5709                         </actions>
5710                 </permacrud>
5711         </class>
5712
5713         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
5714                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
5715                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5716                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5717                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5718                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5719                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5720                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5721                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
5722                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5723                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
5724                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
5725                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
5726                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
5727                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5728                 </fields>
5729                 <links>
5730                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5731                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5732                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5733                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
5734                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
5735                 </links>
5736                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5737                         <actions>
5738                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
5739                                         <context link="subscription" field="owning_lib" />
5740                                 </create>
5741                                 <retrieve/>
5742                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
5743                                         <context link="subscription" field="owning_lib" />
5744                                 </update>
5745                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
5746                                         <context link="subscription" field="owning_lib" />
5747                                 </delete>
5748                         </actions>
5749                 </permacrud>
5750         </class>
5751
5752         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
5753                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
5754                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5755                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
5756                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5757                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5758                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
5759                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
5760                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5761                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
5762                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
5763                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
5764                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
5765                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
5766                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
5767                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5768                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
5769                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5770                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
5771                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
5772                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
5773                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
5774                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
5775                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5776                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
5777                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5778                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
5779                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
5780                         <field reporter:label="Price" name="price" reporter:datatype="money" />
5781                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
5782                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
5783                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
5784                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
5785                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
5786                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
5787                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
5788                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
5789                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
5790                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5791                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5792                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5793                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
5794                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
5795                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5796                 </fields>
5797                 <links>
5798                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
5799                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
5800                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5801                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5802                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5803                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5804                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5805                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
5806                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
5807                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
5808                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
5809                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
5810                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
5811                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5812                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
5813                 </links>
5814                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5815                         <actions>
5816                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5817                                 <retrieve/>
5818                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5819                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5820                         </actions>
5821                 </permacrud>
5822         </class>
5823
5824         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
5825                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
5826                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5827                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5828                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5829                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5830                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5831                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
5832                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5833                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
5834                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
5835                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
5836                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
5837                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
5838                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5839                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
5840                 </fields>
5841                 <links>
5842                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5843                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5844                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5845                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5846                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
5847                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
5848                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
5849                 </links>
5850                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5851                         <actions>
5852                                 <create permission="ADMIN_SERIAL_ITEM">
5853                                         <context link="stream" jump="distribution" field="holding_lib" />
5854                                 </create>
5855                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5856                                         <context link="stream" jump="distribution" field="holding_lib" />
5857                                 </retrieve>
5858                                 <update permission="ADMIN_SERIAL_ITEM">
5859                                         <context link="stream" jump="distribution" field="holding_lib" />
5860                                 </update>
5861                                 <delete permission="ADMIN_SERIAL_ITEM">
5862                                         <context link="stream" jump="distribution" field="holding_lib" />
5863                                 </delete>
5864                         </actions>
5865                 </permacrud>
5866         </class>
5867
5868         <class id="sin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
5869                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
5870                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5871                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
5872                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5873                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5874                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5875                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5876                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5877                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5878                 </fields>
5879                 <links>
5880                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
5881                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5882                 </links>
5883                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5884                         <actions>
5885                                 <create permission="ADMIN_SERIAL_ITEM">
5886                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5887                                 </create>
5888                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5889                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5890                                 </retrieve>
5891                                 <update permission="ADMIN_SERIAL_ITEM">
5892                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5893                                 </update>
5894                                 <delete permission="ADMIN_SERIAL_ITEM">
5895                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5896                                 </delete>
5897                         </actions>
5898                 </permacrud>
5899         </class>
5900         <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">
5901                 <fields>
5902                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
5903                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
5904                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
5905                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
5906                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
5907                 </fields>
5908                 <links>
5909                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5910                 </links>
5911         </class>
5912         <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">
5913                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
5914                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5915                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
5916                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
5917                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
5918                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
5919                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
5920                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5921                 </fields>
5922                 <links>
5923                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5924                 </links>
5925         </class>
5926         <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">
5927                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5928                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5929                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5930                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5931                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5932                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5933                 </fields>
5934                 <links>
5935                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5936                 </links>
5937                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5938                         <actions>
5939                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5940                                         <context link="distribution" field="holding_lib" />
5941                                 </create>
5942                                 <retrieve/>
5943                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5944                                         <context link="distribution" field="holding_lib" />
5945                                 </update>
5946                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5947                                         <context link="distribution" field="holding_lib" />
5948                                 </delete>
5949                         </actions>
5950                 </permacrud>
5951         </class>
5952
5953         <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">
5954                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5955                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5956                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5957                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5958                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5959                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5960                 </fields>
5961                 <links>
5962                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5963                 </links>
5964                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5965                         <actions>
5966                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5967                                         <context link="distribution" field="holding_lib" />
5968                                 </create>
5969                                 <retrieve/>
5970                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5971                                         <context link="distribution" field="holding_lib" />
5972                                 </update>
5973                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5974                                         <context link="distribution" field="holding_lib" />
5975                                 </delete>
5976                         </actions>
5977                 </permacrud>
5978         </class>
5979
5980         <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">
5981                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5982                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5983                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5984                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5985                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5986                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5987                 </fields>
5988                 <links>
5989                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5990                 </links>
5991                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5992                         <actions>
5993                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5994                                         <context link="distribution" field="holding_lib" />
5995                                 </create>
5996                                 <retrieve/>
5997                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5998                                         <context link="distribution" field="holding_lib" />
5999                                 </update>
6000                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6001                                         <context link="distribution" field="holding_lib" />
6002                                 </delete>
6003                         </actions>
6004                 </permacrud>
6005         </class>
6006
6007         <class id="spt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::pattern_template" oils_persist:tablename="serial.pattern_template" reporter:label="Prediction Pattern Template">
6008                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6009                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6010                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6011                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6012                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6013                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6014                 </fields>
6015                 <links>
6016                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6017                 </links>
6018                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6019                         <actions>
6020                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6021                                 <retrieve/>
6022                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6023                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6024                         </actions>
6025                 </permacrud>
6026         </class>
6027
6028         <class id="ascecm" controller="open-ils.cstore open-ils.pcrud" 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">
6029                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6030                         <field name="id" reporter:datatype="id" />
6031                         <field name="owning_copy" reporter:datatype="link"/>
6032                         <field name="stat_cat" reporter:datatype="link"/>
6033                         <field name="stat_cat_entry" reporter:datatype="link"/>
6034                 </fields>
6035                 <links>
6036                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6037                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6038                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6039                 </links>
6040                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6041                         <actions>
6042                                 <retrieve/>
6043                         </actions>
6044                 </permacrud>
6045         </class>
6046         <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">
6047                 <fields oils_persist:primary="code">
6048                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6049                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6050                 </fields>
6051                 <links/>
6052         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6053             <actions>
6054                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6055                 <retrieve/>
6056                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6057                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6058             </actions>
6059         </permacrud>
6060         </class>
6061         <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">
6062                 <fields oils_persist:primary="code">
6063                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6064                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6065                 </fields>
6066                 <links/>
6067         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6068             <actions>
6069                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6070                 <retrieve/>
6071                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6072                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6073             </actions>
6074         </permacrud>
6075         </class>
6076         <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">
6077                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6078                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6079                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6080                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6081                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6082                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6083                 </fields>
6084                 <links>
6085             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6086         </links>
6087         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6088             <actions>
6089                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6090                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6091                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6092                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6093             </actions>
6094         </permacrud>
6095         </class>
6096         <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">
6097                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6098                         <field name="id" reporter:datatype="id" />
6099                         <field name="name" reporter:datatype="text"/>
6100                 </fields>
6101                 <links/>
6102         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6103             <actions>
6104                 <create permission="CREATE_LASSO" global_required="true"/>
6105                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
6106                 <update permission="UPDATE_LASSO" global_required="true"/>
6107                 <delete permission="DELETE_LASSO" global_required="true"/>
6108             </actions>
6109         </permacrud>
6110         </class>
6111         <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">
6112                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6113                         <field name="id" reporter:datatype="id" />
6114                         <field name="lasso" reporter:datatype="link"/>
6115                         <field name="org_unit" reporter:datatype="org_unit"/>
6116                 </fields>
6117                 <links>
6118                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6119                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6120                 </links>
6121         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6122             <actions>
6123                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
6124                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
6125                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
6126                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
6127             </actions>
6128         </permacrud>
6129         </class>
6130         <class id="aoupa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_proximity_adjustment" oils_persist:tablename="actor.org_unit_proximity_adjustment" reporter:label="Org Unit Proximity Adjustment">
6131                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6132                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6133                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6134                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6135                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6136                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6137                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6138                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6139                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
6140                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6141                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6142                 </fields>
6143                 <links>
6144                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6145                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6146                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6147                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6148                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6149                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6150                 </links>
6151         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6152             <actions>
6153                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6154                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6155                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6156                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6157             </actions>
6158         </permacrud>
6159         </class>
6160         <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">
6161                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6162                         <field name="id" reporter:datatype="id" />
6163                         <field name="from_org" reporter:datatype="org_unit"/>
6164                         <field name="to_org" reporter:datatype="org_unit"/>
6165                         <field name="prox" reporter:datatype="int" />
6166                 </fields>
6167                 <links>
6168                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6169                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6170                 </links>
6171         </class>
6172         <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">
6173                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6174                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6175                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6176                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6177                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6178                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6179                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6180                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6181                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6182                 </fields>
6183                 <links/>
6184         </class>
6185         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6186                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6187                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6188                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6189                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6190                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6191                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6192                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6193                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6194                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6195                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6196                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6197                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6198                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6199                 </fields>
6200                 <links>
6201                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6202                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6203                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6204                 </links>
6205         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6206             <actions>
6207                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6208                 <retrieve/>
6209                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6210                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6211             </actions>
6212         </permacrud>
6213         </class>
6214         <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">
6215                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6216                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6217                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6218                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6219                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6220                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6221                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6222                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6223                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6224                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6225                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6226                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6227                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6228                 </fields>
6229                 <links>
6230                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6231                 </links>
6232         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6233             <actions>
6234                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6235                 <retrieve/>
6236                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6237                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6238             </actions>
6239         </permacrud>
6240         </class>
6241         <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">
6242                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6243                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6244                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6245                         <field name="query_text" reporter:datatype="text"/>
6246                 </fields>
6247         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6248             <actions>
6249                 <retrieve/>
6250             </actions>
6251         </permacrud>
6252         </class>
6253
6254         <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">
6255                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6256                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6257                         <field name="owner" reporter:datatype="org_unit"/>
6258                         <field name="code" reporter:datatype="text"/>
6259                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6260                         <field name="create_date" reporter:datatype="timestamp"/>
6261                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6262                 </fields>
6263                 <links>
6264                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6265                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6266                 </links>
6267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6268             <actions>
6269                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6270                 <retrieve/>
6271                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6272                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6273             </actions>
6274         </permacrud>
6275         </class>
6276         <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">
6277                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6278                         <field name="id" reporter:datatype="id"/>
6279                         <field name="grp" reporter:datatype="link"/>
6280                         <field name="pos" reporter:datatype="int"/>
6281                         <field name="query" reporter:datatype="link"/>
6282                 </fields>
6283                 <links>
6284                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6285                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6286                 </links>
6287         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6288             <actions>
6289                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6290                     <context link="grp" field="owner"/>
6291                 </create>
6292                 <retrieve/>
6293                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6294                     <context link="grp" field="owner"/>
6295                 </update>
6296                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6297                     <context link="grp" field="owner"/>
6298                 </delete>
6299             </actions>
6300         </permacrud>
6301         </class>
6302
6303         <!-- A note: Please update alhr and ahopl when updating ahr -->
6304         <class id="ahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request" oils_persist:tablename="action.hold_request" reporter:core="true" reporter:label="Hold Request">
6305                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6306                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6307                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6308                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6309                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6310                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6311                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6312                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6313                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6314                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6315                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6316                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6317                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6318                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6319                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6320                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6321                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6322                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6323                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6324                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6325                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6326                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6327                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6328                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6329                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6330                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6331                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6332                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6333                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6334                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6335                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6336                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6337                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6338                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6339                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6340                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6341                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6342                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6343                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6344                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6345                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6346                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6347                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6348                 </fields>
6349                 <links>
6350                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6351                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6352                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6353                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6354                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6355                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6356                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6357                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6358                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6359                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6360                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6361                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6362                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6363                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6364                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6365                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6366                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6367                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6368                 </links>
6369                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6370                         <actions>
6371                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6372                         </actions>
6373                 </permacrud>
6374         </class>
6375         <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">
6376                 <oils_persist:source_definition><![CDATA[
6377                 SELECT
6378                         ahr.*,
6379                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6380                                 copy_location_order_position,
6381                         CASE WHEN au.alias IS NOT NULL THEN
6382                                 au.alias
6383                         ELSE
6384                                 au.first_given_name
6385                         END AS usr_alias_or_first_given_name,
6386                         au.first_given_name AS usr_first_given_name,
6387                         au.second_given_name AS usr_second_given_name,
6388                         au.family_name AS usr_family_name,
6389                         au.prefix AS usr_prefix,
6390                         au.suffix AS usr_suffix,
6391                         au.alias AS usr_alias,
6392                         CASE WHEN au.alias IS NOT NULL THEN
6393                                 au.alias
6394                         ELSE
6395                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6396                                         COALESCE(au.family_name, ''),
6397                                         COALESCE(au.suffix, ''),
6398                                         ', ',
6399                                         COALESCE(au.prefix, ''),
6400                                         COALESCE(au.first_given_name, ''),
6401                                         COALESCE(au.second_given_name, '')
6402                                 ], ' '), E'\\s+,', ',')
6403                         END AS usr_alias_or_display_name,
6404                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6405                                 COALESCE(au.family_name, ''),
6406                                 COALESCE(au.suffix, ''),
6407                                 ', ',
6408                                 COALESCE(au.prefix, ''),
6409                                 COALESCE(au.first_given_name, ''),
6410                                 COALESCE(au.second_given_name, '')
6411                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6412                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6413                                 AS call_number_label,
6414                         siss.label AS issuance_label,
6415                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6416                         ahcm_1.copy_count AS potential_copies
6417                 FROM action.hold_request ahr
6418                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6419                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6420                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6421                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6422                 JOIN actor.usr au ON (au.id = ahr.usr)
6423                 JOIN (
6424                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6425                         FROM asset.copy_location
6426                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6427                 LEFT JOIN actor.usr_standing_penalty ausp 
6428                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6429                 LEFT JOIN config.standing_penalty csp
6430                         ON (
6431                                 csp.id = ausp.standing_penalty AND 
6432                                 csp.block_list LIKE '%CAPTURE%' AND (
6433                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6434                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6435                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6436                                         )
6437                                 )
6438                         )
6439                 JOIN (
6440                         SELECT COUNT(target_copy) AS copy_count, hold
6441                         FROM action.hold_copy_map
6442                         GROUP BY 2
6443                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6444                 LEFT JOIN serial.issuance siss
6445                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6446                 LEFT JOIN asset.copy_location_order acplo
6447                         ON (acp.location = acplo.location AND
6448                                 acp.circ_lib = acplo.org)
6449                 WHERE
6450                         ahr.capture_time IS NULL AND
6451                         ahr.cancel_time IS NULL AND
6452                         csp.id IS NULL AND
6453                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6454                         acp.status IN (0,7)
6455                 ]]></oils_persist:source_definition>
6456                 <fields oils_persist:primary="id">
6457                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6458                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6459                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6460                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6461                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6462                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6463                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6464                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6465                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6466                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6467                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6468                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6469                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6470                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6471                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6472                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6473                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6474                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6475                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6476                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6477                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6478                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6479                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6480                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6481                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6482                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6483                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6484                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6485                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6486                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6487                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6488                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6489                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6490                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6491                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6492                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6493                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6494                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6495                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6496                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6497                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6498                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6499                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6500                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6501                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6502                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6503                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6504                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6505                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6506                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6507                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6508                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6509                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6510                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
6511                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
6512                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6513                 </fields>
6514                 <links>
6515                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6516                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6517                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6518                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6519                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6520                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6521                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6522                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6523                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6524                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6525                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6526                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6527                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6528                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6529                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6530                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6531                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6532                 </links>
6533                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6534                         <actions>
6535                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6536                         </actions>
6537                 </permacrud>
6538         </class>
6539         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
6540                 <oils_persist:source_definition><![CDATA[
6541                         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 AND current_copy IS NOT NULL AND fulfillment_time IS NULL GROUP BY current_copy)x USING (current_copy, capture_time)
6542                 ]]></oils_persist:source_definition>
6543                 <fields oils_persist:primary="id">
6544                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6545                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6546                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6547                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6548                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6549                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6550                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6551                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6552                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6553                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6554                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6555                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6556                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6557                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6558                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6559                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6560                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6561                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6562                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6563                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6564                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6565                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6566                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6567                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6568                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6569                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6570                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6571                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6572                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6573                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6574                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6575                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6576                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6577                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6578                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6579                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6580                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6581                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6582                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6583                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6584                 </fields>
6585                 <links>
6586                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6587                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6588                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6589                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6590                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6591                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6592                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6593                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6594                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6595                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6596                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6597                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6598                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6599                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6600                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6601                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6602                 </links>
6603         </class>
6604
6605         <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">
6606                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
6607                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6608                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
6609                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6610                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
6611                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
6612                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
6613                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
6614                 </fields>
6615                 <links>
6616                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6617                 </links>
6618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6619                         <actions>
6620                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
6621                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
6622                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
6623                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
6624                         </actions>
6625                 </permacrud>
6626         </class>
6627         <class id="combahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_hold_request" oils_persist:tablename="action.all_hold_request" reporter:core="true" reporter:label="Combined (Active &amp; Aged) Hold Request">
6628                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6629                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6630                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6631                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6632                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6633                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6634                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6635                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6636                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6637                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6638                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6639                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6640                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6641                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6642                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6643                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6644                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6645                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6646                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6647                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6648                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6649                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6650                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6651                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6652                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6653                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6654                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6655                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6656                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6657                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6658                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6659                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6660                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6661                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6662                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6663                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6664                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6665                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6666                 </fields>
6667                 <links>
6668                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6669                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6670                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6671                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6672                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6673                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6674                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6675                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6676                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6677                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6678                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6679                 </links>
6680                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6681                         <actions>
6682                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6683                         </actions>
6684                 </permacrud>
6685         </class>
6686         <class id="aahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::aged_hold_request" oils_persist:tablename="action.aged_hold_request" reporter:core="true" reporter:label="Aged Hold Request">
6687                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6688                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6689                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6690                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6691                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6692                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6693                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6694                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6695                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6696                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6697                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6698                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6699                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6700                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6701                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6702                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6703                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6704                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6705                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6706                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6707                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6708                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6709                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6710                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6711                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6712                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6713                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6714                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6715                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6716                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6717                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6718                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6719                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6720                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6721                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6722                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6723                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6724                 </fields>
6725                 <links>
6726                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6727                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6728                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6729                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6730                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6731                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6732                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6733                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6734                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6735                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6736                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6737                 </links>
6738                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6739                         <actions>
6740                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6741                         </actions>
6742                 </permacrud>
6743         </class>
6744
6745         <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">
6746                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
6747                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
6748                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
6749                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
6750                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
6751                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
6752                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
6753                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
6754                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
6755                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
6756                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
6757                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
6758                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
6759                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6760                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
6761                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
6762                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
6763                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6764                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
6765                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
6766                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
6767                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
6768                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
6769                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
6770                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
6771                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
6772                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
6773                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
6774                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
6775                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
6776                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
6777                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
6778                 </fields>
6779                 <links>
6780                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
6781                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
6782                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
6783                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
6784                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
6785                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
6786                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
6787                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
6788                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
6789                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
6790                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
6791                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
6792                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
6793                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
6794                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
6795                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
6796                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
6797                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
6798                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
6799                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
6800                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
6801                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
6802                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
6803                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
6804                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
6805                 </links>
6806         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6807             <actions>
6808                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
6809                 <retrieve />
6810                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
6811                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
6812             </actions>
6813         </permacrud>
6814         </class>
6815         <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">
6816                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
6817                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6818                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6819                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
6820                 </fields>
6821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6822                         <actions>
6823                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6824                                 <retrieve/>
6825                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6826                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6827                         </actions>
6828                 </permacrud>
6829         </class>
6830         <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">
6831                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
6832                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6833                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
6834                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
6835                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
6836                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
6837                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
6838                 </fields>
6839                 <links>
6840                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
6841                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6842                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
6843                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
6844                 </links>
6845                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6846                         <actions>
6847                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6848                                 <retrieve/>
6849                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6850                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6851                         </actions>
6852                 </permacrud>
6853         </class>
6854         <class id="ccnb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket" oils_persist:tablename="container.call_number_bucket" reporter:label="Call Number Bucket">
6855                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
6856                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6857                         <field name="btype" reporter:datatype="text"/>
6858                         <field name="id" reporter:datatype="id" />
6859                         <field name="name"  reporter:datatype="text"/>
6860                         <field name="description" reporter:datatype="text"/>
6861                         <field name="owner" reporter:datatype="link"/>
6862                         <field name="pub" reporter:datatype="bool"/>
6863                         <field name="create_time" reporter:datatype="timestamp" />
6864                         <field name="owning_lib" reporter:datatype="org_unit" />
6865                 </fields>
6866                 <links>
6867                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6868                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6869                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
6870                 </links>
6871                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6872                         <actions>
6873                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6874                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6875                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6876                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6877                         </actions>
6878                 </permacrud>
6879         </class>
6880         <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">
6881                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
6882                         <field name="id" reporter:datatype="id" />
6883                         <field name="bucket" reporter:datatype="link"/>
6884                         <field name="note" reporter:datatype="text" />
6885                 </fields>
6886                 <links>
6887                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
6888                 </links>
6889         </class>
6890         <class id="asc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
6891                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
6892                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6893                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6894                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6895                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6896                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6897                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6898                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6899                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6900                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6901                 </fields>
6902                 <links>
6903                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6904                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
6905                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
6906                 </links>
6907                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6908                         <actions>
6909                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6910                         </actions>
6911                 </permacrud>
6912         </class>
6913         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
6914                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
6915                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
6916                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6917                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
6918                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6919                 </fields>
6920                 <links>
6921                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6922                 </links>
6923                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6924                         <actions>
6925                                 <retrieve permission="VIEW_USER user_request.view">
6926                                         <context link="usr" field="home_ou" />
6927                                 </retrieve>
6928                         </actions>
6929                 </permacrud>
6930         </class>
6931     <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">
6932         <fields oils_persist:primary="field">
6933             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
6934             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
6935             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
6936         </fields>
6937         <links/>
6938         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6939             <actions>
6940                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
6941                 <retrieve />
6942                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
6943                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
6944             </actions>
6945         </permacrud>
6946     </class>
6947         <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">
6948                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
6949                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6950                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6951                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6952                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6953                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6954                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6955                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
6956                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6957                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6958                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6959                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6960                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
6961                 </fields>
6962                 <links>
6963                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6964                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
6965                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
6966                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
6967                 </links>
6968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6969             <actions>
6970                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6971                 <retrieve />
6972                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6973                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6974             </actions>
6975         </permacrud>
6976         </class>
6977         <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">
6978                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6979                         <field name="field" reporter:datatype="link"/>
6980                         <field name="id" reporter:datatype="id" />
6981                         <field name="source" reporter:datatype="link"/>
6982                         <field name="value"  reporter:datatype="text"/>
6983                 </fields>
6984                 <links>
6985                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6986                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6987                 </links>
6988         </class>
6989         <class id="cub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6990                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6991                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6992                         <field name="btype" reporter:datatype="text"/>
6993                         <field name="id" reporter:datatype="id" />
6994                         <field name="name"  reporter:datatype="text"/>
6995                         <field name="description" reporter:datatype="text"/>
6996                         <field name="owner" reporter:datatype="link"/>
6997                         <field name="pub" reporter:datatype="bool"/>
6998                         <field name="create_time" reporter:datatype="timestamp" />
6999                         <field name="owning_lib" reporter:datatype="org_unit" />
7000                 </fields>
7001                 <links>
7002                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7003                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7004                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7005                 </links>
7006                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7007                         <actions>
7008                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
7009                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
7010                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
7011                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
7012                         </actions>
7013                 </permacrud>
7014         </class>
7015         <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">
7016                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7017                         <field name="id" reporter:datatype="id" />
7018                         <field name="bucket" reporter:datatype="link"/>
7019                         <field name="note" reporter:datatype="text" />
7020                 </fields>
7021                 <links>
7022                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7023                 </links>
7024         </class>
7025         <class id="mcrp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_payment" oils_persist:tablename="money.credit_payment" reporter:label="House Credit Payment">
7026                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7027                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7028                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7029                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7030                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
7031                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7032                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7033                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7034                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7035                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7036                 </fields>
7037                 <links>
7038                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7039                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7040                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7041                 </links>
7042         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7043             <actions>
7044                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7045                     <context link="xact" jump="usr" field="home_ou"/>
7046                 </retrieve>
7047                         </actions>
7048                 </permacrud>
7049         </class>
7050         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7051                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7052                         <field name="id" reporter:datatype="id" />
7053                         <field name="ind1" />
7054                         <field name="ind2" />
7055                         <field name="record" />
7056                         <field name="subfield" />
7057                         <field name="tag" />
7058                         <field name="value" />
7059                 </fields>
7060                 <links>
7061                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7062                 </links>
7063         </class>
7064         <class id="aalink" controller="open-ils.cstore" oils_obj:fieldmapper="authority::authority_linking" oils_persist:tablename="authority.authority_linking" reporter:label="Authority to Authority Linking">
7065                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7066                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7067                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7068                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7069                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7070                 </fields>
7071                 <links>
7072                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7073                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7074                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7075                 </links>
7076         </class>
7077         <class id="cnct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::non_cataloged_type" oils_persist:tablename="config.non_cataloged_type" reporter:label="Non-cataloged Type">
7078                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7079                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7080                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7081                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7082                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7083                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7084                 </fields>
7085                 <links>
7086                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7087                 </links>
7088         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7089             <actions>
7090                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7091                 <retrieve/>
7092                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7093                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7094             </actions>
7095         </permacrud>
7096
7097         </class>
7098         <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">
7099                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7100                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7101                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7102                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7103                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7104                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7105                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7106                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7107                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7108                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7109                 </fields>
7110                 <links>
7111                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7112                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7113                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7114                 </links>
7115         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7116             <actions>
7117                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7118                 <retrieve/>
7119                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7120                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7121             </actions>
7122         </permacrud>
7123         </class>
7124         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
7125                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7126                         <field name="create_date" reporter:datatype="timestamp"/>
7127                         <field name="creator" reporter:datatype="link"/>
7128                         <field name="edit_date" reporter:datatype="timestamp"/>
7129                         <field name="editor" reporter:datatype="link"/>
7130                         <field name="id" reporter:datatype="id" />
7131                         <field name="pub" reporter:datatype="bool"/>
7132                         <field name="record" reporter:datatype="link"/>
7133                         <field name="value"  reporter:datatype="text"/>
7134                 </fields>
7135                 <links>
7136                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7137                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7138                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7139                 </links>
7140         </class>
7141         <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">
7142                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7143                         <field name="balance_owed" reporter:datatype="money" />
7144                         <field name="total_owed" reporter:datatype="money" />
7145                         <field name="total_paid" reporter:datatype="money" />
7146                         <field name="usr" reporter:datatype="link"/>
7147                 </fields>
7148                 <links>
7149                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7150                 </links>
7151         </class>
7152     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7153                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7154                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7155                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7156                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7157                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7158                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7159                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7160                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7161                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7162                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7163                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7164                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7165                 </fields>
7166                 <links>
7167                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7168                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7169                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7170                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7171                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7172                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7173                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7174                 </links>
7175         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7176             <actions>
7177                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7178             </actions>
7179         </permacrud>
7180         </class>
7181         <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">
7182                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7183                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7184                         <field name="quality" reporter:datatype="int" />
7185                         <field name="source" reporter:datatype="text"/>
7186                         <field name="transcendant" reporter:datatype="bool"/>
7187                         <field name="can_have_copies" reporter:datatype="bool"/>
7188                 </fields>
7189                 <links/>
7190         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7191             <actions>
7192                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7193                 <retrieve/>
7194                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7195                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7196             </actions>
7197         </permacrud>
7198         </class>
7199         <class id="mbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction" oils_persist:tablename="money.billable_xact" reporter:label="Billable Transaction">
7200                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7201                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7202                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7203                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7204                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7205                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7206                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7207                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7208                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7209                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7210                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7211                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7212                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7213                 </fields>
7214                 <links>
7215                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7216                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7217                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7218                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7219                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7220                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7221                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7222                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7223                 </links>
7224                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7225                         <actions>
7226                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7227                                         <context link="usr" field="home_ou" />
7228                                 </retrieve>
7229                         </actions>
7230                 </permacrud>
7231         </class>
7232         <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">
7233                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7234                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7235                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7236                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7237                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7238                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7239                 </fields>
7240                 <links>
7241                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7242                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7243                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7244                 </links>
7245         </class>
7246         <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">
7247                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7248                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7249                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7250                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7251                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7252                 </fields>
7253                 <links>
7254                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7255                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7256                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7257                 </links>
7258         </class>
7259         <class id="cubi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_item" oils_persist:tablename="container.user_bucket_item" reporter:label="User Bucket Item">
7260                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7261                         <field name="bucket" reporter:datatype="link"/>
7262                         <field name="id" reporter:datatype="id" />
7263                         <field name="target_user" reporter:datatype="link"/>
7264                         <field name="create_time" reporter:datatype="timestamp" />
7265                         <field name="pos" reporter:datatype="int" />
7266                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7267                 </fields>
7268                 <links>
7269                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7270                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7271             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7272                 </links>
7273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7274                         <actions>
7275                                 <retrieve permission="ADMIN_USER_BUCKET">
7276                     <context link="bucket" owning_lib="owning_lib"/>
7277                 </retrieve>
7278             </actions>
7279         </permacrud>
7280         </class>
7281         <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">
7282                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7283                         <field name="id" reporter:datatype="id" />
7284                         <field name="item" reporter:datatype="link"/>
7285                         <field name="note" reporter:datatype="text" />
7286                 </fields>
7287                 <links>
7288                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7289                 </links>
7290         </class>
7291         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7292                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7293                         <field name="balance_owed" reporter:datatype="money" />
7294                         <field name="total_owed" reporter:datatype="money" />
7295                         <field name="total_paid" reporter:datatype="money" />
7296                         <field name="usr" reporter:datatype="link"/>
7297                 </fields>
7298                 <links>
7299                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7300                 </links>
7301         </class>
7302         <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">
7303                 <fields oils_persist:primary="code" oils_persist:sequence="">
7304                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7305                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7306                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7307                 </fields>
7308                 <links/>
7309         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7310             <actions>
7311                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7312                 <retrieve/>
7313                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7314                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7315             </actions>
7316         </permacrud>
7317         </class>
7318         <class id="mwp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::work_payment" oils_persist:tablename="money.work_payment" reporter:label="Work Payment">
7319                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7320                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7321                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7322                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7323                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7324                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7325                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7326                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7327                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7328                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7329                 </fields>
7330                 <links>
7331                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7332                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7333                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7334                 </links>
7335         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7336             <actions>
7337                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7338                     <context link="xact" jump="usr" field="home_ou"/>
7339                 </retrieve>
7340                         </actions>
7341                 </permacrud>
7342         </class>
7343         <class id="mgp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::goods_payment" oils_persist:tablename="money.goods_payment" reporter:label="Goods Payment">
7344                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7345                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7346                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7347                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7348                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7349                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7350                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7351                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7352                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7353                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7354                 </fields>
7355                 <links>
7356                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7357                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7358                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7359                 </links>
7360         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7361             <actions>
7362                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7363                     <context link="xact" jump="usr" field="home_ou"/>
7364                 </retrieve>
7365                         </actions>
7366                 </permacrud>
7367         </class>
7368         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7369                 <fields oils_persist:primary="id" oils_persist:sequence="">
7370                         <field name="checkin_lib" reporter:datatype="link"/>
7371                         <field name="checkin_staff" reporter:datatype="link"/>
7372                         <field name="checkin_time" reporter:datatype="timestamp"/>
7373                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7374                         <field name="circ_staff" reporter:datatype="link"/>
7375                         <field name="desk_renewal" reporter:datatype="bool"/>
7376                         <field name="due_date" reporter:datatype="timestamp"/>
7377                         <field name="duration" reporter:datatype="interval"/>
7378                         <field name="duration_rule" reporter:datatype="link"/>
7379                         <field name="fine_interval" reporter:datatype="interval"/>
7380                         <field name="id" reporter:datatype="id" />
7381                         <field name="max_fine" reporter:datatype="money" />
7382                         <field name="max_fine_rule" reporter:datatype="link"/>
7383                         <field name="opac_renewal" reporter:datatype="bool"/>
7384                         <field name="phone_renewal" reporter:datatype="bool"/>
7385                         <field name="recurring_fine" reporter:datatype="money" />
7386                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7387                         <field name="renewal_remaining" reporter:datatype="int" />
7388             <field name="grace_period" reporter:datatype="interval" />
7389                         <field name="stop_fines" reporter:datatype="text"/>
7390                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7391                         <field name="target_copy" reporter:datatype="link"/>
7392                         <field name="usr" reporter:datatype="link"/>
7393                         <field name="xact_finish" reporter:datatype="timestamp" />
7394                         <field name="xact_start" reporter:datatype="timestamp" />
7395                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7396                         <field name="auto_renewal" reporter:datatype="bool"/>
7397                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7398                 </fields>
7399                 <links>
7400                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7401                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7402                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7403                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7404                 </links>
7405         </class>
7406         <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">
7407                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7408                         <field name="field" reporter:datatype="link"/>
7409                         <field name="id" reporter:datatype="id" />
7410                         <field name="source" reporter:datatype="link"/>
7411                         <field name="value" reporter:datatype="text"/>
7412                 </fields>
7413                 <links>
7414                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7415                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7416                 </links>
7417         </class>
7418         <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">
7419                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7420                         <field name="high" reporter:datatype="money" />
7421                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7422                         <field name="low" reporter:datatype="money" />
7423                         <field name="name" reporter:datatype="text"/>
7424                         <field name="normal" reporter:datatype="money" />
7425                         <field name="recurrence_interval" reporter:datatype="interval"/>
7426             <field name="grace_period" reporter:datatype="interval" />
7427                 </fields>
7428                 <links/>
7429         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7430             <actions>
7431                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7432                 <retrieve/>
7433                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7434                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7435             </actions>
7436         </permacrud>
7437         </class>
7438         <class id="mckp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::check_payment" oils_persist:tablename="money.check_payment" reporter:label="Check Payment">
7439                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7440                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7441                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7442                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7443                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7444                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7445                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7446                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7447                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7448                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7449                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7450                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7451                 </fields>
7452                 <links>
7453                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7454                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7455                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7456                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7457                 </links>
7458         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7459             <actions>
7460                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7461                     <context link="xact" jump="usr" field="home_ou"/>
7462                 </retrieve>
7463                         </actions>
7464                 </permacrud>
7465         </class>
7466         <class id="mdcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::debit_card_payment" oils_persist:tablename="money.debit_card_payment" reporter:label="Debit Card Payment">
7467                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7468                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7469                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7470                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7471                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7472                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7473                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7474                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7475                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7476                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7477                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7478                 </fields>
7479                 <links>
7480                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7481                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7482                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7483                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7484                 </links>
7485         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7486             <actions>
7487                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7488                     <context link="xact" jump="usr" field="home_ou"/>
7489                 </retrieve>
7490                         </actions>
7491                 </permacrud>
7492         </class>
7493         <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">
7494                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
7495                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
7496                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7497                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7498                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
7499                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
7500                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7501                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
7502                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
7503                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
7504                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
7505                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
7506                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
7507                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
7508                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
7509                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
7510                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
7511                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
7512                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
7513                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
7514                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
7515                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
7516                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
7517                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
7518                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
7519                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
7520                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
7521                         <field reporter:label="Price" name="price" reporter:datatype="money" />
7522                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
7523                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
7524                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
7525                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
7526                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
7527                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
7528                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
7529                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
7530                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7531                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7532                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7533                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
7534                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
7535                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
7536                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7537                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
7538                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
7539                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
7540                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
7541                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
7542                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
7543                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7544                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
7545                 </fields>
7546                 <links>
7547                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
7548                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
7549                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
7550                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7551                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7552                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
7553                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7554                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
7555                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
7556                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
7557                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
7558                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
7559                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
7560                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
7561                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
7562                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
7563                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
7564                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
7565                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
7566                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
7567                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
7568                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
7569                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
7570                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
7571                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
7572                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
7573                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
7574                 </links>
7575         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7576             <actions>
7577                 <create permission="CREATE_COPY">
7578                     <context link="call_number" field="owning_lib"/>
7579                 </create>
7580                 <retrieve/>
7581                 <update permission="UPDATE_COPY">
7582                     <context link="call_number" field="owning_lib"/>
7583                 </update>
7584                 <delete permission="DELETE_COPY">
7585                     <context link="call_number" field="owning_lib"/>
7586                 </delete>
7587             </actions>
7588         </permacrud>
7589         </class>
7590
7591         <class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::latest_inventory" oils_persist:tablename="asset.latest_inventory" reporter:core="true" reporter:label="Latest Inventory">
7592                 <fields oils_persist:primary="id" oils_persist:sequence="asset.latest_inventory_id_seq">
7593             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
7594                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
7595                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
7596                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
7597                 </fields>
7598                 <links>
7599                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
7600                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
7601                 </links>
7602         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7603             <actions>
7604                                 <create/>
7605                                 <retrieve/>
7606                                 <update/>
7607                                 <delete/>
7608             </actions>
7609         </permacrud>
7610         </class>
7611
7612         <class id="ccat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_alert_type" oils_persist:tablename="config.copy_alert_type" reporter:label="Copy Alert Type" oils_persist:restrict_primary="100">
7613                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
7614                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
7615                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
7616                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7617                         <field reporter:label="Name" name="name" reporter:datatype="text" />
7618                         <field reporter:label="State" name="state" reporter:datatype="text"/>
7619                         <field reporter:label="Event" name="event" reporter:datatype="text" />
7620                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
7621                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
7622                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
7623                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
7624                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
7625                 </fields>
7626                 <links>
7627                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
7628                 </links>
7629         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7630             <actions>
7631                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
7632                 <retrieve/>
7633                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
7634                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
7635             </actions>
7636         </permacrud>
7637         </class>
7638
7639         <class id="acas" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::copy_alert_suppress" oils_persist:tablename="actor.copy_alert_suppress" reporter:label="Copy Alert Suppression">
7640                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
7641                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
7642                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
7643                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
7644                 </fields>
7645                 <links>
7646                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7647                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
7648                 </links>
7649         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7650             <actions>
7651                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
7652                 <retrieve/>
7653                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
7654                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
7655             </actions>
7656         </permacrud>
7657         </class>
7658
7659         <class id="aca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_alert" oils_persist:tablename="asset.copy_alert" reporter:label="Copy Alert">
7660                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
7661                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
7662                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
7663                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
7664                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
7665                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
7666                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
7667                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7668                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
7669                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
7670                 </fields>
7671                 <links>
7672                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
7673                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
7674                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
7675                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
7676                 </links>
7677         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7678             <actions>
7679                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
7680                     <context link="copy" field="circ_lib"/>
7681                 </create>
7682                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
7683                     <context link="copy" field="circ_lib"/>
7684                                 </retrieve>
7685                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
7686                     <context link="copy" field="circ_lib"/>
7687                                 </update>
7688                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
7689                     <context link="copy" field="circ_lib"/>
7690                                 </delete>
7691             </actions>
7692         </permacrud>
7693         </class>
7694
7695         <class id="aaca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::active_copy_alert" oils_persist:tablename="asset.active_copy_alert" reporter:label="Active Copy Alert" oils_persist:readonly="true">
7696                 <fields oils_persist:primary="id">
7697                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
7698                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
7699                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
7700                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
7701                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
7702                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
7703                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7704                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
7705                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
7706                 </fields>
7707                 <links>
7708                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
7709                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
7710                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
7711                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
7712                 </links>
7713         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7714             <actions>
7715                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
7716                     <context link="copy" field="circ_lib"/>
7717                 </create>
7718                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
7719                     <context link="copy" field="circ_lib"/>
7720                                 </retrieve>
7721                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
7722                     <context link="copy" field="circ_lib"/>
7723                                 </update>
7724                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
7725                     <context link="copy" field="circ_lib"/>
7726                                 </delete>
7727             </actions>
7728         </permacrud>
7729         </class>
7730
7731         <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">
7732                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
7733                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
7734                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
7735                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7736                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7737                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
7738                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7739                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7740                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
7741                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
7742                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
7743                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
7744                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
7745                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
7746                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
7747                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
7748                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
7749                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
7750                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
7751                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
7752                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
7753                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
7754                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7755                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
7756                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
7757                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
7758                 </fields>
7759                 <links>
7760                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7761                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7762                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7763                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7764                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
7765                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
7766                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
7767                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
7768                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
7769                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
7770                 </links>
7771                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7772                         <actions>
7773                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7774                                 <retrieve />
7775                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7776                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7777                         </actions>
7778                 </permacrud>
7779         </class>
7780
7781         <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">
7782                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
7783                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
7784                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7785                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
7786                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
7787                 </fields>
7788                 <links/>
7789         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7790             <actions>
7791                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7792                 <retrieve/>
7793                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7794                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7795             </actions>
7796         </permacrud>
7797         </class>
7798         <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">
7799                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
7800                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
7801                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7802                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
7803                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
7804                 </fields>
7805                 <links/>
7806         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7807             <actions>
7808                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7809                 <retrieve/>
7810                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7811                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7812             </actions>
7813         </permacrud>
7814         </class>
7815         <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">
7816                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
7817                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7818                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7819                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7820                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7821                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
7822                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
7823                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
7824                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
7825                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
7826                 </fields>
7827                 <links>
7828                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
7829                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
7830                 </links>
7831         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7832             <actions>
7833                 <create permission="CREATE_PERM" global_required="true"/>
7834                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7835                 <update permission="UPDATE_PERM" global_required="true"/>
7836                 <delete permission="DELETE_PERM" global_required="true"/>
7837             </actions>
7838         </permacrud>
7839         </class>
7840         <class id="pgtde" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_tree_display_entry" oils_persist:tablename="permission.grp_tree_display_entry" reporter:label="Permission Group Tree Display Entry">
7841                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
7842                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7843                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
7844                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
7845                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
7846                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
7847                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7848                 </fields>
7849                 <links>
7850                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
7851                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7852                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7853                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
7854                 </links>
7855                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7856                         <actions>
7857                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
7858                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7859                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
7860                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
7861                         </actions>
7862                 </permacrud>
7863         </class>
7864         <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">
7865                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
7866                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
7867                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
7868                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
7869                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
7870                 </fields>
7871                 <links>
7872                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
7873                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
7874                 </links>
7875         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7876             <actions>
7877                 <create permission="ADMIN_SURVEY">
7878                     <context link="question" jump="survey" field="owner"/>
7879                 </create>
7880                 <retrieve/>
7881                 <update permission="ADMIN_SURVEY">
7882                     <context link="question" jump="survey" field="owner"/>
7883                 </update>
7884                 <delete permission="ADMIN_SURVEY">
7885                     <context link="question" jump="survey" field="owner"/>
7886                 </delete>
7887             </actions>
7888         </permacrud>
7889         </class>
7890         <class id="ancc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cataloged_circulation" oils_persist:tablename="action.non_cataloged_circulation" reporter:core="true" reporter:label="Non-cataloged Circulation">
7891                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
7892                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7893                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
7894                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
7895                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
7896                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
7897                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
7898                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
7899                 </fields>
7900                 <links>
7901                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
7902                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7903                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
7904                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7905                 </links>
7906                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7907                         <actions>
7908                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
7909                         </actions>
7910                 </permacrud>
7911         </class>
7912         <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">
7913                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7914                         <field name="balance_owed" reporter:datatype="money" />
7915                         <field name="total_owed" reporter:datatype="money" />
7916                         <field name="total_paid" reporter:datatype="money" />
7917                         <field name="usr" reporter:datatype="link"/>
7918                 </fields>
7919                 <links>
7920                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7921                 </links>
7922         </class>
7923         <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">
7924                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
7925                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
7926                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
7927                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
7928                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
7929                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
7930                 </fields>
7931                 <links>
7932                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7933                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7934                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7935                 </links>
7936         </class>
7937         <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">
7938                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
7939                         <field name="field" reporter:datatype="link"/>
7940                         <field name="id" reporter:datatype="id" />
7941                         <field name="source" reporter:datatype="link"/>
7942                         <field name="value" reporter:datatype="text"/>
7943                 </fields>
7944                 <links>
7945                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7946                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7947                 </links>
7948         </class>
7949         <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">
7950                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
7951                         <field name="field" reporter:datatype="link"/>
7952                         <field name="id" reporter:datatype="id" />
7953                         <field name="source" reporter:datatype="link"/>
7954                         <field name="value" reporter:datatype="text"/>
7955                 </fields>
7956                 <links>
7957                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7958                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7959                 </links>
7960         </class>
7961         <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">
7962                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
7963                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7964                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
7965                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
7966                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
7967                 </fields>
7968                 <links>
7969                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
7970                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7971                 </links>
7972         </class>
7973         <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">
7974                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
7975                         <field name="depth" reporter:datatype="int" />
7976                         <field name="grantable" reporter:datatype="bool"/>
7977                         <field name="grp" reporter:datatype="link"/>
7978                         <field name="id" reporter:datatype="id" />
7979                         <field name="perm" reporter:datatype="link"/>
7980                 </fields>
7981                 <links>
7982                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7983                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7984                 </links>
7985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7986             <actions>
7987                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
7988                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
7989                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
7990                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
7991             </actions>
7992         </permacrud>
7993         </class>
7994         <class id="ccb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
7995                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
7996                         <field name="items" oils_persist:virtual="true" />
7997                         <field name="btype" reporter:datatype="text"/>
7998                         <field name="id" reporter:datatype="id" />
7999                         <field name="name" reporter:datatype="text"/>
8000                         <field name="description" reporter:datatype="text"/>
8001                         <field name="owner" reporter:datatype="link"/>
8002                         <field name="pub" reporter:datatype="bool"/>
8003                         <field name="create_time" reporter:datatype="timestamp" />
8004                         <field name="owning_lib" reporter:datatype="org_unit" />
8005                 </fields>
8006                 <links>
8007                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8008                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8009                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8010                 </links>
8011                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8012                         <actions>
8013                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
8014                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
8015                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
8016                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
8017                         </actions>
8018                 </permacrud>
8019         </class>
8020         <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">
8021                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8022                         <field name="id" reporter:datatype="id" />
8023                         <field name="bucket" reporter:datatype="link"/>
8024                         <field name="note" reporter:datatype="text" />
8025                 </fields>
8026                 <links>
8027                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8028                 </links>
8029         </class>
8030         <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">
8031                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8032                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8033                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8034                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8035                 </fields>
8036                 <links>
8037                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8038                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8039                 </links>
8040         </class>
8041         <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">
8042                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8043                         <field name="depth" reporter:datatype="int"/>
8044                         <field name="grantable" reporter:datatype="bool"/>
8045                         <field name="id" reporter:datatype="id" />
8046                         <field name="perm" reporter:datatype="link"/>
8047                         <field name="usr" reporter:datatype="link"/>
8048                 </fields>
8049                 <links>
8050                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8051                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8052                 </links>
8053         </class>
8054         <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">
8055                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8056                         <field name="object_id" reporter:datatype="text"/>
8057                         <field name="grantable" reporter:datatype="bool"/>
8058                         <field name="id" reporter:datatype="id" />
8059                         <field name="perm" reporter:datatype="link"/>
8060                         <field name="usr" reporter:datatype="link"/>
8061                         <field name="object_type" reporter:datatype="text"/>
8062                 </fields>
8063                 <links>
8064                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8065                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8066                 </links>
8067         </class>
8068         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:core="true" reporter:label="Payments: All">
8069                 <fields oils_persist:primary="id" oils_persist:sequence="">
8070                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8071                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8072                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8073                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8074                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8075                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8076                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8077                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8078                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8079                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8080                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8081                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8082                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8083                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8084                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8085                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8086                 </fields>
8087                 <links>
8088                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8089                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8090                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8091                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8092                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8093                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8094                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8095                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8096                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8097                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8098                 </links>
8099         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8100             <actions>
8101                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8102                     <context link="xact" jump="usr" field="home_ou"/>
8103                 </retrieve>
8104                         </actions>
8105                 </permacrud>
8106         </class>
8107         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8108                 oils_obj:fieldmapper="money::aged_payment" 
8109                 oils_persist:tablename="money.aged_payment" 
8110                 reporter:label="Payments: Aged">
8111                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8112                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8113                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8114                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8115                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8116                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8117                         <field reporter:label="Aged Circulation" name="xact" reporter:datatype="link"/>
8118                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8119                 </fields>
8120                 <links>
8121                         <link field="xact" reltype="has_a" key="id" map="" class="acirc"/>
8122                 </links>
8123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8124                         <actions>
8125                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8126                                         <context link="xact" field="usr_home_ou"/>
8127                                 </retrieve>
8128                         </actions>
8129                 </permacrud>
8130         </class>
8131         <class id="mallp" controller="open-ils.cstore" 
8132                 oils_obj:fieldmapper="money::all_payments" 
8133                 oils_persist:tablename="money.all_payments" 
8134                 oils_persist="readonly" reporter:label="All Payments">
8135                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8136                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8137                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8138                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8139                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8140                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8141                         <field reporter:label="Aged Circulation" name="xact" reporter:datatype="link"/>
8142                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8143                 </fields>
8144                 <links>
8145                         <!-- 
8146                                 'xact' may link to a money.billabl_xact or to a money.aged_circulation.
8147                          -->
8148                 </links>
8149         </class>
8150
8151         <class id="mbp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::bnm_payment" oils_persist:tablename="money.bnm_payment_view" reporter:core="true" reporter:label="Payments: Brick-and-mortar">
8152                 <fields oils_persist:primary="id" oils_persist:sequence="">
8153                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8154                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8155                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8156                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8157                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8158                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8159                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8160                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8161                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8162                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8163                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8164                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8165                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8166                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8167                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8168                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8169                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8170                 </fields>
8171                 <links>
8172                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8173                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8174                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8175                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8176                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8177                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8178                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8179                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8180                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8181                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8182                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8183                 </links>
8184                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8185                         <actions>
8186                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8187                                         <context link="xact" jump="usr" field="home_ou"/>
8188                                 </retrieve>
8189                         </actions>
8190                 </permacrud>
8191         </class>
8192         <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">
8193                 <fields oils_persist:primary="id" oils_persist:sequence="">
8194                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8195                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8196                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8197                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8198                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8199                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8200                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8201                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8202                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8203                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8204                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8205                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8206                 </fields>
8207                 <links>
8208                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8209                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8210                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8211                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8212                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8213                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8214                 </links>
8215         </class>
8216         <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">
8217                 <fields oils_persist:primary="id" oils_persist:sequence="">
8218                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8219                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8220                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8221                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8222                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8223                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8224                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8225                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8226                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8227                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8228                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8229                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8230                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8231                 </fields>
8232                 <links>
8233                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8234                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8235                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8236                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8237                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8238                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8239                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8240                 </links>
8241         </class>
8242         <class id="cbrebi" controller="open-ils.cstore open-ils.pcrud" 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">
8243                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8244                         <field name="bucket" reporter:datatype="link"/>
8245                         <field name="id" reporter:datatype="id" />
8246                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8247                         <field name="create_time" reporter:datatype="timestamp" />
8248                         <field name="pos" reporter:datatype="int" />
8249                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8250                 </fields>
8251                 <links>
8252                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8253                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8254             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8255                 </links>
8256                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8257                         <actions>
8258                                 <retrieve permission="ADMIN_COPY_BUCKET">
8259                     <context link="bucket" owning_lib="owning_lib"/>
8260                 </retrieve>
8261             </actions>
8262         </permacrud>
8263         </class>
8264         <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">
8265                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8266                         <field name="id" reporter:datatype="id" />
8267                         <field name="item" reporter:datatype="link"/>
8268                         <field name="note" reporter:datatype="text" />
8269                 </fields>
8270                 <links>
8271                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8272                 </links>
8273         </class>
8274         <class id="asce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_entry" oils_persist:tablename="asset.stat_cat_entry" reporter:label="Item Stat Cat Entry">
8275                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8276                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8277                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8278                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8279                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8280                 </fields>
8281                 <links>
8282                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8283                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8284                 </links>
8285                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8286                         <actions>
8287                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8288                         </actions>
8289                 </permacrud>
8290         </class>
8291     <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">
8292         <fields oils_persist:primary="field">
8293             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8294             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8295             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8296         </fields>
8297         <links/>
8298         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8299             <actions>
8300                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8301                 <retrieve />
8302                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8303                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8304             </actions>
8305         </permacrud>
8306     </class>
8307         <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">
8308                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8309                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8310                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8311                 </fields>
8312                 <links/>
8313         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8314             <actions>
8315                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8316                 <retrieve/>
8317                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8318                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8319             </actions>
8320         </permacrud>
8321         </class>
8322
8323
8324         <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">
8325                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8326                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8327                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8328                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8329                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8330                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8331                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8332                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8333                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8334                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8335                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8336                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8337                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8338                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8339                 </fields>
8340                 <links>
8341                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8342                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8343                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8344                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8345                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8346                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8347                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8348                 </links>
8349         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8350             <actions>
8351                 <create permission="TRANSIT_COPY">
8352                     <context link="target_copy" field="owner"/>
8353                 </create>
8354                 <retrieve/>
8355                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8356                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8357             </actions>
8358         </permacrud>
8359         </class>
8360         <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">
8361                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8362                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8363                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8364                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8365                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8366                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8367                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8368                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8369                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8370                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8371                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8372                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8373                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8374                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8375                 </fields>
8376                 <links>
8377                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8378                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8379                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8380                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8381                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8382                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8383                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8384                 </links>
8385         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8386             <actions>
8387                 <create permission="TRANSIT_COPY" context_field="owner">
8388                     <context link="target_copy" field="circ_lib"/>
8389                 </create>
8390                 <retrieve/>
8391                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8392                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8393             </actions>
8394         </permacrud>
8395         </class>
8396         <class id="mb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billing" oils_persist:tablename="money.billing" reporter:label="Billing Line Item">
8397                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8398                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8399                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8400                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8401                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8402                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8403                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8404                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8405                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8406                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8407                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8408                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8409                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8410                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8411                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8412                 </fields>
8413                 <links>
8414                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8415                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8416                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8417                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8418                 </links>
8419         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8420             <actions>
8421                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8422                     <context link="xact" jump="usr" field="home_ou"/>
8423                 </retrieve>
8424                         </actions>
8425                 </permacrud>
8426         </class>
8427         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
8428                 oils_obj:fieldmapper="money::aged_billing" 
8429                 oils_persist:tablename="money.aged_billing" 
8430                 reporter:label="Aged Billing Line Item">
8431                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8432                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8433                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8434                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8435                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8436                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8437                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8438                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8439                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8440                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8441                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8442                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8443                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8444                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8445                 </fields>
8446                 <links>
8447                         <link field="xact" reltype="has_a" key="id" map="" class="acirc"/>
8448                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8449                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8450                 </links>
8451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8452                         <actions>
8453                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8454                                         <context link="xact" field="usr_home_ou"/>
8455                                 </retrieve>
8456                         </actions>
8457                 </permacrud>
8458         </class>
8459         <class id="mallb" controller="open-ils.cstore" 
8460                 oils_obj:fieldmapper="money::all_billings" 
8461                 oils_persist:tablename="money.all_billings" 
8462                 oils_persist="readonly" reporter:label="All Billing Line Items">
8463                 <fields oils_persist:primary="id" oils_persist:sequence="">
8464                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8465                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8466                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8467                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8468                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8469                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8470                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8471                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8472                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8473                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8474                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8475                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8476                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8477                 </fields>
8478                 <links>
8479                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8480                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8481                         <!-- 
8482                                 'xact' may link to a money.billabl_xact or to a money.aged_circulation.
8483                          -->
8484                 </links>
8485         </class>
8486         <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">
8487                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
8488                         <field name="grp" />
8489                         <field name="id" reporter:datatype="id" />
8490                         <field name="usr" />
8491                 </fields>
8492                 <links>
8493                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8494                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8495                 </links>
8496         </class>
8497         <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">
8498                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
8499                         <field name="id" reporter:datatype="id" />
8500                         <field name="fq_field" reporter:datatype="text"/>
8501                         <field name="identity_value" reporter:datatype="text"/>
8502                         <field name="translation" reporter:datatype="text"/>
8503                         <field name="string" reporter:datatype="text"/>
8504                 </fields>
8505                 <links>
8506                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
8507                 </links>
8508         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8509             <actions>
8510                 <create permission="CREATE_TRANSLATION" global_required="true"/>
8511                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
8512                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
8513                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
8514             </actions>
8515         </permacrud>
8516         </class>
8517         <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">
8518                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
8519                         <field name="id" reporter:datatype="id" />
8520                         <field name="fm_class" reporter:datatype="text"/>
8521                         <field name="field" reporter:datatype="text"/>
8522                         <field name="owner" reporter:datatype="org_unit"/>
8523                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
8524                 </fields>
8525                 <links>
8526                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8527                 </links>
8528         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8529             <actions>
8530                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
8531                 <retrieve/>
8532                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
8533                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
8534             </actions>
8535         </permacrud>
8536         </class>
8537         <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">
8538                 <fields oils_persist:primary="code">
8539                         <field name="code" reporter:datatype="id" />
8540                         <field name="marc_code" reporter:datatype="text"/>
8541                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8542                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8543                         <field name="rtl" reporter:datatype="bool"/>
8544                 </fields>
8545                 <links/>
8546         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8547             <actions>
8548                 <create permission="CREATE_LOCALE" global_required="true"/>
8549                 <retrieve/>
8550                 <update permission="UPDATE_LOCALE" global_required="true"/>
8551                 <delete permission="DELETE_LOCALE" global_required="true"/>
8552             </actions>
8553         </permacrud>
8554         </class>
8555         <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">
8556                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
8557                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
8558                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
8559                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
8560                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
8561                 </fields>
8562                 <links>
8563                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8564                 </links>
8565         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8566             <actions>
8567                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
8568                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
8569                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
8570                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
8571             </actions>
8572         </permacrud>
8573         </class>
8574
8575         <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">
8576                 <fields oils_persist:primary="id">
8577                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8578                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8579                 </fields>
8580                 <links/>
8581         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8582             <actions>
8583                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
8584                 <retrieve/>
8585                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
8586                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
8587             </actions>
8588         </permacrud>
8589         </class>
8590
8591         <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">
8592                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
8593                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8594                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8595                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
8596                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
8597                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
8598                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
8599                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
8600                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
8601                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8602                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
8603                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
8604                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
8605                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
8606                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
8607                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
8608                         <field reporter:label="Title" name="title" reporter:datatype="text" />
8609                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
8610                         <field reporter:label="Author" name="author" reporter:datatype="text" />
8611                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
8612                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
8613                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
8614                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
8615                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
8616                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
8617                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
8618                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8619                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
8620                 </fields>
8621                 <links>
8622                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8623                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
8624                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8625                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
8626                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
8627                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8628                 </links>
8629         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8630             <actions>
8631                 <create permission="user_request.create">
8632                     <context link="usr" field="home_ou"/>
8633                                 </create>
8634                 <retrieve permission="user_request.view">
8635                     <context link="usr" field="home_ou"/>
8636                                 </retrieve>
8637                 <update permission="user_request.update">
8638                     <context link="usr" field="home_ou"/>
8639                                 </update>
8640                 <delete permission="user_request.delete">
8641                     <context link="usr" field="home_ou"/>
8642                                 </delete>
8643             </actions>
8644         </permacrud>
8645         </class>
8646
8647         <class id="aurs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status" reporter:label="User Purchase Request with Status" oils_persist="readonly">
8648         <oils_persist:source_definition><![CDATA[
8649             SELECT r.*, CASE
8650                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
8651                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
8652                         WHEN l.state = 'received' THEN 5 -- Received
8653                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
8654                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
8655                         WHEN l.id IS NOT NULL THEN 2 -- Pending
8656                         WHEN l.id IS NULL THEN 1 -- New
8657                         ELSE 0 -- Error
8658                     END AS request_status
8659                     ,u.home_ou
8660             FROM      acq.user_request r
8661             JOIN actor.usr u ON (r.usr = u.id)
8662             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
8663             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
8664             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
8665         ]]></oils_persist:source_definition>
8666                 <fields oils_persist:primary="id">
8667                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8668                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8669                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
8670                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
8671                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
8672                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
8673                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
8674                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
8675                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8676                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
8677                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
8678                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
8679                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
8680                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
8681                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
8682                         <field reporter:label="Title" name="title" reporter:datatype="text" />
8683                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
8684                         <field reporter:label="Author" name="author" reporter:datatype="text" />
8685                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
8686                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
8687                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
8688                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
8689                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
8690                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
8691                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
8692                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8693                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
8694                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
8695                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
8696                 </fields>
8697                 <links>
8698                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8699                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
8700                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8701                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
8702                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
8703                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8704                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
8705                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
8706                 </links>
8707         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8708             <actions>
8709                 <retrieve permission="user_request.view">
8710                     <context link="usr" field="home_ou"/>
8711                                 </retrieve>
8712             </actions>
8713         </permacrud>
8714         </class>
8715
8716         <class id="aurst" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status_type" oils_persist:tablename="acq.user_request_status_type" reporter:label="Acquisition Patron Request Status Type">
8717                 <fields oils_persist:primary="id">
8718                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8719                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8720                 </fields>
8721                 <links/>
8722         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8723             <actions>
8724                 <retrieve/>
8725             </actions>
8726         </permacrud>
8727         </class>
8728
8729         <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">
8730                 <fields oils_persist:primary="code">
8731                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
8732                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8733                 </fields>
8734                 <links/>
8735         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8736             <actions>
8737                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8738                 <retrieve/>
8739                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8740                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8741             </actions>
8742         </permacrud>
8743         </class>
8744
8745         <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">
8746                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
8747                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
8748                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
8749                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
8750                         <field reporter:label="Ratio" name="ratio" />
8751                 </fields>
8752                 <links>
8753                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
8754                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
8755                 </links>
8756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8757                         <actions>
8758                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8759                                 <retrieve/>
8760                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8761                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8762                         </actions>
8763                 </permacrud>
8764         </class>
8765
8766         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
8767                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
8768                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8769                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8770                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8771                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8772                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8773                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
8774                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
8775                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
8776                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
8777                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8778                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8779                         <field reporter:label="URL" name="url" reporter:datatype="text" />
8780                         <field reporter:label="Email" name="email" reporter:datatype="text" />
8781                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
8782                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
8783                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
8784                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
8785                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
8786                 </fields>
8787                 <links>
8788                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8789                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8790             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
8791             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
8792                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
8793                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
8794                 </links>
8795         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8796             <actions>
8797                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
8798                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
8799                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
8800                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
8801             </actions>
8802         </permacrud>
8803         </class>
8804
8805         <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">
8806                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
8807                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8808                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8809                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8810                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8811                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8812                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8813                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8814                 </fields>
8815                 <links>
8816                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8817                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8818                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8819                 </links>
8820         </class>
8821
8822         <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">
8823                 <fields oils_persist:primary="code">
8824                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
8825                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8826                 </fields>
8827                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8828             <actions>
8829                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8830                 <retrieve/>
8831                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8832                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8833             </actions>
8834                 </permacrud>
8835         </class>
8836
8837         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
8838                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
8839                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
8840                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
8841                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8842                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
8843                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
8844                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
8845                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
8846                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
8847                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
8848                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
8849                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8850                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
8851                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
8852                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
8853                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
8854                 </fields>
8855                 <links>
8856                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
8857                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8858                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
8859                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
8860                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
8861                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
8862                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
8863                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
8864                 </links>
8865         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8866             <actions>
8867                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
8868                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
8869                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
8870                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
8871             </actions>
8872         </permacrud>
8873         </class>
8874
8875         <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">
8876                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
8877                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8878                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
8879                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8880                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
8881                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
8882                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
8883                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8884                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
8885                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
8886                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
8887                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
8888                 </fields>
8889                 <links>
8890                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
8891                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8892                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8893                 </links>
8894         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8895             <actions>
8896                 <create   permission="ADMIN_INVOICE">
8897                                         <context link="invoice" field="receiver"/>
8898                                 </create>
8899                 <retrieve permission="ADMIN_INVOICE">
8900                                         <context link="invoice" field="receiver"/>
8901                                 </retrieve>
8902                 <update   permission="ADMIN_INVOICE">
8903                                         <context link="invoice" field="receiver"/>
8904                                 </update>
8905                                 <delete   permission="ADMIN_INVOICE">
8906                                         <context link="invoice" field="receiver"/>
8907                                 </delete>
8908             </actions>
8909         </permacrud>
8910         </class>
8911
8912         <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">
8913                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
8914                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8915                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
8916                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8917                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8918                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
8919                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
8920                         <field reporter:label="Author" name="author" reporter:datatype="text" />
8921                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8922                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
8923                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
8924                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8925                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
8926                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
8927                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8928                 </fields>
8929                 <links>
8930                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
8931                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8932                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8933                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8934                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8935                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
8936                 </links>
8937         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8938             <actions>
8939                 <create   permission="ADMIN_INVOICE">
8940                                         <context link="invoice" field="receiver"/>
8941                                 </create>
8942                 <retrieve permission="ADMIN_INVOICE">
8943                                         <context link="invoice" field="receiver"/>
8944                                 </retrieve>
8945                 <update   permission="ADMIN_INVOICE">
8946                                         <context link="invoice" field="receiver"/>
8947                                 </update>
8948                                 <delete   permission="ADMIN_INVOICE">
8949                                         <context link="invoice" field="receiver"/>
8950                                 </delete>
8951             </actions>
8952         </permacrud>
8953         </class>
8954
8955         <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">
8956                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
8957                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
8958                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
8959                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
8960                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
8961                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8962                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8963                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
8964                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
8965                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
8966                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
8967                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
8968                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
8969                 </fields>
8970                 <links>
8971                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8972                 </links>
8973         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8974             <actions>
8975                 <create permission="ADMIN_PROVIDER">
8976                     <context link="provider" field="owner"/>
8977                 </create>
8978                 <retrieve permission="ADMIN_PROVIDER">
8979                     <context link="provider" field="owner"/>
8980                 </retrieve>
8981                 <update permission="ADMIN_PROVIDER">
8982                     <context link="provider" field="owner"/>
8983                 </update>
8984                 <delete permission="ADMIN_PROVIDER">
8985                     <context link="provider" field="owner"/>
8986                 </delete>
8987             </actions>
8988         </permacrud>
8989         </class>
8990
8991         <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">
8992                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
8993                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8994                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8995                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8996                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
8997                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
8998                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
8999         </fields>
9000                 <links>
9001                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9002                 </links>
9003         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9004             <actions>
9005                 <create permission="ADMIN_PROVIDER">
9006                     <context link="provider" field="owner"/>
9007                 </create>
9008                 <retrieve permission="ADMIN_PROVIDER">
9009                     <context link="provider" field="owner"/>
9010                 </retrieve>
9011                 <update permission="ADMIN_PROVIDER">
9012                     <context link="provider" field="owner"/>
9013                 </update>
9014                 <delete permission="ADMIN_PROVIDER">
9015                     <context link="provider" field="owner"/>
9016                 </delete>
9017             </actions>
9018         </permacrud>
9019     </class>
9020         <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">
9021                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9022                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9023                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
9024                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
9025                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9026                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9027                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9028                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
9029                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
9030                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9031                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
9032                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9033                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9034                 </fields>
9035                 <links>
9036                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9037                 </links>
9038         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9039             <actions>
9040                 <create permission="ADMIN_PROVIDER">
9041                     <context link="contact" jump='provider' field="owner"/>
9042                 </create>
9043                 <retrieve permission="ADMIN_PROVIDER">
9044                     <context link="contact" jump='provider' field="owner"/>
9045                 </retrieve>
9046                 <update permission="ADMIN_PROVIDER">
9047                     <context link="contact" jump='provider' field="owner"/>
9048                 </update>
9049                 <delete permission="ADMIN_PROVIDER">
9050                     <context link="contact" jump='provider' field="owner"/>
9051                 </delete>
9052             </actions>
9053         </permacrud>
9054         </class>
9055
9056         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
9057                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9058                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9059                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9060                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9061                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9062                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9063                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9064                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9065                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9066                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9067                 </fields>
9068                 <links>
9069                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9070                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9071                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9072                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9073                 </links>
9074         </class>
9075
9076         <class id="acqfc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_calendar" oils_persist:tablename="acq.fiscal_calendar" reporter:label="Fiscal Calendar">
9077                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9078                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9079                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9080                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9081                 </fields>
9082                 <links>
9083             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9084                 </links>
9085                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9086                         <actions>
9087                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9088                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9089                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9090                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9091                         </actions>
9092                 </permacrud>
9093         </class>
9094
9095         <class id="acqfy" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_year" oils_persist:tablename="acq.fiscal_year" reporter:label="Fiscal Year">
9096                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9097                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9098                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9099                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9100                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9101                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9102                 </fields>
9103                 <links>
9104                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9105                 </links>
9106                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9107                         <actions>
9108                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9109                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9110                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9111                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9112                         </actions>
9113                 </permacrud>
9114         </class>
9115
9116         <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">
9117                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9118                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9119                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
9120                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
9121                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
9122                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9123                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9124                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9125                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9126                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9127                 </fields>
9128                 <links>
9129                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9130                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9131             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9132             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9133                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9134                 </links>
9135         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9136             <actions>
9137                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9138                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9139                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9140                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9141             </actions>
9142         </permacrud>
9143         </class>
9144
9145         <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">
9146                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9147                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9148                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
9149                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9150                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9151                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9152                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9153                 </fields>
9154                 <links>
9155                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9156                 </links>
9157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9158                         <actions>
9159                                 <create permission="ADMIN_FUNDING_SOURCE">
9160                     <context link="funding_source" field="owner"/>
9161                 </create>
9162                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9163                     <context link="funding_source" field="owner"/>
9164                 </retrieve>
9165                                 <update permission="ADMIN_FUNDING_SOURCE">
9166                     <context link="funding_source" field="owner"/>
9167                 </update>
9168                                 <delete permission="ADMIN_FUNDING_SOURCE">
9169                     <context link="funding_source" field="owner"/>
9170                 </delete>
9171                         </actions>
9172                 </permacrud>
9173         </class>
9174
9175         <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">
9176                 <fields oils_persist:primary="id">
9177                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9178                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9179                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9180                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9181                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9182                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9183                 </fields>
9184                 <links>
9185                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9186                 </links>
9187         </class>
9188
9189         <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">
9190                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9191                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9192                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9193                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9194                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9195                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9196                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9197                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9198                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
9199                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9200                 </fields>
9201                 <links>
9202                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9203                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9204                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9205                 </links>
9206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9207                         <actions>
9208                                 <create permission="ADMIN_ACQ_FUND">
9209                     <context link="fund" field="org"/>
9210                 </create>
9211                                 <retrieve permission="ADMIN_ACQ_FUND">
9212                     <context link="fund" field="org"/>
9213                 </retrieve>
9214                                 <update permission="ADMIN_ACQ_FUND">
9215                     <context link="fund" field="org"/>
9216                 </update>
9217                                 <delete permission="ADMIN_ACQ_FUND">
9218                     <context link="fund" field="org"/>
9219                 </delete>
9220                         </actions>
9221                 </permacrud>
9222         </class>
9223
9224         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9225                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9226                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9227                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
9228                         <field reporter:label="Name" name="name" reporter:datatype="text" />
9229                         <field reporter:label="Year" name="year" reporter:datatype="int" />
9230                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
9231                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9232                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9233                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9234                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9235                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9236                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9237                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9238                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9239                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9240                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9241                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9242                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9243                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9244                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9245                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9246                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9247                 </fields>
9248                 <links>
9249                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9250                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9251             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9252             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9253             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9254             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9255             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9256             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9257             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9258             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9259             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9260                 </links>
9261         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9262             <actions>
9263                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9264                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9265                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9266                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9267             </actions>
9268         </permacrud>
9269         </class>
9270
9271         <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">
9272                 <fields oils_persist:primary="fund">
9273                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9274                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9275                 </fields>
9276                 <links>
9277                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9278                 </links>
9279         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9280             <actions>
9281                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9282                                         <context link="fund" field="org" />
9283                 </retrieve>
9284             </actions>
9285         </permacrud>
9286         </class>
9287
9288         <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">
9289                 <fields oils_persist:primary="fund">
9290                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9291                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9292                 </fields>
9293                 <links>
9294                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9295                 </links>
9296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9297             <actions>
9298                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9299                                         <context link="fund" field="org" />
9300                 </retrieve>
9301             </actions>
9302         </permacrud>
9303         </class>
9304
9305         <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">
9306                 <fields oils_persist:primary="fund">
9307                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9308                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9309                 </fields>
9310                 <links>
9311                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9312                 </links>
9313         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9314             <actions>
9315                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9316                                         <context link="fund" field="org" />
9317                 </retrieve>
9318             </actions>
9319         </permacrud>
9320         </class>
9321
9322         <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">
9323                 <fields oils_persist:primary="fund">
9324                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9325                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9326                 </fields>
9327                 <links>
9328                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9329                 </links>
9330         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9331             <actions>
9332                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9333                                         <context link="fund" field="org" />
9334                 </retrieve>
9335             </actions>
9336         </permacrud>
9337         </class>
9338
9339         <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">
9340                 <fields oils_persist:primary="fund">
9341                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9342                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
9343                 </fields>
9344                 <links>
9345                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9346                 </links>
9347         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9348             <actions>
9349                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9350                                         <context link="fund" field="org" />
9351                 </retrieve>
9352             </actions>
9353         </permacrud>
9354         </class>
9355
9356    <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">
9357         <fields oils_persist:primary="fund">
9358             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9359             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9360         </fields>
9361         <links>
9362             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9363         </links>
9364     </class>
9365
9366    <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">
9367         <fields oils_persist:primary="fund">
9368             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9369             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
9370         </fields>
9371         <links>
9372             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9373         </links>
9374     </class>
9375
9376    <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">
9377         <fields oils_persist:primary="fund">
9378             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9379             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9380         </fields>
9381         <links>
9382             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9383         </links>
9384     </class>
9385
9386    <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">
9387         <fields oils_persist:primary="fund">
9388             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9389             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
9390         </fields>
9391         <links>
9392             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9393         </links>
9394     </class>
9395
9396    <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">
9397         <fields oils_persist:primary="fund">
9398             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9399             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
9400         </fields>
9401         <links>
9402             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9403         </links>
9404     </class>
9405
9406         <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">
9407                 <fields oils_persist:primary="funding_source">
9408                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9409                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
9410                 </fields>
9411                 <links>
9412                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9413                 </links>
9414         </class>
9415
9416         <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">
9417                 <fields oils_persist:primary="funding_source">
9418                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9419                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
9420                 </fields>
9421                 <links>
9422                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9423                 </links>
9424         </class>
9425
9426         <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">
9427                 <fields oils_persist:primary="funding_source">
9428                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9429                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
9430                 </fields>
9431                 <links>
9432                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9433                 </links>
9434         </class>
9435
9436         <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">
9437                 <fields oils_persist:primary="fund">
9438                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9439                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
9440                 </fields>
9441                 <links>
9442                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9443                 </links>
9444         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9445             <actions>
9446                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9447                                         <context link="fund" field="org" />
9448                 </retrieve>
9449             </actions>
9450         </permacrud>
9451     </class>
9452     <class id="acqfsum" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_summary" reporter:label="Fund Summary" reporter:core="true" oils_persist:readonly="true">
9453         <oils_persist:source_definition><![CDATA[
9454             SELECT
9455                 acqf.*,
9456                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
9457                 COALESCE(acqfst.amount, 0.00) AS spent_total,
9458                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
9459                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
9460             FROM
9461                 acq.fund acqf
9462                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
9463                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
9464                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
9465                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
9466         ]]></oils_persist:source_definition>
9467         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9468             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9469             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
9470             <field reporter:label="Name" name="name" reporter:datatype="text" />
9471             <field reporter:label="Year" name="year" reporter:datatype="int" />
9472             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
9473             <field reporter:label="Code" name="code" reporter:datatype="text" />
9474             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9475             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9476             <field reporter:label="Active" name="active" reporter:datatype="bool" />
9477             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9478             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9479
9480             <!-- non fund-native fields -->
9481             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
9482             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
9483             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
9484             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
9485         </fields>
9486         <links>
9487             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
9488             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9489             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9490         </links>
9491         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9492             <actions>
9493                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9494             </actions>
9495         </permacrud>
9496         </class>
9497         <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">
9498                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
9499                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
9500                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9501                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9502                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9503                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
9504                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9505                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
9506                 </fields>
9507                 <links>
9508                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
9509                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9510                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9511                 </links>
9512                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9513                         <actions>
9514                                 <create permission="ADMIN_ACQ_FUND">
9515                     <context link="fund" field="org"/>
9516                 </create>
9517                                 <retrieve permission="ADMIN_ACQ_FUND">
9518                     <context link="fund" field="org"/>
9519                 </retrieve>
9520                                 <update permission="ADMIN_ACQ_FUND">
9521                     <context link="fund" field="org"/>
9522                 </update>
9523                                 <delete permission="ADMIN_ACQ_FUND">
9524                     <context link="fund" field="org"/>
9525                 </delete>
9526                         </actions>
9527                 </permacrud>
9528         </class>
9529
9530     <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">
9531         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
9532             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
9533             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9534             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
9535             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
9536             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
9537             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
9538             <field reporter:label="Note" name="note" reporter:datatype="text" />
9539             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
9540         </fields>
9541         <links>
9542             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
9543             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9544             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9545         </links>
9546                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9547                         <actions>
9548                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
9549                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
9550                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
9551                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
9552                         </actions>
9553                 </permacrud>
9554     </class>
9555
9556         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
9557                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
9558                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
9559                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
9560                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
9561                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
9562                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9563                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9564                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
9565                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
9566                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9567                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9568                 </fields>
9569                 <links>
9570                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9571                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9572                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9573                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9574                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
9575                 </links>
9576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9577                         <actions>
9578                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
9579                         </actions>
9580                 </permacrud>
9581         </class>
9582
9583         <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">
9584                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
9585                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9586                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
9587                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9588                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9589                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
9590                 </fields>
9591                 <links>
9592                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9593                 </links>
9594                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9595                         <actions>
9596                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
9597                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
9598                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
9599                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
9600                         </actions>
9601                 </permacrud>
9602         </class>
9603
9604         <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">
9605                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
9606                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9607                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
9608                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9609                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9610                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9611                         <field reporter:label="State" name="state" reporter:datatype="text" />
9612                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
9613                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9614                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9615                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
9616                         <field reporter:label="Name" name="name" reporter:datatype="text" />
9617                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9618                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9619                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
9620                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
9621                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
9622                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
9623                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
9624                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
9625                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9626                 </fields>
9627                 <links>
9628                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9629                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9630                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9631                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
9632                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9633                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
9634                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
9635                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
9636                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
9637                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9638                 </links>
9639                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9640                         <actions>
9641                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
9642                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
9643                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
9644                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
9645                         </actions>
9646                 </permacrud>
9647         </class>
9648
9649         <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">
9650                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
9651                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
9652                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
9653                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
9654                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
9655                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9656                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9657                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
9658                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
9659                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9660                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
9661                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9662                         <field reporter:label="State" name="state" reporter:datatype="text"/>
9663                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
9664                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9665                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9666                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9667                 </fields>
9668                 <links>
9669                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
9670                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9671                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9672                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9673                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
9674                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9675                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9676                 </links>
9677                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9678             <actions>
9679                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
9680             </actions>
9681                 </permacrud>
9682         </class>
9683
9684         <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">
9685                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
9686                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9687                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
9688                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9689                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9690                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9691                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9692                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
9693                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
9694                 </fields>
9695                 <links>
9696                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9697                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9698                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9699                 </links>
9700                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9701             <actions>
9702                 <create permission="CREATE_PURCHASE_ORDER">
9703                     <context link="purchase_order" field="ordering_agency"/>
9704                 </create>
9705                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9706                     <context link="purchase_order" field="ordering_agency"/>
9707                 </retrieve>
9708                 <update permission="CREATE_PURCHASE_ORDER">
9709                     <context link="purchase_order" field="ordering_agency"/>
9710                 </update>
9711                 <delete permission="CREATE_PURCHASE_ORDER">
9712                     <context link="purchase_order" field="ordering_agency"/>
9713                 </delete>
9714             </actions>
9715                 </permacrud>
9716         </class>
9717
9718         <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">
9719                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
9720                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9721                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9722                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9723                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
9724                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9725                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9726                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9727                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
9728                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9729                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9730                 </fields>
9731                 <links>
9732                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9733                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9734                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9735                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9736                 </links>
9737                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9738             <actions>
9739                 <create permission="CREATE_PURCHASE_ORDER">
9740                     <context link="purchase_order" field="ordering_agency"/>
9741                 </create>
9742                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9743                     <context link="purchase_order" field="ordering_agency"/>
9744                 </retrieve>
9745                 <update permission="CREATE_PURCHASE_ORDER">
9746                     <context link="purchase_order" field="ordering_agency"/>
9747                 </update>
9748                 <delete permission="CREATE_PURCHASE_ORDER">
9749                     <context link="purchase_order" field="ordering_agency"/>
9750                 </delete>
9751             </actions>
9752                 </permacrud>
9753         </class>
9754
9755         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
9756                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
9757                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
9758                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
9759                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
9760                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
9761                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9762                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9763                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9764                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
9765                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
9766                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
9767                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
9768                         <field reporter:label="State" name="state" reporter:datatype="text" />
9769                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9770                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9771                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
9772                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9773                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
9774                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
9775                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
9776                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9777                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9778                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
9779                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
9780                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
9781                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
9782                 </fields>
9783                 <links>
9784                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
9785                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9786                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9787                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9788                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9789                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
9790                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
9791                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
9792                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
9793                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
9794                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9795                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
9796                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9797                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
9798                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
9799                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
9800                 </links>
9801                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9802                         <actions>
9803                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
9804                                         <context link="purchase_order" field="ordering_agency"/>
9805                                         <context link="picklist" field="org_unit"/>
9806                                 </retrieve>
9807                         </actions>
9808                 </permacrud>
9809         </class>
9810
9811         <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">
9812                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
9813                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
9814                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
9815                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
9816                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
9817                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9818                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
9819                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
9820                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9821                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9822                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
9823                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
9824                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9825                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
9826                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
9827                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
9828                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
9829                         <field reporter:label="State" name="state" reporter:datatype="text"/>
9830                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
9831                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9832                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
9833                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
9834                 </fields>
9835                 <links>
9836                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
9837                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9838                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9839                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
9840                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9841                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9842                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
9843                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
9844                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9845                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9846                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
9847                 </links>
9848                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9849                         <actions>
9850                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9851                                         <context link="purchase_order" field="ordering_agency"/>
9852                                         <context link="picklist" field="org_unit"/>
9853                                 </retrieve>
9854                         </actions>
9855                 </permacrud>
9856         </class>
9857
9858         <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">
9859                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
9860                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
9861                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9862                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9863                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9864                 </fields>
9865                 <links>
9866                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9867                 </links>
9868                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9869                         <actions>
9870                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9871                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
9872                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9873                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9874                         </actions>
9875                 </permacrud>
9876         </class>
9877
9878         <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">
9879                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
9880                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
9881                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
9882                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9883                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9884                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9885                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9886                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9887                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
9888                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
9889                 </fields>
9890                 <links>
9891                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9892                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9893                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9894                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
9895                 </links>
9896         </class>
9897
9898         <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">
9899                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
9900                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
9901                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
9902                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
9903                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
9904                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
9905                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
9906                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
9907                 </fields>
9908                 <links>
9909                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9910                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
9911                 </links>
9912         </class>
9913
9914         <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">
9915                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
9916                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
9917                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9918                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
9919                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
9920                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
9921                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
9922                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
9923                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9924                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
9925                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
9926                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
9927                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
9928                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9929                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
9930                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9931                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
9932                 </fields>
9933                 <links>
9934                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9935                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
9936                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9937                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9938                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9939                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9940                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9941                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9942                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
9943                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
9944                 </links>
9945         </class>
9946
9947         <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">
9948                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9949                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9950                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9951                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9952                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9953                 </fields>
9954                 <links/>
9955                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9956                         <actions>
9957                                 <retrieve />
9958                         </actions>
9959                 </permacrud>
9960         </class>
9961
9962         <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">
9963                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9964                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9965                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9966                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9967                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9968                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9969             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
9970                 </fields>
9971                 <links/>
9972         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9973             <actions>
9974                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9975                 <retrieve />
9976                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9977                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9978             </actions>
9979         </permacrud>
9980         </class>
9981
9982         <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">
9983                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9984                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9985                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9986                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9987                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9988                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9989                 </fields>
9990                 <links/>
9991         </class>
9992         <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">
9993                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9994                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9995                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9996                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9997                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9998                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9999                 </fields>
10000                 <links>
10001                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10002                 </links>
10003         </class>
10004
10005         <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">
10006             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10007                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10008                 <field reporter:label="Code" name="code" reporter:datatype="text" />
10009                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10010                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10011                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10012                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10013         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10014
10015             </fields>
10016             <links>
10017                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10018             </links>
10019             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10020                 <actions>
10021                     <create permission="ADMIN_PROVIDER">
10022                         <context link="provider" field="owner"/>
10023                     </create>
10024                     <retrieve permission="ADMIN_PROVIDER">
10025                         <context link="provider" field="owner"/>
10026                     </retrieve>
10027                     <update permission="ADMIN_PROVIDER">
10028                         <context link="provider" field="owner"/>
10029                     </update>
10030                     <delete permission="ADMIN_PROVIDER">
10031                         <context link="provider" field="owner"/>
10032                     </delete>
10033                 </actions>
10034             </permacrud>
10035         </class>
10036         
10037         <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">
10038             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10039                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10040                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10041                 <field reporter:label="Name" name="name" reporter:datatype="text" />
10042                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
10043             </fields>
10044             <links>
10045                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10046             </links>
10047             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10048                 <actions>
10049                     <create permission="ADMIN_PROVIDER">
10050                         <context link="provider" field="owner"/>
10051                     </create>
10052                     <retrieve permission="ADMIN_PROVIDER">
10053                         <context link="provider" field="owner"/>
10054                     </retrieve>
10055                     <update permission="ADMIN_PROVIDER">
10056                         <context link="provider" field="owner"/>
10057                     </update>
10058                     <delete permission="ADMIN_PROVIDER">
10059                         <context link="provider" field="owner"/>
10060                     </delete>
10061                 </actions>
10062             </permacrud>
10063         </class>
10064         
10065         <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">
10066             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10067                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10068                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10069                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10070                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10071                 </fields>
10072                 <links/>
10073         </class>
10074
10075         <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">
10076                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10077                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10078                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
10079                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
10080                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10081                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10082                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10083                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10084                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
10085                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10086                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
10087                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10088                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10089                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10090                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10091                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes"/>
10092                 </fields>
10093                 <links>
10094                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10095                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10096                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10097                 </links>
10098         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10099             <actions>
10100                 <create permission="ADMIN_PROVIDER">
10101                     <context link="provider" field="owner"/>
10102                 </create>
10103                 <retrieve permission="ADMIN_PROVIDER">
10104                     <context link="provider" field="owner"/>
10105                 </retrieve>
10106                 <update permission="ADMIN_PROVIDER">
10107                     <context link="provider" field="owner"/>
10108                 </update>
10109                 <delete permission="ADMIN_PROVIDER">
10110                     <context link="provider" field="owner"/>
10111                 </delete>
10112             </actions>
10113         </permacrud>
10114         </class>
10115
10116         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10117                 oils_obj:fieldmapper="acq::edi_attr" 
10118                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10119                 <fields oils_persist:primary="key">
10120                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10121                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10122                 </fields>
10123         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10124             <actions>
10125                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10126                 <retrieve/>
10127                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10128                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10129             </actions>
10130         </permacrud>
10131         </class>
10132         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10133                 oils_obj:fieldmapper="acq::edi_attr_set" 
10134                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10135                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10136                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10137                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10138                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10139                 </fields>
10140                 <links>
10141                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10142                 </links>
10143         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10144             <actions>
10145                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10146                 <retrieve/>
10147                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10148                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10149             </actions>
10150         </permacrud>
10151         </class>
10152         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10153                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10154                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10155                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10156                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10157                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10158                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10159                 </fields>
10160                 <links>
10161                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10162                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10163                 </links>
10164         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10165             <actions>
10166                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10167                 <retrieve/>
10168                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10169                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10170             </actions>
10171         </permacrud>
10172         </class>
10173
10174
10175         <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">
10176                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10177                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10178                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10179                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10180                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10181                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10182                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10183                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10184                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10185                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10186                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10187                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10188                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10189                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10190                 </fields>
10191                 <links>
10192                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10193                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10194                 </links>
10195         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10196             <actions>
10197                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10198                     <context link="account" jump="provider" field="owner"/>
10199                 </retrieve>
10200                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10201                     <context link="account" jump="provider" field="owner"/>
10202                 </update>
10203                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10204                     <context link="account" jump="provider" field="owner"/>
10205                 </delete>
10206             </actions>
10207         </permacrud>
10208         </class>
10209
10210
10211         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
10212                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10213                         <field name="id" reporter:datatype="id" />
10214                         <field name="parent" reporter:datatype="link"/>
10215                         <field name="owner" reporter:datatype="link"/>
10216                         <field name="create_time" reporter:datatype="timestamp"/>
10217                         <field name="name" reporter:datatype="text"/>
10218                         <field name="shared" reporter:datatype="bool"/>
10219                         <field name="share_with" reporter:datatype="link"/>
10220                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10221                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10222                 </fields>
10223                 <links>
10224                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10225                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10226                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10227                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10228                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10229                 </links>
10230         </class>
10231         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
10232                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10233                         <field name="id" reporter:datatype="id" />
10234                         <field name="parent" reporter:datatype="link"/>
10235                         <field name="owner" reporter:datatype="link"/>
10236                         <field name="create_time" reporter:datatype="timestamp"/>
10237                         <field name="name" reporter:datatype="text"/>
10238                         <field name="shared" reporter:datatype="bool"/>
10239                         <field name="share_with" reporter:datatype="link"/>
10240                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10241                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10242                 </fields>
10243                 <links>
10244                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10245                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10246                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10247                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10248                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10249                 </links>
10250         </class>
10251         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
10252                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10253                         <field name="id" reporter:datatype="id" />
10254                         <field name="parent" reporter:datatype="link"/>
10255                         <field name="owner" reporter:datatype="link"/>
10256                         <field name="create_time" reporter:datatype="timestamp"/>
10257                         <field name="name" reporter:datatype="text"/>
10258                         <field name="shared" reporter:datatype="bool"/>
10259                         <field name="share_with" reporter:datatype="link"/>
10260                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10261                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10262                 </fields>
10263                 <links>
10264                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10265                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10266                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10267                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10268                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10269                 </links>
10270         </class>
10271         <class id="rt" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
10272                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10273                         <field name="id" reporter:datatype="id" />
10274                         <field name="owner" reporter:datatype="link"/>
10275                         <field name="create_time" reporter:datatype="timestamp"/>
10276                         <field name="name" reporter:datatype="text"/>
10277                         <field name="data" reporter:datatype="text"/>
10278                         <field name="folder" reporter:datatype="link"/>
10279                         <field name="description" reporter:datatype="text"/>
10280                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10281                 </fields>
10282                 <links>
10283                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10284                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10285                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10286                 </links>
10287         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10288             <actions>
10289                 <create   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
10290                 <retrieve permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
10291                 <update   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
10292                 <delete   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
10293             </actions>
10294         </permacrud>
10295         </class>
10296         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
10297                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
10298                         <field name="id" reporter:datatype="id" />
10299                         <field name="owner" reporter:datatype="link"/>
10300                         <field name="create_time" reporter:datatype="timestamp"/>
10301                         <field name="template" reporter:datatype="link"/>
10302                         <field name="data" reporter:datatype="text"/>
10303                         <field name="folder" reporter:datatype="link"/>
10304                         <field name="recur" reporter:datatype="bool"/>
10305                         <field name="recurrence" reporter:datatype="interval"/>
10306                         <field name="name" reporter:datatype="text"/>
10307                         <field name="description" reporter:datatype="text"/>
10308                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
10309                 </fields>
10310                 <links>
10311                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10312                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
10313                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
10314                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
10315                 </links>
10316         </class>
10317         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
10318                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
10319                         <field name="id" reporter:datatype="id" />
10320                         <field name="runner" reporter:datatype="link"/>
10321                         <field name="start_time" reporter:datatype="timestamp"/>
10322                         <field name="complete_time" reporter:datatype="timestamp"/>
10323                         <field name="run_time" reporter:datatype="timestamp"/>
10324                         <field name="email" reporter:datatype="text"/>
10325                         <field name="excel_format" reporter:datatype="bool"/>
10326                         <field name="csv_format" reporter:datatype="bool"/>
10327                         <field name="html_format" reporter:datatype="bool"/>
10328                         <field name="error_code" reporter:datatype="int"/>
10329                         <field name="error_text" reporter:datatype="text"/>
10330                         <field name="report" reporter:datatype="link"/>
10331                         <field name="folder" reporter:datatype="link"/>
10332                         <field name="chart_pie" reporter:datatype="bool"/>
10333                         <field name="chart_bar" reporter:datatype="bool"/>
10334                         <field name="chart_line" reporter:datatype="bool"/>
10335                 </fields>
10336                 <links>
10337                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
10338                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
10339                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
10340                 </links>
10341         </class>
10342         <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">
10343                 <fields oils_persist:primary="id">
10344                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
10345                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
10346                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
10347                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
10348                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
10349                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
10350                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
10351                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
10352                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
10353                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
10354                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
10355                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
10356                 </fields>
10357                 <links>
10358                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
10359                 </links>
10360                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10361                         <actions>
10362                                 <retrieve />
10363                         </actions>
10364                 </permacrud>
10365         </class>
10366         <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">
10367                 <fields oils_persist:primary="id">
10368                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
10369                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
10370                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
10371                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
10372                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
10373                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
10374                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
10375                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
10376                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
10377                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
10378                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
10379                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
10380                 </fields>
10381                 <links>
10382                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
10383                 </links>
10384         </class>
10385         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
10386                 <fields oils_persist:primary="id">
10387                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
10388                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
10389                         <field reporter:label="Fingerprint" name="fingerprint" />
10390                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
10391                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
10392                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
10393                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
10394                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
10395                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
10396                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
10397                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
10398                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
10399                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
10400                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
10401                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
10402                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
10403                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
10404                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
10405                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
10406                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
10407                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
10408                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
10409                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
10410                 </fields>
10411                 <links>
10412                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
10413                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
10414                 </links>
10415         </class>
10416         <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">
10417                 <fields oils_persist:primary="id">
10418                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
10419                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
10420                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
10421                 </fields>
10422                 <links>
10423                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
10424                 </links>
10425         </class>
10426         <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">
10427                 <fields oils_persist:primary="id">
10428                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
10429                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
10430                 </fields>
10431                 <links>
10432                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
10433                 </links>
10434         </class>
10435         <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">
10436                 <fields oils_persist:primary="id">
10437                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
10438                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
10439                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
10440                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
10441                 </fields>
10442                 <links>
10443                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
10444                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
10445                 </links>
10446         </class>
10447         <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">
10448                 <fields oils_persist:primary="xact">
10449                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
10450                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
10451                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
10452                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
10453                 </fields>
10454                 <links>
10455                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
10456                 </links>
10457         </class>
10458         <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">
10459                 <fields oils_persist:primary="xact">
10460                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
10461                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
10462                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
10463                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
10464                 </fields>
10465                 <links>
10466                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
10467                 </links>
10468         </class>
10469         <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)">
10470                 <fields oils_persist:primary="id">
10471                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
10472                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
10473                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
10474                 </fields>
10475                 <links>
10476                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10477                 </links>
10478         </class>
10479         <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">
10480                 <fields oils_persist:primary="id">
10481                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
10482                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
10483                 </fields>
10484                 <links>
10485                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10486                 </links>
10487         </class>
10488         <class id="erccpo" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::copy_count_per_org" oils_persist:tablename="extend_reporter.copy_count_per_org" reporter:label="Library Holdings Count with Deleted">
10489                 <fields oils_persist:primary="bibid">
10490                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
10491                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
10492                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
10493                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
10494                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
10495                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
10496                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
10497                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
10498                 </fields>
10499                 <links>
10500                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
10501                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10502                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10503                 </links>
10504         </class>
10505         <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">
10506                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
10507                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
10508                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
10509                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
10510                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
10511                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
10512                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
10513                 </fields>
10514                 <links>
10515                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10516                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
10517                 </links>
10518                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10519                         <actions>
10520                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
10521                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
10522                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
10523                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
10524                         </actions>
10525                 </permacrud>
10526         </class>
10527         <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">
10528                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
10529                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
10530                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
10531                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
10532                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10533                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10534                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
10535                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10536                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
10537                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
10538                 </fields>
10539                 <links>
10540                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
10541                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10542                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10543                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10544                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10545                 </links>
10546                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10547                         <actions>
10548                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
10549                                         <context link="formula" field="owner"/>
10550                                 </create>
10551                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
10552                                         <context link="formula" field="owner"/>
10553                                 </retrieve>
10554                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
10555                                         <context link="formula" field="owner"/>
10556                                 </update>
10557                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
10558                                         <context link="formula" field="owner"/>
10559                                 </delete>
10560                         </actions>
10561                 </permacrud>
10562         </class>
10563
10564         <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">
10565                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
10566                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10567                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10568                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10569                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
10570                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10571                 </fields>
10572                 <links>
10573                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10574                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
10575                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10576                 </links>
10577                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10578                         <actions>
10579                                 <create permission="CREATE_PURCHASE_ORDER">
10580                                         <context link="formula" field="owner"/>
10581                 </create>
10582                                 <retrieve permission="CREATE_PURCHASE_ORDER">
10583                                         <context link="formula" field="owner"/>
10584                 </retrieve>
10585                                 <update permission="CREATE_PURCHASE_ORDER">
10586                                         <context link="formula" field="owner"/>
10587                 </update>
10588                                 <delete permission="CREATE_PURCHASE_ORDER">
10589                                         <context link="formula" field="owner"/>
10590                 </delete>
10591                         </actions>
10592                 </permacrud>
10593         </class>
10594
10595         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
10596                 <fields oils_persist:primary="id">
10597                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
10598                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10599                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
10600                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
10601                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
10602                 </fields>
10603                 <links>
10604                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10605                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
10606                 </links>
10607         </class>
10608
10609         <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">
10610                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
10611                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
10612                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
10613                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10614                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10615                 </fields>
10616                 <links>
10617                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10618                 </links>
10619                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10620                         <actions>
10621                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
10622                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
10623                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
10624                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
10625                         </actions>
10626                 </permacrud>
10627         </class>
10628
10629         <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">
10630                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
10631                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
10632                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
10633                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10634                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10635                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
10636                 </fields>
10637                 <links>
10638                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10639                 </links>
10640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10641                         <actions>
10642                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
10643                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
10644                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
10645                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
10646                         </actions>
10647                 </permacrud>
10648         </class>
10649
10650         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
10651                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
10652                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
10653                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
10654                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
10655                 </fields>
10656                 <links>
10657                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
10658                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
10659                 </links>
10660         </class>
10661
10662         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
10663                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
10664                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
10665                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
10666                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
10667                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
10668                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10669                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10670                 </fields>
10671                 <links>
10672                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
10673                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
10674                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10675                 </links>
10676         </class>
10677
10678         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
10679                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
10680                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
10681                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
10682                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
10683                 </fields>
10684                 <links>
10685                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
10686                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
10687                 </links>
10688         </class>
10689
10690         <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">
10691                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
10692                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
10693                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
10694                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
10695                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
10696                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10697                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10698                 </fields>
10699                 <links>
10700                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
10701                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
10702                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10703                 </links>
10704         </class>
10705
10706         <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">
10707                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
10708                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10709                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
10710                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
10711                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10712                 </fields>
10713                 <links>
10714                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10715                 </links>
10716                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10717             <actions>
10718                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10719                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
10720                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10721                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10722             </actions>
10723                 </permacrud>
10724         </class>
10725
10726         <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">
10727                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
10728                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
10729                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
10730                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
10731                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
10732                 </fields>
10733                 <links>
10734                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10735                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
10736                 </links>
10737                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10738                         <actions>
10739                                 <create permission="ADMIN_CLAIM_POLICY">
10740                                         <context link="claim_policy" field="org_unit"/>
10741                 </create>
10742                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
10743                                         <context link="claim_policy" field="org_unit"/>
10744                 </retrieve>
10745                                 <update permission="ADMIN_CLAIM_POLICY">
10746                                         <context link="claim_policy" field="org_unit"/>
10747                 </update>
10748                                 <delete permission="ADMIN_CLAIM_POLICY">
10749                                         <context link="claim_policy" field="org_unit"/>
10750                 </delete>
10751                         </actions>
10752                 </permacrud>
10753         </class>
10754
10755     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
10756         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
10757             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10758             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
10759             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10760             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
10761             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
10762             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
10763             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
10764             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
10765             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
10766             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
10767             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
10768             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
10769             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
10770             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
10771             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10772             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
10773                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
10774                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
10775                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
10776         </fields>
10777         <links>
10778             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
10779             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10780         </links>
10781     </class>
10782
10783     <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">
10784         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
10785             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10786             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10787             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10788             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10789             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10790         </fields>
10791     </class>
10792
10793     <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">
10794         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
10795             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10796             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10797             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10798             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
10799             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
10800             <field reporter:label="City" name="city" reporter:datatype="text"/>
10801             <field reporter:label="County" name="county"  reporter:datatype="text"/>
10802             <field reporter:label="State" name="state" reporter:datatype="text"/>
10803             <field reporter:label="Country" name="country" reporter:datatype="text"/>
10804             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
10805             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10806         </fields>
10807     </class>
10808
10809     <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">
10810         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
10811             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10812             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10813             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10814             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
10815             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
10816             <field reporter:label="City" name="city" reporter:datatype="text"/>
10817             <field reporter:label="County" name="county"  reporter:datatype="text"/>
10818             <field reporter:label="State" name="state" reporter:datatype="text"/>
10819             <field reporter:label="Country" name="country" reporter:datatype="text"/>
10820             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
10821             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10822         </fields>
10823     </class>
10824
10825     <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">
10826         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
10827             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10828             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10829             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10830             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
10831             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
10832             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10833         </fields>
10834     </class>
10835
10836     <class id="stgs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::setting_stage" oils_persist:tablename="staging.setting_stage" reporter:label="User Setting Stage">
10837         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
10838             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10839             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10840             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10841             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
10842             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
10843             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10844         </fields>
10845     </class>
10846
10847         <class id="afsg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_group" oils_persist:tablename="action.fieldset_group" reporter:label="Fieldset Group">
10848                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
10849                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
10850                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10851                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10852                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
10853                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
10854                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
10855                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
10856                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
10857                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10858                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10859                 </fields>
10860                 <links>
10861                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10862                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10863                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
10864                 </links>
10865                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10866                         <actions>
10867                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10868                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10869                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10870                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10871                         </actions>
10872                 </permacrud>
10873         </class>
10874
10875         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
10876                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
10877                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
10878                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10879                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10880                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
10881                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
10882                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
10883                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
10884                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
10885                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
10886                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
10887                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
10888                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
10889                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
10890                 </fields>
10891                 <links>
10892                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10893                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10894                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
10895                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
10896                 </links>
10897                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10898                         <actions>
10899                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10900                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10901                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10902                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10903                         </actions>
10904                 </permacrud>
10905         </class>
10906
10907         <class id="afscv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_col_val" oils_persist:tablename="action.fieldset_col_val" reporter:label="Fieldset Column Value">
10908                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
10909                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
10910                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
10911                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
10912                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
10913                 </fields>
10914                 <links>
10915                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
10916                 </links>
10917                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
10918                         <actions>
10919                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10920                     <context link="fieldset" field="owning_lib"/>
10921                 </create>
10922                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10923                     <context link="fieldset" field="owning_lib"/>
10924                 </retrieve>
10925                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10926                     <context link="fieldset" field="owning_lib"/>
10927                 </update>
10928                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10929                     <context link="fieldset" field="owning_lib"/>
10930                 </delete>
10931                         </actions>
10932                 </permacrud>
10933         </class>
10934
10935     <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">
10936         <fields>
10937             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10938             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10939             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10940         </fields>
10941                 <links>
10942                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10943                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10944                 </links>
10945     </class>
10946
10947     <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">
10948         <fields>
10949             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10950             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
10951         </fields>
10952                 <links>
10953                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10954                 </links>
10955     </class>
10956
10957     <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">
10958         <fields>
10959             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10960             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10961             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10962         </fields>
10963                 <links>
10964                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10965                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10966                 </links>
10967     </class>
10968
10969     <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">
10970         <fields>
10971             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10972             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
10973         </fields>
10974                 <links>
10975                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10976                 </links>
10977     </class>
10978
10979     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
10980                 <oils_persist:source_definition><![CDATA[
10981
10982             SELECT  DISTINCT l.*
10983               FROM  action.unfulfilled_hold_loops l
10984                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
10985               WHERE l.count = m.max
10986
10987                 ]]></oils_persist:source_definition>
10988         <fields>
10989             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10990             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10991             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10992         </fields>
10993                 <links>
10994                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10995                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10996                 </links>
10997     </class>
10998
10999         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11000                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11001                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11002                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11003                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11004                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11005                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11006                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11007                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11008                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11009                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11010                 </fields>
11011                 <links>
11012                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11013                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11014                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11015                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11016                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11017                 </links>
11018         </class>
11019
11020         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11021                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11022                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11023                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11024                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11025                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11026                 </fields>
11027                 <links>
11028                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11029                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11030                 </links>
11031         </class>
11032
11033         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11034                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11035                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11036                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11037                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11038                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11039                 </fields>
11040                 <links>
11041                 </links>
11042         </class>
11043
11044         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11045                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11046                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11047                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11048                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11049                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11050                 </fields>
11051                 <links>
11052                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11053                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11054                 </links>
11055         </class>
11056         
11057         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11058                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11059                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11060                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11061                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11062                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11063                 </fields>
11064                 <links>
11065                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11066                 </links>
11067         </class>
11068         
11069         <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">
11070                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11071                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11072                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11073                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11074                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11075                 </fields>
11076                 <links>
11077                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11078                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11079                 </links>
11080         </class>
11081
11082         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11083                 <fields oils_persist:primary="name">
11084                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11085                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11086                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11087                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11088                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11089                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11090                 </fields>
11091                 <links>
11092                 </links>
11093         </class>
11094
11095         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11096                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11097                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11098                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11099                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11100                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11101                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11102                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11103                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11104                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11105                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11106                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11107                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11108                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11109                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11110                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11111                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11112                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11113                 </fields>
11114                 <links>
11115                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11116                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11117                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11118                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11119                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11120                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11121                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11122                 </links>
11123         </class>
11124
11125         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11126                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11127                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11128                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11129                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11130                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11131                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
11132                 </fields>
11133                 <links>
11134                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11135                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11136                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11137                 </links>
11138         </class>
11139
11140         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11141                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11142                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11143                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
11144                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11145                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11146                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11147                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11148                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11149                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11150                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11151                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11152                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11153                 </fields>
11154                 <links>
11155                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11156                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11157                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11158                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11159                 </links>
11160         </class>
11161
11162         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11163                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11164                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11165                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
11166                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11167                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11168                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
11169                 </fields>
11170                 <links>
11171                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
11172                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
11173                 </links>
11174         </class>
11175
11176         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
11177                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
11178                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
11179                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11180                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11181                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11182                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
11183                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
11184                 </fields>
11185                 <links>
11186                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11187                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11188                 </links>
11189         </class>
11190
11191         <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">
11192                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
11193                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
11194                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11195                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11196                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11197                 </fields>
11198                 <links>
11199                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11200                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11201                 </links>
11202         </class>
11203
11204         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
11205                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11206                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11207                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11208                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11209                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11210                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11211                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11212                 </fields>
11213                 <links>
11214                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11215                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11216                 </links>
11217         </class>
11218
11219         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
11220                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11221                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11222                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11223                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11224                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11225                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11226                 </fields>
11227                 <links>
11228                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11229                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11230                 </links>
11231         </class>
11232
11233         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
11234                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11235                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11236                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11237                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11238                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11239                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11240                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11241                 </fields>
11242                 <links>
11243                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11244                 </links>
11245         </class>
11246
11247         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
11248                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11249                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11250                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11251                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11252                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11253                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11254                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11255                 </fields>
11256                 <links>
11257                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11258                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11259                 </links>
11260         </class>
11261
11262         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
11263                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11264                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11265                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11266                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11267                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11268                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11269                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11270                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11271                 </fields>
11272                 <links>
11273                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11274                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11275                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11276                 </links>
11277         </class>
11278
11279         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
11280                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11281                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11282                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11283                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11284                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11285                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11286                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11287                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11288                 </fields>
11289                 <links>
11290                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11291                 </links>
11292         </class>
11293
11294         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
11295                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11296                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11297                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11298                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11299                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11300                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11301                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11302                 </fields>
11303                 <links>
11304                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11305                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11306                 </links>
11307         </class>
11308
11309         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
11310                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11311                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11312                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11313                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11314                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11315                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11316                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11317                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11318                 </fields>
11319                 <links>
11320                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11321                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11322                 </links>
11323         </class>
11324
11325         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
11326                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11327                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11328                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11329                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11330                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11331                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11332                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11333                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11334                 </fields>
11335                 <links>
11336                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11337                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11338                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11339                 </links>
11340         </class>
11341
11342         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
11343                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11344                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11345                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11346                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11347                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11348                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11349                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11350                 </fields>
11351                 <links>
11352                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11353                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11354                 </links>
11355         </class>
11356
11357         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
11358                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11359                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11360                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11361                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11362                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11363                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11364                 </fields>
11365                 <links>
11366                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11367                 </links>
11368         </class>
11369
11370         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
11371                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11372                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11373                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11374                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11375                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11376                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11377                 </fields>
11378                 <links>
11379                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11380                 </links>
11381         </class>
11382
11383         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
11384                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11385                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11386                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11387                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11388                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11389                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11390                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11391                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11392                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11393                 </fields>
11394                 <links>
11395                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11396                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11397                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11398                 </links>
11399         </class>
11400
11401         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
11402                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11403                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11404                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11405                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11406                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11407                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11408                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11409                 </fields>
11410                 <links>
11411                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11412                 </links>
11413         </class>
11414
11415         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
11416                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11417                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11418                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11419                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11420                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11421                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11422                 </fields>
11423                 <links>
11424                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11425                 </links>
11426         </class>
11427
11428         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
11429                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11430                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11431                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11432                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11433                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11434                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11435                 </fields>
11436                 <links>
11437                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11438                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11439                 </links>
11440         </class>
11441
11442         <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">
11443                 <fields oils_persist:primary="id">
11444                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
11445                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
11446                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
11447                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
11448                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
11449                 </fields>
11450                 <links>
11451                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
11452                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
11453                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
11454                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
11455                 </links>
11456         </class>
11457
11458         <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">
11459                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
11460                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11461                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
11462                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
11463                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
11464                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
11465                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11466                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
11467                 </fields>
11468                 <links/>
11469                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11470                         <actions>
11471                                 <retrieve/>
11472                         </actions>
11473                 </permacrud>
11474         </class>
11475
11476         <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">
11477                 <fields oils_persist:primary="ptype_key">
11478                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
11479                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
11480                 </fields>
11481                 <links/>
11482                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11483                         <actions>
11484                                 <retrieve/>
11485                         </actions>
11486                 </permacrud>
11487         </class>
11488
11489         <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">
11490                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
11491                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11492                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
11493                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
11494                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
11495                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11496                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
11497                 </fields>
11498                 <links>
11499                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
11500                 </links>
11501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11502                         <actions>
11503                                 <retrieve/>
11504                         </actions>
11505                 </permacrud>
11506         </class>
11507
11508         <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">
11509                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
11510                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11511                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
11512                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
11513                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
11514                 </fields>
11515                 <links>
11516                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
11517                 </links>
11518                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11519                         <actions>
11520                                 <retrieve/>
11521                         </actions>
11522                 </permacrud>
11523         </class>
11524
11525     <class
11526         id="uvs"
11527         controller="open-ils.cstore open-ils.pcrud"
11528         oils_obj:fieldmapper="url_verify::session"
11529         oils_persist:tablename="url_verify.session"
11530         reporter:label="URL Verification Session"
11531     >
11532         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
11533             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
11534             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11535                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
11536             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11537             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
11538             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11539             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
11540             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
11541             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
11542         </fields>
11543
11544         <links>
11545             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11546             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11547             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
11548             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
11549             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
11550         </links>
11551
11552         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11553             <actions>
11554                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
11555             </actions>
11556         </permacrud>
11557
11558     </class>
11559
11560     <class id="uvsbrem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::session_biblio_record_entry_map" oils_persist:readonly="true" reporter:label="URL Verify Session Biblio Record Entry Map">
11561         <oils_persist:source_definition><![CDATA[
11562             SELECT
11563                 cbrebi.id AS id,  -- so we can have a pkey in our view
11564                 uvs.id AS session,
11565                 uvs.owning_lib,
11566                 cbrebi.target_biblio_record_entry
11567             FROM url_verify.session uvs
11568             JOIN container.biblio_record_entry_bucket cbreb
11569                 ON (uvs.container = cbreb.id)
11570             JOIN container.biblio_record_entry_bucket_item cbrebi
11571                 ON (cbrebi.bucket = cbreb.id)
11572         ]]></oils_persist:source_definition>
11573         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
11574             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
11575             <field reporter:label="Session" name="session" reporter:datatype="link" />
11576             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
11577             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
11578         </fields>
11579         <links>
11580             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
11581             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
11582             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
11583         </links>
11584         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11585             <actions>
11586                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
11587             </actions>
11588         </permacrud>
11589     </class>
11590
11591     <class
11592         id="uvus"
11593         controller="open-ils.cstore open-ils.pcrud"
11594         oils_obj:fieldmapper="url_verify::url_selector"
11595         oils_persist:tablename="url_verify.url_selector"
11596         reporter:label="URL Verification URL Selector"
11597     >
11598         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
11599             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
11600             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
11601                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
11602             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
11603         </fields>
11604
11605         <links>
11606             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
11607             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
11608         </links>
11609
11610         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11611             <actions>
11612                 <create permission="URL_VERIFY">
11613                     <context link="session" field="owning_lib"/>
11614                 </create>
11615                 <retrieve permission="URL_VERIFY">
11616                     <context link="session" field="owning_lib"/>
11617                 </retrieve>
11618                 <update permission="URL_VERIFY">
11619                     <context link="session" field="owning_lib"/>
11620                 </update>
11621                 <delete permission="URL_VERIFY">
11622                     <context link="session" field="owning_lib"/>
11623                 </delete>
11624             </actions>
11625         </permacrud>
11626
11627     </class>
11628
11629     <class
11630         id="uvu"
11631         controller="open-ils.cstore open-ils.pcrud"
11632         oils_obj:fieldmapper="url_verify::url"
11633         oils_persist:tablename="url_verify.url"
11634         reporter:label="URL Verification URL"
11635     >
11636         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
11637             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
11638                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
11639                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
11640                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
11641                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
11642             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
11643             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
11644             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
11645             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
11646             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
11647             <field reporter:label="Host" name="host" reporter:datatype="text"/>
11648             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
11649             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
11650             <field reporter:label="Path" name="path" reporter:datatype="text"/>
11651             <field reporter:label="Page" name="page" reporter:datatype="text"/>
11652             <field reporter:label="Query" name="query" reporter:datatype="text"/>
11653             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
11654             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
11655         </fields>
11656
11657         <links>
11658             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
11659             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
11660             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
11661             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
11662             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
11663         </links>
11664
11665         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11666             <actions>
11667                 <create permission="URL_VERIFY">
11668                     <context link="session" field="owning_lib"/>
11669                 </create>
11670                 <retrieve permission="URL_VERIFY">
11671                     <context link="session" field="owning_lib"/>
11672                 </retrieve>
11673                 <update permission="URL_VERIFY">
11674                     <context link="session" field="owning_lib"/>
11675                 </update>
11676                 <delete permission="URL_VERIFY">
11677                     <context link="session" field="owning_lib"/>
11678                 </delete>
11679             </actions>
11680         </permacrud>
11681
11682     </class>
11683
11684     <class
11685         id="uvva"
11686         controller="open-ils.cstore open-ils.pcrud"
11687         oils_obj:fieldmapper="url_verify::verification_attempt"
11688         oils_persist:tablename="url_verify.verification_attempt"
11689         reporter:label="URL Verification Attempt"
11690     >
11691         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
11692             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
11693                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
11694                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
11695             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11696             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
11697         </fields>
11698
11699         <links>
11700             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
11701             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11702         </links>
11703
11704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11705             <actions>
11706                 <create permission="URL_VERIFY">
11707                     <context link="session" field="owning_lib"/>
11708                 </create>
11709                 <retrieve permission="URL_VERIFY">
11710                     <context link="session" field="owning_lib"/>
11711                 </retrieve>
11712                 <update permission="URL_VERIFY">
11713                     <context link="session" field="owning_lib"/>
11714                 </update>
11715                 <delete permission="URL_VERIFY">
11716                     <context link="session" field="owning_lib"/>
11717                 </delete>
11718             </actions>
11719         </permacrud>
11720
11721     </class>
11722
11723     <class
11724         id="uvuv"
11725         controller="open-ils.cstore open-ils.pcrud"
11726         oils_obj:fieldmapper="url_verify::url_verification"
11727         oils_persist:tablename="url_verify.url_verification"
11728         reporter:label="URL Verification"
11729     >
11730         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
11731             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
11732                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
11733                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
11734             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
11735             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
11736             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
11737             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
11738                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
11739         </fields>
11740
11741         <links>
11742             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
11743             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
11744             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
11745         </links>
11746
11747         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11748             <actions>
11749                 <create permission="URL_VERIFY">
11750                     <context link="attempt" jump="session" field="owning_lib"/>
11751                 </create>
11752                 <retrieve permission="URL_VERIFY">
11753                     <context link="attempt" jump="session" field="owning_lib"/>
11754                 </retrieve>
11755                 <update permission="URL_VERIFY">
11756                     <context link="attempt" jump="session" field="owning_lib"/>
11757                 </update>
11758                 <delete permission="URL_VERIFY">
11759                     <context link="attempt" jump="session" field="owning_lib"/>
11760                 </delete>
11761             </actions>
11762         </permacrud>
11763
11764     </class>
11765
11766         <class
11767                 id="cfdi"
11768                 controller="open-ils.cstore open-ils.pcrud"
11769                 oils_obj:fieldmapper="config::filter_dialog_interface"
11770                 oils_persist:tablename="config.filter_dialog_interface"
11771                 reporter:label="FilterDialog Interface">
11772                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
11773                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
11774                         <field reporter:label="Description" name="description" reporter:datatype="text" />
11775                 </fields>
11776                 <links>
11777                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
11778                 </links>
11779                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11780                         <actions>
11781                                 <retrieve />
11782                         </actions>
11783                 </permacrud>
11784         </class>
11785
11786         <class
11787                 id="cfdfs"
11788                 controller="open-ils.cstore open-ils.pcrud"
11789                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
11790                 oils_persist:tablename="config.filter_dialog_filter_set"
11791                 reporter:label="FilterDialog Filter Set">
11792                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
11793                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11794                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11795                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11796                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11797                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
11798                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11799                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
11800                 </fields>
11801                 <links>
11802                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11803                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11804                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
11805                 </links>
11806                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11807                         <actions>
11808                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11809                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11810                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11811                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11812                         </actions>
11813                 </permacrud>
11814
11815         </class>
11816
11817         <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">
11818                 <fields oils_persist:primary="code">
11819                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
11820                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
11821                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
11822                 </fields>
11823                 <links/>
11824                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11825                         <actions>
11826                                 <retrieve/>
11827                         </actions>
11828                 </permacrud>
11829         </class>
11830
11831         <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">
11832                 <oils_persist:source_definition><![CDATA[
11833
11834             SELECT  b.id,
11835                     MAX(dcp.edit_date) AS last_delete_date
11836              FROM   biblio.record_entry b
11837                     JOIN asset.call_number cn ON (cn.record = b.id)
11838                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
11839              WHERE  NOT b.deleted
11840              GROUP BY b.id
11841              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
11842
11843                 ]]></oils_persist:source_definition>
11844                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11845                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11846                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
11847                 </fields>
11848                 <links>
11849                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11850                 </links>
11851                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11852                         <actions>
11853                                 <retrieve/>
11854                         </actions>
11855                 </permacrud>
11856         </class>
11857
11858         <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">
11859                 <oils_persist:source_definition><![CDATA[
11860
11861             -- -- 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.
11862             -- -- 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
11863             -- -- may not.
11864             -- SELECT
11865             --     bre.id AS bib_id,
11866             --     COALESCE( z.copy_count, 0 ) AS copy_count,
11867             --     COALESCE( z.hold_count, 0 ) AS hold_count,
11868             --     COALESCE( z.copy_hold_ratio, 0 ) AS hold_copy_ratio
11869             -- FROM (
11870                 SELECT
11871                     y.bre AS id,
11872                     COALESCE( x.copy_count, 0 ) AS copy_count,
11873                     y.hold_count AS hold_count,
11874                     (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
11875                 FROM (
11876                         SELECT
11877                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS bre,
11878                             COUNT(*) AS hold_count
11879                         FROM action.hold_request h
11880                         WHERE
11881                             cancel_time IS NULL
11882                             AND fulfillment_time IS NULL
11883                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
11884                         GROUP BY 1
11885                     )y LEFT JOIN (
11886                         SELECT 
11887                             (SELECT id
11888                                 FROM biblio.record_entry 
11889                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
11890                             ) AS bre, 
11891                             COUNT(*) AS copy_count
11892                         FROM asset.copy
11893                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
11894                         WHERE copy.holdable 
11895                             AND NOT copy.deleted 
11896                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
11897                         GROUP BY 1
11898                     )x ON x.bre = y.bre
11899                 -- )z RIGHT JOIN (
11900                 --     SELECT id
11901                 --     FROM biblio.record_entry
11902                 --     WHERE NOT deleted
11903                 -- )bre ON (z.bib_id = bre.id)
11904                 
11905
11906                 ]]></oils_persist:source_definition>
11907                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11908                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11909                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
11910                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
11911                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
11912                 </fields>
11913                 <links>
11914                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11915                 </links>
11916                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11917                         <actions>
11918                                 <retrieve/>
11919                         </actions>
11920                 </permacrud>
11921         </class>
11922
11923         <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">
11924                 <oils_persist:source_definition><![CDATA[
11925             SELECT *,
11926                 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,
11927                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
11928             FROM
11929                 (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
11930                     FROM
11931                         action.hold_request ahr
11932                         JOIN reporter.hold_request_record rhrr USING (id)
11933                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11934                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
11935                     WHERE
11936                         ahr.cancel_time IS NULL
11937                         AND ahr.fulfillment_time IS NULL
11938                     GROUP BY bib_record, pickup_lib
11939                 )x
11940                 JOIN
11941                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
11942                     FROM
11943                         action.hold_request ahr
11944                         JOIN reporter.hold_request_record rhrr USING (id)
11945                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11946                     WHERE
11947                         ahr.cancel_time IS NULL
11948                         AND ahr.fulfillment_time IS NULL
11949                     GROUP BY bib_record
11950                 )y
11951                 USING (id)
11952                 ]]></oils_persist:source_definition>
11953                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11954                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
11955                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
11956                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
11957                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
11958                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
11959                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
11960                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
11961                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
11962                 </fields>
11963                 <links>
11964                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11965                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
11966                 </links>
11967                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11968                         <actions>
11969                                 <retrieve/>
11970                         </actions>
11971                 </permacrud>
11972         </class>
11973
11974         <class id="rhcrpbapd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup_desc" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library (and Descendants) ">
11975                 <oils_persist:source_definition><![CDATA[
11976             WITH counts_at_ou AS (
11977                 SELECT  rhrr.bib_record AS id,
11978                         aou.id AS pickup_lib_or_desc,
11979                         COUNT(DISTINCT ahr.id) AS holds_at_or_below,
11980                         COALESCE(COUNT(DISTINCT ac.id),0) AS copy_count_at_or_below
11981                   FROM  actor.org_unit aou
11982                         JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
11983                         action.hold_request ahr
11984                         JOIN reporter.hold_request_record rhrr USING (id)
11985                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11986                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
11987                   WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
11988                         AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
11989                         AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
11990                   GROUP BY 1, 2
11991             )
11992             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
11993                    y.holds_everywhere, y.copy_count_everywhere,
11994                 CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE x.holds_at_or_below::FLOAT/x.copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou,
11995                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/y.copy_count_everywhere END AS everywhere_ratio
11996             FROM counts_at_ou x
11997                 JOIN (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
11998                     FROM
11999                         action.hold_request ahr
12000                         JOIN reporter.hold_request_record rhrr USING (id)
12001                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12002                     WHERE
12003                         ahr.cancel_time IS NULL
12004                         AND ahr.fulfillment_time IS NULL
12005                     GROUP BY bib_record
12006                 )y
12007                 USING (id)
12008                 ]]></oils_persist:source_definition>
12009                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12010                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12011                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
12012                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
12013                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
12014                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12015                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12016                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
12017                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12018                 </fields>
12019                 <links>
12020                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12021                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
12022                 </links>
12023                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12024                         <actions>
12025                                 <retrieve/>
12026                         </actions>
12027                 </permacrud>
12028         </class>
12029
12030         <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">
12031                 <oils_persist:source_definition><![CDATA[
12032             SELECT
12033                 ac.id,
12034                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
12035                 MAX(actac.xact_start) AS last_circ
12036             FROM asset.copy ac
12037                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
12038             GROUP BY ac.id
12039
12040             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
12041             --SELECT
12042             --    ac.id,
12043             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
12044             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
12045             --FROM asset.copy ac
12046             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
12047             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
12048             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
12049                 ]]></oils_persist:source_definition>
12050                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12051                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
12052                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
12053                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
12054                 </fields>
12055                 <links>
12056                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
12057                 </links>
12058                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12059                         <actions>
12060                                 <retrieve/>
12061                         </actions>
12062                 </permacrud>
12063         </class>
12064
12065         <class id="ctcl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ts_config_list" oils_persist:tablename="config.ts_config_list" reporter:label="Text Search Configs">
12066                 <fields oils_persist:primary="id">
12067                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
12068                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
12069                 </fields>
12070                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12071                         <actions>
12072                                 <retrieve/>
12073                         </actions>
12074                 </permacrud>
12075         </class>
12076
12077         <class id="cmcts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class_ts_map" oils_persist:tablename="config.metabib_class_ts_map" reporter:label="Metabib Class TS Map">
12078                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
12079                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
12080                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
12081                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
12082                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
12083                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
12084                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
12085                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
12086                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
12087                 </fields>
12088                 <links>
12089                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
12090                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
12091                 </links>
12092                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12093                         <actions>
12094                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12095                                 <retrieve/>
12096                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12097                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12098                         </actions>
12099                 </permacrud>
12100         </class>
12101
12102         <class id="cmfts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_ts_map" oils_persist:tablename="config.metabib_field_ts_map" reporter:label="Metabib Field TS Map">
12103                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
12104                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
12105                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
12106                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
12107                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
12108                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
12109                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
12110                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
12111                 </fields>
12112                 <links>
12113                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
12114                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
12115                 </links>
12116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12117                         <actions>
12118                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12119                                 <retrieve/>
12120                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12121                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12122                         </actions>
12123                 </permacrud>
12124         </class>
12125
12126
12127         <!-- ********************************************************************************************************************* -->
12128         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
12129         <!-- ********************************************************************************************************************* -->
12130         <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">
12131                 <fields oils_persist:primary="id">
12132                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
12133                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
12134                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
12135                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
12136                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
12137                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
12138                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
12139                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
12140                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
12141                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
12142                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
12143                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
12144                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
12145                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
12146                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
12147                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
12148                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
12149                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
12150                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
12151                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
12152                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
12153                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
12154                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
12155                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
12156                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
12157                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
12158                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
12159                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
12160                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
12161                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
12162                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
12163                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
12164                 </fields>
12165                 <links>
12166                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
12167                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
12168                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
12169                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
12170                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
12171                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
12172                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
12173                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
12174                 </links>
12175         </class>
12176
12177         <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">
12178                 <fields oils_persist:primary="id">
12179                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
12180                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
12181                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12182                 </fields>
12183                 <links>
12184                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12185                 </links>
12186         </class>
12187
12188         <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">
12189                 <fields oils_persist:primary="id">
12190                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
12191                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
12192                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12193                 </fields>
12194                 <links>
12195                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12196                 </links>
12197         </class>
12198
12199         <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">
12200                 <fields oils_persist:primary="id">
12201                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
12202
12203                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
12204                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
12205                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
12206
12207                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
12208                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
12209                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
12210
12211                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
12212                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
12213
12214                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
12215                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
12216                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
12217
12218                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
12219                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
12220
12221                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
12222                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
12223                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
12224
12225                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
12226                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
12227                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
12228
12229                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
12230                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
12231                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
12232                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
12233
12234                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
12235                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
12236
12237                 </fields>
12238                 <links>
12239                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
12240                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12241                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
12242                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
12243                 </links>
12244         </class>
12245
12246         <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">
12247                 <oils_persist:source_definition><![CDATA[
12248
12249             SELECT
12250                 po.ordering_agency AS ordering_agency,
12251                 po.id AS purchase_order,
12252                 li.id AS lineitem,
12253                 lid.id AS lineitem_detail,
12254                 cpa.id AS claim_policy_action
12255             FROM
12256                 acq.lineitem_detail lid
12257                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
12258                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
12259                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
12260                 JOIN acq.claim_policy_action cpa ON (
12261                     cpa.claim_policy = cp.id
12262
12263                     -- we only care about claim policy actions whose claim
12264                     -- interval we'd reached or exceeded
12265                     AND (NOW() - cpa.action_interval) > po.order_date
12266
12267                     -- filter out all claim policy actions where claim events
12268                     -- have occurred on or after the action's action_interval
12269                     AND NOT EXISTS (
12270                         SELECT 1
12271                         FROM
12272                             acq.claim_event evt
12273                             JOIN acq.claim claim ON (
12274                                 claim.id = evt.claim
12275                                 AND claim.lineitem_detail = lid.id
12276                             )
12277                         WHERE
12278                             evt.event_date >= (po.order_date + cpa.action_interval)
12279                     )
12280                 )
12281             WHERE
12282                 lid.cancel_reason IS NULL
12283                 AND li.cancel_reason IS NULL -- belt/suspenders
12284                 AND po.cancel_reason IS NULL -- belt/suspenders
12285                 AND lid.recv_time IS NULL
12286                 AND po.state = 'on-order'
12287             ORDER BY 1, 2, 3, 4, 5
12288
12289                 ]]></oils_persist:source_definition>
12290                 <fields>
12291                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
12292                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
12293                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
12294                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
12295                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
12296                 </fields>
12297                 <links>
12298                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
12299                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
12300                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
12301                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
12302                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
12303                 </links>
12304         </class>
12305         <class id="acqlisum" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary" oils_persist:readonly="true" reporter:label="Lineitem Summary" oils_persist:tablename="acq.lineitem_summary">
12306                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
12307                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
12308                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
12309                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
12310                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
12311                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
12312                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
12313                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
12314                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
12315                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
12316                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
12317                 </fields>
12318                 <links>
12319                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
12320                 </links>
12321     </class>
12322         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
12323                 <oils_persist:source_definition><![CDATA[
12324             SELECT * FROM acq.lineitem_summary 
12325                                 WHERE item_count > (invoice_count + cancel_count)
12326         ]]></oils_persist:source_definition>
12327                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
12328                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
12329                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
12330                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
12331                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
12332                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
12333                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
12334                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
12335                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
12336                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
12337                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
12338                 </fields>
12339                 <links>
12340                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
12341                 </links>
12342     </class>
12343         <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">
12344                 <oils_persist:source_definition><![CDATA[
12345
12346                         SELECT  t.*
12347                           FROM  action.transit_copy t
12348                                 JOIN actor.org_unit AS s ON (t.source = s.id)
12349                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
12350                           WHERE s.parent_ou <> d.parent_ou
12351
12352                 ]]></oils_persist:source_definition>
12353                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
12354                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
12355                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
12356                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
12357                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
12358                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
12359                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
12360                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
12361                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
12362                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
12363                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
12364                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
12365                 </fields>
12366                 <links>
12367                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
12368                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
12369                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
12370                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
12371                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
12372                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
12373                 </links>
12374         </class>
12375
12376     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
12377                 <oils_persist:source_definition><![CDATA[
12378
12379         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
12380                 SELECT
12381                         cp.id as copy,
12382                         COUNT(circ.id),
12383                         EXTRACT(YEAR FROM circ.xact_start) AS year,
12384                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
12385                 FROM
12386                         asset.copy cp
12387                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
12388                 GROUP BY 1, 3, 4
12389                 UNION ALL
12390                 SELECT
12391                         cp.id as copy,
12392                         COUNT(circ.id),
12393                         EXTRACT(YEAR FROM circ.xact_start) AS year,
12394                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
12395                 FROM
12396                         asset.copy cp
12397                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
12398                 GROUP BY 1, 3, 4
12399                 UNION ALL
12400                 SELECT
12401                         id as copy,
12402                         circ_count,
12403                         -1 AS year,
12404                         false as is_renewal
12405                 FROM
12406                         extend_reporter.legacy_circ_count
12407         )x GROUP BY 1, 3, 4
12408
12409                 ]]></oils_persist:source_definition>
12410         <fields>
12411             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
12412             <field reporter:label="Count" name="count" reporter:datatype="int"/>
12413             <field reporter:label="Year" name="year" reporter:datatype="int"/>
12414             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
12415         </fields>
12416                 <links>
12417                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
12418                 </links>
12419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12420                         <actions>
12421                                 <retrieve/>
12422                         </actions>
12423                 </permacrud>
12424     </class>
12425
12426         <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">
12427                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
12428                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
12429                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
12430                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
12431                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
12432                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
12433                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
12434                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
12435                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
12436                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
12437                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
12438                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
12439                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
12440                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
12441                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
12442                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
12443                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
12444                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
12445                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
12446                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
12447                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
12448                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
12449                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
12450                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
12451                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
12452                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
12453                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
12454                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
12455                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
12456                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
12457                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
12458                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
12459                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
12460                 </fields>
12461                 <links>
12462                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
12463                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
12464                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
12465                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
12466                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
12467                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12468                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
12469                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
12470                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
12471                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
12472                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
12473                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
12474                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
12475                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
12476                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
12477                 </links>
12478         </class>
12479
12480     <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">
12481         <fields oils_persist:primary="id">
12482             <field reporter:label="Title" name="title" reporter:datatype="text"/>
12483             <field reporter:label="Author" name="author" reporter:datatype="text"/>
12484             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
12485             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
12486             <field reporter:label="Price" name="price" reporter:datatype="money"/>
12487             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
12488             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
12489             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
12490             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
12491             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
12492             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
12493             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
12494             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
12495             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
12496             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
12497             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
12498             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
12499             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
12500             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
12501             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
12502             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
12503             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
12504             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12505             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
12506             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
12507             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
12508             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
12509             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
12510             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
12511             <field reporter:label="Status" name="status" reporter:datatype="link"/>
12512             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
12513             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
12514             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
12515             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
12516         </fields>
12517         <links>
12518             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12519             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
12520             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
12521             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12522             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
12523             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
12524             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
12525             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
12526         </links>
12527     </class>
12528
12529     <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">
12530         <fields oils_persist:primary="id">
12531             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
12532             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12533             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
12534             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
12535         </fields>
12536         <links>
12537             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
12538             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12539         </links>
12540     </class>
12541
12542     <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">
12543         <fields oils_persist:primary="owning_lib">
12544             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12545             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
12546             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
12547         </fields>
12548         <links>
12549             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12550         </links>
12551     </class>
12552
12553     <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">
12554         <fields oils_persist:primary="id">
12555             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
12556             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
12557             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12558             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
12559             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
12560         </fields>
12561         <links>
12562             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
12563             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12564             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
12565         </links>
12566     </class>
12567
12568     <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">
12569         <fields oils_persist:primary="circ_lib">
12570             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
12571             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12572             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
12573             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
12574         </fields>
12575         <links>
12576             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12577             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
12578         </links>
12579     </class>
12580
12581     <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">
12582         <fields oils_persist:primary="id">
12583             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
12584             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12585             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12586             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
12587             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
12588         </fields>
12589         <links>
12590             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
12591             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12592             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12593         </links>
12594     </class>
12595
12596     <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">
12597         <fields oils_persist:primary="home_ou">
12598             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12599             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12600             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
12601             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
12602         </fields>
12603         <links>
12604             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12605             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12606         </links>
12607     </class>
12608         <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">
12609                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
12610                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
12611                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
12612                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
12613                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
12614                 </fields>
12615                 <links>
12616                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12617                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
12618                 </links>
12619                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12620                         <actions>
12621                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
12622                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
12623                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
12624                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
12625                         </actions>
12626                 </permacrud>
12627         </class>
12628         <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">
12629                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
12630                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
12631                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
12632                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
12633                 </fields>
12634                 <links>
12635                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
12636                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
12637                         </links>
12638                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12639                 <actions>
12640                                 <create permission="ADMIN_ACQ_FUND_TAG">
12641                                         <context link="tag" field="owner"/>
12642                                 </create>
12643                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
12644                                         <context link="tag" field="owner"/>
12645                                 </retrieve>
12646                                 <update permission="ADMIN_ACQ_FUND_TAG">
12647                                         <context link="tag" field="owner"/>
12648                                 </update>
12649                                 <delete permission="ADMIN_ACQ_FUND_TAG">
12650                                         <context link="tag" field="owner"/>
12651                                 </delete>
12652                         </actions>
12653                 </permacrud>
12654         </class>
12655         <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">
12656                 <oils_persist:source_definition><![CDATA[
12657                 SELECT
12658                         poi.purchase_order AS purchase_order,
12659                         ii.invoice AS invoice,
12660                         NULL AS lineitem,
12661                         poi.id AS po_item,
12662                         NULL AS picklist
12663                 FROM
12664                         acq.po_item poi
12665                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
12666                 UNION SELECT
12667                         jub.purchase_order AS purchase_order,
12668                         ie.invoice AS invoice,
12669                         jub.id AS lineitem,
12670                         NULL AS po_item,
12671                         jub.picklist AS picklist
12672                 FROM
12673                         acq.lineitem jub
12674                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
12675                 UNION SELECT
12676                         ii.purchase_order AS purchase_order,
12677                         ii.invoice AS invoice,
12678                         NULL AS lineitem,
12679                         NULL AS po_item,
12680                         NULL AS picklist
12681                 FROM
12682                         acq.invoice_item ii
12683                 WHERE ii.po_item IS NULL
12684                 UNION SELECT
12685                         ie.purchase_order AS purchase_order,
12686                         ie.invoice AS invoice,
12687                         NULL AS lineitem,
12688                         NULL AS po_item,
12689                         NULL AS picklist
12690                 FROM
12691                         acq.invoice_entry ie
12692                 WHERE ie.lineitem IS NULL
12693                 UNION SELECT
12694                         NULL AS purchase_order,
12695                         NULL AS invoice,
12696                         jub.id AS lineitem,
12697                         NULL AS po_item,
12698                         jub.picklist AS picklist
12699                 FROM
12700                         acq.lineitem jub
12701                 WHERE jub.purchase_order IS NULL
12702                 ]]></oils_persist:source_definition>
12703                 <fields>
12704                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
12705                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
12706                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
12707                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
12708                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
12709                 </fields>
12710                 <links>
12711                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
12712                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
12713                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
12714                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
12715                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
12716                 </links>
12717         </class>
12718         <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">
12719                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
12720                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12721                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
12722                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
12723                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
12724                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
12725                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12726                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
12727                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
12728                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
12729                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
12730                 </fields>
12731                 <links>
12732                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
12733                 </links>
12734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12735                         <actions>
12736                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12737                                 <retrieve/>
12738                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12739                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12740                         </actions>
12741                 </permacrud>
12742         </class>
12743
12744         <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">
12745                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
12746                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12747                         <field name="date_applied" reporter:datatype="timestamp"/>
12748                         <field name="org" reporter:datatype="org_unit"/>
12749                         <field name="original_value" reporter:datatype="text"/>
12750                         <field name="new_value" reporter:datatype="text"/>
12751                         <field name="field_name" reporter:datatype="link"/>
12752                 </fields>
12753                 <links>
12754                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
12755                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
12756                 </links>
12757                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12758                         <actions>
12759                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
12760                                 <retrieve permission="STAFF_LOGIN" context_field="org"/>
12761                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
12762                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
12763                         </actions>
12764                 </permacrud>
12765         </class>
12766         <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">
12767                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
12768                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12769                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
12770                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
12771                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12772                 </fields>
12773                 <links>
12774                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
12775                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
12776                 </links>
12777         </class>
12778         <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">
12779                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
12780                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12781                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
12782                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
12783                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12784                 </fields>
12785                 <links>
12786                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
12787                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
12788                 </links>
12789         </class>
12790         <class id="cfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group" oils_persist:tablename="config.floating_group" reporter:label="Floating Group">
12791                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
12792                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
12793                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12794                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
12795                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
12796                 </fields>
12797                 <links>
12798                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
12799                 </links>
12800                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12801                         <actions>
12802                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12803                                 <retrieve/>
12804                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12805                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12806                         </actions>
12807                 </permacrud>
12808         </class>
12809         <class id="cfgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group_member" oils_persist:tablename="config.floating_group_member" reporter:label="Floating Group Members">
12810                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
12811                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12812                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
12813                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
12814                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
12815                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
12816                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
12817                 </fields>
12818                 <links>
12819                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
12820                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
12821                 </links>
12822                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12823                         <actions>
12824                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12825                                 <retrieve/>
12826                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12827                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12828                         </actions>
12829                 </permacrud>
12830         </class>
12831         <class id="cctt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_tag_type" oils_persist:tablename="config.copy_tag_type" reporter:label="Copy Tag Types" oils_persist:field_safe="true">
12832                 <fields oils_persist:primary="code">
12833                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
12834                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12835                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
12836                 </fields>
12837                 <links>
12838                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12839                 </links>
12840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12841                         <actions>
12842                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12843                                 <retrieve/>
12844                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12845                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12846                         </actions>
12847                 </permacrud>
12848         </class>
12849         <class id="acpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag" oils_persist:tablename="asset.copy_tag" reporter:label="Copy Tags" oils_persist:field_safe="true">
12850                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
12851                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12852                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
12853                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12854                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12855                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
12856                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
12857                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
12858                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
12859                 </fields>
12860                 <links>
12861                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
12862                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12863                 </links>
12864                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12865                         <actions>
12866                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
12867                                 <retrieve/>
12868                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
12869                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
12870                         </actions>
12871                 </permacrud>
12872         </class>
12873         <class id="acptcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag_copy_map" oils_persist:tablename="asset.copy_tag_copy_map" reporter:label="Copy Tag Copy Map" oils_persist:field_safe="true">
12874                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
12875                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12876                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
12877                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
12878                 </fields>
12879                 <links>
12880                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
12881                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
12882                 </links>
12883                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12884                         <actions>
12885                                 <create permission="UPDATE_COPY">
12886                     <context link="copy" field="circ_lib"/>
12887                 </create>
12888                                 <retrieve/>
12889                                 <update permission="UPDATE_COPY">
12890                     <context link="copy" field="circ_lib"/>
12891                 </update>
12892                                 <delete permission="UPDATE_COPY">
12893                     <context link="copy" field="circ_lib"/>
12894                 </delete>
12895                         </actions>
12896                 </permacrud>
12897         </class>
12898         <class id="hasholdscount" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::has_holds_count" reporter:label="Copy Has Holds Count" oils_persist:readonly="true">
12899         <oils_persist:source_definition><![CDATA[
12900         SELECT ahcm.target_copy AS id,count(*) AS count
12901          FROM
12902          action.hold_request ahr,
12903          action.hold_copy_map ahcm
12904          WHERE
12905          ahr.cancel_time IS NULL AND
12906          ahr.fulfillment_time IS NULL AND
12907          ahr.capture_time IS NULL AND
12908          ahr.id = ahcm.hold
12909          GROUP BY ahcm.target_copy
12910         ]]></oils_persist:source_definition>
12911         <fields oils_persist:primary="id">
12912             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
12913             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
12914         </fields>
12915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12916             <actions>
12917                <retrieve/>
12918             </actions>
12919         </permacrud>
12920         </class>
12921
12922         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
12923                 oils_obj:fieldmapper="config::workstation_setting_type" 
12924                 oils_persist:tablename="config.workstation_setting_type" 
12925                 reporter:label="Workstation Setting Type">
12926                 <fields oils_persist:primary="name">
12927                         <field name="name" reporter:datatype="text"/>
12928                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
12929                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
12930                         <field name="datatype" reporter:datatype="text"/>
12931                         <field name="fm_class" reporter:datatype="text"/>
12932                         <field name="grp" reporter:datatype="link"/>
12933                 </fields>
12934                 <links>
12935                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
12936                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
12937                 </links>
12938                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12939                         <actions>
12940                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
12941                                 <retrieve/>
12942                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
12943                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
12944                         </actions>
12945                 </permacrud>
12946         </class>
12947
12948         <!-- no pcrud access is granted for now, because it's assumed these
12949                          setting values will be applied and retrived via the API. -->
12950         <class id="awss" 
12951                 controller="open-ils.cstore"
12952                 oils_obj:fieldmapper="actor::workstation_setting" 
12953                 oils_persist:tablename="actor.workstation_setting" 
12954                 reporter:label="Workstation Setting">
12955                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
12956                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
12957                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
12958                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12959                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
12960                 </fields>
12961                 <links>
12962                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
12963                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
12964                 </links>
12965         </class>
12966
12967         <class id="cht" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_type" oils_persist:tablename="config.hold_type" reporter:label="Hold Type" oils_persist:readonly="true">
12968         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
12969                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
12970                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
12971                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
12972         </fields>
12973         </class>
12974
12975         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
12976                 oils_obj:fieldmapper="config::print_template" 
12977                 oils_persist:tablename="config.print_template" 
12978                 reporter:label="Print Templates">
12979                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
12980                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
12981                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
12982                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
12983                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
12984                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
12985                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
12986                         <field name="content_type" reporter:datatype="text"/>
12987                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
12988                 </fields>
12989                 <links>
12990                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12991                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
12992                 </links>
12993                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12994                         <actions>
12995                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
12996                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
12997                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
12998                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
12999                         </actions>
13000                 </permacrud>
13001         </class>
13002
13003         <class id="cct" 
13004                 controller="open-ils.cstore open-ils.pcrud"
13005                 oils_obj:fieldmapper="config::carousel_type" 
13006                 oils_persist:tablename="config.carousel_type" 
13007                 reporter:label="Carousel Types">
13008                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
13009                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
13010                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_obj:i18n="true"/>
13011                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
13012                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
13013                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
13014                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
13015                 </fields>
13016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13017                         <actions>
13018                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13019                                 <retrieve/>
13020                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13021                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13022                         </actions>
13023                 </permacrud>
13024         </class>
13025
13026         <class id="cc" 
13027                 controller="open-ils.cstore open-ils.pcrud"
13028                 oils_obj:fieldmapper="container::carousel" 
13029                 oils_persist:tablename="container.carousel" 
13030                 reporter:label="Carousels">
13031                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
13032                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
13033                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
13034                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
13035                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_obj:i18n="true"/>
13036                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
13037                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
13038                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
13039                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
13040                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
13041                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
13042                         <field reporter:label="Item Libraries" name="owning_lib_filter" reporter:datatype="text" />      <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
13043                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
13044                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
13045                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
13046                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
13047                 </fields>
13048                 <links>
13049                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
13050                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13051                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
13052                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13053                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
13054                 </links>
13055                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13056                         <actions>
13057                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
13058                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
13059                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
13060                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
13061                         </actions>
13062                 </permacrud>
13063         </class>
13064
13065         <class id="ccou" 
13066                 controller="open-ils.cstore open-ils.pcrud"
13067                 oils_obj:fieldmapper="container::carousel_org_unit" 
13068                 oils_persist:tablename="container.carousel_org_unit" 
13069                 reporter:label="Carousels Visible at Library">
13070                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
13071                         <field reporter:label="ID" name="id" reporter:datatype="id" />
13072                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
13073                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
13074                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
13075                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
13076                 </fields>
13077                 <links>
13078                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
13079                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13080                 </links>
13081                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13082                         <actions>
13083                                 <create permission="ADMIN_CAROUSEL">
13084                                     <context link="carousel" field="owner" />
13085                                 </create>
13086                                 <retrieve permission="ADMIN_CAROUSEL">
13087                                     <context link="carousel" field="owner" />
13088                                 </retrieve>
13089                                 <update permission="ADMIN_CAROUSEL">
13090                                     <context link="carousel" field="owner" />
13091                                 </update>
13092                                 <delete permission="ADMIN_CAROUSEL">
13093                                     <context link="carousel" field="owner" />
13094                                 </delete>
13095                         </actions>
13096                 </permacrud>
13097         </class>
13098
13099         <class id="cra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remoteauth_profile" oils_persist:tablename="config.remoteauth_profile" reporter:label="Remote Patron Authentication Configuration Profile">
13100                 <fields oils_persist:primary="name">
13101                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
13102                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
13103                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
13104                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
13105                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
13106                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
13107                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
13108                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
13109                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
13110                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
13111                 </fields>
13112                 <links>
13113                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
13114                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
13115                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
13116                 </links>
13117                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13118                         <actions>
13119                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
13120                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
13121                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
13122                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
13123                         </actions>
13124                 </permacrud>
13125         </class>
13126
13127         <!-- ********************************************************************************************************************* -->
13128 </IDL>
13129
13130 <!--
13131     vim:noet:ts=4:sw=4:
13132 -->