[open-ils-commits] r15471 - trunk/Open-ILS/examples (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Feb 8 12:40:54 EST 2010


Author: miker
Date: 2010-02-08 12:40:51 -0500 (Mon, 08 Feb 2010)
New Revision: 15471

Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
Log:
adding IDL view to calculate the date of removal for the last copy on a bib record

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2010-02-05 22:29:26 UTC (rev 15470)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2010-02-08 17:40:51 UTC (rev 15471)
@@ -6245,6 +6245,34 @@
 		</permacrud>
 	</class>
 
+	<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">
+		<oils_persist:source_definition>
+
+            SELECT  b.id,
+                    MAX(dcp.edit_date) AS last_delete_date
+             FROM   biblio.record_entry b
+                    JOIN asset.call_number cn ON (cn.record = b.id)
+                    JOIN asset.copy dcp ON (cn.id = dcp.call_number)
+             WHERE  NOT b.deleted
+             GROUP BY b.id
+             HAVING SUM( CASE WHEN dcp.deleted THEN -1 ELSE 0 END) &lt; 0 
+
+		</oils_persist:source_definition>
+		<fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
+			<field reporter:label="Record ID" name="id" reporter:datatype="id"/>
+			<field reporter:label="Delete Date/Time" name="copy_delete_date" reporter:datatype="timestamp"/>
+		</fields>
+		<links>
+			<link field="id" reltype="has_a" key="id" map="" class="bre"/>
+		</links>
+		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+			<actions>
+				<retrieve/>
+			</actions>
+		</permacrud>
+	</class>
+
+
 	<!-- ********************************************************************************************************************* -->
 	<!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
 	<!-- ********************************************************************************************************************* -->



More information about the open-ils-commits mailing list