]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1721304 - Add labels for config.standing_penalty in IDL xml
[working/Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           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                 </fields>
98                 <links>
99                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
100                 </links>
101         </class>
102
103         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
104                 <fields>
105                         <field name="id" oils_persist:virtual="true" />
106                         <field name="children" oils_persist:virtual="true" />
107                         <field name="owner_doc" oils_persist:virtual="true" />
108                         <field name="intra_doc_id" oils_persist:virtual="true" />
109                         <field name="parent_node" oils_persist:virtual="true" />
110                         <field name="node_type" oils_persist:virtual="true" />
111                         <field name="namespace_uri" oils_persist:virtual="true" />
112                         <field name="name" oils_persist:virtual="true" />
113                         <field name="value" oils_persist:virtual="true" />
114                 </fields>
115         </class>
116
117         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
118                 <fields>
119                         <field name="title" oils_persist:virtual="true" />
120                         <field name="author" oils_persist:virtual="true" />
121                         <field name="doc_id" oils_persist:virtual="true" />
122                         <field name="doc_type" oils_persist:virtual="true" />
123                         <field name="pubdate" oils_persist:virtual="true" />
124                         <field name="isbn" oils_persist:virtual="true" />
125                         <field name="publisher" oils_persist:virtual="true" />
126                         <field name="tcn" oils_persist:virtual="true" />
127                         <field name="subject" oils_persist:virtual="true" />
128                         <field name="types_of_resource" oils_persist:virtual="true" />
129                         <field name="call_numbers" oils_persist:virtual="true" />
130                         <field name="edition" oils_persist:virtual="true" />
131                         <field name="online_loc" oils_persist:virtual="true" />
132                         <field name="synopsis" oils_persist:virtual="true" />
133                         <field name="physical_description" oils_persist:virtual="true" />
134                         <field name="toc" oils_persist:virtual="true" />
135                         <field name="copy_count" oils_persist:virtual="true" />
136                         <field name="series" oils_persist:virtual="true" />
137                         <field name="serials" oils_persist:virtual="true" />
138                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
139                 </fields>
140         </class>
141
142         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
143                 <fields>
144                         <field name="err_msg" oils_persist:virtual="true" />
145                         <field name="type" oils_persist:virtual="true" />
146                 </fields>
147         </class>
148
149         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
150                 <fields>
151                         <field name="err_msg" oils_persist:virtual="true" />
152                         <field name="type" oils_persist:virtual="true" />
153                 </fields>
154         </class>
155
156         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
157                 <fields oils_persist:primary="matchpoint">
158                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
159                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
160                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
161                 </fields>
162                 <links>
163                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
164                 </links>
165         </class>
166
167         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
168         <!-- when the time is right, turn me into a view.  -->
169                 <fields>
170             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
171             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
172             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
173             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
174             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
175             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
176             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
177             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
178             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
179             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
180                 </fields>
181         </class>
182
183         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
184                 <fields>
185                         <field name="public_name" oils_persist:virtual="true" />
186                         <field name="target_url" oils_persist:virtual="true" />
187                         <field name="target_coverage" oils_persist:virtual="true" />
188                         <field name="target_embargo" oils_persist:virtual="true" />
189                 </fields>
190         </class>
191
192         <!-- Actually in the DB -->
193         <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">
194                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
195                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
196                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
197                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
198                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
199                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
200                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
201                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
202                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
203                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
204                 </fields>
205                 <links>
206                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
207                 </links>
208                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
209                         <actions>
210                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
211                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
212                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
213                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
214                         </actions>
215                 </permacrud>
216         </class>
217
218         <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">
219                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
220                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
221                         <field reporter:label="Group" name="grp" reporter:datatype="link"/>
222                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
223                 </fields>
224                 <links>
225                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
226                 </links>
227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
228                         <actions>
229                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
230                     <context link="grp" field="owner"/>
231                 </create>
232                                 <retrieve/>
233                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
234                     <context link="grp" field="owner"/>
235                 </update>
236                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
237                     <context link="grp" field="owner"/>
238                 </delete>
239                         </actions>
240                 </permacrud>
241         </class>
242
243         <class  id="rrbs" 
244             controller="open-ils.cstore open-ils.pcrud" 
245             oils_obj:fieldmapper="rating::record_badge_score" 
246             oils_persist:tablename="rating.record_badge_score" 
247             reporter:label="Statistical Popularity Badge">
248                 <fields oils_persist:primary="id" 
249                 oils_persist:sequence="rating.record_badge_score_id_seq">
250                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
251                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
252                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
253                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
254                 </fields>
255         <links>
256             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
257             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
258         </links>
259                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
260                         <actions>
261                                 <retrieve/>
262                         </actions>
263                 </permacrud>
264         </class>
265
266         <class  id="rp" 
267             controller="open-ils.cstore open-ils.pcrud" 
268             oils_obj:fieldmapper="rating::popularity_parameter" 
269             oils_persist:tablename="rating.popularity_parameter" 
270             reporter:label="Statistical Popularity Parameter">
271                 <fields oils_persist:primary="id" 
272                 oils_persist:sequence="rating.popularity_parameter_id_seq">
273                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
274                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
275                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
276                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
277                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
278                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
279                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
280                 </fields>
281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
282                         <actions>
283                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
284                                 <retrieve/>
285                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
286                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
287                         </actions>
288                 </permacrud>
289         </class>
290
291         <class  id="rb" 
292             controller="open-ils.cstore open-ils.pcrud" 
293             oils_obj:fieldmapper="rating::badge" 
294             oils_persist:tablename="rating.badge" 
295             reporter:label="Statistical Popularity Badge">
296                 <fields oils_persist:primary="id" 
297                 oils_persist:sequence="rating.badge_id_seq">
298                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
299                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
300                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
301                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
302                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
303                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
304                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
305                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
306                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
307                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
308                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
309                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
310                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
311                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
312                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
313                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
314                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
315                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
316                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
317                 </fields>
318                 <links>
319                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
320                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
321                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
322                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
323                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
324                 </links>
325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
326                         <actions>
327                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
328                                 <retrieve/>
329                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
330                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
331                         </actions>
332                 </permacrud>
333         </class>
334
335         <class  id="vibtg" 
336             controller="open-ils.cstore open-ils.pcrud" 
337             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
338             oils_persist:tablename="vandelay.import_bib_trash_group" 
339             reporter:label="Import/Overlay Field Groups for Removal">
340                 <fields oils_persist:primary="id" 
341                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
342                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
343                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
344                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
345                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
346                 </fields>
347                 <links>
348                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
349                 </links>
350                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
351                         <actions>
352                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
353                                 <retrieve/>
354                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
355                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
356                         </actions>
357                 </permacrud>
358         </class>
359
360
361         <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">
362                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
363                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
364                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
365                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
366                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
367                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
368                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
369                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
370                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
371                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
372                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
373                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
374                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
375                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
376                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
377                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
378                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
379                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
380                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
381                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
382                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
383                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
384                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
385                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
386                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
387                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
388                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
389                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
390                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
391                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
392                 </fields>
393                 <links>
394                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
395                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
396                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
397                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
398                 </links>
399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
400                         <actions>
401                                 <create permission="CREATE_IMPORT_ITEM">
402                     <context link="definition" field="owner"/>
403                                 </create>
404                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
405                     <context link="definition" field="owner"/>
406                                 </retrieve>
407                                 <update permission="UPDATE_IMPORT_ITEM">
408                     <context link="definition" field="owner"/>
409                                 </update>
410                                 <delete permission="DELETE_IMPORT_ITEM">
411                     <context link="definition" field="owner"/>
412                                 </delete>
413                         </actions>
414                 </permacrud>
415         </class>
416
417         <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">
418                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
419                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
420                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
421                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
422                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
423                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
424                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
425                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
426                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
427                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
428                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
429                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
430                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
431                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
432                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
433                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
434                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
435                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
436                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
437                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
438                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
439                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
440                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
441                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
442                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
443                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
444                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
445                 </fields>
446                 <links>
447                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
448                 </links>
449                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
450                         <actions>
451                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
452                                 <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"/>
453                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
454                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
455                         </actions>
456                 </permacrud>
457         </class>
458
459         <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">
460                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
461                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
462                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
463                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
464                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
465                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
466                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
467                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
468                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
469                 </fields>
470                 <links>
471                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
472                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
473                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
474                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
475                 </links>
476                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
477                         <actions>
478                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
479                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
480                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
481                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
482                         </actions>
483                 </permacrud>
484         </class>
485
486         <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">
487                 <fields oils_persist:primary="code">
488                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
489                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
490                 </fields>
491                 <links>
492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
493                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
494                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
495                 </links>
496                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
497                         <actions>
498                                 <retrieve/>
499                         </actions>
500                 </permacrud>
501         </class>
502
503         <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">
504                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
505                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
506                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
507                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
508                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
509                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
510                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
511                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
512                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
513                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
514                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
515                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
516                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
517                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
518                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
519                 </fields>
520                 <links>
521                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
522                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
523                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
524                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
525             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
526             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
527             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
528                 </links>
529                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
530                         <actions>
531                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
532                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
533                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
534                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
535                         </actions>
536                 </permacrud>
537         </class>
538
539         <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">
540                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
541                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
542                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
543                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
544                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
545                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
546                 </fields>
547                 <links/>
548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
549                         <actions>
550                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
551                 <retrieve/>
552                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
553                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
554                         </actions>
555                 </permacrud>
556         </class>
557
558         <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">
559                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
560                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
561                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
562                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
563                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
564                 </fields>
565                 <links>
566                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
567                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
568                 </links>
569                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
570                         <actions>
571                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
572                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
573                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
574                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
575                         </actions>
576                 </permacrud>
577         </class>
578
579         <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">
580                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
581                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
582                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
583                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
584                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
585                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
586                 </fields>
587                 <links>
588                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
589                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
590                 </links>
591                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
592                         <actions>
593                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
594                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
595                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
596                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
597                         </actions>
598                 </permacrud>
599         </class>
600
601         <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">
602                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
603                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
604                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
605                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
606                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
607                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
608                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
609                 </fields>
610                 <links>
611                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
612                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
613                 </links>
614                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
615                         <actions>
616                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
617                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
618                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
619                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
620                         </actions>
621                 </permacrud>
622         </class>
623
624         <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">
625                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
626                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
627                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
628                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
629                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
630                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
631                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
632                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
633                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
634                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
635                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
636                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
637                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
638                 </fields>
639                 <links>
640                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
641                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
642                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
643             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
644             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
645                 </links>
646                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
647                         <actions>
648                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
649                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
650                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
651                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
652                         </actions>
653                 </permacrud>
654         </class>
655
656         <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">
657                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
658                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
659                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
660                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
661                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
662                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
663                 </fields>
664                 <links/>
665                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
666                         <actions>
667                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
668                 <retrieve/>
669                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
670                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
671                         </actions>
672                 </permacrud>
673         </class>
674
675         <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">
676                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
677                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
678                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
679                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
680                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
681                 </fields>
682                 <links>
683                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
684                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
685                 </links>
686                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
687                         <actions>
688                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
689                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
690                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
691                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
692                         </actions>
693                 </permacrud>
694         </class>
695
696         <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">
697                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
698                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
699                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
700                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
701                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
702                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
703                 </fields>
704                 <links>
705                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
706                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
707                 </links>
708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
709                         <actions>
710                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
711                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
712                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
713                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
714                         </actions>
715                 </permacrud>
716         </class>
717
718         <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">
719                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
720                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
721                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
722                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
723                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
724                 </fields>
725                 <links>
726                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
727                 </links>
728                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
729                         <actions>
730                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
731                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
732                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
733                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
734                         </actions>
735                 </permacrud>
736         </class>
737
738         <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">
739                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
740                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
741                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
742                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
743                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
744                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
745                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
746                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
747             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
748                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
749                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
750                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
751                 </fields>
752                 <links>
753                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
754                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
755                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
756                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
757                 </links>
758                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
759                         <actions>
760                                 <create permission="ADMIN_IMPORT_MATCH_SET">
761                     <context link="match_set" field="owner"/>
762                                 </create>
763                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
764                     <context link="match_set" field="owner"/>
765                                 </retrieve>
766                                 <update permission="ADMIN_IMPORT_MATCH_SET">
767                     <context link="match_set" field="owner"/>
768                                 </update>
769                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
770                     <context link="match_set" field="owner"/>
771                                 </delete>
772                         </actions>
773                 </permacrud>
774         </class>
775
776         <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">
777                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
778                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
779                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
780                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
781                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
782                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
783                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
784                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
785                 </fields>
786                 <links>
787                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
788                 </links>
789                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
790                         <actions>
791                                 <create permission="ADMIN_IMPORT_MATCH_SET">
792                     <context link="match_set" field="owner"/>
793                                 </create>
794                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
795                     <context link="match_set" field="owner"/>
796                                 </retrieve>
797                                 <update permission="ADMIN_IMPORT_MATCH_SET">
798                     <context link="match_set" field="owner"/>
799                                 </update>
800                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
801                     <context link="match_set" field="owner"/>
802                                 </delete>
803                         </actions>
804                 </permacrud>
805         </class>
806
807         <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">
808                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
809                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
810                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
811                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
812                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
813                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
814                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
815                 </fields>
816                 <links>
817                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
818                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
819                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
820                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
821                 </links>
822         </class>
823
824     <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">
825         <fields oils_persist:primary="name">
826             <field reporter:label="Name" name="name" reporter:datatype="text"/>
827             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
828             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
829             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
830         </fields>
831         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
832             <actions>
833                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
834                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
835                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
836                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
837             </actions>
838         </permacrud>
839     </class>
840
841     <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">
842         <fields oils_persist:primary="id">
843             <field reporter:label="ID" name="id" reporter:datatype="id"/>
844             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
845             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
846             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
847             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
848         </fields>
849         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
850             <actions>
851                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
852                 <retrieve/>
853                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
854                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
855             </actions>
856         </permacrud>
857     </class>
858
859         <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">
860                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
861                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
862                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
863                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
864                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
865                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
866                 </fields>
867                 <links>
868                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
869                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
870                 </links>
871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
872             <actions>
873                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
874                 <retrieve/>
875                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
876                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
877             </actions>
878         </permacrud>
879         </class>
880
881         <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">
882                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
883                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
884                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
885                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
886         </fields>
887         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
888             <actions>
889                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
890                 <retrieve/>
891                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
892                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
893             </actions>
894         </permacrud>
895         </class>
896
897         <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">
898                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
899                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
900                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
901                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
902                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
903                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
904                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
905                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
906                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
907                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
908                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
909                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
910         </fields>
911                 <links>
912                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
913                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
914         </links>
915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
916             <actions>
917                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
918                 <retrieve/>
919                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
920                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
921             </actions>
922         </permacrud>
923         </class>
924
925         <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">
926                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
927                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
928                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
929                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
930                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
931                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
932                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
933                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
934                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
935                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
936                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
937         </fields>
938                 <links>
939                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
940                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
941         </links>
942         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
943             <actions>
944                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
945                 <retrieve/>
946                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
947                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
948             </actions>
949         </permacrud>
950         </class>
951
952         <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">
953                 <fields oils_persist:primary="name">
954                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
955                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
956                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
957                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
958                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
959                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
960                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
961                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
962                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
963                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
964                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
965                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
966                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
967                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
968                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
969                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
970                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
971                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
972                 </fields>
973                 <links>
974                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
975                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
976                 </links>
977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
978             <actions>
979                 <create permission="ADMIN_SVF" global_required="true"/>
980                 <retrieve/>
981                 <update permission="ADMIN_SVF" global_required="true"/>
982                 <delete permission="ADMIN_SVF" global_required="true"/>
983             </actions>
984         </permacrud>
985         </class>
986
987         <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">
988                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
989                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
990                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
991                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
992             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
993                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
994                 </fields>
995                 <links/>
996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
997             <actions>
998                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
999                 <retrieve/>
1000                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1001                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1002             </actions>
1003         </permacrud>
1004         </class>
1005
1006         <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">
1007                 <fields oils_persist:primary="coded_value">
1008                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1009                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1010                 </fields>
1011                 <links>
1012                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1013                 </links>
1014         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1015             <actions>
1016                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1017                 <retrieve/>
1018                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1019                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1020             </actions>
1021         </permacrud>
1022         </class>
1023
1024         <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">
1025                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1026                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1027                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1028                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1029                 </fields>
1030                 <links>
1031                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1032                 </links>
1033         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1034             <actions>
1035                 <retrieve/>
1036             </actions>
1037         </permacrud>
1038         </class>
1039
1040
1041         <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">
1042                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1043                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1044                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1045                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1046                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1047                 </fields>
1048                 <links>
1049                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1050                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1051                 </links>
1052         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1053             <actions>
1054                 <retrieve/>
1055             </actions>
1056         </permacrud>
1057         </class>
1058
1059
1060         <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">
1061                 <fields oils_persist:primary="source">
1062                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1063                         <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 -->
1064                 </fields>
1065                 <links>
1066                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1067                 </links>
1068         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1069             <actions>
1070                 <retrieve/>
1071             </actions>
1072         </permacrud>
1073         </class>
1074
1075         <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">
1076                 <fields>
1077                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1078                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1079                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <retrieve/>
1087             </actions>
1088         </permacrud>
1089         </class>
1090
1091         <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">
1092                 <fields oils_persist:primary="id">
1093                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1094                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1095                 </fields>
1096                 <links>
1097                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1098                 </links>
1099         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1100             <actions>
1101                 <retrieve/>
1102             </actions>
1103         </permacrud>
1104         </class>
1105
1106         <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">
1107                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1108                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1109                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1110                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1111                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1112                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1113                 </fields>
1114                 <links>
1115                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1116                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1117                 </links>
1118         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1119             <actions>
1120                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1121                 <retrieve/>
1122                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1123                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1124             </actions>
1125         </permacrud>
1126         </class>
1127
1128         <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">
1129                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1130                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1131                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1132                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1133                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1134                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1135                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1136                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1137             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1138             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1139             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1140                 </fields>
1141                 <links>
1142                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1143                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1144                 </links>
1145         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1146             <actions>
1147                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1148                 <retrieve/>
1149                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1150                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1151             </actions>
1152         </permacrud>
1153         </class>
1154
1155         <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">
1156                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1157                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1158                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1159                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1160                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1161                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1162                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1163                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1164                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1165                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1166                 </fields>
1167                 <links>
1168                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1169                 </links>
1170         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1171             <actions>
1172                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1173                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1174                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1175                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1176             </actions>
1177         </permacrud>
1178         </class>
1179
1180     <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">
1181         <fields oils_persist:primary="name">
1182             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1183             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1184             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1185             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1186             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1187             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1188             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1189             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1190             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1191             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1192         </fields>
1193         <links>
1194             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1195             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1196         </links>
1197         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1198             <actions>
1199                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1200                 <retrieve/>
1201                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1202                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1203             </actions>
1204         </permacrud>
1205     </class>
1206
1207     <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">
1208         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1209             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1210             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1211             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1212             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1213             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1214             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1215             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1216         </fields>
1217         <links>
1218             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1219         </links>
1220         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1221             <actions>
1222                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1223                 <retrieve/>
1224                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1225                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1226             </actions>
1227         </permacrud>
1228     </class>
1229
1230     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1231                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1232                         oils_persist:tablename="config.z3950_index_field_map" 
1233                         reporter:label="Z39.50 Index Field Map">
1234         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1235             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1236             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1237             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1238             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1239             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1240             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1241         </fields>
1242         <links>
1243             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1244             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1245             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1246         </links>
1247         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1248             <actions>
1249                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1250                 <retrieve/>
1251                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1252                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1253             </actions>
1254         </permacrud>
1255     </class>
1256
1257
1258         <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">
1259                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1260                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1261                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1262                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1263                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1264                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1265                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1266                 </fields>
1267                 <links>
1268             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1269             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1270                 </links>
1271                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1272                         <actions>
1273                                 <retrieve/>
1274                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1275                         </actions>
1276                 </permacrud>
1277         </class>
1278
1279         <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">
1280                 <fields oils_persist:primary="key">
1281                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
1282                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1283                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1284                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1285                 </fields>
1286                 <links/>
1287                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1288                         <actions>
1289                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1290                                 <retrieve/>
1291                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1292                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1293                         </actions>
1294                 </permacrud>
1295         </class>
1296
1297         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1298                 <fields oils_persist:primary="module">
1299                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1300                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1301                 </fields>
1302                 <links/>
1303         </class>
1304
1305         <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">
1306                 <fields oils_persist:primary="module">
1307                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1308                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1309                 </fields>
1310                 <links/>
1311                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1312                         <actions>
1313                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1314                                 <retrieve/>
1315                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1316                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1317                         </actions>
1318                 </permacrud>
1319         </class>
1320
1321         <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">
1322                 <fields oils_persist:primary="module">
1323                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1325                 </fields>
1326                 <links/>
1327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1328                         <actions>
1329                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1330                                 <retrieve/>
1331                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1332                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1333                         </actions>
1334                 </permacrud>
1335         </class>
1336
1337         <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">
1338                 <fields oils_persist:primary="module">
1339                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1340                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1341                 </fields>
1342                 <links/>
1343                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1344                         <actions>
1345                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1346                                 <retrieve/>
1347                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1348                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1349                         </actions>
1350                 </permacrud>
1351         </class>
1352
1353         <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">
1354                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1355                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1356                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1357                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1358                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1359                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1360                 </fields>
1361                 <links>
1362                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1363                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1364                 </links>
1365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1366                         <actions>
1367                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1368                     <context link="event_def" field="owner"/>
1369                 </create>
1370                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1371                     <context link="event_def" field="owner"/>
1372                 </retrieve>
1373                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1374                     <context link="event_def" field="owner"/>
1375                 </update>
1376                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1377                     <context link="event_def" field="owner"/>
1378                 </delete>
1379                         </actions>
1380                 </permacrud>
1381         </class>
1382
1383         <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">
1384                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1385                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1386                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1387                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1388                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1389                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1390                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1391                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1392                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1393                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1394                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1395                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1396                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1397                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1398                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1399                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1400                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1401                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1402                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1403                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1404                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1405                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1406                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1407                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1408                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1409                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1410                 </fields>
1411                 <links>
1412                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1413                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1414                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1415                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1416                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1417                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1418                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1419                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1420                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1421                 </links>
1422                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1423                         <actions>
1424                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1425                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1426                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1427                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1428                         </actions>
1429                 </permacrud>
1430         </class>
1431
1432         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1433                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1434                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1435                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1436                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1437                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1438                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1439                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1440                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1441                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1442                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1443                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1444                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1445                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1446                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1447                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1448                 </fields>
1449                 <links>
1450                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1451                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1452                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1453                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1454                 </links>
1455         </class>
1456
1457         <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">
1458                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1459                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1460                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1461                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1462                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1463                 </fields>
1464                 <links>
1465                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
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">
1470                     <context link="event_def" field="owner"/>
1471                 </create>
1472                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1473                     <context link="event_def" field="owner"/>
1474                 </retrieve>
1475                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1476                     <context link="event_def" field="owner"/>
1477                 </update>
1478                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1479                     <context link="event_def" field="owner"/>
1480                 </delete>
1481                         </actions>
1482                 </permacrud>
1483         </class>
1484
1485         <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">
1486                 <oils_persist:source_definition><![CDATA[
1487                 SELECT  atevdef.hook,
1488                         atevdef.name,
1489                         atevdef.reactor,
1490                         atev.id,
1491                         atev.event_def,
1492                         atev.add_time,
1493                         atev.run_time,
1494                         atev.start_time,
1495                         atev.update_time,
1496                         atev.complete_time,
1497                         atev.update_process,
1498                         atev.state,
1499                         atev.user_data,
1500                         atev.template_output,
1501                         atev.error_output,
1502                         atev.async_output,
1503                         targ_circ.id AS target_circ,
1504                         targ_ahr.id AS target_hold,
1505                         COALESCE(
1506                                 targ_circ.circ_lib,
1507                                 targ_ahr.pickup_lib
1508                         ) AS perm_lib
1509                 FROM action_trigger.event atev
1510                 JOIN action_trigger.event_definition atevdef ON
1511                         (atevdef.id = atev.event_def)
1512                 JOIN action_trigger.hook ath ON
1513                         (ath.key = atevdef.hook)
1514                 LEFT JOIN action.circulation targ_circ ON
1515                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1516                 LEFT JOIN action.hold_request targ_ahr ON
1517                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1518                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1519                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1520                                 'circ.staff.max_visible_event_age',
1521                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1522                         ) UNION
1523                         SELECT '1000 YEARS'::INTERVAL AS value
1524                 ) ous)
1525                 ]]></oils_persist:source_definition>
1526                 <fields oils_persist:primary="id">
1527                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1528                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1529                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1530                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1531                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1532                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1533                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1534                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1535                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1536                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1537                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1538                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1539                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1540                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1541                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1542                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1543                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1544                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1545                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1546                 </fields>
1547                 <links>
1548                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1549                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1550                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1551                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1552                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1553                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1554                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1555                 </links>
1556                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1557                         <actions>
1558                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1559                         </actions>
1560                 </permacrud>
1561         </class>
1562
1563         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1564                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1565                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1566                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1567                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1568                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1569                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1570                 </fields>
1571                 <links>
1572                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1573                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1574                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1575                 </links>
1576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1577                         <actions>
1578                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1579                         </actions>
1580                 </permacrud>
1581         </class>
1582
1583         <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">
1584                 <fields oils_persist:primary="code">
1585                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1586                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1587                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1588                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1589                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1590                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1591                 </fields>
1592                 <links/>
1593         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1594             <actions>
1595                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1596                 <retrieve/>
1597                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1598                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1599             </actions>
1600         </permacrud>
1601         </class>
1602
1603         <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">
1604                 <fields oils_persist:primary="code">
1605                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1606                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1607                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1608                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1609                 </fields>
1610                 <links/>
1611         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1612             <actions>
1613                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1614                 <retrieve/>
1615                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1616                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1617             </actions>
1618         </permacrud>
1619         </class>
1620
1621         <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">
1622                 <fields oils_persist:primary="code">
1623                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1624                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1625                 </fields>
1626                 <links/>
1627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1628             <actions>
1629                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1630                 <retrieve/>
1631                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1632                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1633             </actions>
1634         </permacrud>
1635         </class>
1636
1637         <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">
1638                 <fields oils_persist:primary="code">
1639                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1640                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1641                 </fields>
1642                 <links/>
1643         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1644             <actions>
1645                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1646                 <retrieve/>
1647                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1648                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1649             </actions>
1650         </permacrud>
1651         </class>
1652
1653         <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">
1654                 <fields oils_persist:primary="code">
1655                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1656                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1657                 </fields>
1658                 <links/>
1659         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1660             <actions>
1661                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1662                 <retrieve/>
1663                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1664                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1665             </actions>
1666         </permacrud>
1667         </class>
1668
1669         <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">
1670                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1671                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1672                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1673                 </fields>
1674                 <links/>
1675         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1676             <actions>
1677                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1678                 <retrieve/>
1679                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1680                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1681             </actions>
1682         </permacrud>
1683         </class>
1684
1685         <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">
1686                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1687                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1688                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1689                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1690                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1691                 </fields>
1692         <links>
1693             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1694             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1695             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1696         </links>
1697         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1698             <actions>
1699                 <create permission="UPDATE_COPY">
1700                     <context link="target_copy" field="circ_lib"/>
1701                 </create>
1702                 <retrieve/>
1703                 <update permission="UPDATE_COPY">
1704                     <context link="target_copy" field="circ_lib"/>
1705                 </update>
1706                 <delete permission="UPDATE_COPY">
1707                     <context link="target_copy" field="circ_lib"/>
1708                 </delete>
1709             </actions>
1710         </permacrud>
1711         </class>
1712
1713         <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">
1714                 <fields oils_persist:primary="code">
1715                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1716                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1717                 </fields>
1718                 <links/>
1719         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1720             <actions>
1721                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1722                 <retrieve/>
1723                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1724                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1725             </actions>
1726         </permacrud>
1727         </class>
1728
1729         <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">
1730                 <fields oils_persist:primary="code">
1731                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1732                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1733                 </fields>
1734                 <links/>
1735         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1736             <actions>
1737                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1738                 <retrieve/>
1739                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1740                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1741             </actions>
1742         </permacrud>
1743         </class>
1744
1745         <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">
1746                 <fields oils_persist:primary="code">
1747                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1748                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1749                 </fields>
1750                 <links/>
1751         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1752             <actions>
1753                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1754                 <retrieve/>
1755                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1756                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1757             </actions>
1758         </permacrud>
1759         </class>
1760
1761     <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">
1762         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1763             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1764             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1765             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1766             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1767             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1768             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1769             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1770             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1771             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1772             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1773             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1774             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1775             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1776             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1777             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1778             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1779             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1780         </fields>
1781         <links/>
1782         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1783             <actions>
1784                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1785                 <retrieve/>
1786                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1787                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1788             </actions>
1789         </permacrud>
1790     </class>
1791
1792     <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">
1793         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1794             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1795             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1796             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1797             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1798             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1799             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1800             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1801             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1802             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1803             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1804             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1805             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1806             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1807             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1808             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1809             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1810             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1811             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1812             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1813         </fields>
1814         <links/>
1815         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1816             <actions>
1817                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1818                 <retrieve/>
1819                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1820                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1821             </actions>
1822         </permacrud>
1823     </class>
1824
1825     <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">
1826         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1827             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1828             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1829             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1830             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1831             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1832         </fields>
1833         <links>
1834             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1835             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1836             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1837         </links>
1838         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1839             <actions>
1840                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1841                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1842                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1843                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1844             </actions>
1845         </permacrud>
1846     </class>
1847
1848         <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">
1849                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1850                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1851                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1852                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1853                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1854                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1855                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1856                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1857                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1858                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1859                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1860                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1861                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1862                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1863                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1864                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1865                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1866             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1867                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1868                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1869                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1870                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1871                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1872                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1873                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1874                 </fields>
1875                 <links>
1876                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1877                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1878                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1879                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1880                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1881                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1882                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1883                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1884                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1885                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1886                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1887                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1888                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1889             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1890                 </links>
1891         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1892             <actions>
1893                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1894                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1895                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1896                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1897             </actions>
1898         </permacrud>
1899         </class>
1900
1901         <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">
1902                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1903                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1904                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1905                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1906                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1907                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1908                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1909                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1910                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1911                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1912                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1913                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1914                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1915                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1916                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1917                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1918             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1919                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1920                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1921             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1922                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1923                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1924                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1925                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1926             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1927             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1928             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1929                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1930                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1931                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1932                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1933                 </fields>
1934                 <links>
1935                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1936                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1937                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1938                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1939                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1940                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1941                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1942                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1943                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1944                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1945                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1946                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1947                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1948                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1949             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1950                 </links>
1951         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1952             <actions>
1953                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1954                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1955                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1956                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1957             </actions>
1958         </permacrud>
1959         </class>
1960
1961     <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">
1962         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1963             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1964             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1965             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1966         </fields>
1967         <links/>
1968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1969             <actions>
1970                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1971                 <retrieve/>
1972                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1973                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1974             </actions>
1975         </permacrud>
1976     </class>
1977
1978     <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">
1979         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1980             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1981             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1982             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1983             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1984             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1985             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1986             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1987         </fields>
1988         <links>
1989             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1990         </links>
1991         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1992             <actions>
1993                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1994                 <retrieve/>
1995                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1996                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1997             </actions>
1998         </permacrud>
1999     </class>
2000
2001     <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">
2002         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2003             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2004             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2005             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2006             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2007             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2008         </fields>
2009         <links>
2010             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2011             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2012         </links>
2013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2014             <actions>
2015                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2016                     <context link="matchpoint" field="org_unit"/>
2017                 </create>
2018                 <retrieve/>
2019                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2020                     <context link="matchpoint" field="org_unit"/>
2021                 </update>
2022                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2023                     <context link="matchpoint" field="org_unit"/>
2024                 </delete>
2025             </actions>
2026         </permacrud>
2027     </class>
2028
2029     <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">
2030         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2031             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2032             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2033             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2034         </fields>
2035         <links>
2036             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2037             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2038         </links>
2039         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2040             <actions>
2041                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2042                     <context link="limit_set" field="owning_lib"/>
2043                 </create>
2044                 <retrieve/>
2045                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2046                     <context link="limit_set" field="owning_lib"/>
2047                 </update>
2048                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2049                     <context link="limit_set" field="owning_lib"/>
2050                 </delete>
2051             </actions>
2052         </permacrud>
2053     </class>
2054     <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">
2055         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2056             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2057             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2058             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2059         </fields>
2060         <links>
2061             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2062             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2063         </links>
2064         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2065             <actions>
2066                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2067                     <context link="limit_set" field="owning_lib"/>
2068                 </create>
2069                 <retrieve/>
2070                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2071                     <context link="limit_set" field="owning_lib"/>
2072                 </update>
2073                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2074                     <context link="limit_set" field="owning_lib"/>
2075                 </delete>
2076             </actions>
2077         </permacrud>
2078     </class>
2079
2080     <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">
2081         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2082             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2083             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2084             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2085             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2086         </fields>
2087         <links>
2088             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2089             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2090         </links>
2091         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2092             <actions>
2093                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2094                     <context link="limit_set" field="owning_lib"/>
2095                 </create>
2096                 <retrieve/>
2097                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2098                     <context link="limit_set" field="owning_lib"/>
2099                 </update>
2100                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2101                     <context link="limit_set" field="owning_lib"/>
2102                 </delete>
2103             </actions>
2104         </permacrud>
2105     </class>
2106
2107         <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">
2108                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2109                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2110                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2111                 </fields>
2112                 <links/>
2113         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2114             <actions>
2115                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2116                 <retrieve/>
2117                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2118                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2119             </actions>
2120         </permacrud>
2121         </class>
2122
2123         <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">
2124                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2125                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2126                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2127                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2128                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2129                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2130                 </fields>
2131                 <links>
2132                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2133                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2134                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2135                 </links>
2136         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2137             <actions>
2138                 <create permission="ADMIN_SURVEY">
2139                     <context link="survey" field="owner"/>
2140                 </create>
2141                 <retrieve/>
2142                 <update permission="ADMIN_SURVEY">
2143                     <context link="survey" field="owner"/>
2144                 </update>
2145                 <delete permission="ADMIN_SURVEY">
2146                     <context link="survey" field="owner"/>
2147                 </delete>
2148             </actions>
2149         </permacrud>
2150         </class>
2151         <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">
2152                 <fields oils_persist:primary="id" oils_persist:sequence="">
2153                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2154                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2155                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2156                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2157                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2158                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2159                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2160                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2161                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2162                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2163                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2164                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2165                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2166                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2167                 </fields>
2168                 <links>
2169                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2170                 </links>
2171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2172                         <actions>
2173                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2174                                         <context link="usr" field="home_ou" />
2175                                 </retrieve>
2176                         </actions>
2177                 </permacrud>
2178         </class>
2179         <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">
2180                 <fields oils_persist:primary="id" oils_persist:sequence="">
2181                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2182                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2183                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2184                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2185                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2186                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2187                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2188                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2189                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2190                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2191                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2192                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2193                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2194                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2195                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2196                 </fields>
2197                 <links>
2198                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2199                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2200                 </links>
2201         </class>
2202         <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">
2203                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2204                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2205                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2206                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2207                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2208                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2209                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2210                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2211                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2212                 </fields>
2213                 <links>
2214                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2215                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2216                 </links>
2217                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2218                         <actions> <!-- created magically, so no create action -->
2219                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2220                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2221                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2222                         </actions>
2223                 </permacrud>
2224         </class>
2225         <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)">
2226                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2227                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2228                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2229                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2230                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2231                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2232                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2233                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2234                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2235                 </fields>
2236                 <links>
2237                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2238                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2239                 </links>
2240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2241                         <actions> <!-- created magically, so no create action -->
2242                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2243                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2244                         </actions>
2245                 </permacrud>
2246         </class>
2247         <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">
2248                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2249                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2250                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2251                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2252                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2253                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2254                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2255                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2256                 </fields>
2257                 <links>
2258                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2259                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2260                 </links>
2261         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2262             <actions>
2263                 <create permission="UPDATE_USER" context_field="owner">
2264                     <context link="usr" field="home_ou"/>
2265                 </create>
2266                                 <!-- note: public notes are still accessible via API -->
2267                 <retrieve permission="UPDATE_USER">
2268                     <context link="usr" field="home_ou"/>
2269                                 </retrieve>
2270                 <update permission="UPDATE_USER">
2271                     <context link="usr" field="home_ou"/>
2272                                 </update>
2273                 <delete permission="UPDATE_USER">
2274                     <context link="usr" field="home_ou"/>
2275                                 </delete>
2276             </actions>
2277         </permacrud>
2278         </class>
2279         <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">
2280                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2281                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2282                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2283                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2284                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2285                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2286                 </fields>
2287                 <links>
2288                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2289                 </links>
2290         </class>
2291         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2292                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2293                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2294                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2295                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2296                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2297                 </fields>
2298                 <links>
2299                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2300                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2301                 </links>
2302         </class>
2303         <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">
2304                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2305                         <field name="field" reporter:datatype="link"/>
2306                         <field name="id" reporter:datatype="id" />
2307                         <field name="source" reporter:datatype="link"/>
2308                         <field name="value" reporter:datatype="text"/>
2309                 </fields>
2310                 <links>
2311                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2312                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2313                 </links>
2314         </class>
2315         <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">
2316                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2317                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2318                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2319                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2320                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2321                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2322                 </fields>
2323                 <links>
2324                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2325                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2326                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2327                 </links>
2328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2329                         <actions>
2330                                 <retrieve/>
2331                         </actions>
2332                 </permacrud>
2333         </class>
2334         <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">
2335                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2336                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2337                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2338                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2339                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2340                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2341                 </fields>
2342                 <links>
2343                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2344                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2345                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2346                 </links>
2347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2348                         <actions>
2349                                 <retrieve/>
2350                         </actions>
2351                 </permacrud>
2352         </class>
2353         <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">
2354                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2355                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2356                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2357                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2358                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2359                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2360                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2361                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2362                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2363                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2364                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2365                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2366                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2367                 </fields>
2368                 <links>
2369                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2370                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2371                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2372                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2373                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2374                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2375                 </links>
2376         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2377             <actions>
2378                 <create permission="TRANSIT_COPY" context_field="owner">
2379                     <context link="target_copy" field="circ_lib"/>
2380                 </create>
2381                 <retrieve/>
2382                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2383                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2384             </actions>
2385         </permacrud>
2386         </class>
2387         <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">
2388                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2389                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2390                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2391                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2392                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2393                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2394                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2395                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2396                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2397                 </fields>
2398                 <links>
2399                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2400                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2401                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2402                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2403                 </links>
2404         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2405             <actions>
2406                 <create permission="ADMIN_SURVEY">
2407                     <context link="survey" field="owner"/>
2408                 </create>
2409                 <retrieve permission="VIEW_USER">
2410                     <context link="usr" field="home_ou"/>
2411                 </retrieve>
2412                 <update permission="ADMIN_SURVEY">
2413                     <context link="survey" field="owner"/>
2414                 </update>
2415                 <delete permission="ADMIN_SURVEY">
2416                     <context link="survey" field="owner"/>
2417                 </delete>
2418             </actions>
2419         </permacrud>
2420         </class>
2421         <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">
2422                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2423                         <field name="bucket" />
2424                         <field name="id" reporter:datatype="id" />
2425                         <field name="target_copy" reporter:datatype="link"/>
2426                         <field name="create_time" reporter:datatype="timestamp" />
2427                         <field name="pos" reporter:datatype="int" />
2428                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2429                 </fields>
2430                 <links>
2431                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2432                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2433             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2434                 </links>
2435                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2436                         <actions>
2437                                 <retrieve permission="ADMIN_COPY_BUCKET">
2438                     <context link="bucket" owning_lib="owning_lib"/>
2439                 </retrieve>
2440             </actions>
2441         </permacrud>
2442         </class>
2443         <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">
2444                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2445                         <field name="id" reporter:datatype="id" />
2446                         <field name="item" reporter:datatype="link"/>
2447                         <field name="note" reporter:datatype="text" />
2448                 </fields>
2449                 <links>
2450                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2451                 </links>
2452         </class>
2453
2454         <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">
2455                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2456                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2457                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2458                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2459                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2460                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2461                 </fields>
2462                 <links>
2463                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2464                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2465                 </links>
2466                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2467                         <actions>
2468                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2469                                 <retrieve/>
2470                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2471                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2472                         </actions>
2473                 </permacrud>
2474         </class>
2475
2476         <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">
2477                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2478                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2479                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2480                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2481                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2482                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2483                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2484                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2485                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2486                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2487                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2488                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2489                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2490                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2491                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2492                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2493                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2494                 </fields>
2495                 <links>
2496                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2497                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2498                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2499                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2500                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2501                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2502                         <link field="heading" reltype="has_a" key="id" map="" class="ahf"/>
2503                 </links>
2504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2505                         <actions>
2506                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2507                                 <retrieve/>
2508                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2509                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2510                         </actions>
2511                 </permacrud>
2512         </class>
2513
2514         <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">
2515                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2516                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2517                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2518                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2519                 </fields>
2520                 <links>
2521                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2522                 </links>
2523                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2524                         <actions>
2525                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2526                                 <retrieve/>
2527                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2528                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2529                         </actions>
2530                 </permacrud>
2531         </class>
2532
2533         <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">
2534                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2535                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2536                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2537                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2538                 </fields>
2539                 <links>
2540                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2541                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2542                 </links>
2543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2544                         <actions>
2545                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2546                                 <retrieve/>
2547                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2548                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2549                         </actions>
2550                 </permacrud>
2551         </class>
2552
2553         <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">
2554                 <fields oils_persist:primary="code">
2555                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2556                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2557                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2558                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2559                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2560                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2561                 </fields>
2562                 <links>
2563                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2564                 </links>
2565                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2566                         <actions>
2567                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2568                                 <retrieve/>
2569                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2570                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2571                         </actions>
2572                 </permacrud>
2573         </class>
2574
2575         <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">
2576                 <fields oils_persist:primary="code">
2577                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2578                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2579                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2580                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2581                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2582                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2583                 </fields>
2584                 <links>
2585                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2586                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2587                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2588                 </links>
2589                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2590                         <actions>
2591                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2592                                 <retrieve/>
2593                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2594                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2595                         </actions>
2596                 </permacrud>
2597         </class>
2598
2599     <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">
2600         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2601             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2602             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2603             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2604         </fields>
2605         <links>
2606             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2607             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2608         </links>
2609         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2610             <actions>
2611                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2612                 <retrieve/>
2613                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2614                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2615             </actions>
2616         </permacrud>
2617     </class>
2618
2619         <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">
2620                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2621                         <field name="active" reporter:datatype="bool"/>
2622                         <field name="create_date" reporter:datatype="timestamp"/>
2623                         <field name="creator" />
2624                         <field name="deleted" reporter:datatype="bool"/>
2625                         <field name="edit_date" reporter:datatype="timestamp"/>
2626                         <field name="editor" />
2627                         <field name="id" reporter:datatype="id" />
2628                         <field name="last_xact_id" />
2629                         <field name="marc" />
2630                         <field name="source" />
2631                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2632                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2633                         <field name="heading" />
2634                         <field name="simple_heading" />
2635                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2636                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2637                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2638                 </fields>
2639                 <links>
2640                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2641                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2642                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2643                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2644                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2645                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2646                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2647                 </links>
2648                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2649                         <actions>
2650                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2651                                 <retrieve/>
2652                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2653                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2654                         </actions>
2655                 </permacrud>
2656         </class>
2657         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2658                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2659                         <field name="char_encoding" />
2660                         <field name="id" />
2661                         <field name="record" />
2662                         <field name="record_status" />
2663                         <field name="thesaurus" />
2664                 </fields>
2665                 <links>
2666                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2667                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2668                 </links>
2669         </class>
2670         <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">
2671                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2672                         <field name="id" reporter:datatype="id" />
2673                         <field name="bib" reporter:datatype="link" />
2674                         <field name="authority" reporter:datatype="link" />
2675                 </fields>
2676                 <links>
2677                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2678                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2679                 </links>
2680         </class>
2681         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2682                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2683                         <field name="id" reporter:datatype="id" />
2684                         <field name="record" reporter:datatype="link" />
2685                         <field name="atag" reporter:datatype="link" />
2686                         <field name="value" reporter:datatype="text" />
2687                 </fields>
2688                 <links>
2689                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2690                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2691                 </links>
2692         </class>
2693
2694         <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">
2695                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
2696                         <field name="id" reporter:datatype="id" />
2697                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
2698                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
2699                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
2700                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
2701                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
2702                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
2703                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
2704                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
2705                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
2706                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
2707                 </fields>
2708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2709                         <actions>
2710                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2711                                 <retrieve/>
2712                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2713                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2714                         </actions>
2715                 </permacrud>
2716         </class>
2717
2718         <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">
2719                 <fields oils_persist:primary="code" oils_persist:sequence="">
2720                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2721                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2722                 </fields>
2723                 <links/>
2724         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2725             <actions>
2726                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2727                 <retrieve/>
2728                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2729                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2730             </actions>
2731         </permacrud>
2732         </class>
2733         <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">
2734                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2735                         <field name="accepting_usr" />
2736                         <field name="amount" reporter:datatype="money" />
2737                         <field name="amount_collected" reporter:datatype="money" />
2738                         <field name="approval_code" reporter:datatype="text"/>
2739                         <field name="cash_drawer" reporter:datatype="link"/>
2740                         <field name="cc_number" reporter:datatype="text"/>
2741                         <field name="cc_order_number" reporter:datatype="text"/>
2742                         <field name="cc_processor" reporter:datatype="text"/>
2743                         <field name="id" reporter:datatype="id" />
2744                         <field name="note" reporter:datatype="text"/>
2745                         <field name="payment_ts" reporter:datatype="timestamp"/>
2746                         <field name="xact" reporter:datatype="link"/>
2747                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2748                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2749                 </fields>
2750                 <links>
2751                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2752                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2753                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2754                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2755                 </links>
2756         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2757             <actions>
2758                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2759                     <context link="xact" jump="usr" field="home_ou"/>
2760                 </retrieve>
2761                         </actions>
2762                 </permacrud>
2763         </class>
2764         <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">
2765                 <fields oils_persist:primary="name">
2766                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2767                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2768                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2769                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2770                 </fields>
2771                 <links/>
2772         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2773             <actions>
2774                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2775                 <retrieve/>
2776                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2777                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2778             </actions>
2779         </permacrud>
2780         </class>
2781
2782         <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">
2783                 <fields oils_persist:primary="alias">
2784                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2785                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2786                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2787                 </fields>
2788                 <links>
2789                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2790                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2791                 </links>
2792         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2793             <actions>
2794                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2795                 <retrieve/>
2796                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2797                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2798             </actions>
2799         </permacrud>
2800         </class>
2801
2802         <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">
2803                 <fields oils_persist:primary="name">
2804                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2805                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2806                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2807                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2808                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2809                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2810                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2811                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2812                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2813                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2814                 </fields>
2815                 <links>
2816                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2817                 </links>
2818         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2819             <actions>
2820                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2821                 <retrieve/>
2822                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2823                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2824             </actions>
2825         </permacrud>
2826         </class>
2827
2828         <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">
2829                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2830                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2831                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2832                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2833                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2834                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2835                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2836                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2837                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2838                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2839                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2840                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
2841                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2842                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2843                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2844                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
2845                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
2846                 </fields>
2847                 <links>
2848                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2849                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
2850                 </links>
2851         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2852             <actions>
2853                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2854                 <retrieve/>
2855                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2856                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2857             </actions>
2858         </permacrud>
2859         </class>
2860         <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">
2861                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2862                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2863                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2864                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2865                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2866                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2867                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2868                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2869                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2870                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2871                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2872                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2873                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2874                 </fields>
2875                 <links>
2876                 </links>
2877                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2878                         <actions>
2879                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2880                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2881                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2882                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2883                         </actions>
2884                 </permacrud>
2885         </class>
2886         <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">
2887                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2888                         <field name="id" reporter:datatype="id" />
2889                         <field name="name" reporter:datatype="text"/>
2890                         <field name="xpath" reporter:datatype="text"/>
2891                         <field name="format" reporter:datatype="link"/>
2892                         <field name="first_word" reporter:datatype="bool" />
2893                 </fields>
2894                 <links/>
2895         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2896             <actions>
2897                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2898                 <retrieve/>
2899                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2900                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2901             </actions>
2902         </permacrud>
2903         </class>
2904         <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">
2905                 <fields oils_persist:primary="code" oils_persist:sequence="">
2906                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2907                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2908                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2909                 </fields>
2910                 <links/>
2911         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2912             <actions>
2913                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2914                 <retrieve/>
2915                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2916                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2917             </actions>
2918         </permacrud>
2919         </class>
2920         <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">
2921                 <fields oils_persist:primary="code" oils_persist:sequence="">
2922                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2923                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2924                 </fields>
2925                 <links/>
2926         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2927             <actions>
2928                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2929                 <retrieve/>
2930                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2931                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2932             </actions>
2933         </permacrud>
2934         </class>
2935     <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">
2936         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2937             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2938             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2939             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2940             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2941         </fields>
2942         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2943             <actions>
2944                 <retrieve/>
2945             </actions>
2946         </permacrud>
2947     </class>
2948         <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">
2949                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2950                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2951                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2952                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2953                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2954                 </fields>
2955                 <links>
2956                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2957                 </links>
2958         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2959             <actions>
2960                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2961                 <retrieve/>
2962                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2963                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2964             </actions>
2965         </permacrud>
2966         </class>
2967         <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">
2968                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2969                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2970                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2971                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2972                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2973                 </fields>
2974                 <links>
2975                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2976                 </links>
2977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2978             <actions>
2979                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2980                 <retrieve/>
2981                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2982                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2983             </actions>
2984         </permacrud>
2985         </class>
2986         <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">
2987                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2988                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2989                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2990                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2991                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2992                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2993                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2994                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2995                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2996                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2997                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2998                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2999                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3000                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3001                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3002                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3003                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3004                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3005                 </fields>
3006                 <links>
3007                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3008                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3009                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3010                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3011                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3012                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3013                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3014                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3015                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3016                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3017                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3018                 </links>
3019         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3020             <actions>
3021                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3022                 <retrieve/>
3023                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3024                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3025             </actions>
3026         </permacrud>
3027         </class>
3028         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3029                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3030                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3031                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3032                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3033                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3034                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3035                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3036                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3037                 </fields>
3038                 <links>
3039                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3040                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3041         </links>
3042         </class>
3043         <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">
3044                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3045                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3046                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3047                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3048                 </fields>
3049                 <links>
3050                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3051                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3052                 </links>
3053         </class>
3054         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3055                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3056                         <field name="id" reporter:datatype="id" />
3057                         <field name="value" oils_persist:i18n="true" />
3058                 </fields>
3059                 <links/>
3060         </class>
3061         <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">
3062                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3063                         <field name="balance_owed" reporter:datatype="money" />
3064                         <field name="total_owed" reporter:datatype="money" />
3065                         <field name="total_paid" reporter:datatype="money" />
3066                         <field name="usr" reporter:datatype="link"/>
3067                 </fields>
3068                 <links>
3069                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3070         </links>
3071         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3072             <actions>
3073                 <retrieve permission="VIEW_USER">
3074                     <context link="usr" field="home_ou"/>
3075                 </retrieve>
3076             </actions>
3077         </permacrud>
3078         </class>
3079         <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">
3080                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3081                         <field name="collector" />
3082                         <field name="enter_time" reporter:datatype="timestamp"/>
3083                         <field name="id" reporter:datatype="id" />
3084                         <field name="location" reporter:datatype="link"/>
3085                         <field name="usr" reporter:datatype="link"/>
3086                 </fields>
3087                 <links>
3088                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3089                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3090                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3091                 </links>
3092         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3093             <actions>
3094                 <create permission="money.collections_tracker.create" context_field="location"/>
3095                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3096                 <delete permission="money.collections_tracker.create" context_field="location"/>
3097             </actions>
3098         </permacrud>
3099         </class>
3100         <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">
3101                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3102                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3103                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3104                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3105                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3106                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3107                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3108                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3109                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3110                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3111                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3112                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3113                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3114                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3115                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3116                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3117                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3118                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3119                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3120                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3121                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3122                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3123                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3124                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3125                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3126                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3127                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3128                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3129                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3130                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3131                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3132                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3133                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3134                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3135                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3136                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3137                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3138                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3139                 </fields>
3140                 <links>
3141                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3142                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3143                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3144                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3145                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3146                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3147                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3148                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3149                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3150                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3151                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3152                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3153                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3154                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3155                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3156                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3157                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3158                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3159                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3160                         <link field="mattrs" reltype="might_have" key="id" map="" class="mraf"/>
3161                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3162                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3163                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3164                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3165                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3166                 </links>
3167         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3168             <actions>
3169                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3170                 <retrieve/>
3171                 <update permission="UPDATE_MARC" global_required="true"/>
3172                 <!-- 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. -->
3173                 <delete permission="DELETE_RECORD" global_required="true"/>
3174             </actions>
3175         </permacrud>
3176         </class>
3177         <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">
3178                 <fields oils_persist:primary="id">
3179                         <field name="dow_0_close" />
3180                         <field name="dow_0_open" />
3181                         <field name="dow_1_close" />
3182                         <field name="dow_1_open" />
3183                         <field name="dow_2_close" />
3184                         <field name="dow_2_open" />
3185                         <field name="dow_3_close" />
3186                         <field name="dow_3_open" />
3187                         <field name="dow_4_close" />
3188                         <field name="dow_4_open" />
3189                         <field name="dow_5_close" />
3190                         <field name="dow_5_open" />
3191                         <field name="dow_6_close" />
3192                         <field name="dow_6_open" />
3193                         <field name="id" reporter:datatype="id" />
3194                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3195                 </fields>
3196                 <links>
3197                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3198                 </links>
3199         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3200             <actions>
3201                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3202                 <retrieve/>
3203                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3204                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3205             </actions>
3206         </permacrud>
3207         </class>
3208         <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">
3209                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3210                         <field name="id" reporter:datatype="id" />
3211                         <field name="record" reporter:datatype="link"/>
3212                         <field name="label" reporter:datatype="text"/>
3213                         <field name="label_sortkey" reporter:datatype="text"/>
3214                         <field name="deleted" reporter:datatype="bool"/>
3215                 </fields>
3216                 <links>
3217                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3218                 </links>
3219         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3220             <actions>
3221                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3222                 <retrieve/>
3223                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3224                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3225             </actions>
3226         </permacrud>
3227         </class>
3228         <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">
3229                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3230                         <field name="id" reporter:datatype="id" />
3231                         <field name="target_copy" reporter:datatype="link" />
3232                         <field name="part" reporter:datatype="link"/>
3233                 </fields>
3234                 <links>
3235                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3236                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3237                 </links>
3238         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3239             <actions>
3240                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3241                 <retrieve/>
3242                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3243                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3244             </actions>
3245         </permacrud>
3246         </class>
3247         <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">
3248                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3249                         <field name="close_end" reporter:datatype="timestamp" />
3250                         <field name="close_start" reporter:datatype="timestamp" />
3251                         <field name="id" reporter:datatype="id" />
3252                         <field name="org_unit" reporter:datatype="org_unit"/>
3253                         <field name="reason" reporter:datatype="text"/>
3254                         <field name="full_day" reporter:datatype="bool"/>
3255                         <field name="multi_day" reporter:datatype="bool"/>
3256                 </fields>
3257                 <links>
3258                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3259                 </links>
3260         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3261             <actions>
3262                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3263                 <retrieve/>
3264                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3265                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3266             </actions>
3267         </permacrud>
3268         </class>
3269         <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">
3270                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3271                         <field name="extended" reporter:datatype="interval"/>
3272                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3273                         <field name="max_renewals" reporter:datatype="int" />
3274                         <field name="name" reporter:datatype="text"/>
3275                         <field name="normal" reporter:datatype="interval"/>
3276                         <field name="shrt" reporter:datatype="interval"/>
3277                 </fields>
3278                 <links>
3279                 </links>
3280         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3281             <actions>
3282                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3283                 <retrieve/>
3284                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3285                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3286             </actions>
3287         </permacrud>
3288         </class>
3289
3290         <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">
3291                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3292                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3293                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3294             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3295                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3296             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3297                 </fields>
3298                 <links>
3299             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3300                 </links>
3301                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3302             <actions>
3303                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3304                 <retrieve/>
3305                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3306                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3307             </actions>
3308                 </permacrud>
3309         </class>
3310
3311         <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">
3312                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3313                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3314                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3315                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3316             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3317                 </fields>
3318                 <links>
3319                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3320                 </links>
3321                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3322             <actions>
3323                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3324                 <retrieve/>
3325                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3326                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3327             </actions>
3328                 </permacrud>
3329         </class>
3330
3331         <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">
3332                 <fields oils_persist:primary="id" oils_persist:sequence="">
3333                         <field name="balance_owed" reporter:datatype="money"/>
3334                         <field name="id" reporter:datatype="id" />
3335                         <field name="last_billing_note" reporter:datatype="text"/>
3336                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3337                         <field name="last_billing_type" reporter:datatype="text"/>
3338                         <field name="last_payment_note" reporter:datatype="text"/>
3339                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3340                         <field name="last_payment_type" reporter:datatype="text"/>
3341                         <field name="total_owed" reporter:datatype="money"/>
3342                         <field name="total_paid" reporter:datatype="money"/>
3343                         <field name="usr" reporter:datatype="link"/>
3344                         <field name="xact_finish" reporter:datatype="timestamp" />
3345                         <field name="xact_start" reporter:datatype="timestamp" />
3346                         <field name="xact_type" reporter:datatype="text"/>
3347                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3348                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3349                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3350                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3351                         <field name="billing_location" reporter:datatype="link"/>
3352                 </fields>
3353                 <links>
3354                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3355                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3356                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3357                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3358                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3359                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3360                 </links>
3361                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3362                         <actions>
3363                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3364                                         <context link="usr" field="home_ou" />
3365                                 </retrieve>
3366                         </actions>
3367                 </permacrud>
3368         </class>
3369         <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">
3370                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3371                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3372                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3373                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3374                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3375                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3376                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3377                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3378                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3379                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3380                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3381                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3382                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3383                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3384                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3385                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3386                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3387                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3388                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3389                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3390                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3391                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3392                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3393                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3394                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3395                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3396                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3397                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3398                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3399                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3400                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3401                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3402                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3403                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3404                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3405                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3406                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3407                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3408                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3409                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3410                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3411                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3412                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3413                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3414                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3415                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3416                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3417                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3418                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3419                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3420                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3421                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3422                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3423                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3424                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3425                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3426                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3427                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3428                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3429                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3430                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3431                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3432                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3433                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3434                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
3435                 </fields>
3436                 <links>
3437                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3438                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3439                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3440                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3441                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3442                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3443                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3444                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3445                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3446                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3447                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3448                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3449                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3450                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3451                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3452                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3453                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3454                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3455                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3456                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3457                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3458                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3459                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3460                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3461                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3462                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3463                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3464                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3465                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3466                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3467                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
3468                 </links>
3469                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3470                         <actions>
3471                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3472                         </actions>
3473                 </permacrud>
3474         </class>
3475         <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">
3476                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3477                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3478                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3479                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3480                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3481                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3482                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3483                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3484                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3485         </fields>
3486                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3487                         <actions>
3488                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3489                                 <retrieve/>
3490                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3491                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3492                         </actions>
3493                 </permacrud>
3494         </class>
3495         <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">
3496                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3497                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3498                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3499                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3500                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3501         </fields>
3502         <links>
3503                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3504                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3505                 </links>
3506                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3507                         <actions>
3508                                 <retrieve permission="RUN_REPORTS">
3509                                         <context link="usr" field="home_ou" />
3510                                 </retrieve>
3511                         </actions>
3512                 </permacrud>
3513         </class>
3514         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3515                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3516                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3517                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3518                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3519                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3520                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3521                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3522         </fields>
3523         <links>
3524                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3525                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3526                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3527                 </links>
3528                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3529                         <actions>
3530                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3531                                         <context link="usr" field="home_ou" />
3532                                         <context link="ws" field="owning_lib" />
3533                                 </retrieve>
3534                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3535                                         <context link="usr" field="home_ou" />
3536                                         <context link="ws" field="owning_lib" />
3537                                 </create>
3538                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3539                                         <context link="usr" field="home_ou" />
3540                                         <context link="ws" field="owning_lib" />
3541                                 </update>
3542                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3543                                         <context link="usr" field="home_ou" />
3544                                         <context link="ws" field="owning_lib" />
3545                                 </delete>
3546                         </actions>
3547                 </permacrud>
3548         </class>
3549         <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">
3550                 <fields oils_persist:primary="name">
3551                         <field name="name" reporter:datatype="text"/>
3552                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3553                 </fields>
3554                 <links/>
3555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3556                         <actions>
3557                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3558                                 <retrieve/>
3559                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3560                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3561                         </actions>
3562                 </permacrud>
3563         </class>
3564         <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">
3565                 <fields oils_persist:primary="name">
3566                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3567                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3568                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3569                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3570                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3571                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3572                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3573                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3574                 </fields>
3575                 <links>
3576                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3577                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3578                 </links>
3579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3580                         <actions>
3581                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3582                                 <retrieve/>
3583                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3584                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3585                         </actions>
3586                 </permacrud>
3587         </class>
3588         <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">
3589                 <fields oils_persist:primary="name">
3590                         <field name="name" reporter:datatype="text"/>
3591                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3592                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3593                         <field name="datatype" reporter:datatype="text"/>
3594                         <field name="view_perm" reporter:datatype="link"/>
3595                         <field name="update_perm" reporter:datatype="link"/>
3596                         <field name="fm_class" reporter:datatype="text"/>
3597                         <field name="grp" reporter:datatype="link"/>
3598                 </fields>
3599                 <links>
3600                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3601                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3602                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3603                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3604                 </links>
3605                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3606                         <actions>
3607                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3608                                 <retrieve/>
3609                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3610                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3611                         </actions>
3612                 </permacrud>
3613         </class>
3614         <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">
3615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3616                         <field name="id" />
3617                         <field name="name"  reporter:datatype="text"/>
3618                         <field name="org_unit" reporter:datatype="org_unit"/>
3619                         <field name="value"  reporter:datatype="text"/>
3620                 </fields>
3621                 <links>
3622                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3623                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3624                 </links>
3625         </class>
3626         <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">
3627                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3628                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3629                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3630                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3631                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3632                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3633                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3634                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3635                 </fields>
3636                 <links>
3637                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3638                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3639                 </links>
3640         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3641             <actions>
3642                 <create permission="CREATE_COPY_NOTE">
3643                     <context link="owning_copy" field="circ_lib"/>
3644                 </create>
3645                 <retrieve permission="VIEW_COPY_NOTES">
3646                     <context link="owning_copy" field="circ_lib"/>
3647                 </retrieve>
3648                 <update permission="UPDATE_COPY_NOTE">
3649                     <context link="owning_copy" field="circ_lib"/>
3650                 </update>
3651                 <delete permission="DELETE_COPY_NOTE">
3652                     <context link="owning_copy" field="circ_lib"/>
3653                 </delete>
3654             </actions>
3655         </permacrud>
3656         </class>
3657         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3658                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3659                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3660                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3661                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3662                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3663                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3664                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3665                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3666                 </fields>
3667                 <links>
3668                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3669                 </links>
3670         </class>
3671         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3672                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3673                         <field name="fingerprint"  reporter:datatype="text"/>
3674                         <field name="id" reporter:datatype="id" />
3675                         <field name="master_record" reporter:datatype="link"/>
3676                         <field name="mods"  reporter:datatype="text"/>
3677                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3678                 </fields>
3679                 <links>
3680                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3681                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3682                 </links>
3683         </class>
3684         <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">
3685                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3686                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3687                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3688                 </fields>
3689                 <links/>
3690         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3691             <actions>
3692                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3693                 <retrieve/>
3694                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3695                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3696             </actions>
3697         </permacrud>
3698         </class>
3699         <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">
3700                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3701                         <field name="code"  reporter:datatype="text"/>
3702                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3703                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3704                 </fields>
3705                 <links/>
3706         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3707             <actions>
3708                 <create permission="CREATE_PERM" global_required="true"/>
3709                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3710                 <update permission="UPDATE_PERM" global_required="true"/>
3711                 <delete permission="DELETE_PERM" global_required="true"/>
3712             </actions>
3713         </permacrud>
3714         </class>
3715         <class id="mmrsm" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord_source_map" oils_persist:tablename="metabib.metarecord_source_map" oils_persist:field_safe="true" reporter:label="Metarecord Source Map">
3716                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3717                         <field name="id" reporter:datatype="id" />
3718                         <field name="metarecord" reporter:datatype="link"/>
3719                         <field name="source" reporter:datatype="link"/>
3720                 </fields>
3721                 <links>
3722                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3723                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3724                 </links>
3725         </class>
3726         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
3727                         oils_obj:fieldmapper="metabib::display_entry" 
3728                         oils_persist:tablename="metabib.display_entry" 
3729                         oils_persist:field_safe="true"
3730                         reporter:label="Display Field Entry" oils_persist:readonly="true">
3731                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
3732                         <field name="id" reporter:datatype="id" />
3733                         <field name="field" reporter:datatype="link"/>
3734                         <field name="source" reporter:datatype="link"/>
3735                         <field name="value"  reporter:datatype="text"/>
3736                 </fields>
3737                 <links>
3738                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3739                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3740                 </links>
3741                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3742                         <actions>
3743                                 <retrieve/>
3744                         </actions>
3745                 </permacrud>
3746         </class>
3747         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
3748                 oils_persist:tablename="metabib.flat_display_entry"
3749                 oils_obj:fieldmapper="metabib::flat_display_entry" 
3750                 oils_persist:field_safe="true"
3751                 reporter:label="Flat Display Entry" 
3752                 oils_persist:readonly="true">
3753                 <fields>
3754                         <field name="source" reporter:datatype="id" />
3755                         <field name="name" reporter:datatype="text"/>
3756                         <field name="multi" reporter:datatype="bool"/>
3757                         <field name="label" reporter:datatype="text"/>
3758                         <field name="field" reporter:datatype="link"/>
3759                         <field name="value" reporter:datatype="text"/>
3760                 </fields>
3761                 <links>
3762                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3763                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3764                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
3765                 </links>
3766                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3767                         <actions>
3768                                 <retrieve/>
3769                         </actions>
3770                 </permacrud>
3771         </class>
3772         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
3773                 oils_persist:tablename="metabib.compressed_display_entry"
3774                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
3775                 oils_persist:field_safe="true"
3776                 reporter:label="Compressed Display Entry" 
3777                 oils_persist:readonly="true">
3778                 <fields>
3779                         <field name="source" reporter:datatype="id" />
3780                         <field name="name" reporter:datatype="text"/>
3781                         <field name="multi" reporter:datatype="bool"/>
3782                         <field name="label" reporter:datatype="text"/>
3783                         <field name="field" reporter:datatype="link"/>
3784                         <field name="value" reporter:datatype="text"/>
3785                 </fields>
3786                 <links>
3787                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3788                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3789                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
3790                 </links>
3791                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3792                         <actions>
3793                                 <retrieve/>
3794                         </actions>
3795                 </permacrud>
3796         </class>
3797         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
3798                 oils_persist:tablename="metabib.wide_display_entry"
3799                 oils_obj:fieldmapper="metabib::wide_display_entry" 
3800                 oils_persist:field_safe="true"
3801                 reporter:label="Wide Display Entry" 
3802                 oils_persist:readonly="true">
3803                 <fields oils_persist:primary="source">
3804                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
3805                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
3806                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
3807                         <field name="subject" reporter:label="Subject" reporter:datatype="text"/>
3808                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
3809                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
3810                         <!-- TODO add all well-known fields -->
3811                 </fields>
3812                 <links>
3813                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3814                 </links>
3815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3816                         <actions>
3817                                 <retrieve/>
3818                         </actions>
3819                 </permacrud>
3820         </class>
3821
3822         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
3823                 oils_persist:tablename="config.display_field_map"
3824                 oils_obj:fieldmapper="config::display_field_map"
3825                 oils_persist:field_safe="true"
3826                 reporter:label="Display Field Map" 
3827                 oils_persist:readonly="true">
3828                 <fields oils_persist:primary="name">
3829                         <field name="name" reporter:datatype="text"/>
3830                         <field name="field" reporter:datatype="link"/>
3831                         <field name="multi" reporter:datatype="bool"/>
3832                 </fields>
3833                 <links>
3834                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3835                 </links>
3836                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3837                         <actions>
3838                                 <retrieve/>
3839                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3840                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3841                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3842                         </actions>
3843                 </permacrud>
3844         </class>
3845
3846         <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">
3847                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3848                         <field name="id" reporter:datatype="id" />
3849                         <field name="field" reporter:datatype="link"/>
3850                         <field name="source" reporter:datatype="link"/>
3851                         <field name="value"  reporter:datatype="text"/>
3852                 </fields>
3853                 <links>
3854                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3855                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3856                 </links>
3857         </class>
3858         <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">
3859                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3860                         <field name="id" reporter:datatype="id" />
3861                         <field name="value" reporter:datatype="text"/>
3862                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3863                 </fields>
3864                 <links>
3865                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3866                 </links>
3867         </class>
3868         <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">
3869                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3870                         <field name="id" reporter:datatype="id" />
3871                         <field name="entry" reporter:datatype="link"/>
3872                         <field name="def" reporter:datatype="link"/>
3873                         <field name="source" reporter:datatype="link"/>
3874                 </fields>
3875                 <links>
3876                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3877                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3878                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3879                 </links>
3880         </class>
3881         <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">
3882                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3883                         <field name="id" reporter:datatype="id" />
3884                         <field name="entry" reporter:datatype="link"/>
3885                         <field name="simple_heading" reporter:datatype="link"/>
3886                 </fields>
3887                 <links>
3888                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3889                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3890                 </links>
3891         </class>
3892         <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">
3893                 <oils_persist:source_definition>
3894                         SELECT * FROM metabib.author_field_entry
3895                                                 UNION ALL
3896                         SELECT * FROM metabib.keyword_field_entry
3897                                                 UNION ALL
3898                         SELECT * FROM metabib.identifier_field_entry
3899                                                 UNION ALL
3900                         SELECT * FROM metabib.title_field_entry
3901                                                 UNION ALL
3902                         SELECT * FROM metabib.subject_field_entry
3903                                                 UNION ALL
3904                         SELECT * FROM metabib.series_field_entry
3905                 </oils_persist:source_definition>
3906                 <fields>
3907                         <field name="field" reporter:datatype="link"/>
3908                         <field name="id" reporter:datatype="id" />
3909                         <field name="source" reporter:datatype="link"/>
3910                         <field name="value"  reporter:datatype="text"/>
3911                 </fields>
3912                 <links>
3913                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3914                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3915                 </links>
3916         </class>
3917         <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">
3918                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3919                         <field name="field" reporter:datatype="link"/>
3920                         <field name="id" reporter:datatype="id" />
3921                         <field name="source" reporter:datatype="link"/>
3922                         <field name="value"  reporter:datatype="text"/>
3923                 </fields>
3924                 <links>
3925                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3926                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3927                 </links>
3928         </class>
3929         <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">
3930                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3931                         <field name="accepting_usr" reporter:datatype="link"/>
3932                         <field name="amount" reporter:datatype="money" />
3933                         <field name="amount_collected" reporter:datatype="money" />
3934                         <field name="cash_drawer" reporter:datatype="link"/>
3935                         <field name="id" reporter:datatype="id" />
3936                         <field name="note"  reporter:datatype="text"/>
3937                         <field name="payment_ts" reporter:datatype="timestamp"/>
3938                         <field name="xact" reporter:datatype="link"/>
3939                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3940                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3941                 </fields>
3942                 <links>
3943                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3944                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3945                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3946                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3947                 </links>
3948         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3949             <actions>
3950                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3951                     <context link="xact" jump="usr" field="home_ou"/>
3952                 </retrieve>
3953                         </actions>
3954                 </permacrud>
3955         </class>
3956         <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">
3957                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3958                         <field name="accepting_usr" reporter:datatype="link"/>
3959                         <field name="amount" reporter:datatype="money" />
3960                         <field name="amount_collected" reporter:datatype="money" />
3961                         <field name="id" reporter:datatype="id" />
3962                         <field name="note"  reporter:datatype="text"/>
3963                         <field name="payment_ts" reporter:datatype="timestamp"/>
3964                         <field name="xact" reporter:datatype="link"/>
3965                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3966                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3967                 </fields>
3968                 <links>
3969                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3970                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3971                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3972                 </links>
3973         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3974             <actions>
3975                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3976                     <context link="xact" jump="usr" field="home_ou"/>
3977                 </retrieve>
3978                         </actions>
3979                 </permacrud>
3980         </class>
3981         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
3982                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3983                         <field name="accepting_usr" reporter:datatype="link"/>
3984                         <field name="amount" reporter:datatype="money" />
3985                         <field name="amount_collected" reporter:datatype="money" />
3986                         <field name="id" reporter:datatype="id" />
3987                         <field name="note"  reporter:datatype="text"/>
3988                         <field name="payment_ts" reporter:datatype="timestamp"/>
3989                         <field name="xact" reporter:datatype="link"/>
3990                         <field name="billing" reporter:datatype="link"/>
3991                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3992                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3993                 </fields>
3994                 <links>
3995                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3996                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3997                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3998                         <link field="billing" reltype="might_have" key="id" class="mb"/>
3999                 </links>
4000         </class>
4001         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4002                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4003                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4004                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4005                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4006                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4007                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4008                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4009                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4010                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4011                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4012                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4013                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4014                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4015                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4016                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4017                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4018                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4019                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4020                 </fields>
4021                 <links>
4022                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4023                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4024                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4025                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4026                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4027                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4028                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4029                 </links>
4030         </class>
4031
4032         <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">
4033                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4034                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4035                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4036                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4037                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4038                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4039                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4040                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4041                 </fields>
4042                 <links/>
4043         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4044             <actions>
4045                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4046                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
4047                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4048                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4049             </actions>
4050         </permacrud>
4051         </class>
4052         <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">
4053                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4054                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4055                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4056                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4057                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4058                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4059                 </fields>
4060                 <links>
4061                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4062                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4063                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4064         </links>
4065         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4066             <actions>
4067                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4068                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4069                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4070                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4071             </actions>
4072         </permacrud>
4073         </class>
4074         <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">
4075                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4076                         <field name="holdable" reporter:datatype="bool"/>
4077                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4078                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4079                         <field name="opac_visible" reporter:datatype="bool"/>
4080             <field name="copy_active" reporter:datatype="bool"/>
4081             <field name="restrict_copy_delete" reporter:datatype="bool"/>
4082             <field name="is_available" reporter:datatype="bool"/>
4083                 </fields>
4084                 <links/>
4085         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4086             <actions>
4087                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4088                 <retrieve/>
4089                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4090                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4091             </actions>
4092         </permacrud>
4093         </class>
4094         <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">
4095                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
4096                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4097                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4098                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4099                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4100                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4101                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4102                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4103                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
4104                 </fields>
4105                 <links>
4106                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4107                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4108                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4109                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4110                 </links>
4111                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4112                         <actions>
4113                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4114                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4115                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4116                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4117                         </actions>
4118                 </permacrud>
4119         </class>
4120         <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">
4121                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4122                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4123                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4124                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4125                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4126                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4127                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4128                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4129                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4130                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4131                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4132                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4133                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4134                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4135                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4136                 </fields>
4137                 <links>
4138                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4139                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4140                 </links>
4141                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4142                         <actions>
4143                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4144                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4145                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4146                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4147                         </actions>
4148                 </permacrud>
4149         </class>
4150         <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">
4151                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4152                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4153                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4154                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4155                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4156                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4157                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4158                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4159                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4160                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4161                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4162                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4163                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4164                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4165                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4166                 </fields>
4167                 <links>
4168                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4169                 </links>
4170                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4171                         <actions>
4172                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4173                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4174                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4175                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4176                         </actions>
4177                 </permacrud>
4178         </class>
4179
4180
4181         <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">
4182                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4183                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4184                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4185                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4186                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4187                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4188                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4189                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4190                 </fields>
4191                 <links>
4192                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4193                 </links>
4194         </class>
4195
4196         <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">
4197                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4198                         <field name="call_number" />
4199                         <field name="create_date" reporter:datatype="timestamp"/>
4200                         <field name="creator" reporter:datatype="link"/>
4201                         <field name="id" reporter:datatype="id" />
4202                         <field name="pub" reporter:datatype="bool"/>
4203                         <field name="title"  reporter:datatype="text"/>
4204                         <field name="value"  reporter:datatype="text"/>
4205                 </fields>
4206                 <links>
4207                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4208                 </links>
4209         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4210             <actions>
4211                 <create permission="CREATE_VOLUME_NOTE">
4212                     <context link="call_number" field="owning_lib"/>
4213                 </create>
4214                 <retrieve permission="VIEW_VOLUME_NOTES">
4215                     <context link="call_number" field="owning_lib"/>
4216                 </retrieve>
4217                 <update permission="UPDATE_VOLUME_NOTE">
4218                     <context link="call_number" field="owning_lib"/>
4219                 </update>
4220                 <delete permission="DELETE_VOLUME_NOTE">
4221                     <context link="call_number" field="owning_lib"/>
4222                 </delete>
4223             </actions>
4224         </permacrud>
4225         </class>
4226         <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">
4227                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4228                         <field name="create_date" reporter:datatype="timestamp"/>
4229                         <field name="creator" reporter:datatype="link"/>
4230                         <field name="edit_date" reporter:datatype="timestamp"/>
4231                         <field name="editor" reporter:datatype="link"/>
4232                         <field name="id" reporter:datatype="id" />
4233                         <field name="record" reporter:datatype="link"/>
4234                         <field name="value" reporter:datatype="text"/>
4235                 </fields>
4236                 <links>
4237                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4238                 </links>
4239         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4240             <actions>
4241                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4242                 <retrieve/>
4243                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4244                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4245             </actions>
4246         </permacrud>
4247         </class>
4248         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4249         <oils_persist:source_definition>
4250 SELECT  usr,
4251         SUM(
4252             CASE
4253                 WHEN (
4254                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4255                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4256                 ) THEN 1
4257                 ELSE 0
4258             END
4259         ) AS out,
4260
4261         SUM(
4262             CASE
4263                 WHEN (
4264                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4265                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4266                 ) THEN 1
4267                 ELSE 0
4268             END
4269         ) AS overdue,
4270
4271         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4272         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4273         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4274   FROM  action.circulation
4275   WHERE checkin_time IS NULL
4276   GROUP BY 1
4277         </oils_persist:source_definition>
4278         <fields oils_persist:primary="usr">
4279             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4280             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4281             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4282             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4283             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4284             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4285         </fields>
4286         <links>
4287             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4288         </links>
4289         </class>
4290         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4291         <oils_persist:source_definition>
4292 SELECT  usr,
4293         STRING_AGG(
4294             CASE
4295                 WHEN (
4296                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4297                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4298                 ) THEN id::TEXT
4299                 ELSE '0'
4300             END
4301         ,',') AS out,
4302
4303         STRING_AGG(
4304             CASE
4305                 WHEN (
4306                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4307                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4308                 ) THEN id::TEXT
4309                 ELSE '0'
4310             END
4311         ,',') AS overdue,
4312
4313         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
4314         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
4315         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
4316   FROM  action.circulation
4317   WHERE checkin_time IS NULL
4318   GROUP BY 1
4319         </oils_persist:source_definition>
4320         <fields oils_persist:primary="usr">
4321             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4322             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4323             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4324             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4325             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4326             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4327         </fields>
4328         <links>
4329             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4330         </links>
4331         </class>
4332         <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">
4333                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4334                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4335                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4336                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4337                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
4338                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4339                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4340                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4341                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4342                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4343                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4344                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4345                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4346                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4347                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4348                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4349                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4350                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4351                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4352                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4353                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4354                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4355                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4356                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4357                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4358                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4359                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4360                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4361                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4362                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4363                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4364                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4365                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4366                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4367                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4368                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4369                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4370                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4371                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4372                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4373                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4374                 </fields>
4375                 <links>
4376                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4377                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4378                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4379                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4380                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4381                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4382                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4383                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4384                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4385                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4386                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4387                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4388                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4389                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4390                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4391                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4392                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4393                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
4394                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4395                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4396                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4397                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4398                 </links>
4399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4400                         <actions>
4401                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4402                         </actions>
4403                 </permacrud>
4404         </class>
4405         <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">
4406                 <fields>
4407                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
4408                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4409                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
4410                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4411                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
4412                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
4413                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
4414                 </fields>
4415                 <links>
4416                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4417                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4418                 </links>
4419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4420                         <actions>
4421                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4422                         </actions>
4423                 </permacrud>
4424         </class>
4425         <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">
4426                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4427                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4428                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4429                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4430                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4431                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4432                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4433                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4434                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4435                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4436                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4437                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4438                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4439                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4440                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4441                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4442                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4443                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4444                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4445                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4446                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4447                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4448                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4449                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4450                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4451                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4452                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4453                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4454                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4455                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4456                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4457                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4458                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4459                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4460                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4461                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4462                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4463                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4464                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4465                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4466                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4467                 </fields>
4468                 <links>
4469                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4470                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4471                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4472                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4473                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4474                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4475                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4476                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4477                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4478                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4479                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4480                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4481                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4482                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4483                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4484                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4485                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4486                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4487                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4488                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4489                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4490                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4491                 </links>
4492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4493                         <actions>
4494                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4495                         </actions>
4496                 </permacrud>
4497         </class>
4498
4499         <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">
4500                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4501                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4502                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4503                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4504                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4505                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4506                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4507                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4508                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4509                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4510                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4511                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4512                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4513                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4514                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4515                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4516                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4517                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4518                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4519                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4520                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4521                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4522                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4523                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4524                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4525                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4526                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4527                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4528                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4529                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4530                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4531                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4532                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4533                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4534                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4535                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4536                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4537                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4538                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4539                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4540                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4541                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4542                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4543                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4544                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4545                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4546                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4547                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4548                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4549                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4550                 </fields>
4551                 <links>
4552                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4553                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4554                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4555                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4556                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4557                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4558                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4559                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4560                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4561                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4562                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4563                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4564                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4565                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4566                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4567                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4568                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4569                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4570                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4571                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4572                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4573                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4574                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4575                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
4576                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
4577                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4578                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4579                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4580                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4581                 </links>
4582                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4583                         <actions>
4584                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4585                         </actions>
4586                 </permacrud>
4587         </class>
4588         <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">
4589                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4590                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4591                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4592                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4593                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4594                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4595                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4596                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4597                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4598                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4599                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4600                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4601                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4602                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4603                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4604                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4605                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4606                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4607                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4608                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4609                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4610                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4611                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4612                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4613                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4614                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4615                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4616                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4617                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4618                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4619                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4620                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4621                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4622                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4623                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4624                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4625                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4626                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4627                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4628                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4629                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4630                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4631                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4632                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4633                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4634                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4635                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4636                 </fields>
4637                 <links>
4638                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4639                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4640                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4641                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4642                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4643                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4644                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4645                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4646                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4647                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4648                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4649                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4650                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4651                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4652                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4653                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4654                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4655                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4656                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4657                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4658                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4659                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4660                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4661                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4662                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4663                 </links>
4664         </class>
4665         <class id="auch" 
4666                 controller="open-ils.cstore" 
4667                 oils_obj:fieldmapper="action::user_circ_history" 
4668                 oils_persist:tablename="action.usr_circ_history" 
4669                 reporter:label="User Checkout History">
4670                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
4671                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4672                         <!-- prevent reporting on the user that owns the checkout history -->
4673                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
4674                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4675                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
4676                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
4677                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
4678                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
4679                 </fields>
4680                 <links>
4681                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4682                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4683                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
4684                 </links>
4685         </class>
4686         <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">
4687                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4688                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4689                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4690                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4691                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4692                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4693                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4694                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4695                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4696                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4697                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4698                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4699                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4700                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4701                 </fields>
4702                 <links>
4703                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4704                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4705                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4706                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4707                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4708                 </links>
4709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4710                         <actions>
4711                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4712                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4713                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4714                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4715                         </actions>
4716                 </permacrud>
4717         </class>
4718
4719         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4720                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4721                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4722                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4723                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4724                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4725                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4726                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4727                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4728                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4729                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4730                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4731                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4732                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4733                 </fields>
4734                 <links>
4735                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4736                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4737                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4738                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4739                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4740                 </links>
4741                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4742                         <actions>
4743                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4744                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4745                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4746                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4747                         </actions>
4748                 </permacrud>
4749         </class>
4750         
4751         <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">
4752                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4753                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4754                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4755                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4756                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4757                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4758                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4759                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4760                 </fields>
4761                 <links>
4762                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4763                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4764                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4765                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4766                 </links>
4767                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4768                         <actions>
4769                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4770                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4771                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4772                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4773                         </actions>
4774                 </permacrud>
4775         </class>
4776         
4777         <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">
4778                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4779                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4780                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4781                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4782                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4783                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4784                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4785                 </fields>
4786                 <links>
4787                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4788                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4789                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4790                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4791                 </links>
4792                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4793                         <actions>
4794                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4795                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4796                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4797                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4798                         </actions>
4799                 </permacrud>
4800         </class>
4801         
4802         <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">
4803                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4804                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4805                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4806                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4807                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4808                 </fields>
4809                 <links>
4810                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4811                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4812                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4813                 </links>
4814                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4815                         <actions>
4816                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4817                     <context link="resource" field="owner" />
4818                 </create>
4819                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4820                     <context link="resource" field="owner" />
4821                 </retrieve>
4822                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4823                     <context link="resource" field="owner" />
4824                 </update>
4825                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4826                     <context link="resource" field="owner" />
4827                 </delete>
4828                         </actions>
4829                 </permacrud>
4830         </class>
4831         
4832         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4833                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4834                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4835                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4836                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4837                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4838                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4839                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4840                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4841                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4842                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4843                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4844                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4845                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4846                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4847                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4848                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4849                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4850                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4851                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4852                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4853                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4854                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4855                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4856                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4857                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4858                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4859                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4860                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4861                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4862                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4863                 </fields>
4864                 <links>
4865                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4866                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4867                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4868                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4869                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4870                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4871                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4872                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4873                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4874                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4875                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4876                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4877                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4878                 </links>
4879                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4880                         <actions>
4881                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4882                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4883                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4884                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4885                         </actions>
4886                 </permacrud>
4887         </class>
4888         
4889         <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">
4890                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4891                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4892                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4893                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4894                 </fields>
4895                 <links>
4896                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4897                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4898                 </links>
4899                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4900                         <actions>
4901                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4902                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4903                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4904                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4905                         </actions>
4906                 </permacrud>
4907         </class>
4908
4909         <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">
4910                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4911                         <field name="bucket" reporter:datatype="link"/>
4912                         <field name="id" reporter:datatype="id" />
4913                         <field name="target_call_number" reporter:datatype="link" />
4914                         <field name="create_time" reporter:datatype="timestamp" />
4915                         <field name="pos" reporter:datatype="int" />
4916                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4917                 </fields>
4918                 <links>
4919                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4920                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4921             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4922                 </links>
4923                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4924                         <actions>
4925                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
4926                     <context link="bucket" owning_lib="owning_lib"/>
4927                 </retrieve>
4928             </actions>
4929         </permacrud>
4930         </class>
4931         <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">
4932                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4933                         <field name="id" reporter:datatype="id" />
4934                         <field name="item" reporter:datatype="link"/>
4935                         <field name="note" reporter:datatype="text" />
4936                 </fields>
4937                 <links>
4938                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4939                 </links>
4940         </class>
4941         <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">
4942                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4943                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4944                         <field name="btype" reporter:datatype="text"/>
4945                         <field name="id" reporter:datatype="id" />
4946                         <field name="name" reporter:datatype="text"/>
4947                         <field name="description" reporter:datatype="text"/>
4948                         <field name="owner" reporter:datatype="link"/>
4949                         <field name="pub" reporter:datatype="bool"/>
4950                         <field name="create_time" reporter:datatype="timestamp" />
4951                         <field name="owning_lib" reporter:datatype="org_unit" />
4952                 </fields>
4953                 <links>
4954                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4955                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4956                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4957                 </links>
4958                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4959                         <actions>
4960                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4961                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4962                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4963                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4964                         </actions>
4965                 </permacrud>
4966         </class>
4967         <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">
4968                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4969                         <field name="id" reporter:datatype="id" />
4970                         <field name="bucket" reporter:datatype="link"/>
4971                         <field name="note" reporter:datatype="text" />
4972                 </fields>
4973                 <links>
4974                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4975                 </links>
4976         </class>
4977         <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">
4978                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4979                         <field name="hold" reporter:datatype="link"/>
4980                         <field name="id" reporter:datatype="id" />
4981                         <field name="target_copy" reporter:datatype="link"/>
4982                         <field name="proximity" reporter:datatype="number"/>
4983                 </fields>
4984                 <links>
4985                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4986                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4987                 </links>
4988         </class>
4989         <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">
4990                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4991                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4992                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4993                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4994                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4995                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4996                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4997                 </fields>
4998                 <links>
4999                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5000                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5001                 </links>
5002         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5003             <actions>
5004                 <create permission="CREATE_HOLD_NOTIFICATION">
5005                                         <context link="hold" jump="usr" field="home_ou" />
5006                                 </create>
5007                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5008                                         <context link="hold" jump="usr" field="home_ou" />
5009                                 </retrieve>
5010                 <update permission="CREATE_HOLD_NOTIFICATION">
5011                                         <context link="hold" jump="usr" field="home_ou" />
5012                                 </update>
5013                 <delete permission="CREATE_HOLD_NOTIFICATION">
5014                                         <context link="hold" jump="usr" field="home_ou" />
5015                                 </delete>
5016             </actions>
5017         </permacrud>
5018         </class>
5019         <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">
5020                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5021                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5022                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5023                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5024                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5025                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5026                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5027                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5028                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5029                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5030                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5031                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5032                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5033                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5034                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5035                 </fields>
5036                 <links>
5037                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5038                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5039                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5040                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5041                 </links>
5042         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5043             <actions>
5044                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5045                 <retrieve/>
5046                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5047                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5048             </actions>
5049         </permacrud>
5050         </class>
5051         <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">
5052                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5053                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5054                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5055                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5056                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
5057             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5058             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5059             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5060                 </fields>
5061                 <links>
5062                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5063                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5064                 </links>
5065         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5066             <actions>
5067                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5068                 <retrieve/>
5069                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5070                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5071             </actions>
5072         </permacrud>
5073         </class>
5074         <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">
5075                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5076                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5077             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5078             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5079                 </fields>
5080                 <links>
5081                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5082                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5083                 </links>
5084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5085             <actions>
5086                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5087                                         <context link="lgroup" field="owner" />
5088                 </create>
5089                 <retrieve/>
5090                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5091                                         <context link="lgroup" field="owner" />
5092                 </update>
5093                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5094                                         <context link="lgroup" field="owner" />
5095                 </delete>
5096             </actions>
5097         </permacrud>
5098         </class>
5099
5100     <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">
5101         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5102             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5103             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5104             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5105             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5106         </fields>
5107         <links>
5108             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5109             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5110         </links>
5111         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5112             <actions>
5113                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5114                 <retrieve/>
5115                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5116                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5117             </actions>
5118         </permacrud>
5119     </class>
5120
5121         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5122                 <fields>
5123                         <field name="sre_id" oils_persist:virtual="true" />
5124                         <field name="location" oils_persist:virtual="true" />
5125                         <field name="owning_lib" oils_persist:virtual="true" />
5126                         <field name="basic_holdings" oils_persist:virtual="true" />
5127                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5128                         <field name="supplement_holdings" oils_persist:virtual="true" />
5129                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5130                         <field name="index_holdings" oils_persist:virtual="true" />
5131                         <field name="index_holdings_add" oils_persist:virtual="true" />
5132                         <field name="online" oils_persist:virtual="true" />
5133                         <field name="missing" oils_persist:virtual="true" />
5134                         <field name="incomplete" oils_persist:virtual="true" />
5135                 </fields>
5136         </class>
5137
5138         <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">
5139                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5140                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5141                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5142                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5143                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5144                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5145                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5146                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5147                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5148                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5149                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5150                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5151                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5152                 </fields>
5153                 <links>
5154                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5155                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5156                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5157                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5158                 </links>
5159                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5160                         <actions>
5161                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5162                                 <retrieve/>
5163                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5164                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5165                         </actions>
5166                 </permacrud>
5167         </class>
5168
5169         <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">
5170                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5171                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5172                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5173                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5174                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5175                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5176                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5177                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5178                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5179                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5180                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5181                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5182                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5183                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5184                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5185                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5186                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5187                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5188                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5189                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5190                 </fields>
5191                 <links>
5192                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5193                 </links>
5194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5195                         <actions>
5196                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5197                                         <context link="subscription" field="owning_lib" />
5198                                 </create>
5199                                 <retrieve />
5200                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5201                                         <context link="subscription" field="owning_lib" />
5202                                 </update>
5203                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5204                                         <context link="subscription" field="owning_lib" />
5205                                 </delete>
5206                         </actions>
5207                 </permacrud>
5208         </class>
5209
5210         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5211                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5212                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5213                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5214                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5215                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5216                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
5217                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
5218                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
5219                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
5220                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
5221                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5222                 </fields>
5223                 <links>
5224                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5225                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
5226                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
5227                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
5228                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
5229                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
5230                 </links>
5231                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5232                         <actions>
5233                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5234                                 <retrieve />
5235                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5236                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5237                         </actions>
5238                 </permacrud>
5239         </class>
5240
5241         <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">
5242                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
5243                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5244                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5245                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5246                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5247                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5248                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5249                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5250                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5251                 </fields>
5252                 <links>
5253                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5254                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5255                 </links>
5256                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5257                         <actions>
5258                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5259                     <context link="subscription" field="owning_lib"/>
5260                 </create>
5261                                 <retrieve />
5262                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5263                     <context link="subscription" field="owning_lib"/>
5264                 </update>
5265                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5266                     <context link="subscription" field="owning_lib"/>
5267                 </delete>
5268                         </actions>
5269                 </permacrud>
5270         </class>
5271
5272         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
5273                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
5274                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5275                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
5276                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
5277                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5278                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
5279                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5280                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
5281                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
5282                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
5283                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
5284                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
5285                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
5286                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
5287                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
5288                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5289                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5290                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5291                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5292                 </fields>
5293                 <links>
5294                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
5295                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5296                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
5297                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
5298                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
5299                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
5300                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
5301                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
5302                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
5303                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
5304                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
5305                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
5306                 </links>
5307                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5308                         <actions>
5309                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5310                                 <retrieve />
5311                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5312                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5313                         </actions>
5314                 </permacrud>
5315         </class>
5316
5317         <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">
5318                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
5319                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5320                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5321                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5322                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5323                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5324                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5325                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5326                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5327                 </fields>
5328                 <links>
5329                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5330                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5331                 </links>
5332                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5333                         <actions>
5334                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5335                                         <context link="distribution" field="holding_lib" />
5336                                 </create>
5337                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
5338                                         <context link="distribution" field="holding_lib" />
5339                                 </retrieve>
5340                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5341                                         <context link="distribution" field="holding_lib" />
5342                                 </update>
5343                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5344                                         <context link="distribution" field="holding_lib" />
5345                                 </delete>
5346                         </actions>
5347                 </permacrud>
5348         </class>
5349
5350         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
5351                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
5352                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5353                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5354                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
5355                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5356                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
5357                 </fields>
5358                 <links>
5359                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5360                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
5361                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
5362                 </links>
5363                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5364                         <actions>
5365                                 <create permission="ADMIN_SERIAL_STREAM">
5366                                         <context link="distribution" field="holding_lib" />
5367                                 </create>
5368                                 <retrieve />
5369                                 <update permission="ADMIN_SERIAL_STREAM">
5370                                         <context link="distribution" field="holding_lib" />
5371                                 </update>
5372                                 <delete permission="ADMIN_SERIAL_STREAM">
5373                                         <context link="distribution" field="holding_lib" />
5374                                 </delete>
5375                         </actions>
5376                 </permacrud>
5377         </class>
5378
5379         <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">
5380                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
5381                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5382                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5383                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5384                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
5385                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
5386                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5387                 </fields>
5388                 <links>
5389                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5390                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
5391                 </links>
5392                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5393                         <actions>
5394                                 <create permission="ADMIN_SERIAL_STREAM">
5395                                         <context link="stream" jump="distribution" field="holding_lib" />
5396                                 </create>
5397                                 <retrieve permission="RECEIVE_SERIAL">
5398                                         <context link="stream" jump="distribution" field="holding_lib" />
5399                                 </retrieve>
5400                                 <update permission="ADMIN_SERIAL_STREAM">
5401                                         <context link="stream" jump="distribution" field="holding_lib" />
5402                                 </update>
5403                                 <delete permission="ADMIN_SERIAL_STREAM">
5404                                         <context link="stream" jump="distribution" field="holding_lib" />
5405                                 </delete>
5406                         </actions>
5407                 </permacrud>
5408         </class>
5409
5410         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
5411                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
5412                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5413                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5414                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5415                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5416                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5417                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5418                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
5419                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5420                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
5421                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
5422                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
5423                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
5424                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5425                 </fields>
5426                 <links>
5427                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5428                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5429                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5430                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
5431                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
5432                 </links>
5433                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5434                         <actions>
5435                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
5436                                         <context link="subscription" field="owning_lib" />
5437                                 </create>
5438                                 <retrieve/>
5439                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
5440                                         <context link="subscription" field="owning_lib" />
5441                                 </update>
5442                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
5443                                         <context link="subscription" field="owning_lib" />
5444                                 </delete>
5445                         </actions>
5446                 </permacrud>
5447         </class>
5448
5449         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
5450                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
5451                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5452                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
5453                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5454                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5455                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
5456                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
5457                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5458                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
5459                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
5460                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
5461                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
5462                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
5463                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
5464                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5465                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
5466                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5467                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
5468                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
5469                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
5470                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
5471                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
5472                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5473                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
5474                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5475                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
5476                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
5477                         <field reporter:label="Price" name="price" reporter:datatype="money" />
5478                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
5479                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
5480                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
5481                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
5482                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
5483                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
5484                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
5485                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
5486                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
5487                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5488                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5489                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5490                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
5491                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
5492                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5493                 </fields>
5494                 <links>
5495                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
5496                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
5497                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5498                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5499                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5500                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5501                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5502                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
5503                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
5504                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
5505                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
5506                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
5507                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
5508                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5509                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
5510                 </links>
5511                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5512                         <actions>
5513                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5514                                 <retrieve/>
5515                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5516                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5517                         </actions>
5518                 </permacrud>
5519         </class>
5520
5521         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
5522                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
5523                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5524                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5525                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5526                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5527                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5528                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
5529                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5530                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
5531                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
5532                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
5533                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
5534                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
5535                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5536                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
5537                 </fields>
5538                 <links>
5539                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5540                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5541                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5542                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5543                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
5544                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
5545                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
5546                 </links>
5547                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5548                         <actions>
5549                                 <create permission="ADMIN_SERIAL_ITEM">
5550                                         <context link="stream" jump="distribution" field="holding_lib" />
5551                                 </create>
5552                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5553                                         <context link="stream" jump="distribution" field="holding_lib" />
5554                                 </retrieve>
5555                                 <update permission="ADMIN_SERIAL_ITEM">
5556                                         <context link="stream" jump="distribution" field="holding_lib" />
5557                                 </update>
5558                                 <delete permission="ADMIN_SERIAL_ITEM">
5559                                         <context link="stream" jump="distribution" field="holding_lib" />
5560                                 </delete>
5561                         </actions>
5562                 </permacrud>
5563         </class>
5564
5565         <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">
5566                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
5567                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5568                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
5569                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5570                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5571                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5572                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5573                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5574                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5575                 </fields>
5576                 <links>
5577                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
5578                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5579                 </links>
5580                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5581                         <actions>
5582                                 <create permission="ADMIN_SERIAL_ITEM">
5583                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5584                                 </create>
5585                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5586                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5587                                 </retrieve>
5588                                 <update permission="ADMIN_SERIAL_ITEM">
5589                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5590                                 </update>
5591                                 <delete permission="ADMIN_SERIAL_ITEM">
5592                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5593                                 </delete>
5594                         </actions>
5595                 </permacrud>
5596         </class>
5597         <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">
5598                 <fields>
5599                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
5600                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
5601                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
5602                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
5603                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
5604                 </fields>
5605                 <links>
5606                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5607                 </links>
5608         </class>
5609         <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">
5610                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
5611                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5612                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
5613                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
5614                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
5615                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
5616                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
5617                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5618                 </fields>
5619                 <links>
5620                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5621                 </links>
5622         </class>
5623         <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">
5624                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5625                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5626                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5627                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5628                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5629                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5630                 </fields>
5631                 <links>
5632                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5633                 </links>
5634                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5635                         <actions>
5636                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5637                                         <context link="distribution" field="holding_lib" />
5638                                 </create>
5639                                 <retrieve/>
5640                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5641                                         <context link="distribution" field="holding_lib" />
5642                                 </update>
5643                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5644                                         <context link="distribution" field="holding_lib" />
5645                                 </delete>
5646                         </actions>
5647                 </permacrud>
5648         </class>
5649
5650         <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">
5651                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5652                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5653                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5654                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5655                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5656                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5657                 </fields>
5658                 <links>
5659                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5660                 </links>
5661                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5662                         <actions>
5663                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5664                                         <context link="distribution" field="holding_lib" />
5665                                 </create>
5666                                 <retrieve/>
5667                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5668                                         <context link="distribution" field="holding_lib" />
5669                                 </update>
5670                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5671                                         <context link="distribution" field="holding_lib" />
5672                                 </delete>
5673                         </actions>
5674                 </permacrud>
5675         </class>
5676
5677         <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">
5678                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5679                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5680                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5681                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5682                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5683                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5684                 </fields>
5685                 <links>
5686                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5687                 </links>
5688                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5689                         <actions>
5690                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5691                                         <context link="distribution" field="holding_lib" />
5692                                 </create>
5693                                 <retrieve/>
5694                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5695                                         <context link="distribution" field="holding_lib" />
5696                                 </update>
5697                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5698                                         <context link="distribution" field="holding_lib" />
5699                                 </delete>
5700                         </actions>
5701                 </permacrud>
5702         </class>
5703
5704         <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">
5705                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
5706                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5707                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5708                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
5709                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5710                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
5711                 </fields>
5712                 <links>
5713                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5714                 </links>
5715                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5716                         <actions>
5717                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
5718                                 <retrieve/>
5719                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
5720                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
5721                         </actions>
5722                 </permacrud>
5723         </class>
5724
5725         <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">
5726                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5727                         <field name="id" reporter:datatype="id" />
5728                         <field name="owning_copy" reporter:datatype="link"/>
5729                         <field name="stat_cat" reporter:datatype="link"/>
5730                         <field name="stat_cat_entry" reporter:datatype="link"/>
5731                 </fields>
5732                 <links>
5733                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5734                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5735                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5736                 </links>
5737                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5738                         <actions>
5739                                 <retrieve/>
5740                         </actions>
5741                 </permacrud>
5742         </class>
5743         <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">
5744                 <fields oils_persist:primary="code">
5745                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5746                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5747                 </fields>
5748                 <links/>
5749         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5750             <actions>
5751                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5752                 <retrieve/>
5753                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5754                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5755             </actions>
5756         </permacrud>
5757         </class>
5758         <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">
5759                 <fields oils_persist:primary="code">
5760                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5761                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5762                 </fields>
5763                 <links/>
5764         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5765             <actions>
5766                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5767                 <retrieve/>
5768                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5769                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5770             </actions>
5771         </permacrud>
5772         </class>
5773         <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">
5774                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5775                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5776                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5777                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5778                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5779                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5780                 </fields>
5781                 <links>
5782             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5783         </links>
5784         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5785             <actions>
5786                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5787                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5788                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5789                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5790             </actions>
5791         </permacrud>
5792         </class>
5793         <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">
5794                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5795                         <field name="id" reporter:datatype="id" />
5796                         <field name="name" reporter:datatype="text"/>
5797                 </fields>
5798                 <links/>
5799         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5800             <actions>
5801                 <create permission="CREATE_LASSO" global_required="true"/>
5802                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5803                 <update permission="UPDATE_LASSO" global_required="true"/>
5804                 <delete permission="DELETE_LASSO" global_required="true"/>
5805             </actions>
5806         </permacrud>
5807         </class>
5808         <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">
5809                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5810                         <field name="id" reporter:datatype="id" />
5811                         <field name="lasso" reporter:datatype="link"/>
5812                         <field name="org_unit" reporter:datatype="org_unit"/>
5813                 </fields>
5814                 <links>
5815                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5816                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5817                 </links>
5818         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5819             <actions>
5820                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5821                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5822                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5823                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5824             </actions>
5825         </permacrud>
5826         </class>
5827         <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">
5828                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5829                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5830                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5831                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5832                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5833                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5834                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5835                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5836                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5837                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5838                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5839                 </fields>
5840                 <links>
5841                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5842                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5843                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5844                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5845                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5846                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5847                 </links>
5848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5849             <actions>
5850                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5851                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5852                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5853                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5854             </actions>
5855         </permacrud>
5856         </class>
5857         <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">
5858                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5859                         <field name="id" reporter:datatype="id" />
5860                         <field name="from_org" reporter:datatype="org_unit"/>
5861                         <field name="to_org" reporter:datatype="org_unit"/>
5862                         <field name="prox" reporter:datatype="int" />
5863                 </fields>
5864                 <links>
5865                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5866                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5867                 </links>
5868         </class>
5869         <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">
5870                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5871                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5872                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5873                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5874                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5875                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5876                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5877                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5878                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5879                 </fields>
5880                 <links/>
5881         </class>
5882         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5883                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5884                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5885                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5886                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5887                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5888                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5889                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5890                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5891                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5892                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5893                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5894                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5895                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5896                 </fields>
5897                 <links>
5898                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5899                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5900                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5901                 </links>
5902         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5903             <actions>
5904                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5905                 <retrieve/>
5906                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5907                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5908             </actions>
5909         </permacrud>
5910         </class>
5911         <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">
5912                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5913                         <field name="address_type"  reporter:datatype="text"/>
5914                         <field name="city"  reporter:datatype="text"/>
5915                         <field name="country"  reporter:datatype="text"/>
5916                         <field name="county"  reporter:datatype="text"/>
5917                         <field name="id" reporter:datatype="id" />
5918                         <field name="org_unit" reporter:datatype="org_unit"/>
5919                         <field name="post_code"  reporter:datatype="text"/>
5920                         <field name="state"  reporter:datatype="text"/>
5921                         <field name="street1"  reporter:datatype="text"/>
5922                         <field name="street2"  reporter:datatype="text"/>
5923                         <field name="valid" reporter:datatype="bool"/>
5924                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5925                 </fields>
5926                 <links>
5927                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5928                 </links>
5929         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5930             <actions>
5931                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5932                 <retrieve/>
5933                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5934                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5935             </actions>
5936         </permacrud>
5937         </class>
5938         <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">
5939                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5940                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5941                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5942                         <field name="query_text" reporter:datatype="text"/>
5943                 </fields>
5944         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5945             <actions>
5946                 <retrieve/>
5947             </actions>
5948         </permacrud>
5949         </class>
5950
5951         <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">
5952                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5953                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5954                         <field name="owner" reporter:datatype="org_unit"/>
5955                         <field name="code" reporter:datatype="text"/>
5956                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5957                         <field name="create_date" reporter:datatype="timestamp"/>
5958                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5959                 </fields>
5960                 <links>
5961                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5962                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5963                 </links>
5964         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5965             <actions>
5966                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5967                 <retrieve/>
5968                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5969                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5970             </actions>
5971         </permacrud>
5972         </class>
5973         <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">
5974                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5975                         <field name="id" reporter:datatype="id"/>
5976                         <field name="grp" reporter:datatype="link"/>
5977                         <field name="pos" reporter:datatype="int"/>
5978                         <field name="query" reporter:datatype="link"/>
5979                 </fields>
5980                 <links>
5981                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5982                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5983                 </links>
5984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5985             <actions>
5986                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5987                     <context link="grp" field="owner"/>
5988                 </create>
5989                 <retrieve/>
5990                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5991                     <context link="grp" field="owner"/>
5992                 </update>
5993                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5994                     <context link="grp" field="owner"/>
5995                 </delete>
5996             </actions>
5997         </permacrud>
5998         </class>
5999
6000         <!-- A note: Please update alhr and ahopl when updating ahr -->
6001         <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">
6002                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6003                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6004                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6005                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6006                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6007                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6008                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6009                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6010                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6011                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6012                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6013                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6014                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6015                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6016                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6017                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6018                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6019                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6020                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6021                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6022                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6023                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6024                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6025                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6026                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6027                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6028                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6029                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6030                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6031                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6032                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6033                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6034                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6035                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6036                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6037                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6038                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6039                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6040                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6041                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6042                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6043                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6044                 </fields>
6045                 <links>
6046                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6047                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6048                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6049                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6050                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6051                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6052                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6053                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6054                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6055                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6056                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6057                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6058                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6059                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6060                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6061                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6062                 </links>
6063                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6064                         <actions>
6065                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6066                         </actions>
6067                 </permacrud>
6068         </class>
6069         <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">
6070                 <oils_persist:source_definition><![CDATA[
6071                 SELECT
6072                         ahr.*,
6073                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6074                                 copy_location_order_position,
6075                         CASE WHEN au.alias IS NOT NULL THEN
6076                                 au.alias
6077                         ELSE
6078                                 au.first_given_name
6079                         END AS usr_alias_or_first_given_name,
6080                         au.first_given_name AS usr_first_given_name,
6081                         au.second_given_name AS usr_second_given_name,
6082                         au.family_name AS usr_family_name,
6083                         au.prefix AS usr_prefix,
6084                         au.suffix AS usr_suffix,
6085                         au.alias AS usr_alias,
6086                         CASE WHEN au.alias IS NOT NULL THEN
6087                                 au.alias
6088                         ELSE
6089                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6090                                         COALESCE(au.family_name, ''),
6091                                         COALESCE(au.suffix, ''),
6092                                         ', ',
6093                                         COALESCE(au.prefix, ''),
6094                                         COALESCE(au.first_given_name, ''),
6095                                         COALESCE(au.second_given_name, '')
6096                                 ], ' '), E'\\s+,', ',')
6097                         END AS usr_alias_or_display_name,
6098                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6099                                 COALESCE(au.family_name, ''),
6100                                 COALESCE(au.suffix, ''),
6101                                 ', ',
6102                                 COALESCE(au.prefix, ''),
6103                                 COALESCE(au.first_given_name, ''),
6104                                 COALESCE(au.second_given_name, '')
6105                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6106                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6107                                 AS call_number_label,
6108                         siss.label AS issuance_label,
6109                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6110                         ahcm_1.copy_count AS potential_copies
6111                 FROM action.hold_request ahr
6112                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6113                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6114                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6115                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6116                 JOIN actor.usr au ON (au.id = ahr.usr)
6117                 JOIN (
6118                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6119                         FROM asset.copy_location
6120                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6121                 LEFT JOIN actor.usr_standing_penalty ausp 
6122                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6123                 LEFT JOIN config.standing_penalty csp
6124                         ON (
6125                                 csp.id = ausp.standing_penalty AND 
6126                                 csp.block_list LIKE '%CAPTURE%' AND (
6127                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6128                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6129                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6130                                         )
6131                                 )
6132                         )
6133                 JOIN (
6134                         SELECT COUNT(target_copy) AS copy_count, hold
6135                         FROM action.hold_copy_map
6136                         GROUP BY 2
6137                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6138                 LEFT JOIN serial.issuance siss
6139                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6140                 LEFT JOIN asset.copy_location_order acplo
6141                         ON (acp.location = acplo.location AND
6142                                 acp.circ_lib = acplo.org)
6143                 WHERE
6144                         ahr.capture_time IS NULL AND
6145                         ahr.cancel_time IS NULL AND
6146                         csp.id IS NULL AND
6147                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6148                         acp.status IN (0,7)
6149                 ]]></oils_persist:source_definition>
6150                 <fields oils_persist:primary="id">
6151                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6152                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6153                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6154                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6155                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6156                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6157                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6158                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6159                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6160                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6161                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6162                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6163                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6164                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6165                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6166                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6167                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6168                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6169                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6170                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6171                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6172                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6173                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6174                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6175                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6176                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6177                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6178                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6179                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6180                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6181                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6182                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6183                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6184                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6185                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6186                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6187                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6188                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6189                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6190                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6191                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6192                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6193                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6194                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6195                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6196                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6197                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6198                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6199                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6200                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6201                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6202                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6203                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
6204                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
6205                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6206                 </fields>
6207                 <links>
6208                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6209                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6210                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6211                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6212                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6213                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6214                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6215                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6216                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6217                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6218                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6219                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6220                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6221                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6222                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6223                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6224                 </links>
6225                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6226                         <actions>
6227                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6228                         </actions>
6229                 </permacrud>
6230         </class>
6231         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
6232                 <oils_persist:source_definition>
6233                         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)
6234                 </oils_persist:source_definition>
6235                 <fields oils_persist:primary="id">
6236                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6237                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6238                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6239                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6240                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6241                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6242                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6243                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6244                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6245                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6246                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6247                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6248                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6249                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6250                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6251                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6252                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6253                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6254                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6255                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6256                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6257                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6258                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6259                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6260                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6261                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6262                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6263                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6264                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6265                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6266                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6267                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6268                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6269                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6270                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6271                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6272                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6273                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6274                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6275                 </fields>
6276                 <links>
6277                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6278                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6279                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6280                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6281                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6282                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6283                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6284                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6285                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6286                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6287                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6288                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6289                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6290                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6291                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6292                 </links>
6293         </class>
6294
6295         <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">
6296                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
6297                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6298                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
6299                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6300                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
6301                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
6302                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
6303                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
6304                 </fields>
6305                 <links>
6306                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6307                 </links>
6308                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6309                         <actions>
6310                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
6311                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
6312                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
6313                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
6314                         </actions>
6315                 </permacrud>
6316         </class>
6317         <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">
6318                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6319                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6320                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6321                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6322                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6323                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6324                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6325                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6326                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6327                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6328                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6329                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6330                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6331                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6332                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6333                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6334                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6335                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6336                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6337                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6338                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6339                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6340                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6341                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6342                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6343                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6344                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6345                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6346                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6347                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6348                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6349                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6350                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6351                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6352                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6353                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6354                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6355                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6356                 </fields>
6357                 <links>
6358                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6359                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6360                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6361                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6362                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6363                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6364                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6365                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6366                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6367                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6368                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6369                 </links>
6370                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6371                         <actions>
6372                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6373                         </actions>
6374                 </permacrud>
6375         </class>
6376         <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">
6377                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6378                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6379                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6380                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6381                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6382                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6383                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6384                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6385                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6386                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6387                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6388                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6389                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6390                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6391                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6392                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6393                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6394                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6395                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6396                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6397                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6398                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6399                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6400                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6401                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6402                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6403                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6404                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6405                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6406                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6407                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6408                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6409                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6410                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6411                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6412                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6413                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6414                 </fields>
6415                 <links>
6416                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6417                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6418                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6419                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6420                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6421                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6422                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6423                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6424                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6425                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6426                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6427                 </links>
6428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6429                         <actions>
6430                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6431                         </actions>
6432                 </permacrud>
6433         </class>
6434
6435         <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">
6436                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
6437                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
6438                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
6439                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
6440                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
6441                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
6442                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
6443                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6444                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
6445                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
6446                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
6447                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
6448                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
6449                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6450                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
6451                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
6452                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
6453                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6454                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
6455                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
6456                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
6457                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
6458                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
6459                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
6460                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
6461                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
6462                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
6463                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
6464                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
6465                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
6466                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
6467                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
6468                 </fields>
6469                 <links>
6470                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
6471                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
6472                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
6473                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
6474                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
6475                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
6476                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
6477                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
6478                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
6479                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
6480                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
6481                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
6482                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
6483                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
6484                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
6485                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
6486                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
6487                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
6488                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
6489                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
6490                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
6491                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
6492                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
6493                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
6494                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
6495                 </links>
6496         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6497             <actions>
6498                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
6499                 <retrieve />
6500                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
6501                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
6502             </actions>
6503         </permacrud>
6504         </class>
6505         <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">
6506                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
6507                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6508                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6509                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
6510                 </fields>
6511                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6512                         <actions>
6513                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6514                                 <retrieve/>
6515                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6516                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6517                         </actions>
6518                 </permacrud>
6519         </class>
6520         <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">
6521                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
6522                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6523                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
6524                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
6525                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
6526                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
6527                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
6528                 </fields>
6529                 <links>
6530                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
6531                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6532                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
6533                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
6534                 </links>
6535                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6536                         <actions>
6537                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6538                                 <retrieve/>
6539                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6540                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6541                         </actions>
6542                 </permacrud>
6543         </class>
6544         <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">
6545                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
6546                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6547                         <field name="btype" reporter:datatype="text"/>
6548                         <field name="id" reporter:datatype="id" />
6549                         <field name="name"  reporter:datatype="text"/>
6550                         <field name="description" reporter:datatype="text"/>
6551                         <field name="owner" reporter:datatype="link"/>
6552                         <field name="pub" reporter:datatype="bool"/>
6553                         <field name="create_time" reporter:datatype="timestamp" />
6554                         <field name="owning_lib" reporter:datatype="org_unit" />
6555                 </fields>
6556                 <links>
6557                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6558                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6559                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
6560                 </links>
6561                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6562                         <actions>
6563                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6564                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6565                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6566                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6567                         </actions>
6568                 </permacrud>
6569         </class>
6570         <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">
6571                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
6572                         <field name="id" reporter:datatype="id" />
6573                         <field name="bucket" reporter:datatype="link"/>
6574                         <field name="note" reporter:datatype="text" />
6575                 </fields>
6576                 <links>
6577                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
6578                 </links>
6579         </class>
6580         <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">
6581                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
6582                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6583                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6584                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6585                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6586                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6587                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6588                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6589                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6590                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6591                 </fields>
6592                 <links>
6593                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6594                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
6595                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
6596                 </links>
6597                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6598                         <actions>
6599                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6600                         </actions>
6601                 </permacrud>
6602         </class>
6603         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
6604                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
6605                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
6606                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6607                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
6608                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6609                 </fields>
6610                 <links>
6611                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6612                 </links>
6613                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6614                         <actions>
6615                                 <retrieve permission="VIEW_USER">
6616                                         <context link="usr" field="home_ou" />
6617                                 </retrieve>
6618                         </actions>
6619                 </permacrud>
6620         </class>
6621     <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">
6622         <fields oils_persist:primary="field">
6623             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
6624             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
6625             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
6626         </fields>
6627         <links/>
6628         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6629             <actions>
6630                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
6631                 <retrieve />
6632                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
6633                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
6634             </actions>
6635         </permacrud>
6636     </class>
6637         <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">
6638                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
6639                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6640                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6641                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6642                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6643                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6644                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6645                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
6646                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6647                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6648                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6649                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6650                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
6651                 </fields>
6652                 <links>
6653                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6654                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
6655                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
6656                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
6657                 </links>
6658         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6659             <actions>
6660                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6661                 <retrieve />
6662                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6663                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6664             </actions>
6665         </permacrud>
6666         </class>
6667         <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">
6668                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6669                         <field name="field" reporter:datatype="link"/>
6670                         <field name="id" reporter:datatype="id" />
6671                         <field name="source" reporter:datatype="link"/>
6672                         <field name="value"  reporter:datatype="text"/>
6673                 </fields>
6674                 <links>
6675                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6676                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6677                 </links>
6678         </class>
6679         <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">
6680                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6681                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6682                         <field name="btype" reporter:datatype="text"/>
6683                         <field name="id" reporter:datatype="id" />
6684                         <field name="name"  reporter:datatype="text"/>
6685                         <field name="description" reporter:datatype="text"/>
6686                         <field name="owner" reporter:datatype="link"/>
6687                         <field name="pub" reporter:datatype="bool"/>
6688                         <field name="create_time" reporter:datatype="timestamp" />
6689                         <field name="owning_lib" reporter:datatype="org_unit" />
6690                 </fields>
6691                 <links>
6692                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6693                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6694                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6695                 </links>
6696                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6697                         <actions>
6698                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6699                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6700                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6701                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6702                         </actions>
6703                 </permacrud>
6704         </class>
6705         <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">
6706                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6707                         <field name="id" reporter:datatype="id" />
6708                         <field name="bucket" reporter:datatype="link"/>
6709                         <field name="note" reporter:datatype="text" />
6710                 </fields>
6711                 <links>
6712                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6713                 </links>
6714         </class>
6715         <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">
6716                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6717                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6718                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6719                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6720                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6721                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6722                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6723                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6724                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6725                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6726                 </fields>
6727                 <links>
6728                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6729                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6730                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6731                 </links>
6732         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6733             <actions>
6734                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6735                     <context link="xact" jump="usr" field="home_ou"/>
6736                 </retrieve>
6737                         </actions>
6738                 </permacrud>
6739         </class>
6740         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6741                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6742                         <field name="id" reporter:datatype="id" />
6743                         <field name="ind1" />
6744                         <field name="ind2" />
6745                         <field name="record" />
6746                         <field name="subfield" />
6747                         <field name="tag" />
6748                         <field name="value" />
6749                 </fields>
6750                 <links>
6751                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6752                 </links>
6753         </class>
6754         <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">
6755                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6756                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6757                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6758                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6759                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6760                 </fields>
6761                 <links>
6762                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6763                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6764                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6765                 </links>
6766         </class>
6767         <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">
6768                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6769                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6770                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6771                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6772                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6773                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6774                 </fields>
6775                 <links>
6776                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6777                 </links>
6778         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6779             <actions>
6780                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6781                 <retrieve/>
6782                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6783                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6784             </actions>
6785         </permacrud>
6786
6787         </class>
6788         <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">
6789                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6790                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6791                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6792                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6793                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6794                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6795                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6796                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6797                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6798                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6799                 </fields>
6800                 <links>
6801                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6802                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6803                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6804                 </links>
6805         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6806             <actions>
6807                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6808                 <retrieve/>
6809                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6810                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6811             </actions>
6812         </permacrud>
6813         </class>
6814         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6815                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6816                         <field name="create_date" reporter:datatype="timestamp"/>
6817                         <field name="creator" reporter:datatype="link"/>
6818                         <field name="edit_date" reporter:datatype="timestamp"/>
6819                         <field name="editor" reporter:datatype="link"/>
6820                         <field name="id" reporter:datatype="id" />
6821                         <field name="pub" reporter:datatype="bool"/>
6822                         <field name="record" reporter:datatype="link"/>
6823                         <field name="value"  reporter:datatype="text"/>
6824                 </fields>
6825                 <links>
6826                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6827                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6828                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6829                 </links>
6830         </class>
6831         <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">
6832                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6833                         <field name="balance_owed" reporter:datatype="money" />
6834                         <field name="total_owed" reporter:datatype="money" />
6835                         <field name="total_paid" reporter:datatype="money" />
6836                         <field name="usr" reporter:datatype="link"/>
6837                 </fields>
6838                 <links>
6839                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6840                 </links>
6841         </class>
6842     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6843                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6844                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6845                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6846                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6847                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6848                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6849                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6850                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6851                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6852                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6853                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6854                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6855                 </fields>
6856                 <links>
6857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6858                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6859                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6860                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6861                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6862                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6863                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6864                 </links>
6865         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6866             <actions>
6867                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
6868             </actions>
6869         </permacrud>
6870         </class>
6871         <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">
6872                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6873                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6874                         <field name="quality" reporter:datatype="int" />
6875                         <field name="source" reporter:datatype="text"/>
6876                         <field name="transcendant" reporter:datatype="bool"/>
6877                         <field name="can_have_copies" reporter:datatype="bool"/>
6878                 </fields>
6879                 <links/>
6880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6881             <actions>
6882                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6883                 <retrieve/>
6884                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6885                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6886             </actions>
6887         </permacrud>
6888         </class>
6889         <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">
6890                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6891                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6892                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6893                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6894                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6895                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6896                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6897                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6898                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6899                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6900                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6901                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6902                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6903                 </fields>
6904                 <links>
6905                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6906                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6907                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6908                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6909                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6910                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6911                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6912                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6913                 </links>
6914                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6915                         <actions>
6916                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6917                                         <context link="usr" field="home_ou" />
6918                                 </retrieve>
6919                         </actions>
6920                 </permacrud>
6921         </class>
6922         <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">
6923                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6924                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6925                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6926                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6927                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6928                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6929                 </fields>
6930                 <links>
6931                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6932                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6933                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6934                 </links>
6935         </class>
6936         <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">
6937                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6938                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6939                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6940                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6941                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6942                 </fields>
6943                 <links>
6944                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6945                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6946                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6947                 </links>
6948         </class>
6949         <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">
6950                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6951                         <field name="bucket" reporter:datatype="link"/>
6952                         <field name="id" reporter:datatype="id" />
6953                         <field name="target_user" reporter:datatype="link"/>
6954                         <field name="create_time" reporter:datatype="timestamp" />
6955                         <field name="pos" reporter:datatype="int" />
6956                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6957                 </fields>
6958                 <links>
6959                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6960                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6961             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6962                 </links>
6963                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6964                         <actions>
6965                                 <retrieve permission="ADMIN_USER_BUCKET">
6966                     <context link="bucket" owning_lib="owning_lib"/>
6967                 </retrieve>
6968             </actions>
6969         </permacrud>
6970         </class>
6971         <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">
6972                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6973                         <field name="id" reporter:datatype="id" />
6974                         <field name="item" reporter:datatype="link"/>
6975                         <field name="note" reporter:datatype="text" />
6976                 </fields>
6977                 <links>
6978                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6979                 </links>
6980         </class>
6981         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6982                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6983                         <field name="balance_owed" reporter:datatype="money" />
6984                         <field name="total_owed" reporter:datatype="money" />
6985                         <field name="total_paid" reporter:datatype="money" />
6986                         <field name="usr" reporter:datatype="link"/>
6987                 </fields>
6988                 <links>
6989                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6990                 </links>
6991         </class>
6992         <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">
6993                 <fields oils_persist:primary="code" oils_persist:sequence="">
6994                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6995                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6996                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6997                 </fields>
6998                 <links/>
6999         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7000             <actions>
7001                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7002                 <retrieve/>
7003                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7004                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7005             </actions>
7006         </permacrud>
7007         </class>
7008         <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">
7009                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7010                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7011                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7012                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7013                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7014                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7015                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7016                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7017                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7018                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7019                 </fields>
7020                 <links>
7021                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7022                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7023                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7024                 </links>
7025         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7026             <actions>
7027                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7028                     <context link="xact" jump="usr" field="home_ou"/>
7029                 </retrieve>
7030                         </actions>
7031                 </permacrud>
7032         </class>
7033         <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">
7034                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7035                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7036                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7037                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7038                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7039                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7040                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7041                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7042                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7043                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7044                 </fields>
7045                 <links>
7046                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7047                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7048                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7049                 </links>
7050         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7051             <actions>
7052                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7053                     <context link="xact" jump="usr" field="home_ou"/>
7054                 </retrieve>
7055                         </actions>
7056                 </permacrud>
7057         </class>
7058         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7059                 <fields oils_persist:primary="id" oils_persist:sequence="">
7060                         <field name="checkin_lib" reporter:datatype="link"/>
7061                         <field name="checkin_staff" reporter:datatype="link"/>
7062                         <field name="checkin_time" reporter:datatype="timestamp"/>
7063                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7064                         <field name="circ_staff" reporter:datatype="link"/>
7065                         <field name="desk_renewal" reporter:datatype="bool"/>
7066                         <field name="due_date" reporter:datatype="timestamp"/>
7067                         <field name="duration" reporter:datatype="interval"/>
7068                         <field name="duration_rule" reporter:datatype="link"/>
7069                         <field name="fine_interval" reporter:datatype="interval"/>
7070                         <field name="id" reporter:datatype="id" />
7071                         <field name="max_fine" reporter:datatype="money" />
7072                         <field name="max_fine_rule" reporter:datatype="link"/>
7073                         <field name="opac_renewal" reporter:datatype="bool"/>
7074                         <field name="phone_renewal" reporter:datatype="bool"/>
7075                         <field name="recurring_fine" reporter:datatype="money" />
7076                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7077                         <field name="renewal_remaining" reporter:datatype="int" />
7078             <field name="grace_period" reporter:datatype="interval" />
7079                         <field name="stop_fines" reporter:datatype="text"/>
7080                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7081                         <field name="target_copy" reporter:datatype="link"/>
7082                         <field name="usr" reporter:datatype="link"/>
7083                         <field name="xact_finish" reporter:datatype="timestamp" />
7084                         <field name="xact_start" reporter:datatype="timestamp" />
7085                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7086                 </fields>
7087                 <links>
7088                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7089                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7090                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7091                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7092                 </links>
7093         </class>
7094         <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">
7095                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7096                         <field name="field" reporter:datatype="link"/>
7097                         <field name="id" reporter:datatype="id" />
7098                         <field name="source" reporter:datatype="link"/>
7099                         <field name="value" reporter:datatype="text"/>
7100                 </fields>
7101                 <links>
7102                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7103                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7104                 </links>
7105         </class>
7106         <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">
7107                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7108                         <field name="high" reporter:datatype="money" />
7109                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7110                         <field name="low" reporter:datatype="money" />
7111                         <field name="name" reporter:datatype="text"/>
7112                         <field name="normal" reporter:datatype="money" />
7113                         <field name="recurrence_interval" reporter:datatype="interval"/>
7114             <field name="grace_period" reporter:datatype="interval" />
7115                 </fields>
7116                 <links/>
7117         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7118             <actions>
7119                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7120                 <retrieve/>
7121                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7122                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7123             </actions>
7124         </permacrud>
7125         </class>
7126         <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">
7127                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7128                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7129                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7130                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7131                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7132                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7133                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7134                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7135                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7136                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7137                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7138                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7139                 </fields>
7140                 <links>
7141                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7142                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7143                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7144                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7145                 </links>
7146         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7147             <actions>
7148                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7149                     <context link="xact" jump="usr" field="home_ou"/>
7150                 </retrieve>
7151                         </actions>
7152                 </permacrud>
7153         </class>
7154         <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">
7155                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
7156                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
7157                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7158                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7159                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
7160                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
7161                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7162                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
7163                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
7164                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
7165                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
7166                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
7167                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
7168                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
7169                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
7170                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
7171                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
7172                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
7173                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
7174                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
7175                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
7176                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
7177                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
7178                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
7179                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
7180                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
7181                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
7182                         <field reporter:label="Price" name="price" reporter:datatype="money" />
7183                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
7184                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
7185                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
7186                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
7187                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
7188                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
7189                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
7190                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
7191                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7192                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7193                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7194                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
7195                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
7196                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
7197                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7198                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
7199                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
7200                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
7201                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7204                 </fields>
7205                 <links>
7206                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
7207                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
7208                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
7209                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7210                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7211                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
7212                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7213                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
7214                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
7215                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
7216                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
7217                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
7218                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
7219                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
7220                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
7221                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
7222                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
7223                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
7224                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
7225                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
7226                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
7227                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
7228                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
7229                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
7230                 </links>
7231         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7232             <actions>
7233                 <create permission="CREATE_COPY">
7234                     <context link="call_number" field="owning_lib"/>
7235                 </create>
7236                 <retrieve/>
7237                 <update permission="UPDATE_COPY">
7238                     <context link="call_number" field="owning_lib"/>
7239                 </update>
7240                 <delete permission="DELETE_COPY">
7241                     <context link="call_number" field="owning_lib"/>
7242                 </delete>
7243             </actions>
7244         </permacrud>
7245         </class>
7246
7247         <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">
7248                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
7249                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
7250                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
7251                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7252                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7253                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
7254                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7255                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7256                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
7257                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
7258                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
7259                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
7260                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
7261                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
7262                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
7263                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
7264                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
7265                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
7266                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
7267                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
7268                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
7269                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
7270                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7271                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
7272                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
7273                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
7274                 </fields>
7275                 <links>
7276                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7277                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7278                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7279                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7280                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
7281                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
7282                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
7283                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
7284                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
7285                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
7286                 </links>
7287                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7288                         <actions>
7289                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7290                                 <retrieve />
7291                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7292                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7293                         </actions>
7294                 </permacrud>
7295         </class>
7296
7297         <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">
7298                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
7299                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
7300                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7301                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
7302                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
7303                 </fields>
7304                 <links/>
7305         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7306             <actions>
7307                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7308                 <retrieve/>
7309                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7310                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7311             </actions>
7312         </permacrud>
7313         </class>
7314         <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">
7315                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
7316                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
7317                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7318                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
7319                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
7320                 </fields>
7321                 <links/>
7322         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7323             <actions>
7324                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7325                 <retrieve/>
7326                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7327                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7328             </actions>
7329         </permacrud>
7330         </class>
7331         <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">
7332                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
7333                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7334                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7335                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7336                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7337                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
7338                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
7339                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
7340                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
7341                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
7342                 </fields>
7343                 <links>
7344                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
7345                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
7346                 </links>
7347         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7348             <actions>
7349                 <create permission="CREATE_PERM" global_required="true"/>
7350                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7351                 <update permission="UPDATE_PERM" global_required="true"/>
7352                 <delete permission="DELETE_PERM" global_required="true"/>
7353             </actions>
7354         </permacrud>
7355         </class>
7356         <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">
7357                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
7358                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
7359                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
7360                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
7361                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
7362                 </fields>
7363                 <links>
7364                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
7365                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
7366                 </links>
7367         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7368             <actions>
7369                 <create permission="ADMIN_SURVEY">
7370                     <context link="question" jump="survey" field="owner"/>
7371                 </create>
7372                 <retrieve/>
7373                 <update permission="ADMIN_SURVEY">
7374                     <context link="question" jump="survey" field="owner"/>
7375                 </update>
7376                 <delete permission="ADMIN_SURVEY">
7377                     <context link="question" jump="survey" field="owner"/>
7378                 </delete>
7379             </actions>
7380         </permacrud>
7381         </class>
7382         <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">
7383                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
7384                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7385                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
7386                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
7387                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
7388                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
7389                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
7390                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
7391                 </fields>
7392                 <links>
7393                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
7394                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7395                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
7396                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7397                 </links>
7398                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7399                         <actions>
7400                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
7401                         </actions>
7402                 </permacrud>
7403         </class>
7404         <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">
7405                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7406                         <field name="balance_owed" reporter:datatype="money" />
7407                         <field name="total_owed" reporter:datatype="money" />
7408                         <field name="total_paid" reporter:datatype="money" />
7409                         <field name="usr" reporter:datatype="link"/>
7410                 </fields>
7411                 <links>
7412                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7413                 </links>
7414         </class>
7415         <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">
7416                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
7417                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
7418                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
7419                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
7420                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
7421                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
7422                 </fields>
7423                 <links>
7424                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7425                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7426                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7427                 </links>
7428         </class>
7429         <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">
7430                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
7431                         <field name="field" reporter:datatype="link"/>
7432                         <field name="id" reporter:datatype="id" />
7433                         <field name="source" reporter:datatype="link"/>
7434                         <field name="value" reporter:datatype="text"/>
7435                 </fields>
7436                 <links>
7437                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7438                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7439                 </links>
7440         </class>
7441         <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">
7442                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
7443                         <field name="field" reporter:datatype="link"/>
7444                         <field name="id" reporter:datatype="id" />
7445                         <field name="source" reporter:datatype="link"/>
7446                         <field name="value" reporter:datatype="text"/>
7447                 </fields>
7448                 <links>
7449                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7450                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7451                 </links>
7452         </class>
7453         <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">
7454                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
7455                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7456                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
7457                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
7458                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
7459                 </fields>
7460                 <links>
7461                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
7462                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7463                 </links>
7464         </class>
7465         <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">
7466                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
7467                         <field name="depth" reporter:datatype="int" />
7468                         <field name="grantable" reporter:datatype="bool"/>
7469                         <field name="grp" reporter:datatype="link"/>
7470                         <field name="id" reporter:datatype="id" />
7471                         <field name="perm" reporter:datatype="link"/>
7472                 </fields>
7473                 <links>
7474                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7475                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7476                 </links>
7477         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7478             <actions>
7479                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
7480                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
7481                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
7482                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
7483             </actions>
7484         </permacrud>
7485         </class>
7486         <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">
7487                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
7488                         <field name="items" oils_persist:virtual="true" />
7489                         <field name="btype" reporter:datatype="text"/>
7490                         <field name="id" reporter:datatype="id" />
7491                         <field name="name" reporter:datatype="text"/>
7492                         <field name="description" reporter:datatype="text"/>
7493                         <field name="owner" reporter:datatype="link"/>
7494                         <field name="pub" reporter:datatype="bool"/>
7495                         <field name="create_time" reporter:datatype="timestamp" />
7496                         <field name="owning_lib" reporter:datatype="org_unit" />
7497                 </fields>
7498                 <links>
7499                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7500                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7501                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
7502                 </links>
7503                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7504                         <actions>
7505                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7506                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7507                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7508                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7509                         </actions>
7510                 </permacrud>
7511         </class>
7512         <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">
7513                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
7514                         <field name="id" reporter:datatype="id" />
7515                         <field name="bucket" reporter:datatype="link"/>
7516                         <field name="note" reporter:datatype="text" />
7517                 </fields>
7518                 <links>
7519                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
7520                 </links>
7521         </class>
7522         <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">
7523                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
7524                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
7525                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7526                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
7527                 </fields>
7528                 <links>
7529                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7530                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
7531                 </links>
7532         </class>
7533         <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">
7534                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
7535                         <field name="depth" reporter:datatype="int"/>
7536                         <field name="grantable" reporter:datatype="bool"/>
7537                         <field name="id" reporter:datatype="id" />
7538                         <field name="perm" reporter:datatype="link"/>
7539                         <field name="usr" reporter:datatype="link"/>
7540                 </fields>
7541                 <links>
7542                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7543                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7544                 </links>
7545         </class>
7546         <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">
7547                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
7548                         <field name="object_id" reporter:datatype="text"/>
7549                         <field name="grantable" reporter:datatype="bool"/>
7550                         <field name="id" reporter:datatype="id" />
7551                         <field name="perm" reporter:datatype="link"/>
7552                         <field name="usr" reporter:datatype="link"/>
7553                         <field name="object_type" reporter:datatype="text"/>
7554                 </fields>
7555                 <links>
7556                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7557                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7558                 </links>
7559         </class>
7560         <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">
7561                 <fields oils_persist:primary="id" oils_persist:sequence="">
7562                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7563                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7564                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7565                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7566                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7567                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7568                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7569                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7570                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7571                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7572                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7573                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7574                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7575                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7576                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7577                 </fields>
7578                 <links>
7579                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7580                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7581                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7582                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7583                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7584                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7585                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7586                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7587                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7588                 </links>
7589         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7590             <actions>
7591                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7592                     <context link="xact" jump="usr" field="home_ou"/>
7593                 </retrieve>
7594                         </actions>
7595                 </permacrud>
7596         </class>
7597         <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">
7598                 <fields oils_persist:primary="id" oils_persist:sequence="">
7599                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7600                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7601                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7602                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7603                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7604                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7605                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7606                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7607                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7608                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7609                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7610                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7611                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7612                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7613                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7614                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7615                 </fields>
7616                 <links>
7617                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7618                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7619                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7620                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7621                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7622                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7623                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7624                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7625                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7626                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7627                 </links>
7628                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7629                         <actions>
7630                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7631                                         <context link="xact" jump="usr" field="home_ou"/>
7632                                 </retrieve>
7633                         </actions>
7634                 </permacrud>
7635         </class>
7636         <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">
7637                 <fields oils_persist:primary="id" oils_persist:sequence="">
7638                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7639                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7640                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7641                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7642                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7643                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7644                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7645                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7646                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7647                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7648                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7649                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7650                 </fields>
7651                 <links>
7652                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7653                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7654                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7655                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7656                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7657                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7658                 </links>
7659         </class>
7660         <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">
7661                 <fields oils_persist:primary="id" oils_persist:sequence="">
7662                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7663                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7664                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7665                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7666                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7667                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7668                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7669                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
7670                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7671                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7672                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7673                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7674                 </fields>
7675                 <links>
7676                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7677                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7678                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7679                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7680                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7681                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7682                 </links>
7683         </class>
7684         <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">
7685                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
7686                         <field name="bucket" reporter:datatype="link"/>
7687                         <field name="id" reporter:datatype="id" />
7688                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
7689                         <field name="create_time" reporter:datatype="timestamp" />
7690                         <field name="pos" reporter:datatype="int" />
7691                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7692                 </fields>
7693                 <links>
7694                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
7695                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
7696             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
7697                 </links>
7698                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7699                         <actions>
7700                                 <retrieve permission="ADMIN_COPY_BUCKET">
7701                     <context link="bucket" owning_lib="owning_lib"/>
7702                 </retrieve>
7703             </actions>
7704         </permacrud>
7705         </class>
7706         <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">
7707                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
7708                         <field name="id" reporter:datatype="id" />
7709                         <field name="item" reporter:datatype="link"/>
7710                         <field name="note" reporter:datatype="text" />
7711                 </fields>
7712                 <links>
7713                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
7714                 </links>
7715         </class>
7716         <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">
7717                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
7718                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
7719                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7720                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7721                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7722                 </fields>
7723                 <links>
7724                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7725                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7726                 </links>
7727                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7728                         <actions>
7729                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7730                         </actions>
7731                 </permacrud>
7732         </class>
7733     <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">
7734         <fields oils_persist:primary="field">
7735             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7736             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7737             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7738         </fields>
7739         <links/>
7740         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7741             <actions>
7742                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7743                 <retrieve />
7744                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7745                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7746             </actions>
7747         </permacrud>
7748     </class>
7749         <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">
7750                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7751                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7752                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7753                 </fields>
7754                 <links/>
7755         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7756             <actions>
7757                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7758                 <retrieve/>
7759                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7760                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7761             </actions>
7762         </permacrud>
7763         </class>
7764
7765
7766         <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">
7767                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7768                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7769                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7770                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7771                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7772                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7773                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7774                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7775                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7776                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7777                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7778                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7779                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7780                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7781                 </fields>
7782                 <links>
7783                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7784                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7785                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7786                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7787                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7788                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7789                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7790                 </links>
7791         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7792             <actions>
7793                 <create permission="TRANSIT_COPY">
7794                     <context link="target_copy" field="owner"/>
7795                 </create>
7796                 <retrieve/>
7797                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7798                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7799             </actions>
7800         </permacrud>
7801         </class>
7802         <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">
7803                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7804                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7805                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7806                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7807                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7808                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7809                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7810                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7811                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7812                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7813                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7814                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7815                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7816                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7817                 </fields>
7818                 <links>
7819                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7820                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7821                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7822                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7823                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7824                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7825                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7826                 </links>
7827         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7828             <actions>
7829                 <create permission="TRANSIT_COPY" context_field="owner">
7830                     <context link="target_copy" field="circ_lib"/>
7831                 </create>
7832                 <retrieve/>
7833                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7834                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7835             </actions>
7836         </permacrud>
7837         </class>
7838         <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">
7839                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7840                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7841                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7842                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7843                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7844                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7845                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7846                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7847                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7848                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7849                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7850                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
7851                 </fields>
7852                 <links>
7853                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7854                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7855                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7856                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
7857                 </links>
7858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7859             <actions>
7860                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7861                     <context link="xact" jump="usr" field="home_ou"/>
7862                 </retrieve>
7863                         </actions>
7864                 </permacrud>
7865         </class>
7866         <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">
7867                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7868                         <field name="grp" />
7869                         <field name="id" reporter:datatype="id" />
7870                         <field name="usr" />
7871                 </fields>
7872                 <links>
7873                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7874                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7875                 </links>
7876         </class>
7877         <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">
7878                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7879                         <field name="id" reporter:datatype="id" />
7880                         <field name="fq_field" reporter:datatype="text"/>
7881                         <field name="identity_value" reporter:datatype="text"/>
7882                         <field name="translation" reporter:datatype="text"/>
7883                         <field name="string" reporter:datatype="text"/>
7884                 </fields>
7885                 <links>
7886                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7887                 </links>
7888         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7889             <actions>
7890                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7891                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7892                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7893                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7894             </actions>
7895         </permacrud>
7896         </class>
7897         <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">
7898                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7899                         <field name="id" reporter:datatype="id" />
7900                         <field name="fm_class" reporter:datatype="text"/>
7901                         <field name="field" reporter:datatype="text"/>
7902                         <field name="owner" reporter:datatype="org_unit"/>
7903                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7904                 </fields>
7905                 <links>
7906                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7907                 </links>
7908         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7909             <actions>
7910                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7911                 <retrieve/>
7912                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7913                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7914             </actions>
7915         </permacrud>
7916         </class>
7917         <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">
7918                 <fields oils_persist:primary="code">
7919                         <field name="code" reporter:datatype="id" />
7920                         <field name="marc_code" reporter:datatype="text"/>
7921                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7922                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7923                         <field name="rtl" reporter:datatype="bool"/>
7924                 </fields>
7925                 <links/>
7926         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7927             <actions>
7928                 <create permission="CREATE_LOCALE" global_required="true"/>
7929                 <retrieve/>
7930                 <update permission="UPDATE_LOCALE" global_required="true"/>
7931                 <delete permission="DELETE_LOCALE" global_required="true"/>
7932             </actions>
7933         </permacrud>
7934         </class>
7935         <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">
7936                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7937                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7938                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7939                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7940             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7941                 </fields>
7942                 <links>
7943                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7944                 </links>
7945         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7946             <actions>
7947                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7948                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7949                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7950                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7951             </actions>
7952         </permacrud>
7953         </class>
7954
7955         <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">
7956                 <fields oils_persist:primary="id">
7957                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7958                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7959                 </fields>
7960                 <links/>
7961         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7962             <actions>
7963                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7964                 <retrieve/>
7965                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7966                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7967             </actions>
7968         </permacrud>
7969         </class>
7970
7971         <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">
7972                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7973                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7974                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7975                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7976                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7977                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7978                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7979                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7980                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7981                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7982                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7983                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7984                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7985                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7986                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7987                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7988                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7989                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7990                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7991                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7992                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7993                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7994                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7995                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7996                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7997                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7998                 </fields>
7999                 <links>
8000                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8001                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
8002                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8003                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
8004                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
8005                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8006                 </links>
8007         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8008             <actions>
8009                 <create permission="user_request.create">
8010                     <context link="usr" field="home_ou"/>
8011                                 </create>
8012                 <retrieve permission="user_request.view">
8013                     <context link="usr" field="home_ou"/>
8014                                 </retrieve>
8015                 <update permission="user_request.update">
8016                     <context link="usr" field="home_ou"/>
8017                                 </update>
8018                 <delete permission="user_request.delete">
8019                     <context link="usr" field="home_ou"/>
8020                                 </delete>
8021             </actions>
8022         </permacrud>
8023         </class>
8024
8025         <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">
8026                 <fields oils_persist:primary="code">
8027                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
8028                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8029                 </fields>
8030                 <links/>
8031         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8032             <actions>
8033                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8034                 <retrieve/>
8035                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8036                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8037             </actions>
8038         </permacrud>
8039         </class>
8040
8041         <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">
8042                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
8043                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
8044                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
8045                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
8046                         <field reporter:label="Ratio" name="ratio" />
8047                 </fields>
8048                 <links>
8049                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
8050                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
8051                 </links>
8052                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8053                         <actions>
8054                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8055                                 <retrieve/>
8056                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8057                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8058                         </actions>
8059                 </permacrud>
8060         </class>
8061
8062         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
8063                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
8064                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8065                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8066                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8067                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8068                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8069                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
8070                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
8071                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
8072                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
8073                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8074                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8075                         <field reporter:label="URL" name="url" reporter:datatype="text" />
8076                         <field reporter:label="Email" name="email" reporter:datatype="text" />
8077                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
8078                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
8079                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
8080                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
8081                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
8082                 </fields>
8083                 <links>
8084                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8085                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8086             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
8087             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
8088                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
8089                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
8090                 </links>
8091         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8092             <actions>
8093                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
8094                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
8095                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
8096                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
8097             </actions>
8098         </permacrud>
8099         </class>
8100
8101         <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">
8102                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
8103                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8104                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8105                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8106                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8107                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8108                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8109                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8110                 </fields>
8111                 <links>
8112                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8113                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8114                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8115                 </links>
8116         </class>
8117
8118         <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">
8119                 <fields oils_persist:primary="code">
8120                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
8121                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8122                 </fields>
8123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8124             <actions>
8125                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8126                 <retrieve/>
8127                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8128                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8129             </actions>
8130                 </permacrud>
8131         </class>
8132
8133         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
8134                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
8135                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
8136                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
8137                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8138                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
8139                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
8140                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
8141                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
8142                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
8143                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
8144                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
8145                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8146                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
8147                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
8148                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
8149                 </fields>
8150                 <links>
8151                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
8152                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8153                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
8154                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
8155                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
8156                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
8157                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
8158                 </links>
8159         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8160             <actions>
8161                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
8162                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
8163                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
8164                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
8165             </actions>
8166         </permacrud>
8167         </class>
8168
8169         <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">
8170                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
8171                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8172                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
8173                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8174                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
8175                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
8176                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
8177                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8178                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
8179                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
8180                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
8181                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
8182                 </fields>
8183                 <links>
8184                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
8185                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8186                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8187                 </links>
8188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8189             <actions>
8190                 <create   permission="ADMIN_INVOICE">
8191                                         <context link="invoice" field="receiver"/>
8192                                 </create>
8193                 <retrieve permission="ADMIN_INVOICE">
8194                                         <context link="invoice" field="receiver"/>
8195                                 </retrieve>
8196                 <update   permission="ADMIN_INVOICE">
8197                                         <context link="invoice" field="receiver"/>
8198                                 </update>
8199                                 <delete   permission="ADMIN_INVOICE">
8200                                         <context link="invoice" field="receiver"/>
8201                                 </delete>
8202             </actions>
8203         </permacrud>
8204         </class>
8205
8206         <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">
8207                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
8208                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8209                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
8210                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8211                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8212                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
8213                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
8214                         <field reporter:label="Author" name="author" reporter:datatype="text" />
8215                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8216                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
8217                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
8218                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8219                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
8220                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
8221                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8222                 </fields>
8223                 <links>
8224                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
8225                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8226                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8227                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8228                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8229                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
8230                 </links>
8231         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8232             <actions>
8233                 <create   permission="ADMIN_INVOICE">
8234                                         <context link="invoice" field="receiver"/>
8235                                 </create>
8236                 <retrieve permission="ADMIN_INVOICE">
8237                                         <context link="invoice" field="receiver"/>
8238                                 </retrieve>
8239                 <update   permission="ADMIN_INVOICE">
8240                                         <context link="invoice" field="receiver"/>
8241                                 </update>
8242                                 <delete   permission="ADMIN_INVOICE">
8243                                         <context link="invoice" field="receiver"/>
8244                                 </delete>
8245             </actions>
8246         </permacrud>
8247         </class>
8248
8249         <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">
8250                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
8251                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
8252                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
8253                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
8254                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
8255                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8256                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8257                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
8258                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
8259                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
8260                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
8261                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
8262                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
8263                 </fields>
8264                 <links>
8265                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8266                 </links>
8267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8268             <actions>
8269                 <create permission="ADMIN_PROVIDER">
8270                     <context link="provider" field="owner"/>
8271                 </create>
8272                 <retrieve permission="ADMIN_PROVIDER">
8273                     <context link="provider" field="owner"/>
8274                 </retrieve>
8275                 <update permission="ADMIN_PROVIDER">
8276                     <context link="provider" field="owner"/>
8277                 </update>
8278                 <delete permission="ADMIN_PROVIDER">
8279                     <context link="provider" field="owner"/>
8280                 </delete>
8281             </actions>
8282         </permacrud>
8283         </class>
8284
8285         <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">
8286                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
8287                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8288                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8289                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8290                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
8291                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
8292                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
8293         </fields>
8294                 <links>
8295                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8296                 </links>
8297         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8298             <actions>
8299                 <create permission="ADMIN_PROVIDER">
8300                     <context link="provider" field="owner"/>
8301                 </create>
8302                 <retrieve permission="ADMIN_PROVIDER">
8303                     <context link="provider" field="owner"/>
8304                 </retrieve>
8305                 <update permission="ADMIN_PROVIDER">
8306                     <context link="provider" field="owner"/>
8307                 </update>
8308                 <delete permission="ADMIN_PROVIDER">
8309                     <context link="provider" field="owner"/>
8310                 </delete>
8311             </actions>
8312         </permacrud>
8313     </class>
8314         <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">
8315                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
8316                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
8317                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
8318                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
8319                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
8320                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
8321                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
8322                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
8323                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
8324                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
8325                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
8326                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
8327                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
8328                 </fields>
8329                 <links>
8330                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
8331                 </links>
8332         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8333             <actions>
8334                 <create permission="ADMIN_PROVIDER">
8335                     <context link="contact" jump='provider' field="owner"/>
8336                 </create>
8337                 <retrieve permission="ADMIN_PROVIDER">
8338                     <context link="contact" jump='provider' field="owner"/>
8339                 </retrieve>
8340                 <update permission="ADMIN_PROVIDER">
8341                     <context link="contact" jump='provider' field="owner"/>
8342                 </update>
8343                 <delete permission="ADMIN_PROVIDER">
8344                     <context link="contact" jump='provider' field="owner"/>
8345                 </delete>
8346             </actions>
8347         </permacrud>
8348         </class>
8349
8350         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
8351                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
8352                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
8353                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
8354                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
8355                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
8356                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
8357                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
8358                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
8359                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8360                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
8361                 </fields>
8362                 <links>
8363                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
8364                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
8365                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
8366                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
8367                 </links>
8368         </class>
8369
8370         <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">
8371                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
8372                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8373                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
8374                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
8375                 </fields>
8376                 <links>
8377             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
8378                 </links>
8379                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8380                         <actions>
8381                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8382                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8383                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8384                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8385                         </actions>
8386                 </permacrud>
8387         </class>
8388
8389         <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">
8390                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
8391                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
8392                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
8393                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
8394                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
8395                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
8396                 </fields>
8397                 <links>
8398                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
8399                 </links>
8400                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8401                         <actions>
8402                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8403                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8404                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8405                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8406                         </actions>
8407                 </permacrud>
8408         </class>
8409
8410         <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">
8411                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
8412                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8413                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8414                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8415                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8416                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8417                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8418                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8419                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
8420                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
8421                 </fields>
8422                 <links>
8423                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8424                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8425             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
8426             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
8427                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
8428                 </links>
8429         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8430             <actions>
8431                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8432                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
8433                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8434                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8435             </actions>
8436         </permacrud>
8437         </class>
8438
8439         <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">
8440                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
8441                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
8442                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
8443                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8444                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8445                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
8446                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
8447                 </fields>
8448                 <links>
8449                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8450                 </links>
8451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8452                         <actions>
8453                                 <create permission="ADMIN_FUNDING_SOURCE">
8454                     <context link="funding_source" field="owner"/>
8455                 </create>
8456                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
8457                     <context link="funding_source" field="owner"/>
8458                 </retrieve>
8459                                 <update permission="ADMIN_FUNDING_SOURCE">
8460                     <context link="funding_source" field="owner"/>
8461                 </update>
8462                                 <delete permission="ADMIN_FUNDING_SOURCE">
8463                     <context link="funding_source" field="owner"/>
8464                 </delete>
8465                         </actions>
8466                 </permacrud>
8467         </class>
8468
8469         <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">
8470                 <fields oils_persist:primary="id">
8471                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
8472                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
8473                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
8474                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
8475                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8476                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8477                 </fields>
8478                 <links>
8479                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8480                 </links>
8481         </class>
8482
8483         <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">
8484                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
8485                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
8486                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8487                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
8488                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
8489                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8490                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
8491                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
8492                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8493                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
8494                 </fields>
8495                 <links>
8496                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8497                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8498                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
8499                 </links>
8500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8501                         <actions>
8502                                 <create permission="ADMIN_ACQ_FUND">
8503                     <context link="fund" field="org"/>
8504                 </create>
8505                                 <retrieve permission="ADMIN_ACQ_FUND">
8506                     <context link="fund" field="org"/>
8507                 </retrieve>
8508                                 <update permission="ADMIN_ACQ_FUND">
8509                     <context link="fund" field="org"/>
8510                 </update>
8511                                 <delete permission="ADMIN_ACQ_FUND">
8512                     <context link="fund" field="org"/>
8513                 </delete>
8514                         </actions>
8515                 </permacrud>
8516         </class>
8517
8518         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
8519                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8520                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8521                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8522                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8523                         <field reporter:label="Year" name="year" reporter:datatype="int" />
8524                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8525                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8526                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8527                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8528                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8529                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8530                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8531                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8532                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8533                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
8534                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8535                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
8536                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
8537                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
8538                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
8539                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8540                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8541                 </fields>
8542                 <links>
8543                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8544                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8545             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
8546             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
8547             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
8548             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
8549             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
8550             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
8551             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
8552             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
8553             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
8554                 </links>
8555         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
8556             <actions>
8557                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
8558                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8559                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
8560                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
8561             </actions>
8562         </permacrud>
8563         </class>
8564
8565         <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">
8566                 <fields oils_persist:primary="fund">
8567                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8568                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8569                 </fields>
8570                 <links>
8571                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8572                 </links>
8573         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8574             <actions>
8575                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8576                                         <context link="fund" field="org" />
8577                 </retrieve>
8578             </actions>
8579         </permacrud>
8580         </class>
8581
8582         <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">
8583                 <fields oils_persist:primary="fund">
8584                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8585                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
8586                 </fields>
8587                 <links>
8588                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8589                 </links>
8590         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8591             <actions>
8592                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8593                                         <context link="fund" field="org" />
8594                 </retrieve>
8595             </actions>
8596         </permacrud>
8597         </class>
8598
8599         <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">
8600                 <fields oils_persist:primary="fund">
8601                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8602                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
8603                 </fields>
8604                 <links>
8605                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8606                 </links>
8607         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8608             <actions>
8609                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8610                                         <context link="fund" field="org" />
8611                 </retrieve>
8612             </actions>
8613         </permacrud>
8614         </class>
8615
8616         <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">
8617                 <fields oils_persist:primary="fund">
8618                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8619                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8620                 </fields>
8621                 <links>
8622                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8623                 </links>
8624         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8625             <actions>
8626                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8627                                         <context link="fund" field="org" />
8628                 </retrieve>
8629             </actions>
8630         </permacrud>
8631         </class>
8632
8633         <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">
8634                 <fields oils_persist:primary="fund">
8635                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8636                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
8637                 </fields>
8638                 <links>
8639                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8640                 </links>
8641         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8642             <actions>
8643                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8644                                         <context link="fund" field="org" />
8645                 </retrieve>
8646             </actions>
8647         </permacrud>
8648         </class>
8649
8650    <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">
8651         <fields oils_persist:primary="fund">
8652             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8653             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8654         </fields>
8655         <links>
8656             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8657         </links>
8658     </class>
8659
8660    <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">
8661         <fields oils_persist:primary="fund">
8662             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8663             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
8664         </fields>
8665         <links>
8666             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8667         </links>
8668     </class>
8669
8670    <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">
8671         <fields oils_persist:primary="fund">
8672             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8673             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8674         </fields>
8675         <links>
8676             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8677         </links>
8678     </class>
8679
8680    <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">
8681         <fields oils_persist:primary="fund">
8682             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8683             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
8684         </fields>
8685         <links>
8686             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8687         </links>
8688     </class>
8689
8690    <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">
8691         <fields oils_persist:primary="fund">
8692             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8693             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
8694         </fields>
8695         <links>
8696             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8697         </links>
8698     </class>
8699
8700         <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">
8701                 <fields oils_persist:primary="funding_source">
8702                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8703                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
8704                 </fields>
8705                 <links>
8706                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8707                 </links>
8708         </class>
8709
8710         <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">
8711                 <fields oils_persist:primary="funding_source">
8712                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8713                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
8714                 </fields>
8715                 <links>
8716                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8717                 </links>
8718         </class>
8719
8720         <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">
8721                 <fields oils_persist:primary="funding_source">
8722                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8723                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
8724                 </fields>
8725                 <links>
8726                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8727                 </links>
8728         </class>
8729
8730         <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">
8731                 <fields oils_persist:primary="fund">
8732                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8733                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
8734                 </fields>
8735                 <links>
8736                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8737                 </links>
8738         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8739             <actions>
8740                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8741                                         <context link="fund" field="org" />
8742                 </retrieve>
8743             </actions>
8744         </permacrud>
8745     </class>
8746     <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">
8747         <oils_persist:source_definition><![CDATA[
8748             SELECT
8749                 acqf.*,
8750                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8751                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8752                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8753                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8754             FROM
8755                 acq.fund acqf
8756                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8757                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8758                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8759                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8760         ]]></oils_persist:source_definition>
8761         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8762             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8763             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8764             <field reporter:label="Name" name="name" reporter:datatype="text" />
8765             <field reporter:label="Year" name="year" reporter:datatype="int" />
8766             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8767             <field reporter:label="Code" name="code" reporter:datatype="text" />
8768             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8769             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8770             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8771             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8772             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8773
8774             <!-- non fund-native fields -->
8775             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8776             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8777             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8778             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8779         </fields>
8780         <links>
8781             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8782             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8783             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8784         </links>
8785         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8786             <actions>
8787                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8788             </actions>
8789         </permacrud>
8790         </class>
8791         <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">
8792                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8793                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8794                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8795                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8796                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8797                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8798                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8799                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8800                 </fields>
8801                 <links>
8802                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8803                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8804                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8805                 </links>
8806                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8807                         <actions>
8808                                 <create permission="ADMIN_ACQ_FUND">
8809                     <context link="fund" field="org"/>
8810                 </create>
8811                                 <retrieve permission="ADMIN_ACQ_FUND">
8812                     <context link="fund" field="org"/>
8813                 </retrieve>
8814                                 <update permission="ADMIN_ACQ_FUND">
8815                     <context link="fund" field="org"/>
8816                 </update>
8817                                 <delete permission="ADMIN_ACQ_FUND">
8818                     <context link="fund" field="org"/>
8819                 </delete>
8820                         </actions>
8821                 </permacrud>
8822         </class>
8823
8824     <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">
8825         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8826             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8827             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8828             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8829             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8830             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8831             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8832             <field reporter:label="Note" name="note" reporter:datatype="text" />
8833             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8834         </fields>
8835         <links>
8836             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8837             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8838             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8839         </links>
8840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8841                         <actions>
8842                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8843                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8844                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8845                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8846                         </actions>
8847                 </permacrud>
8848     </class>
8849
8850         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8851                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8852                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8853                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8854                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8855                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8856                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8857                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8858                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8859                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8860                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8861                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8862                 </fields>
8863                 <links>
8864                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8865                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8866                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8867                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8868                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8869                 </links>
8870                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8871                         <actions>
8872                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8873                         </actions>
8874                 </permacrud>
8875         </class>
8876
8877         <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">
8878                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8879                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8880                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8881                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8882                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8883                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8884                 </fields>
8885                 <links>
8886                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8887                 </links>
8888                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8889                         <actions>
8890                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8891                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8892                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8893                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8894                         </actions>
8895                 </permacrud>
8896         </class>
8897
8898         <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">
8899                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8900                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8901                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8902                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8903                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8904                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8905                         <field reporter:label="State" name="state" reporter:datatype="text" />
8906                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8907                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8908                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8909                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8910                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8911                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8912                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8913                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8914                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8915                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8916                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8917                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8918                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
8919                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8920                 </fields>
8921                 <links>
8922                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8923                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8924                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8925                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8926                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8927                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8928                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8929                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8930                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8931                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8932                 </links>
8933                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8934                         <actions>
8935                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8936                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8937                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8938                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8939                         </actions>
8940                 </permacrud>
8941         </class>
8942
8943         <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">
8944                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8945                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8946                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8947                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8948                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8949                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8950                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8951                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8952                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8953                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8954                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8955                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8956                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8957                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8958                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8959                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8960                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8961                 </fields>
8962                 <links>
8963                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8964                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8965                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8966                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8967                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8968                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8969                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8970                 </links>
8971                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8972             <actions>
8973                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8974             </actions>
8975                 </permacrud>
8976         </class>
8977
8978         <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">
8979                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8980                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8981                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8982                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8983                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8984                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8985                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8986                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8987                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8988                 </fields>
8989                 <links>
8990                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8991                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8992                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8993                 </links>
8994                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8995             <actions>
8996                 <create permission="CREATE_PURCHASE_ORDER">
8997                     <context link="purchase_order" field="ordering_agency"/>
8998                 </create>
8999                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9000                     <context link="purchase_order" field="ordering_agency"/>
9001                 </retrieve>
9002                 <update permission="CREATE_PURCHASE_ORDER">
9003                     <context link="purchase_order" field="ordering_agency"/>
9004                 </update>
9005                 <delete permission="CREATE_PURCHASE_ORDER">
9006                     <context link="purchase_order" field="ordering_agency"/>
9007                 </delete>
9008             </actions>
9009                 </permacrud>
9010         </class>
9011
9012         <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">
9013                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
9014                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9015                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9016                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9017                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
9018                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9019                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9020                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9021                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
9022                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9023                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9024                 </fields>
9025                 <links>
9026                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9027                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9028                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9029                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9030                 </links>
9031                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9032             <actions>
9033                 <create permission="CREATE_PURCHASE_ORDER">
9034                     <context link="purchase_order" field="ordering_agency"/>
9035                 </create>
9036                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9037                     <context link="purchase_order" field="ordering_agency"/>
9038                 </retrieve>
9039                 <update permission="CREATE_PURCHASE_ORDER">
9040                     <context link="purchase_order" field="ordering_agency"/>
9041                 </update>
9042                 <delete permission="CREATE_PURCHASE_ORDER">
9043                     <context link="purchase_order" field="ordering_agency"/>
9044                 </delete>
9045             </actions>
9046                 </permacrud>
9047         </class>
9048
9049         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
9050                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
9051                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
9052                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
9053                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
9054                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
9055                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9056                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9057                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9058                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
9059                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
9060                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
9061                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
9062                         <field reporter:label="State" name="state" reporter:datatype="text" />
9063                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9064                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9065                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
9066                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9067                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
9068                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
9069                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
9070                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9071                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9072                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
9073                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
9074                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
9075                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
9076                 </fields>
9077                 <links>
9078                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
9079                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9080                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9081                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9082                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9083                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
9084                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
9085                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
9086                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
9087                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
9088                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9089                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
9090                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9091                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
9092                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
9093                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
9094                 </links>
9095                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9096                         <actions>
9097                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
9098                                         <context link="purchase_order" field="ordering_agency"/>
9099                                         <context link="picklist" field="org_unit"/>
9100                                 </retrieve>
9101                         </actions>
9102                 </permacrud>
9103         </class>
9104
9105         <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">
9106                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
9107                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
9108                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
9109                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
9110                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
9111                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9112                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
9113                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
9114                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9115                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9116                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
9117                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
9118                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9119                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
9120                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
9121                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
9122                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
9123                         <field reporter:label="State" name="state" reporter:datatype="text"/>
9124                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
9125                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9126                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
9127                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
9128                 </fields>
9129                 <links>
9130                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
9131                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9132                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9133                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
9134                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9135                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9136                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
9137                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
9138                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9139                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9140                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
9141                 </links>
9142                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9143                         <actions>
9144                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9145                                         <context link="purchase_order" field="ordering_agency"/>
9146                                         <context link="picklist" field="org_unit"/>
9147                                 </retrieve>
9148                         </actions>
9149                 </permacrud>
9150         </class>
9151
9152         <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">
9153                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
9154                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
9155                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9156                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9157                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9158                 </fields>
9159                 <links>
9160                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9161                 </links>
9162                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9163                         <actions>
9164                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9165                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
9166                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9167                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9168                         </actions>
9169                 </permacrud>
9170         </class>
9171
9172         <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">
9173                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
9174                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
9175                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
9176                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9177                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9178                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9179                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9180                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9181                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
9182                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
9183                 </fields>
9184                 <links>
9185                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9186                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9187                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9188                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
9189                 </links>
9190         </class>
9191
9192         <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">
9193                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
9194                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
9195                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
9196                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
9197                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
9198                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
9199                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
9200                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
9201                 </fields>
9202                 <links>
9203                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9204                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
9205                 </links>
9206         </class>
9207
9208         <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">
9209                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
9210                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
9211                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9212                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
9213                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
9214                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
9215                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
9216                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
9217                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9218                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
9219                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
9220                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
9221                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
9222                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9223                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
9224                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9225                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
9226                 </fields>
9227                 <links>
9228                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9229                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
9230                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9231                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9232                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9233                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9234                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9235                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9236                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
9237                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
9238                 </links>
9239         </class>
9240
9241         <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">
9242                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9243                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9244                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9245                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9246                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9247                 </fields>
9248                 <links/>
9249                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9250                         <actions>
9251                                 <retrieve />
9252                         </actions>
9253                 </permacrud>
9254         </class>
9255
9256         <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">
9257                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9258                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9259                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9260                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9261                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9262                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9263             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
9264                 </fields>
9265                 <links/>
9266         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9267             <actions>
9268                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9269                 <retrieve />
9270                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9271                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9272             </actions>
9273         </permacrud>
9274         </class>
9275
9276         <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">
9277                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9278                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9279                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9280                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9281                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9282                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9283                 </fields>
9284                 <links/>
9285         </class>
9286         <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">
9287                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9288                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9289                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9290                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9291                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9292                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9293                 </fields>
9294                 <links>
9295                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9296                 </links>
9297         </class>
9298
9299         <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">
9300             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9301                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9302                 <field reporter:label="Code" name="code" reporter:datatype="text" />
9303                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9304                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9305                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9306                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9307         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
9308
9309             </fields>
9310             <links>
9311                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9312             </links>
9313             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9314                 <actions>
9315                     <create permission="ADMIN_PROVIDER">
9316                         <context link="provider" field="owner"/>
9317                     </create>
9318                     <retrieve permission="ADMIN_PROVIDER">
9319                         <context link="provider" field="owner"/>
9320                     </retrieve>
9321                     <update permission="ADMIN_PROVIDER">
9322                         <context link="provider" field="owner"/>
9323                     </update>
9324                     <delete permission="ADMIN_PROVIDER">
9325                         <context link="provider" field="owner"/>
9326                     </delete>
9327                 </actions>
9328             </permacrud>
9329         </class>
9330         
9331         <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">
9332             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
9333                 <field reporter:label="ID" name="id" reporter:datatype="id" />
9334                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9335                 <field reporter:label="Name" name="name" reporter:datatype="text" />
9336                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
9337             </fields>
9338             <links>
9339                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9340             </links>
9341             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9342                 <actions>
9343                     <create permission="ADMIN_PROVIDER">
9344                         <context link="provider" field="owner"/>
9345                     </create>
9346                     <retrieve permission="ADMIN_PROVIDER">
9347                         <context link="provider" field="owner"/>
9348                     </retrieve>
9349                     <update permission="ADMIN_PROVIDER">
9350                         <context link="provider" field="owner"/>
9351                     </update>
9352                     <delete permission="ADMIN_PROVIDER">
9353                         <context link="provider" field="owner"/>
9354                     </delete>
9355                 </actions>
9356             </permacrud>
9357         </class>
9358         
9359         <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">
9360             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9361                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9362                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9363                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9364                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9365                 </fields>
9366                 <links/>
9367         </class>
9368
9369         <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">
9370                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
9371                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
9372                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
9373                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
9374                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
9375                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
9376                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
9377                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
9378                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
9379                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
9380                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
9381                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
9382                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
9383                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
9384                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
9385                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes"/>
9386                 </fields>
9387                 <links>
9388                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9389                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9390                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
9391                 </links>
9392         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9393             <actions>
9394                 <create permission="ADMIN_PROVIDER">
9395                     <context link="provider" field="owner"/>
9396                 </create>
9397                 <retrieve permission="ADMIN_PROVIDER">
9398                     <context link="provider" field="owner"/>
9399                 </retrieve>
9400                 <update permission="ADMIN_PROVIDER">
9401                     <context link="provider" field="owner"/>
9402                 </update>
9403                 <delete permission="ADMIN_PROVIDER">
9404                     <context link="provider" field="owner"/>
9405                 </delete>
9406             </actions>
9407         </permacrud>
9408         </class>
9409
9410         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
9411                 oils_obj:fieldmapper="acq::edi_attr" 
9412                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
9413                 <fields oils_persist:primary="key">
9414                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
9415                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
9416                 </fields>
9417         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9418             <actions>
9419                 <create permission="ADMIN_PROVIDER" global_required="true"/>
9420                 <retrieve/>
9421                 <update permission="ADMIN_PROVIDER" global_required="true"/>
9422                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
9423             </actions>
9424         </permacrud>
9425         </class>
9426         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
9427                 oils_obj:fieldmapper="acq::edi_attr_set" 
9428                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
9429                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
9430                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
9431                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
9432                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
9433                 </fields>
9434                 <links>
9435                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
9436                 </links>
9437         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9438             <actions>
9439                 <create permission="ADMIN_PROVIDER" global_required="true"/>
9440                 <retrieve/>
9441                 <update permission="ADMIN_PROVIDER" global_required="true"/>
9442                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
9443             </actions>
9444         </permacrud>
9445         </class>
9446         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
9447                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
9448                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
9449                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
9450                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
9451                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
9452                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
9453                 </fields>
9454                 <links>
9455                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
9456                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
9457                 </links>
9458         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9459             <actions>
9460                 <create permission="ADMIN_PROVIDER" global_required="true"/>
9461                 <retrieve/>
9462                 <update permission="ADMIN_PROVIDER" global_required="true"/>
9463                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
9464             </actions>
9465         </permacrud>
9466         </class>
9467
9468
9469         <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">
9470                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
9471                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
9472                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
9473                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
9474                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
9475                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
9476                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
9477                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
9478                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
9479                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
9480                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
9481                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
9482                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
9483                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
9484                 </fields>
9485                 <links>
9486                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
9487                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9488                 </links>
9489         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9490             <actions>
9491                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9492                     <context link="account" jump="provider" field="owner"/>
9493                 </retrieve>
9494                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9495                     <context link="account" jump="provider" field="owner"/>
9496                 </update>
9497                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9498                     <context link="account" jump="provider" field="owner"/>
9499                 </delete>
9500             </actions>
9501         </permacrud>
9502         </class>
9503
9504
9505         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
9506                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
9507                         <field name="id" reporter:datatype="id" />
9508                         <field name="parent" reporter:datatype="link"/>
9509                         <field name="owner" reporter:datatype="link"/>
9510                         <field name="create_time" reporter:datatype="timestamp"/>
9511                         <field name="name" reporter:datatype="text"/>
9512                         <field name="shared" reporter:datatype="bool"/>
9513                         <field name="share_with" reporter:datatype="link"/>
9514                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9515                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
9516                 </fields>
9517                 <links>
9518                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9519                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
9520                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
9521                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9522                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
9523                 </links>
9524         </class>
9525         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
9526                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
9527                         <field name="id" reporter:datatype="id" />
9528                         <field name="parent" reporter:datatype="link"/>
9529                         <field name="owner" reporter:datatype="link"/>
9530                         <field name="create_time" reporter:datatype="timestamp"/>
9531                         <field name="name" reporter:datatype="text"/>
9532                         <field name="shared" reporter:datatype="bool"/>
9533                         <field name="share_with" reporter:datatype="link"/>
9534                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9535                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
9536                 </fields>
9537                 <links>
9538                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9539                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
9540                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
9541                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9542                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
9543                 </links>
9544         </class>
9545         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
9546                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
9547                         <field name="id" reporter:datatype="id" />
9548                         <field name="parent" reporter:datatype="link"/>
9549                         <field name="owner" reporter:datatype="link"/>
9550                         <field name="create_time" reporter:datatype="timestamp"/>
9551                         <field name="name" reporter:datatype="text"/>
9552                         <field name="shared" reporter:datatype="bool"/>
9553                         <field name="share_with" reporter:datatype="link"/>
9554                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9555                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9556                 </fields>
9557                 <links>
9558                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9559                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
9560                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
9561                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9562                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
9563                 </links>
9564         </class>
9565         <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">
9566                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
9567                         <field name="id" reporter:datatype="id" />
9568                         <field name="owner" reporter:datatype="link"/>
9569                         <field name="create_time" reporter:datatype="timestamp"/>
9570                         <field name="name" reporter:datatype="text"/>
9571                         <field name="data" reporter:datatype="text"/>
9572                         <field name="folder" reporter:datatype="link"/>
9573                         <field name="description" reporter:datatype="text"/>
9574                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9575                 </fields>
9576                 <links>
9577                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9578                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
9579                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
9580                 </links>
9581         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9582             <actions>
9583                 <create   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9584                 <retrieve permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9585                 <update   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9586                 <delete   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9587             </actions>
9588         </permacrud>
9589         </class>
9590         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
9591                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
9592                         <field name="id" reporter:datatype="id" />
9593                         <field name="owner" reporter:datatype="link"/>
9594                         <field name="create_time" reporter:datatype="timestamp"/>
9595                         <field name="template" reporter:datatype="link"/>
9596                         <field name="data" reporter:datatype="text"/>
9597                         <field name="folder" reporter:datatype="link"/>
9598                         <field name="recur" reporter:datatype="bool"/>
9599                         <field name="recurrence" reporter:datatype="interval"/>
9600                         <field name="name" reporter:datatype="text"/>
9601                         <field name="description" reporter:datatype="text"/>
9602                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
9603                 </fields>
9604                 <links>
9605                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9606                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
9607                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
9608                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
9609                 </links>
9610         </class>
9611         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
9612                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
9613                         <field name="id" reporter:datatype="id" />
9614                         <field name="runner" reporter:datatype="link"/>
9615                         <field name="start_time" reporter:datatype="timestamp"/>
9616                         <field name="complete_time" reporter:datatype="timestamp"/>
9617                         <field name="run_time" reporter:datatype="timestamp"/>
9618                         <field name="email" reporter:datatype="text"/>
9619                         <field name="excel_format" reporter:datatype="bool"/>
9620                         <field name="csv_format" reporter:datatype="bool"/>
9621                         <field name="html_format" reporter:datatype="bool"/>
9622                         <field name="error_code" reporter:datatype="int"/>
9623                         <field name="error_text" reporter:datatype="text"/>
9624                         <field name="report" reporter:datatype="link"/>
9625                         <field name="folder" reporter:datatype="link"/>
9626                         <field name="chart_pie" reporter:datatype="bool"/>
9627                         <field name="chart_bar" reporter:datatype="bool"/>
9628                         <field name="chart_line" reporter:datatype="bool"/>
9629                 </fields>
9630                 <links>
9631                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
9632                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
9633                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
9634                 </links>
9635         </class>
9636         <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">
9637                 <fields oils_persist:primary="id">
9638                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9639                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9640                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9641                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9642                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9643                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9644                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9645                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9646                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9647                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9648                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9649                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9650                 </fields>
9651                 <links>
9652                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9653                 </links>
9654                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9655                         <actions>
9656                                 <retrieve />
9657                         </actions>
9658                 </permacrud>
9659         </class>
9660         <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">
9661                 <fields oils_persist:primary="id">
9662                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9663                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9664                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9665                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9666                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9667                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9668                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9669                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9670                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9671                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9672                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9673                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9674                 </fields>
9675                 <links>
9676                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9677                 </links>
9678         </class>
9679         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
9680                 <fields oils_persist:primary="id">
9681                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9682                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
9683                         <field reporter:label="Fingerprint" name="fingerprint" />
9684                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9685                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9686                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9687                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9688                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
9689                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9690                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9691                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9692                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
9693                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
9694                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
9695                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9696                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9697                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
9698                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
9699                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
9700                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
9701                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
9702                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
9703                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9704                 </fields>
9705                 <links>
9706                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
9707                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9708                 </links>
9709         </class>
9710         <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">
9711                 <fields oils_persist:primary="id">
9712                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
9713                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
9714                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
9715                 </fields>
9716                 <links>
9717                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
9718                 </links>
9719         </class>
9720         <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">
9721                 <fields oils_persist:primary="id">
9722                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
9723                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
9724                 </fields>
9725                 <links>
9726                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
9727                 </links>
9728         </class>
9729         <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">
9730                 <fields oils_persist:primary="id">
9731                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
9732                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
9733                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
9734                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
9735                 </fields>
9736                 <links>
9737                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
9738                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
9739                 </links>
9740         </class>
9741         <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">
9742                 <fields oils_persist:primary="xact">
9743                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9744                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
9745                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
9746                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
9747                 </fields>
9748                 <links>
9749                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9750                 </links>
9751         </class>
9752         <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">
9753                 <fields oils_persist:primary="xact">
9754                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9755                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
9756                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
9757                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
9758                 </fields>
9759                 <links>
9760                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9761                 </links>
9762         </class>
9763         <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)">
9764                 <fields oils_persist:primary="id">
9765                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
9766                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
9767                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
9768                 </fields>
9769                 <links>
9770                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9771                 </links>
9772         </class>
9773         <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">
9774                 <fields oils_persist:primary="id">
9775                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
9776                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
9777                 </fields>
9778                 <links>
9779                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
9780                 </links>
9781         </class>
9782         <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">
9783                 <fields oils_persist:primary="bibid">
9784                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
9785                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
9786                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
9787                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
9788                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
9789                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
9790                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
9791                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
9792                 </fields>
9793                 <links>
9794                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
9795                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9796                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9797                 </links>
9798         </class>
9799         <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">
9800                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
9801                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
9802                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
9803                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
9804                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
9805                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
9806                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
9807                 </fields>
9808                 <links>
9809                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9810                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
9811                 </links>
9812                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9813                         <actions>
9814                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9815                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9816                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9817                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9818                         </actions>
9819                 </permacrud>
9820         </class>
9821         <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">
9822                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
9823                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
9824                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
9825                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9826                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9827                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9828                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9829                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9830                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9831                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9832                 </fields>
9833                 <links>
9834                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9835                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9836                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9837                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9838                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9839                 </links>
9840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9841                         <actions>
9842                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9843                                         <context link="formula" field="owner"/>
9844                                 </create>
9845                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9846                                         <context link="formula" field="owner"/>
9847                                 </retrieve>
9848                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9849                                         <context link="formula" field="owner"/>
9850                                 </update>
9851                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9852                                         <context link="formula" field="owner"/>
9853                                 </delete>
9854                         </actions>
9855                 </permacrud>
9856         </class>
9857
9858         <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">
9859                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9860                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9861                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9862                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9863                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9864                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9865                 </fields>
9866                 <links>
9867                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9868                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9869                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9870                 </links>
9871                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9872                         <actions>
9873                                 <create permission="CREATE_PURCHASE_ORDER">
9874                                         <context link="formula" field="owner"/>
9875                 </create>
9876                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9877                                         <context link="formula" field="owner"/>
9878                 </retrieve>
9879                                 <update permission="CREATE_PURCHASE_ORDER">
9880                                         <context link="formula" field="owner"/>
9881                 </update>
9882                                 <delete permission="CREATE_PURCHASE_ORDER">
9883                                         <context link="formula" field="owner"/>
9884                 </delete>
9885                         </actions>
9886                 </permacrud>
9887         </class>
9888
9889         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9890                 <fields oils_persist:primary="id">
9891                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9892                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9893                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9894                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9895                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9896                 </fields>
9897                 <links>
9898                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9899                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9900                 </links>
9901         </class>
9902
9903         <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">
9904                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9905                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9906                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9907                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9908                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9909                 </fields>
9910                 <links>
9911                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9912                 </links>
9913                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9914                         <actions>
9915                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9916                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9917                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9918                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9919                         </actions>
9920                 </permacrud>
9921         </class>
9922
9923         <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">
9924                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9925                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9926                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9927                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9928                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9929                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9930                 </fields>
9931                 <links>
9932                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9933                 </links>
9934                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9935                         <actions>
9936                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9937                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9938                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9939                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9940                         </actions>
9941                 </permacrud>
9942         </class>
9943
9944         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9945                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9946                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9947                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9948                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9949                 </fields>
9950                 <links>
9951                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9952                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9953                 </links>
9954         </class>
9955
9956         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9957                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9958                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9959                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9960                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9961                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9962                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9963                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9964                 </fields>
9965                 <links>
9966                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9967                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9968                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9969                 </links>
9970         </class>
9971
9972         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9973                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9974                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9975                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9976                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9977                 </fields>
9978                 <links>
9979                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9980                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9981                 </links>
9982         </class>
9983
9984         <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">
9985                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9986                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9987                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9988                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9989                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9990                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9991                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9992                 </fields>
9993                 <links>
9994                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9995                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9996                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9997                 </links>
9998         </class>
9999
10000         <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">
10001                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
10002                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10003                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
10004                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
10005                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10006                 </fields>
10007                 <links>
10008                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10009                 </links>
10010                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10011             <actions>
10012                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10013                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
10014                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10015                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10016             </actions>
10017                 </permacrud>
10018         </class>
10019
10020         <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">
10021                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
10022                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
10023                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
10024                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
10025                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
10026                 </fields>
10027                 <links>
10028                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10029                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
10030                 </links>
10031                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10032                         <actions>
10033                                 <create permission="ADMIN_CLAIM_POLICY">
10034                                         <context link="claim_policy" field="org_unit"/>
10035                 </create>
10036                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
10037                                         <context link="claim_policy" field="org_unit"/>
10038                 </retrieve>
10039                                 <update permission="ADMIN_CLAIM_POLICY">
10040                                         <context link="claim_policy" field="org_unit"/>
10041                 </update>
10042                                 <delete permission="ADMIN_CLAIM_POLICY">
10043                                         <context link="claim_policy" field="org_unit"/>
10044                 </delete>
10045                         </actions>
10046                 </permacrud>
10047         </class>
10048
10049     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
10050         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
10051             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10052             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
10053             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10054             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
10055             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
10056             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
10057             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
10058             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
10059             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
10060             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
10061             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
10062             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
10063             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
10064             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
10065             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10066             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
10067         </fields>
10068         <links>
10069             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
10070         </links>
10071     </class>
10072
10073     <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">
10074         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
10075             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10076             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10077             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10078             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10079             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10080         </fields>
10081     </class>
10082
10083     <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">
10084         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
10085             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10086             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10087             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10088             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
10089             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
10090             <field reporter:label="City" name="city" reporter:datatype="text"/>
10091             <field reporter:label="County" name="county"  reporter:datatype="text"/>
10092             <field reporter:label="State" name="state" reporter:datatype="text"/>
10093             <field reporter:label="Country" name="country" reporter:datatype="text"/>
10094             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
10095             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10096         </fields>
10097     </class>
10098
10099     <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">
10100         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
10101             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10102             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10103             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10104             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
10105             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
10106             <field reporter:label="City" name="city" reporter:datatype="text"/>
10107             <field reporter:label="County" name="county"  reporter:datatype="text"/>
10108             <field reporter:label="State" name="state" reporter:datatype="text"/>
10109             <field reporter:label="Country" name="country" reporter:datatype="text"/>
10110             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
10111             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10112         </fields>
10113     </class>
10114
10115     <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">
10116         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
10117             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10118             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10119             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10120             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
10121             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
10122             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10123         </fields>
10124     </class>
10125
10126     <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">
10127         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
10128             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10129             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10130             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10131             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
10132             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
10133             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10134         </fields>
10135     </class>
10136
10137         <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">
10138                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
10139                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
10140                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10141                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10142                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
10143                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
10144                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
10145                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
10146                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
10147                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10148                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10149                 </fields>
10150                 <links>
10151                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10152                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10153                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
10154                 </links>
10155                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10156                         <actions>
10157                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10158                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10159                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10160                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10161                         </actions>
10162                 </permacrud>
10163         </class>
10164
10165         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
10166                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
10167                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
10168                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10169                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10170                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
10171                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
10172                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
10173                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
10174                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
10175                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
10176                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
10177                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
10178                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
10179                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
10180                 </fields>
10181                 <links>
10182                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10183                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10184                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
10185                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
10186                 </links>
10187                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10188                         <actions>
10189                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10190                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10191                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10192                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10193                         </actions>
10194                 </permacrud>
10195         </class>
10196
10197         <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">
10198                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
10199                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
10200                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
10201                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
10202                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
10203                 </fields>
10204                 <links>
10205                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
10206                 </links>
10207                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
10208                         <actions>
10209                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10210                     <context link="fieldset" field="owning_lib"/>
10211                 </create>
10212                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10213                     <context link="fieldset" field="owning_lib"/>
10214                 </retrieve>
10215                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10216                     <context link="fieldset" field="owning_lib"/>
10217                 </update>
10218                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10219                     <context link="fieldset" field="owning_lib"/>
10220                 </delete>
10221                         </actions>
10222                 </permacrud>
10223         </class>
10224
10225     <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">
10226         <fields>
10227             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10228             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10229             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10230         </fields>
10231                 <links>
10232                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10233                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10234                 </links>
10235     </class>
10236
10237     <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">
10238         <fields>
10239             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10240             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
10241         </fields>
10242                 <links>
10243                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10244                 </links>
10245     </class>
10246
10247     <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">
10248         <fields>
10249             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10250             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10251             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10252         </fields>
10253                 <links>
10254                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10255                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10256                 </links>
10257     </class>
10258
10259     <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">
10260         <fields>
10261             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10262             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
10263         </fields>
10264                 <links>
10265                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10266                 </links>
10267     </class>
10268
10269     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
10270                 <oils_persist:source_definition>
10271
10272             SELECT  DISTINCT l.*
10273               FROM  action.unfulfilled_hold_loops l
10274                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
10275               WHERE l.count = m.max
10276
10277                 </oils_persist:source_definition>
10278         <fields>
10279             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10280             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10281             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10282         </fields>
10283                 <links>
10284                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10285                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10286                 </links>
10287     </class>
10288
10289         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
10290                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
10291                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
10292                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
10293                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
10294                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
10295                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
10296                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
10297                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
10298                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
10299                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
10300                 </fields>
10301                 <links>
10302                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
10303                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
10304                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
10305                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
10306                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
10307                 </links>
10308         </class>
10309
10310         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
10311                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
10312                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
10313                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
10314                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10315                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
10316                 </fields>
10317                 <links>
10318                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
10319                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
10320                 </links>
10321         </class>
10322
10323         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
10324                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
10325                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
10326                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
10327                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
10328                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
10329                 </fields>
10330                 <links>
10331                 </links>
10332         </class>
10333
10334         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
10335                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
10336                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
10337                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
10338                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10339                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
10340                 </fields>
10341                 <links>
10342                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
10343                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
10344                 </links>
10345         </class>
10346         
10347         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
10348                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
10349                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
10350                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
10351                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
10352                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
10353                 </fields>
10354                 <links>
10355                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
10356                 </links>
10357         </class>
10358         
10359         <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">
10360                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
10361                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
10362                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10363                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10364                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
10365                 </fields>
10366                 <links>
10367                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10368                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
10369                 </links>
10370         </class>
10371
10372         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
10373                 <fields oils_persist:primary="name">
10374                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
10375                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10376                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
10377                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10378                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
10379                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
10380                 </fields>
10381                 <links>
10382                 </links>
10383         </class>
10384
10385         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
10386                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10387                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10388                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
10389                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10390                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10391                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10392                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10393                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10394                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10395                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10396                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10397                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
10398                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10399                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10400                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
10401                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10402                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
10403                 </fields>
10404                 <links>
10405                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10406                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10407                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
10408                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10409                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10410                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
10411                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
10412                 </links>
10413         </class>
10414
10415         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
10416                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
10417                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
10418                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10419                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10420                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
10421                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
10422                 </fields>
10423                 <links>
10424                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10425                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
10426                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
10427                 </links>
10428         </class>
10429
10430         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
10431                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
10432                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
10433                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
10434                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
10435                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
10436                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
10437                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
10438                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10439                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
10440                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10441                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
10442                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
10443                 </fields>
10444                 <links>
10445                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10446                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
10447                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
10448                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
10449                 </links>
10450         </class>
10451
10452         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
10453                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
10454                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
10455                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
10456                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10457                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10458                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
10459                 </fields>
10460                 <links>
10461                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
10462                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
10463                 </links>
10464         </class>
10465
10466         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
10467                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
10468                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
10469                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
10470                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10471                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
10472                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
10473                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
10474                 </fields>
10475                 <links>
10476                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
10477                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
10478                 </links>
10479         </class>
10480
10481         <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">
10482                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
10483                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
10484                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
10485                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10486                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
10487                 </fields>
10488                 <links>
10489                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
10490                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
10491                 </links>
10492         </class>
10493
10494         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
10495                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10496                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10497                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10498                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10499                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10500                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10501                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10502                 </fields>
10503                 <links>
10504                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10505                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10506                 </links>
10507         </class>
10508
10509         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
10510                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10511                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10512                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10513                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10514                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10515                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
10516                 </fields>
10517                 <links>
10518                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10519                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
10520                 </links>
10521         </class>
10522
10523         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
10524                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10525                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10526                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10527                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10528                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10529                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10530                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10531                 </fields>
10532                 <links>
10533                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10534                 </links>
10535         </class>
10536
10537         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
10538                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10539                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10540                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10541                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10542                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10543                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10544                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10545                 </fields>
10546                 <links>
10547                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10548                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10549                 </links>
10550         </class>
10551
10552         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
10553                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10554                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10555                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10556                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10557                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10558                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10559                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
10560                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10561                 </fields>
10562                 <links>
10563                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10564                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10565                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
10566                 </links>
10567         </class>
10568
10569         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
10570                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10571                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10572                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10573                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10574                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10575                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10576                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10577                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10578                 </fields>
10579                 <links>
10580                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10581                 </links>
10582         </class>
10583
10584         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
10585                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10586                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10587                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10588                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10589                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10590                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10591                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10592                 </fields>
10593                 <links>
10594                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10595                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10596                 </links>
10597         </class>
10598
10599         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
10600                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10601                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10602                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10603                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10604                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10605                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10606                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10607                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10608                 </fields>
10609                 <links>
10610                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10611                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10612                 </links>
10613         </class>
10614
10615         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
10616                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10617                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10618                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10619                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10620                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10621                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10622                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10623                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10624                 </fields>
10625                 <links>
10626                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10627                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10628                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10629                 </links>
10630         </class>
10631
10632         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
10633                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10634                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10635                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10636                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10637                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10638                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10639                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10640                 </fields>
10641                 <links>
10642                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10643                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10644                 </links>
10645         </class>
10646
10647         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
10648                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10649                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10650                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10651                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10652                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10653                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10654                 </fields>
10655                 <links>
10656                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10657                 </links>
10658         </class>
10659
10660         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
10661                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10662                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10663                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10664                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10665                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10666                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10667                 </fields>
10668                 <links>
10669                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10670                 </links>
10671         </class>
10672
10673         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
10674                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10675                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10676                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10677                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10678                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10679                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10680                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10681                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
10682                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10683                 </fields>
10684                 <links>
10685                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10686                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10687                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
10688                 </links>
10689         </class>
10690
10691         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
10692                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10693                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10694                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10695                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10696                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10697                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10698                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10699                 </fields>
10700                 <links>
10701                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10702                 </links>
10703         </class>
10704
10705         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
10706                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10707                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10708                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10709                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10710                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10711                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10712                 </fields>
10713                 <links>
10714                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10715                 </links>
10716         </class>
10717
10718         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
10719                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10720                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10721                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10722                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10723                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10724                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10725                 </fields>
10726                 <links>
10727                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10728                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10729                 </links>
10730         </class>
10731
10732         <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">
10733                 <fields oils_persist:primary="id">
10734                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
10735                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
10736                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
10737                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
10738                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
10739                 </fields>
10740                 <links>
10741                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
10742                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10743                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
10744                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
10745                 </links>
10746         </class>
10747
10748         <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">
10749                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
10750                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10751                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
10752                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10753                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
10754                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10755                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10756                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
10757                 </fields>
10758                 <links/>
10759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10760                         <actions>
10761                                 <retrieve/>
10762                         </actions>
10763                 </permacrud>
10764         </class>
10765
10766         <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">
10767                 <fields oils_persist:primary="ptype_key">
10768                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
10769                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10770                 </fields>
10771                 <links/>
10772                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10773                         <actions>
10774                                 <retrieve/>
10775                         </actions>
10776                 </permacrud>
10777         </class>
10778
10779         <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">
10780                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
10781                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10782                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
10783                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10784                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10785                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10786                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10787                 </fields>
10788                 <links>
10789                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
10790                 </links>
10791                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10792                         <actions>
10793                                 <retrieve/>
10794                         </actions>
10795                 </permacrud>
10796         </class>
10797
10798         <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">
10799                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
10800                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10801                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
10802                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
10803                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10804                 </fields>
10805                 <links>
10806                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10807                 </links>
10808                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10809                         <actions>
10810                                 <retrieve/>
10811                         </actions>
10812                 </permacrud>
10813         </class>
10814
10815     <class
10816         id="uvs"
10817         controller="open-ils.cstore open-ils.pcrud"
10818         oils_obj:fieldmapper="url_verify::session"
10819         oils_persist:tablename="url_verify.session"
10820         reporter:label="URL Verification Session"
10821     >
10822         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
10823             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
10824             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10825                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
10826             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10827             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
10828             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10829             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
10830             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
10831             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
10832         </fields>
10833
10834         <links>
10835             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10836             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10837             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
10838             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
10839             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
10840         </links>
10841
10842         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10843             <actions>
10844                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
10845             </actions>
10846         </permacrud>
10847
10848     </class>
10849
10850     <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">
10851         <oils_persist:source_definition>
10852             SELECT
10853                 cbrebi.id AS id,  -- so we can have a pkey in our view
10854                 uvs.id AS session,
10855                 uvs.owning_lib,
10856                 cbrebi.target_biblio_record_entry
10857             FROM url_verify.session uvs
10858             JOIN container.biblio_record_entry_bucket cbreb
10859                 ON (uvs.container = cbreb.id)
10860             JOIN container.biblio_record_entry_bucket_item cbrebi
10861                 ON (cbrebi.bucket = cbreb.id)
10862         </oils_persist:source_definition>
10863         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
10864             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
10865             <field reporter:label="Session" name="session" reporter:datatype="link" />
10866             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10867             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
10868         </fields>
10869         <links>
10870             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
10871             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
10872             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
10873         </links>
10874         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10875             <actions>
10876                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
10877             </actions>
10878         </permacrud>
10879     </class>
10880
10881     <class
10882         id="uvus"
10883         controller="open-ils.cstore open-ils.pcrud"
10884         oils_obj:fieldmapper="url_verify::url_selector"
10885         oils_persist:tablename="url_verify.url_selector"
10886         reporter:label="URL Verification URL Selector"
10887     >
10888         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
10889             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
10890             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10891                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10892             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10893         </fields>
10894
10895         <links>
10896             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10897             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10898         </links>
10899
10900         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10901             <actions>
10902                 <create permission="URL_VERIFY">
10903                     <context link="session" field="owning_lib"/>
10904                 </create>
10905                 <retrieve permission="URL_VERIFY">
10906                     <context link="session" field="owning_lib"/>
10907                 </retrieve>
10908                 <update permission="URL_VERIFY">
10909                     <context link="session" field="owning_lib"/>
10910                 </update>
10911                 <delete permission="URL_VERIFY">
10912                     <context link="session" field="owning_lib"/>
10913                 </delete>
10914             </actions>
10915         </permacrud>
10916
10917     </class>
10918
10919     <class
10920         id="uvu"
10921         controller="open-ils.cstore open-ils.pcrud"
10922         oils_obj:fieldmapper="url_verify::url"
10923         oils_persist:tablename="url_verify.url"
10924         reporter:label="URL Verification URL"
10925     >
10926         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10927             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10928                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10929                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10930                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10931                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10932             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10933             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10934             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10935             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10936             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10937             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10938             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10939             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10940             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10941             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10942             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10943             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10944             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10945         </fields>
10946
10947         <links>
10948             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10949             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10950             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10951             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10952             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10953         </links>
10954
10955         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10956             <actions>
10957                 <create permission="URL_VERIFY">
10958                     <context link="session" field="owning_lib"/>
10959                 </create>
10960                 <retrieve permission="URL_VERIFY">
10961                     <context link="session" field="owning_lib"/>
10962                 </retrieve>
10963                 <update permission="URL_VERIFY">
10964                     <context link="session" field="owning_lib"/>
10965                 </update>
10966                 <delete permission="URL_VERIFY">
10967                     <context link="session" field="owning_lib"/>
10968                 </delete>
10969             </actions>
10970         </permacrud>
10971
10972     </class>
10973
10974     <class
10975         id="uvva"
10976         controller="open-ils.cstore open-ils.pcrud"
10977         oils_obj:fieldmapper="url_verify::verification_attempt"
10978         oils_persist:tablename="url_verify.verification_attempt"
10979         reporter:label="URL Verification Attempt"
10980     >
10981         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10982             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10983                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10984                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10985             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10986             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10987         </fields>
10988
10989         <links>
10990             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10991             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10992         </links>
10993
10994         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10995             <actions>
10996                 <create permission="URL_VERIFY">
10997                     <context link="session" field="owning_lib"/>
10998                 </create>
10999                 <retrieve permission="URL_VERIFY">
11000                     <context link="session" field="owning_lib"/>
11001                 </retrieve>
11002                 <update permission="URL_VERIFY">
11003                     <context link="session" field="owning_lib"/>
11004                 </update>
11005                 <delete permission="URL_VERIFY">
11006                     <context link="session" field="owning_lib"/>
11007                 </delete>
11008             </actions>
11009         </permacrud>
11010
11011     </class>
11012
11013     <class
11014         id="uvuv"
11015         controller="open-ils.cstore open-ils.pcrud"
11016         oils_obj:fieldmapper="url_verify::url_verification"
11017         oils_persist:tablename="url_verify.url_verification"
11018         reporter:label="URL Verification"
11019     >
11020         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
11021             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
11022                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
11023                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
11024             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
11025             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
11026             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
11027             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
11028                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
11029         </fields>
11030
11031         <links>
11032             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
11033             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
11034             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
11035         </links>
11036
11037         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11038             <actions>
11039                 <create permission="URL_VERIFY">
11040                     <context link="attempt" jump="session" field="owning_lib"/>
11041                 </create>
11042                 <retrieve permission="URL_VERIFY">
11043                     <context link="attempt" jump="session" field="owning_lib"/>
11044                 </retrieve>
11045                 <update permission="URL_VERIFY">
11046                     <context link="attempt" jump="session" field="owning_lib"/>
11047                 </update>
11048                 <delete permission="URL_VERIFY">
11049                     <context link="attempt" jump="session" field="owning_lib"/>
11050                 </delete>
11051             </actions>
11052         </permacrud>
11053
11054     </class>
11055
11056         <class
11057                 id="cfdi"
11058                 controller="open-ils.cstore open-ils.pcrud"
11059                 oils_obj:fieldmapper="config::filter_dialog_interface"
11060                 oils_persist:tablename="config.filter_dialog_interface"
11061                 reporter:label="FilterDialog Interface">
11062                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
11063                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
11064                         <field reporter:label="Description" name="description" reporter:datatype="text" />
11065                 </fields>
11066                 <links>
11067                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
11068                 </links>
11069                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11070                         <actions>
11071                                 <retrieve />
11072                         </actions>
11073                 </permacrud>
11074         </class>
11075
11076         <class
11077                 id="cfdfs"
11078                 controller="open-ils.cstore open-ils.pcrud"
11079                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
11080                 oils_persist:tablename="config.filter_dialog_filter_set"
11081                 reporter:label="FilterDialog Filter Set">
11082                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
11083                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11084                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11085                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11086                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11087                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
11088                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11089                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
11090                 </fields>
11091                 <links>
11092                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11093                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11094                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
11095                 </links>
11096                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11097                         <actions>
11098                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11099                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11100                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11101                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11102                         </actions>
11103                 </permacrud>
11104
11105         </class>
11106
11107         <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">
11108                 <fields oils_persist:primary="code">
11109                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
11110                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
11111                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
11112                 </fields>
11113                 <links/>
11114                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11115                         <actions>
11116                                 <retrieve/>
11117                         </actions>
11118                 </permacrud>
11119         </class>
11120
11121         <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">
11122                 <oils_persist:source_definition>
11123
11124             SELECT  b.id,
11125                     MAX(dcp.edit_date) AS last_delete_date
11126              FROM   biblio.record_entry b
11127                     JOIN asset.call_number cn ON (cn.record = b.id)
11128                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
11129              WHERE  NOT b.deleted
11130              GROUP BY b.id
11131              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
11132
11133                 </oils_persist:source_definition>
11134                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11135                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11136                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
11137                 </fields>
11138                 <links>
11139                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11140                 </links>
11141                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11142                         <actions>
11143                                 <retrieve/>
11144                         </actions>
11145                 </permacrud>
11146         </class>
11147
11148         <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">
11149                 <oils_persist:source_definition>
11150
11151             -- -- 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.
11152             -- -- 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
11153             -- -- may not.
11154             -- SELECT
11155             --     bre.id AS bib_id,
11156             --     COALESCE( z.copy_count, 0 ) AS copy_count,
11157             --     COALESCE( z.hold_count, 0 ) AS hold_count,
11158             --     COALESCE( z.copy_hold_ratio, 0 ) AS hold_copy_ratio
11159             -- FROM (
11160                 SELECT
11161                     y.bre AS id,
11162                     COALESCE( x.copy_count, 0 ) AS copy_count,
11163                     y.hold_count AS hold_count,
11164                     (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
11165                 FROM (
11166                         SELECT
11167                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS bre,
11168                             COUNT(*) AS hold_count
11169                         FROM action.hold_request h
11170                         WHERE
11171                             cancel_time IS NULL
11172                             AND fulfillment_time IS NULL
11173                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
11174                         GROUP BY 1
11175                     )y LEFT JOIN (
11176                         SELECT 
11177                             (SELECT id
11178                                 FROM biblio.record_entry 
11179                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
11180                             ) AS bre, 
11181                             COUNT(*) AS copy_count
11182                         FROM asset.copy
11183                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
11184                         WHERE copy.holdable 
11185                             AND NOT copy.deleted 
11186                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
11187                         GROUP BY 1
11188                     )x ON x.bre = y.bre
11189                 -- )z RIGHT JOIN (
11190                 --     SELECT id
11191                 --     FROM biblio.record_entry
11192                 --     WHERE NOT deleted
11193                 -- )bre ON (z.bib_id = bre.id)
11194                 
11195
11196                 </oils_persist:source_definition>
11197                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11198                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11199                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
11200                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
11201                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
11202                 </fields>
11203                 <links>
11204                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11205                 </links>
11206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11207                         <actions>
11208                                 <retrieve/>
11209                         </actions>
11210                 </permacrud>
11211         </class>
11212
11213         <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">
11214                 <oils_persist:source_definition>
11215             SELECT *,
11216                 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,
11217                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
11218             FROM
11219                 (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
11220                     FROM
11221                         action.hold_request ahr
11222                         JOIN reporter.hold_request_record rhrr USING (id)
11223                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11224                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
11225                     WHERE
11226                         ahr.cancel_time IS NULL
11227                         AND ahr.fulfillment_time IS NULL
11228                     GROUP BY bib_record, pickup_lib
11229                 )x
11230                 JOIN
11231                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
11232                     FROM
11233                         action.hold_request ahr
11234                         JOIN reporter.hold_request_record rhrr USING (id)
11235                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11236                     WHERE
11237                         ahr.cancel_time IS NULL
11238                         AND ahr.fulfillment_time IS NULL
11239                     GROUP BY bib_record
11240                 )y
11241                 USING (id)
11242                 </oils_persist:source_definition>
11243                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11244                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
11245                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
11246                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
11247                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
11248                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
11249                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
11250                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
11251                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
11252                 </fields>
11253                 <links>
11254                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11255                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
11256                 </links>
11257                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11258                         <actions>
11259                                 <retrieve/>
11260                         </actions>
11261                 </permacrud>
11262         </class>
11263
11264         <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) ">
11265                 <oils_persist:source_definition>
11266             WITH counts_at_ou AS (
11267                 SELECT  rhrr.bib_record AS id,
11268                         aou.id AS pickup_lib_or_desc,
11269                         COUNT(DISTINCT ahr.id) AS holds_at_or_below,
11270                         COALESCE(COUNT(DISTINCT ac.id),0) AS copy_count_at_or_below
11271                   FROM  actor.org_unit aou
11272                         JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
11273                         action.hold_request ahr
11274                         JOIN reporter.hold_request_record rhrr USING (id)
11275                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11276                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
11277                   WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
11278                         AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
11279                         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
11280                   GROUP BY 1, 2
11281             )
11282             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
11283                    y.holds_everywhere, y.copy_count_everywhere,
11284                 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,
11285                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/y.copy_count_everywhere END AS everywhere_ratio
11286             FROM counts_at_ou x
11287                 JOIN (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
11288                     FROM
11289                         action.hold_request ahr
11290                         JOIN reporter.hold_request_record rhrr USING (id)
11291                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11292                     WHERE
11293                         ahr.cancel_time IS NULL
11294                         AND ahr.fulfillment_time IS NULL
11295                     GROUP BY bib_record
11296                 )y
11297                 USING (id)
11298                 </oils_persist:source_definition>
11299                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11300                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
11301                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
11302                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
11303                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
11304                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
11305                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
11306                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
11307                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
11308                 </fields>
11309                 <links>
11310                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11311                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
11312                 </links>
11313                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11314                         <actions>
11315                                 <retrieve/>
11316                         </actions>
11317                 </permacrud>
11318         </class>
11319
11320         <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">
11321                 <oils_persist:source_definition>
11322             SELECT
11323                 ac.id,
11324                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
11325                 MAX(actac.xact_start) AS last_circ
11326             FROM asset.copy ac
11327                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
11328             GROUP BY ac.id
11329
11330             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
11331             --SELECT
11332             --    ac.id,
11333             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
11334             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
11335             --FROM asset.copy ac
11336             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
11337             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
11338             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
11339                 </oils_persist:source_definition>
11340                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11341                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
11342                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
11343                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
11344                 </fields>
11345                 <links>
11346                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11347                 </links>
11348                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11349                         <actions>
11350                                 <retrieve/>
11351                         </actions>
11352                 </permacrud>
11353         </class>
11354
11355         <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">
11356                 <fields oils_persist:primary="id">
11357                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
11358                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
11359                 </fields>
11360                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11361                         <actions>
11362                                 <retrieve/>
11363                         </actions>
11364                 </permacrud>
11365         </class>
11366
11367         <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">
11368                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
11369                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
11370                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
11371                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
11372                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
11373                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
11374                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
11375                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
11376                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
11377                 </fields>
11378                 <links>
11379                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
11380                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
11381                 </links>
11382                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11383                         <actions>
11384                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11385                                 <retrieve/>
11386                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11387                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11388                         </actions>
11389                 </permacrud>
11390         </class>
11391
11392         <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">
11393                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
11394                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
11395                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
11396                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
11397                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
11398                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
11399                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
11400                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
11401                 </fields>
11402                 <links>
11403                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
11404                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
11405                 </links>
11406                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11407                         <actions>
11408                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11409                                 <retrieve/>
11410                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11411                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11412                         </actions>
11413                 </permacrud>
11414         </class>
11415
11416
11417         <!-- ********************************************************************************************************************* -->
11418         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
11419         <!-- ********************************************************************************************************************* -->
11420         <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">
11421                 <fields oils_persist:primary="id">
11422                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
11423                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
11424                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
11425                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
11426                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
11427                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
11428                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
11429                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
11430                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
11431                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
11432                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
11433                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
11434                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
11435                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
11436                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
11437                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
11438                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
11439                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
11440                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
11441                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
11442                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
11443                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
11444                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
11445                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
11446                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
11447                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
11448                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
11449                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
11450                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
11451                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
11452                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
11453                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
11454                 </fields>
11455                 <links>
11456                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11457                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11458                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
11459                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11460                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
11461                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
11462                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
11463                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
11464                 </links>
11465         </class>
11466
11467         <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">
11468                 <fields oils_persist:primary="id">
11469                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
11470                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
11471                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11472                 </fields>
11473                 <links>
11474                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11475                 </links>
11476         </class>
11477
11478         <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">
11479                 <fields oils_persist:primary="id">
11480                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
11481                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
11482                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11483                 </fields>
11484                 <links>
11485                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11486                 </links>
11487         </class>
11488
11489         <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">
11490                 <fields oils_persist:primary="id">
11491                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
11492
11493                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
11494                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
11495                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
11496
11497                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
11498                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
11499                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
11500
11501                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
11502                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
11503
11504                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
11505                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
11506                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
11507
11508                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
11509                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
11510
11511                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
11512                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
11513                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
11514
11515                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
11516                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
11517                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
11518
11519                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
11520                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
11521                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
11522                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
11523
11524                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
11525                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
11526
11527                 </fields>
11528                 <links>
11529                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
11530                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11531                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
11532                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
11533                 </links>
11534         </class>
11535
11536         <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">
11537                 <oils_persist:source_definition>
11538
11539             SELECT
11540                 po.ordering_agency AS ordering_agency,
11541                 po.id AS purchase_order,
11542                 li.id AS lineitem,
11543                 lid.id AS lineitem_detail,
11544                 cpa.id AS claim_policy_action
11545             FROM
11546                 acq.lineitem_detail lid
11547                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
11548                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
11549                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
11550                 JOIN acq.claim_policy_action cpa ON (
11551                     cpa.claim_policy = cp.id
11552
11553                     -- we only care about claim policy actions whose claim
11554                     -- interval we'd reached or exceeded
11555                     AND (NOW() - cpa.action_interval) &gt; po.order_date
11556
11557                     -- filter out all claim policy actions where claim events
11558                     -- have occurred on or after the action's action_interval
11559                     AND NOT EXISTS (
11560                         SELECT 1
11561                         FROM
11562                             acq.claim_event evt
11563                             JOIN acq.claim claim ON (
11564                                 claim.id = evt.claim
11565                                 AND claim.lineitem_detail = lid.id
11566                             )
11567                         WHERE
11568                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
11569                     )
11570                 )
11571             WHERE
11572                 lid.cancel_reason IS NULL
11573                 AND li.cancel_reason IS NULL -- belt/suspenders
11574                 AND po.cancel_reason IS NULL -- belt/suspenders
11575                 AND lid.recv_time IS NULL
11576                 AND po.state = 'on-order'
11577             ORDER BY 1, 2, 3, 4, 5
11578
11579                 </oils_persist:source_definition>
11580                 <fields>
11581                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
11582                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
11583                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11584                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11585                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
11586                 </fields>
11587                 <links>
11588                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
11589                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
11590                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11591                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11592                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
11593                 </links>
11594         </class>
11595         <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">
11596                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11597                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11598                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11599                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11600                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11601                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11602                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11603                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11604                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11605                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11606                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11607                 </fields>
11608                 <links>
11609                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11610                 </links>
11611     </class>
11612         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
11613                 <oils_persist:source_definition>
11614             SELECT * FROM acq.lineitem_summary 
11615                                 WHERE item_count > (invoice_count + cancel_count)
11616         </oils_persist:source_definition>
11617                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11618                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11619                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11620                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11621                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11622                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11623                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11624                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11625                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11626                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11627                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11628                 </fields>
11629                 <links>
11630                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11631                 </links>
11632     </class>
11633         <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">
11634                 <oils_persist:source_definition>
11635
11636                         SELECT  t.*
11637                           FROM  action.transit_copy t
11638                                 JOIN actor.org_unit AS s ON (t.source = s.id)
11639                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
11640                           WHERE s.parent_ou &lt;&gt; d.parent_ou
11641
11642                 </oils_persist:source_definition>
11643                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
11644                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
11645                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
11646                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
11647                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
11648                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
11649                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
11650                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
11651                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
11652                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
11653                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
11654                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
11655                 </fields>
11656                 <links>
11657                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
11658                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
11659                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
11660                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
11661                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11662                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
11663                 </links>
11664         </class>
11665
11666     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
11667                 <oils_persist:source_definition>
11668
11669         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
11670                 SELECT
11671                         cp.id as copy,
11672                         COUNT(circ.id),
11673                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11674                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11675                 FROM
11676                         asset.copy cp
11677                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
11678                 GROUP BY 1, 3, 4
11679                 UNION ALL
11680                 SELECT
11681                         cp.id as copy,
11682                         COUNT(circ.id),
11683                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11684                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11685                 FROM
11686                         asset.copy cp
11687                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
11688                 GROUP BY 1, 3, 4
11689                 UNION ALL
11690                 SELECT
11691                         id as copy,
11692                         circ_count,
11693                         -1 AS year,
11694                         false as is_renewal
11695                 FROM
11696                         extend_reporter.legacy_circ_count
11697         )x GROUP BY 1, 3, 4
11698
11699                 </oils_persist:source_definition>
11700         <fields>
11701             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
11702             <field reporter:label="Count" name="count" reporter:datatype="int"/>
11703             <field reporter:label="Year" name="year" reporter:datatype="int"/>
11704             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
11705         </fields>
11706                 <links>
11707                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
11708                 </links>
11709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11710                         <actions>
11711                                 <retrieve/>
11712                         </actions>
11713                 </permacrud>
11714     </class>
11715
11716         <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">
11717                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
11718                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
11719                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
11720                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
11721                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
11722                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
11723                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
11724                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
11725                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
11726                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
11727                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
11728                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
11729                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
11730                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
11731                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
11732                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
11733                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
11734                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
11735                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
11736                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
11737                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
11738                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
11739                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
11740                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
11741                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
11742                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
11743                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
11744                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
11745                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
11746                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
11747                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
11748                 </fields>
11749                 <links>
11750                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
11751                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
11752                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
11753                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11754                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
11755                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11756                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11757                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
11758                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
11759                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
11760                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
11761                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
11762                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
11763                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
11764                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
11765                 </links>
11766         </class>
11767
11768     <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">
11769         <fields oils_persist:primary="id">
11770             <field reporter:label="Title" name="title" reporter:datatype="text"/>
11771             <field reporter:label="Author" name="author" reporter:datatype="text"/>
11772             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
11773             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11774             <field reporter:label="Price" name="price" reporter:datatype="money"/>
11775             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11776             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
11777             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
11778             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
11779             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
11780             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
11781             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
11782             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
11783             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
11784             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
11785             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
11786             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
11787             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
11788             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
11789             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
11790             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
11791             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
11792             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11793             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
11794             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
11795             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
11796             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
11797             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
11798             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
11799             <field reporter:label="Status" name="status" reporter:datatype="link"/>
11800             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
11801             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
11802             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
11803             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
11804         </fields>
11805         <links>
11806             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11807             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11808             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11809             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11810             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
11811             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
11812             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
11813             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
11814         </links>
11815     </class>
11816
11817     <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">
11818         <fields oils_persist:primary="id">
11819             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11820             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11821             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11822             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11823         </fields>
11824         <links>
11825             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11826             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11827         </links>
11828     </class>
11829
11830     <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">
11831         <fields oils_persist:primary="owning_lib">
11832             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11833             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11834             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11835         </fields>
11836         <links>
11837             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11838         </links>
11839     </class>
11840
11841     <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">
11842         <fields oils_persist:primary="id">
11843             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11844             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11845             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11846             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11847             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11848         </fields>
11849         <links>
11850             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11851             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11852             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11853         </links>
11854     </class>
11855
11856     <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">
11857         <fields oils_persist:primary="circ_lib">
11858             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11859             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11860             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11861             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11862         </fields>
11863         <links>
11864             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11865             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11866         </links>
11867     </class>
11868
11869     <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">
11870         <fields oils_persist:primary="id">
11871             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11872             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11873             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11874             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11875             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11876         </fields>
11877         <links>
11878             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11879             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11880             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11881         </links>
11882     </class>
11883
11884     <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">
11885         <fields oils_persist:primary="home_ou">
11886             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11887             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11888             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11889             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11890         </fields>
11891         <links>
11892             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11893             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11894         </links>
11895     </class>
11896         <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">
11897                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
11898                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
11899                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
11900                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
11901                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
11902                 </fields>
11903                 <links>
11904                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11905                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
11906                 </links>
11907                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11908                         <actions>
11909                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11910                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
11911                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11912                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11913                         </actions>
11914                 </permacrud>
11915         </class>
11916         <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">
11917                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
11918                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
11919                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
11920                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
11921                 </fields>
11922                 <links>
11923                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11924                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
11925                         </links>
11926                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11927                 <actions>
11928                                 <create permission="ADMIN_ACQ_FUND_TAG">
11929                                         <context link="tag" field="owner"/>
11930                                 </create>
11931                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
11932                                         <context link="tag" field="owner"/>
11933                                 </retrieve>
11934                                 <update permission="ADMIN_ACQ_FUND_TAG">
11935                                         <context link="tag" field="owner"/>
11936                                 </update>
11937                                 <delete permission="ADMIN_ACQ_FUND_TAG">
11938                                         <context link="tag" field="owner"/>
11939                                 </delete>
11940                         </actions>
11941                 </permacrud>
11942         </class>
11943         <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">
11944                 <oils_persist:source_definition><![CDATA[
11945                 SELECT
11946                         poi.purchase_order AS purchase_order,
11947                         ii.invoice AS invoice,
11948                         NULL AS lineitem,
11949                         poi.id AS po_item,
11950                         NULL AS picklist
11951                 FROM
11952                         acq.po_item poi
11953                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11954                 UNION SELECT
11955                         jub.purchase_order AS purchase_order,
11956                         ie.invoice AS invoice,
11957                         jub.id AS lineitem,
11958                         NULL AS po_item,
11959                         jub.picklist AS picklist
11960                 FROM
11961                         acq.lineitem jub
11962                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11963                 UNION SELECT
11964                         ii.purchase_order AS purchase_order,
11965                         ii.invoice AS invoice,
11966                         NULL AS lineitem,
11967                         NULL AS po_item,
11968                         NULL AS picklist
11969                 FROM
11970                         acq.invoice_item ii
11971                 WHERE ii.po_item IS NULL
11972                 UNION SELECT
11973                         ie.purchase_order AS purchase_order,
11974                         ie.invoice AS invoice,
11975                         NULL AS lineitem,
11976                         NULL AS po_item,
11977                         NULL AS picklist
11978                 FROM
11979                         acq.invoice_entry ie
11980                 WHERE ie.lineitem IS NULL
11981                 UNION SELECT
11982                         NULL AS purchase_order,
11983                         NULL AS invoice,
11984                         jub.id AS lineitem,
11985                         NULL AS po_item,
11986                         jub.picklist AS picklist
11987                 FROM
11988                         acq.lineitem jub
11989                 WHERE jub.purchase_order IS NULL
11990                 ]]></oils_persist:source_definition>
11991                 <fields>
11992                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11993                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11994                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11995                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11996                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11997                 </fields>
11998                 <links>
11999                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
12000                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
12001                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
12002                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
12003                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
12004                 </links>
12005         </class>
12006         <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">
12007                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
12008                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12009                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
12010                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
12011                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
12012                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
12013                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12014                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
12015                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
12016                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
12017                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
12018                 </fields>
12019                 <links>
12020                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
12021                 </links>
12022                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12023                         <actions>
12024                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12025                                 <retrieve/>
12026                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12027                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12028                         </actions>
12029                 </permacrud>
12030         </class>
12031
12032         <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">
12033                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
12034                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12035                         <field name="date_applied" reporter:datatype="timestamp"/>
12036                         <field name="org" reporter:datatype="org_unit"/>
12037                         <field name="original_value" reporter:datatype="text"/>
12038                         <field name="new_value" reporter:datatype="text"/>
12039                         <field name="field_name" reporter:datatype="link"/>
12040                 </fields>
12041                 <links>
12042                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
12043                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
12044                 </links>
12045                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12046                         <actions>
12047                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
12048                                 <retrieve permission="STAFF_LOGIN" context_field="org"/>
12049                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
12050                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
12051                         </actions>
12052                 </permacrud>
12053         </class>
12054         <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">
12055                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
12056                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12057                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
12058                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
12059                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12060                 </fields>
12061                 <links>
12062                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
12063                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
12064                 </links>
12065         </class>
12066         <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">
12067                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
12068                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12069                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
12070                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
12071                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12072                 </fields>
12073                 <links>
12074                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
12075                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
12076                 </links>
12077         </class>
12078         <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">
12079                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
12080                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
12081                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12082                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
12083                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
12084                 </fields>
12085                 <links>
12086                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
12087                 </links>
12088                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12089                         <actions>
12090                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12091                                 <retrieve/>
12092                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12093                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12094                         </actions>
12095                 </permacrud>
12096         </class>
12097         <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">
12098                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
12099                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12100                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
12101                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
12102                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
12103                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
12104                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
12105                 </fields>
12106                 <links>
12107                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
12108                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
12109                 </links>
12110                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12111                         <actions>
12112                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12113                                 <retrieve/>
12114                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12115                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12116                         </actions>
12117                 </permacrud>
12118         </class>
12119         <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">
12120                 <fields oils_persist:primary="code">
12121                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
12122                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12123                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
12124                 </fields>
12125                 <links>
12126                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12127                 </links>
12128                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12129                         <actions>
12130                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12131                                 <retrieve/>
12132                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12133                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12134                         </actions>
12135                 </permacrud>
12136         </class>
12137         <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">
12138                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
12139                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12140                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
12141                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12142                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12143                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
12144                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
12145                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
12146                 </fields>
12147                 <links>
12148                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
12149                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12150                 </links>
12151                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12152                         <actions>
12153                                 <create permission="ADMIN_COPY_TAGS" context_field="owner"/>
12154                                 <retrieve/>
12155                                 <update permission="ADMIN_COPY_TAGS" context_field="owner"/>
12156                                 <delete permission="ADMIN_COPY_TAGS" context_field="owner"/>
12157                         </actions>
12158                 </permacrud>
12159         </class>
12160         <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">
12161                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
12162                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12163                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
12164                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
12165                 </fields>
12166                 <links>
12167                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
12168                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
12169                 </links>
12170                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12171                         <actions>
12172                                 <create permission="UPDATE_COPY">
12173                     <context link="copy" field="circ_lib"/>
12174                 </create>
12175                                 <retrieve/>
12176                                 <update permission="UPDATE_COPY">
12177                     <context link="copy" field="circ_lib"/>
12178                 </update>
12179                                 <delete permission="UPDATE_COPY">
12180                     <context link="copy" field="circ_lib"/>
12181                 </delete>
12182                         </actions>
12183                 </permacrud>
12184         </class>
12185         <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">
12186         <oils_persist:source_definition>
12187         SELECT ahcm.target_copy AS id,count(*) AS count
12188          FROM
12189          action.hold_request ahr,
12190          action.hold_copy_map ahcm
12191          WHERE
12192          ahr.cancel_time IS NULL AND
12193          ahr.fulfillment_time IS NULL AND
12194          ahr.capture_time IS NULL AND
12195          ahr.id = ahcm.hold
12196          GROUP BY ahcm.target_copy
12197         </oils_persist:source_definition>
12198         <fields oils_persist:primary="id">
12199             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
12200             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
12201         </fields>
12202         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12203             <actions>
12204                <retrieve/>
12205             </actions>
12206         </permacrud>
12207         </class>
12208
12209         <!-- ********************************************************************************************************************* -->
12210
12211 </IDL>
12212
12213 <!--
12214     vim:noet:ts=4:sw=4:
12215 -->