[open-ils-commits] r831 - in ESI-Examples/trunk: . notices (dmcmorris)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 15 13:03:25 EDT 2010
Author: dmcmorris
Date: 2010-03-15 13:03:22 -0400 (Mon, 15 Mar 2010)
New Revision: 831
Added:
ESI-Examples/trunk/notices/
ESI-Examples/trunk/notices/blank-letterhead.jpg
ESI-Examples/trunk/notices/multi-site-notice.xsl
ESI-Examples/trunk/notices/overdue-sample.xml
ESI-Examples/trunk/notices/overdue_combined_xml
ESI-Examples/trunk/notices/overdue_notices.sh
ESI-Examples/trunk/notices/print_overdue.sh
Log:
Adding sample notices package provided by Ben Ostrowsky, Equinox Software Inc.
Added: ESI-Examples/trunk/notices/blank-letterhead.jpg
===================================================================
(Binary files differ)
Property changes on: ESI-Examples/trunk/notices/blank-letterhead.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ESI-Examples/trunk/notices/multi-site-notice.xsl
===================================================================
--- ESI-Examples/trunk/notices/multi-site-notice.xsl (rev 0)
+++ ESI-Examples/trunk/notices/multi-site-notice.xsl 2010-03-15 17:03:22 UTC (rev 831)
@@ -0,0 +1,259 @@
+<xsl:stylesheet version = '1.0'
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml"/>
+
+ <xsl:param name="gendate">
+ </xsl:param>
+ <xsl:param name="lid"/>
+ <xsl:variable name="empty_string"/>
+
+ <xsl:template match="file">
+ <xsl:variable name="locname" select="$lid" />
+ <fo:root>
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="late-notice">
+ <fo:region-body margin="25mm"/>
+ <fo:region-after region-name="footer-main" extent="0.5in"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <xsl:apply-templates/>
+ </fo:root>
+ </xsl:template>
+
+ <xsl:template match="notice">
+ <xsl:if test="location/name[contains(text(), $lid)]">
+ <xsl:call-template name="notice_template"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="notice_template">
+ <xsl:variable name="name1" select="patron/first_given_name" />
+ <xsl:variable name="name2" select="patron/family_name" />
+ <xsl:variable name="wholename" select="concat($name1,' ',$name2)"/>
+ <xsl:variable name="citystatezip" select="concat(patron/addr_city, ' ', patron/addr_state, ' ', patron/addr_post_code)"/>
+ <!-- find longest part of address -->
+ <xsl:variable name="name-length" select="string-length($wholename)" />
+ <xsl:variable name="s1-length" select="string-length(patron/addr_street1)"/>
+ <xsl:variable name="s2-length" select="string-length(patron/addr_street2)"/>
+ <xsl:variable name="csz-length" select="string-length($citystatezip)"/>
+ <xsl:variable name="l1">
+ <xsl:choose>
+ <xsl:when test="$name-length > $s1-length">
+ <xsl:value-of select="$name-length"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$s1-length"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="l2">
+ <xsl:choose>
+ <xsl:when test="$s2-length > $l1">
+ <xsl:value-of select="$s2-length"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$l1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="longest">
+ <xsl:choose>
+ <xsl:when test="$csz-length > $l2">
+ <xsl:value-of select="$csz-length"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$l2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="addr-rmargin" select="163 - ($longest * 4) - 1" />
+
+ <!-- Logo information (for letterhead) -->
+ <xsl:variable name="logo-height">30.0</xsl:variable> <!-- in millimeters (max 30.0) -->
+ <!-- <xsl:variable name="logo-url">/openils/var/data/templates/letterhead.jpg</xsl:variable> -->
+ <xsl:variable name="logo-url">/home/opensrf/scripts/overdue/generic/blank-letterhead.jpg</xsl:variable>
+
+ <fo:page-sequence master-reference="late-notice">
+
+ <!-- Footer (if desired) -->
+ <fo:static-content flow-name="footer-main">
+ <fo:block xsl:use-attribute-sets="footer">
+ Page <fo:page-number/>
+ </fo:block>
+ </fo:static-content>
+
+ <fo:flow flow-name="xsl-region-body" font="12pt Helvetica">
+
+ <fo:block text-align="center">
+ <xsl:element name="fo:external-graphic">
+ <xsl:attribute name="src">url('<xsl:value-of select="$logo-url"/>')</xsl:attribute>
+ <xsl:attribute name="content-height"><xsl:value-of select="$logo-height"/>mm</xsl:attribute>
+ </xsl:element>
+ </fo:block>
+
+ <!-- ##### ADDRESS BLOCK ########################################## -->
+ <xsl:element name="fo:block">
+ <xsl:attribute name="margin-left">4mm</xsl:attribute>
+ <xsl:attribute name="margin-top"><xsl:value-of select="36 - $logo-height"/>mm</xsl:attribute>
+ <xsl:attribute name="margin-bottom"><xsl:choose><xsl:when test="not(patron/addr_street2='')">15mm</xsl:when><xsl:otherwise>20mm</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="margin-right"><xsl:value-of select="$addr-rmargin"/>mm</xsl:attribute>
+ <xsl:attribute name="padding">2mm</xsl:attribute>
+ <xsl:attribute name="text-transform">uppercase</xsl:attribute>
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="background">#cccccc</xsl:attribute>
+ <fo:block><xsl:value-of select="$wholename"/></fo:block>
+ <fo:block><xsl:value-of select="patron/addr_street1"/></fo:block>
+ <xsl:if test="not(patron/addr_street2='')">
+ <fo:block><xsl:value-of select="patron/addr_street2"/></fo:block>
+ </xsl:if>
+ <fo:block><xsl:value-of select="$citystatezip"/></fo:block>
+ </xsl:element>
+
+ <!-- ##### SALUTATION ############################################### -->
+ <fo:block text-align="right">
+ <xsl:value-of select="$gendate"/>
+ </fo:block>
+ <fo:block margin-top="5mm">
+ Dear <xsl:value-of select="$wholename"/>:
+ </fo:block>
+ <fo:block margin-top="5mm">
+ Our records indicate you have overdue library
+ <xsl:choose>
+ <xsl:when test="count(item)>'1'">
+ materials. The items are
+ </xsl:when>
+ <xsl:otherwise>
+ material. The item is
+ </xsl:otherwise>
+ </xsl:choose>
+ listed below.
+ </fo:block>
+
+ <!-- ##### ITEMS TABLE ############################################ -->
+ <xsl:for-each select="item">
+ <?dbfo-need height="2in" ?>
+ <fo:table margin-top="5mm" margin-left="2mm" table-layout="fixed"
+ width="100%">
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell text-transform="capitalize" font-style="italic"
+ border-left="1pt solid black">
+ <fo:block><xsl:value-of select="title" /></fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ <fo:table margin-bottom="5mm" margin-left="2mm" table-layout="fixed"
+ width="100%" font-size="8pt">
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell border-left="1pt solid black">
+ <fo:block>Due Date</fo:block>
+ </fo:table-cell>
+ <fo:table-cell font-family="Courier">
+ <fo:block>
+ <xsl:value-of select="due_date" />
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border-left="1pt solid black">
+ <fo:block>Call#</fo:block>
+ </fo:table-cell>
+ <fo:table-cell font-family="Courier">
+ <fo:block>
+ <xsl:value-of select="call_number" />
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border-left="1pt solid black">
+ <fo:block>Barcode</fo:block>
+ </fo:table-cell>
+ <fo:table-cell font-family="Courier">
+ <fo:block>
+ <xsl:value-of select="barcode" />
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <xsl:choose>
+ <xsl:when test="price != $empty_string">
+ <fo:table-row>
+ <fo:table-cell border-left="1pt solid black">
+ <fo:block>Price</fo:block>
+ </fo:table-cell>
+ <fo:table-cell font-family="Courier">
+ <fo:block>
+ <xsl:value-of select="format-number(price, '#.00')" />
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </xsl:when>
+ </xsl:choose>
+ </fo:table-body>
+ </fo:table>
+ </xsl:for-each>
+
+ <!-- ##### VARIABLE LATENESS MESSAGE ######################### -->
+ <fo:block>
+ If you would like to renew
+ <xsl:choose>
+ <xsl:when test="count(item)>'1'">
+ them,
+ </xsl:when>
+ <xsl:otherwise>
+ it,
+ </xsl:otherwise>
+ </xsl:choose>
+ please email or call us.
+ </fo:block>
+ <fo:block margin-top="5mm">
+ Thank you,
+ </fo:block>
+ <fo:block margin-top="5mm">
+ The Library Staff
+ </fo:block>
+
+ <!-- ##### STANDARD FOOTER ##################################### -->
+ <fo:block margin-top="3mm" margin-left="3mm">
+ <xsl:value-of select="location/name"/>
+ </fo:block>
+ <fo:table font-size="10pt" width="100%" table-layout="fixed">
+ <fo:table-column column-width="20mm" />
+ <fo:table-column column-width="200mm" />
+ <fo:table-body>
+ <fo:table-row margin-left="3mm">
+ <fo:table-cell><fo:block>Address</fo:block></fo:table-cell>
+ <fo:table-cell>
+ <fo:block>
+ <xsl:value-of select="location/addr_street1"/>
+ </fo:block>
+ <xsl:if test="not(location/addr_street2='')">
+ <fo:block><xsl:value-of select="location/addr_street2"/></fo:block>
+ </xsl:if>
+ <fo:block>
+ <xsl:value-of select="location/addr_city"/>,
+ <xsl:value-of select="location/addr_state"/>
+ <xsl:value-of select="concat(' ', location/addr_post_code)"/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row margin-left="3mm">
+ <fo:table-cell><fo:block>Phone</fo:block></fo:table-cell>
+ <fo:table-cell font-family="Courier">
+ <fo:block><xsl:value-of select="location/phone"/></fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row margin-left="3mm">
+ <fo:table-cell><fo:block>Email</fo:block></fo:table-cell>
+ <fo:table-cell font-family="Courier">
+ <fo:block><<xsl:value-of select="location/email"/>></fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+ </xsl:template>
+</xsl:stylesheet>
Added: ESI-Examples/trunk/notices/overdue-sample.xml
===================================================================
--- ESI-Examples/trunk/notices/overdue-sample.xml (rev 0)
+++ ESI-Examples/trunk/notices/overdue-sample.xml 2010-03-15 17:03:22 UTC (rev 831)
@@ -0,0 +1,433 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<file type="notice" date="2010-03-08" time="15:31:03">
+ <notice type='overdue' notify_interval='7 days'>
+ <patron>
+ <barcode>200000000009827</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>15376</sys_id>
+ </patron>
+ <location>
+ <name>Euphoria Public Library</name>
+ <shortname>EUPH</shortname>
+ <phone>770-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+euphoria at privacy.net</email>
+ <sys_id>5</sys_id>
+ </location>
+ <item>
+ <title>Wide Sargasso Sea </title>
+ <author>Rhys, Jean</author>
+ <due_date>2010-04-12</due_date>
+ <call_number>FIC RHY</call_number>
+ <barcode>33400000041247</barcode>
+ <circ_id>588</circ_id>
+ <price>11.00</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='7 days'>
+ <patron>
+ <barcode>200000000009915</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>15461</sys_id>
+ </patron>
+ <location>
+ <name>Euphoria Public Library</name>
+ <shortname>EUPH</shortname>
+ <phone>770-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+euphoria at privacy.net</email>
+ <sys_id>5</sys_id>
+ </location>
+ <item>
+ <title>The demonata, book 8 Wolf Island</title>
+ <author>Shan, Darren</author>
+ <due_date>2010-04-12</due_date>
+ <call_number>YA FIC SHA</call_number>
+ <barcode>33400000047306</barcode>
+ <circ_id>491</circ_id>
+ <price>16.99</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='7 days'>
+ <patron>
+ <barcode>200000000009932</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>15478</sys_id>
+ </patron>
+ <location>
+ <name>Euphoria Public Library</name>
+ <shortname>EUPH</shortname>
+ <phone>770-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+euphoria at privacy.net</email>
+ <sys_id>5</sys_id>
+ </location>
+ <item>
+ <title>The forgotten garden</title>
+ <author>Morton, Kate</author>
+ <due_date>2010-04-12</due_date>
+ <call_number>FIC MOR</call_number>
+ <barcode>33400000066330</barcode>
+ <circ_id>573</circ_id>
+ <price>26.00</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='7 days'>
+ <patron>
+ <barcode>23120000068496</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>18496</sys_id>
+ </patron>
+ <location>
+ <name>Euphoria Public Library</name>
+ <shortname>EUPH</shortname>
+ <phone>770-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+euphoria at privacy.net</email>
+ <sys_id>5</sys_id>
+ </location>
+ <item>
+ <title>Mythago wood</title>
+ <author>Holdstock, Robert</author>
+ <due_date>2010-04-12</due_date>
+ <call_number>FIC HOL</call_number>
+ <barcode>33400010098987</barcode>
+ <circ_id>585</circ_id>
+ <price>14.95</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='28 days'>
+ <patron>
+ <barcode>23120000014265</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>18358</sys_id>
+ </patron>
+ <location>
+ <name>Hedonia Public Library</name>
+ <shortname>HEDO</shortname>
+ <phone>404-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+hedonia at privacy.net</email>
+ <sys_id>3</sys_id>
+ </location>
+ <item>
+ <title>Pursuit of honor : a novel</title>
+ <author>Flynn, Vince.</author>
+ <due_date>2010-03-21</due_date>
+ <call_number>FIC Fly</call_number>
+ <barcode>3312000026675F</barcode>
+ <circ_id>549</circ_id>
+ <price>27.99</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='28 days'>
+ <patron>
+ <barcode>23120000009190</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>19142</sys_id>
+ </patron>
+ <location>
+ <name>Hedonia Public Library</name>
+ <shortname>HEDO</shortname>
+ <phone>404-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+hedonia at privacy.net</email>
+ <sys_id>3</sys_id>
+ </location>
+ <item>
+ <title>Night and Day -32</title>
+ <author></author>
+ <due_date>2010-03-22</due_date>
+ <call_number>WAC</call_number>
+ <barcode>3312000028570B</barcode>
+ <circ_id>473</circ_id>
+ <price></price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='28 days'>
+ <patron>
+ <barcode>23120000000397</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>19336</sys_id>
+ </patron>
+ <location>
+ <name>Hedonia Public Library</name>
+ <shortname>HEDO</shortname>
+ <phone>404-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+hedonia at privacy.net</email>
+ <sys_id>3</sys_id>
+ </location>
+ <item>
+ <title>The Paris Vendetta</title>
+ <author>Berry, Steve</author>
+ <due_date>2010-03-21</due_date>
+ <call_number>UNCATALOGED</call_number>
+ <barcode>3BFPL00026761B</barcode>
+ <circ_id>471</circ_id>
+ <price></price>
+ </item>
+ <item>
+ <title>There Goes the Bride</title>
+ <author>MC Beaton</author>
+ <due_date>2010-03-21</due_date>
+ <call_number>UNCATALOGED</call_number>
+ <barcode>33120000310281</barcode>
+ <circ_id>468</circ_id>
+ <price></price>
+ </item>
+ <item>
+ <title>The Scarpetta factor</title>
+ <author>Cornwell, Patricia Daniels.</author>
+ <due_date>2010-03-21</due_date>
+ <call_number>FIC Cor</call_number>
+ <barcode>3312000026695H</barcode>
+ <circ_id>470</circ_id>
+ <price>27.95</price>
+ </item>
+ <item>
+ <title>The Swan Thieves</title>
+ <author>Kostova, Elizabeth</author>
+ <due_date>2010-03-21</due_date>
+ <call_number>UNCATALOGED</call_number>
+ <barcode>33120000310307</barcode>
+ <circ_id>469</circ_id>
+ <price></price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='42 days'>
+ <patron>
+ <barcode>23120000003102</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>19574</sys_id>
+ </patron>
+ <location>
+ <name>Hedonia Public Library</name>
+ <shortname>HEDO</shortname>
+ <phone>404-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+hedonia at privacy.net</email>
+ <sys_id>3</sys_id>
+ </location>
+ <item>
+ <title>Beardsley Zoo </title>
+ <author></author>
+ <due_date>2010-03-08</due_date>
+ <call_number>PAS Bea</call_number>
+ <barcode>33120000224041</barcode>
+ <circ_id>423</circ_id>
+ <price>150.00</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='42 days'>
+ <patron>
+ <barcode>23120000022607</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>20609</sys_id>
+ </patron>
+ <location>
+ <name>Hedonia Public Library</name>
+ <shortname>HEDO</shortname>
+ <phone>404-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+hedonia at privacy.net</email>
+ <sys_id>3</sys_id>
+ </location>
+ <item>
+ <title>(500) days of Summer</title>
+ <author>Tuchinsky, Jessica.</author>
+ <due_date>2010-03-08</due_date>
+ <call_number>DVD 500</call_number>
+ <barcode>33120000304242</barcode>
+ <circ_id>359</circ_id>
+ <price>19.95</price>
+ </item>
+ <item>
+ <title>District 9</title>
+ <author>Jackson, Peter</author>
+ <due_date>2010-03-08</due_date>
+ <call_number>DVD DIS</call_number>
+ <barcode>33120000304501</barcode>
+ <circ_id>358</circ_id>
+ <price>19.95</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='42 days'>
+ <patron>
+ <barcode>23120000002039</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>20742</sys_id>
+ </patron>
+ <location>
+ <name>Hedonia Public Library</name>
+ <shortname>HEDO</shortname>
+ <phone>404-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+hedonia at privacy.net</email>
+ <sys_id>3</sys_id>
+ </location>
+ <item>
+ <title>My sister's keeper</title>
+ <author>Johnson, Mark.</author>
+ <due_date>2010-03-08</due_date>
+ <call_number>DVD MY</call_number>
+ <barcode>33120000303375</barcode>
+ <circ_id>339</circ_id>
+ <price>19.95</price>
+ </item>
+ </notice>
+ <notice type='overdue' notify_interval='42 days'>
+ <patron>
+ <barcode>23120000009935</barcode>
+ <first_given_name>Firstname</first_given_name>
+ <family_name>Lastname</family_name>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email></email>
+ <sys_id>20764</sys_id>
+ </patron>
+ <location>
+ <name>Hedonia Public Library</name>
+ <shortname>HEDO</shortname>
+ <phone>404-555-1212</phone>
+ <addr_street1>123 Evergreen Road</addr_street1>
+ <addr_street2></addr_street2>
+ <addr_city>Norcross</addr_city>
+ <addr_state>GA</addr_state>
+ <addr_post_code>12345</addr_post_code>
+ <email>me+hedonia at privacy.net</email>
+ <sys_id>3</sys_id>
+ </location>
+ <item>
+ <title>Four Christmases</title>
+ <author>Favreau, Jon.</author>
+ <due_date>2010-03-08</due_date>
+ <call_number>DVD FOU</call_number>
+ <barcode>33120000303195</barcode>
+ <circ_id>455</circ_id>
+ <price>19.95</price>
+ </item>
+ <item>
+ <title>G-Force</title>
+ <author>Bruckheimer, Jerry.</author>
+ <due_date>2010-03-08</due_date>
+ <call_number>DVD GFO</call_number>
+ <barcode>33120000304130</barcode>
+ <circ_id>454</circ_id>
+ <price>19.95</price>
+ </item>
+ </notice>
+</file>
Added: ESI-Examples/trunk/notices/overdue_combined_xml
===================================================================
--- ESI-Examples/trunk/notices/overdue_combined_xml (rev 0)
+++ ESI-Examples/trunk/notices/overdue_combined_xml 2010-03-15 17:03:22 UTC (rev 831)
@@ -0,0 +1,56 @@
+[% USE date -%]
+<?xml version='1.0' encoding='UTF-8'?>
+<file type="notice" date="[% date.format(date.now,'%Y-%m-%d') %]" time="[% date.format(date.now, '%H:%M:%S') %]">
+ [%- FOREACH circ_set = overdues %]
+ [%- SET user = circ_set.circ_list.0.usr -%]
+ [%- SET lib = circ_set.circ_list.0.circ_lib -%]
+ [%- SET user_addr = user.mailing_address -%]
+ [%- IF !user_addr or user_addr.valid == 'f' -%]
+ [%- SET user_addr = user.billing_address -%]
+ [%- END %]
+ [%- SET lib_addr = lib.mailing_address -%]
+ [%- IF !lib_addr -%]
+ [%- SET lib_addr = lib.billing_address -%]
+ [%- END -%]
+ [%- IF !user_addr or user_addr.valid == 'f'; NEXT; END; %]
+ <notice type='overdue' notify_interval='[% circ_set.notice.notify_interval %]'>
+ <patron>
+ <barcode>[% user.card.barcode %]</barcode>
+ <profile>[% user.profile.name %]</profile>
+ <first_given_name>[% escape_xml(user.first_given_name) %]</first_given_name>
+ <family_name>[% escape_xml(user.family_name) %]</family_name>
+ <addr_street1>[% escape_xml(user_addr.street1) %]</addr_street1>
+ <addr_street2>[% escape_xml(user_addr.street2) %]</addr_street2>
+ <addr_city>[% escape_xml(user_addr.city) %]</addr_city>
+ <addr_state>[% user_addr.state %]</addr_state>
+ <addr_post_code>[% user_addr.post_code %]</addr_post_code>
+ <email>[% user.email %]</email>
+ <sys_id>[% user.id %]</sys_id>
+ </patron>
+ <location>
+ <name>[% escape_xml(lib.name) %]</name>
+ <shortname>[% escape_xml(lib.shortname) %]</shortname>
+ <phone>[% lib.phone %]</phone>
+ <addr_street1>[% escape_xml(lib_addr.street1) %]</addr_street1>
+ <addr_street2>[% escape_xml(lib_addr.street2) %]</addr_street2>
+ <addr_city>[% escape_xml(lib_addr.city) %]</addr_city>
+ <addr_state>[% lib_addr.state %]</addr_state>
+ <addr_post_code>[% lib_addr.post_code %]</addr_post_code>
+ <email>[% lib.email %]</email>
+ <sys_id>[% lib.id %]</sys_id>
+ </location>
+ [%- FOREACH circ = circ_set.circ_list %]
+ [%- SET due_date = parse_due_date(circ) %]
+ <item>
+ <title>[% escape_xml(get_bib_attr(circ, 'title')) %]</title>
+ <author>[% escape_xml(get_bib_attr(circ, 'author')) %]</author>
+ <due_date>[% date.format(due_date, '%Y-%m-%d') %]</due_date>
+ <call_number>[% escape_xml(circ.target_copy.call_number.label) %]</call_number>
+ <barcode>[% escape_xml(circ.target_copy.barcode) %]</barcode>
+ <circ_id>[% circ.id %]</circ_id>
+ <price>[% circ.target_copy.price %]</price>
+ </item>
+ [%- END -%]
+ </notice>
+ [%- END %]
+</file>
Added: ESI-Examples/trunk/notices/overdue_notices.sh
===================================================================
--- ESI-Examples/trunk/notices/overdue_notices.sh (rev 0)
+++ ESI-Examples/trunk/notices/overdue_notices.sh 2010-03-15 17:03:22 UTC (rev 831)
@@ -0,0 +1,37 @@
+#!/bin/bash
+DATE=$(date +%Y-%m-%d);
+GENDATE=`date +'%d %b %Y'`
+DAY=$(date +%u);
+#XML_FILE="/openils/var/data/overdue/overdue.$DATE.xml";
+XML_FILE="/tmp/overdue.$DATE.xml";
+#EMAIL_FILE="/openils/var/data/overdue/combined_email.$DATE.txt";
+EMAIL_FILE="/tmp/combined_email.$DATE.txt";
+
+[ $(whoami) != "opensrf" ] && echo "Must be run as opensrf" && exit 1;
+
+source /etc/profile;
+cd /openils/bin/
+
+# ALL, NO EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue,predue --use-email-outfile $EMAIL_FILE --generate-global-templates --days-back $ARGS > $XML_FILE;
+
+# ALL + EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue,predue --use-email-outfile $EMAIL_FILE --generate-global-templates --send-email > $XML_FILE;
+
+
+# --- overdues first, then predues
+
+# PREDUES + EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types predue --use-email-outfile $EMAIL_FILE --send-email --days-back $ARGS;
+
+# -------------------------------------
+
+# OVERDUES, NO EMAIL
+./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue --use-email-outfile $EMAIL_FILE --generate-global-templates > $XML_FILE;
+
+# OVERDUES + EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue --use-email-outfile $EMAIL_FILE --generate-global-templates --send-email > $XML_FILE;
+
+#cd /home/opensrf/scripts/overdue
+cd /home/opensrf/scripts/overdue/generic
+./print_overdue.sh
Property changes on: ESI-Examples/trunk/notices/overdue_notices.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: ESI-Examples/trunk/notices/print_overdue.sh
===================================================================
--- ESI-Examples/trunk/notices/print_overdue.sh (rev 0)
+++ ESI-Examples/trunk/notices/print_overdue.sh 2010-03-15 17:03:22 UTC (rev 831)
@@ -0,0 +1,59 @@
+#!/bin/bash
+DATE=$(date +%Y-%m-%d);
+GENDATE=`date +'%d %b %Y'`
+DAY=$(date +%u);
+#XML_FILE="/openils/var/data/overdue/overdue.$DATE.xml";
+XML_FILE="/home/opensrf/scripts/overdue/generic/overdue-sample.xml";
+#FO_XSL="/home/opensrf/scripts/overdue/multi-site-notice.xsl";
+FO_XSL="/home/opensrf/scripts/overdue/generic/multi-site-notice.xsl";
+EMAIL_FILE="/openils/var/data/overdue/combined_email.$DATE.txt";
+#FOP_OPTS="-Djava.awt.headless=true"
+
+[ $(whoami) != "opensrf" ] && echo "Must be run as opensrf" && exit 1;
+
+source /etc/profile;
+cd /openils/bin/
+
+# ALL, NO EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue,predue --use-email-outfile $EMAIL_FILE --generate-global-templates --days-back $ARGS > $XML_FILE;
+
+# ALL + EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue,predue --use-email-outfile $EMAIL_FILE --generate-global-templates --send-email --days-back $ARGS > $XML_FILE;
+
+
+# --- overdues first, then predues
+
+# PREDUES + EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types predue --use-email-outfile $EMAIL_FILE --send-email --days-back $ARGS;
+
+# -------------------------------------
+
+# OVERDUES, NO EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue --use-email-outfile $EMAIL_FILE --generate-global-templates > $XML_FILE;
+
+# OVERDUES + EMAIL
+#./generate_circ_notices.pl --osrf_config /openils/conf/opensrf_core.xml --notice-types overdue --use-email-outfile $EMAIL_FILE --generate-global-templates --send-email > $XML_FILE;
+
+
+SHORTNAME=EUPH
+SEARCHFOR=Euphoria
+PRINT_FO_FILE="/openils/var/data/overdue/$SHORTNAME-overdue-$DATE.fo";
+PDF_FILE="/openils/var/data/overdue/$SHORTNAME-overdue-$DATE.pdf";
+xsltproc --stringparam gendate "${GENDATE}" --stringparam lid $SEARCHFOR $FO_XSL $XML_FILE > $PRINT_FO_FILE;
+LINES=$( egrep -v "^[[:space:]]*$|^#" "$PRINT_FO_FILE" | wc -l )
+if [ $LINES -gt 3 ] ; then
+ fop $PRINT_FO_FILE $PDF_FILE;
+ cp $PDF_FILE /openils/var/web/notices/$SHORTNAME/
+fi
+
+SHORTNAME=HEDO
+SEARCHFOR=Hedonia
+PRINT_FO_FILE="/openils/var/data/overdue/$SHORTNAME-overdue-$DATE.fo";
+PDF_FILE="/openils/var/data/overdue/$SHORTNAME-overdue-$DATE.pdf";
+xsltproc --stringparam gendate "${GENDATE}" --stringparam lid $SEARCHFOR $FO_XSL $XML_FILE > $PRINT_FO_FILE;
+LINES=$( egrep -v "^[[:space:]]*$|^#" "$PRINT_FO_FILE" | wc -l )
+if [ $LINES -gt 3 ] ; then
+ fop $PRINT_FO_FILE $PDF_FILE;
+ cp $PDF_FILE /openils/var/web/notices/$SHORTNAME/
+fi
+
Property changes on: ESI-Examples/trunk/notices/print_overdue.sh
___________________________________________________________________
Name: svn:executable
+ *
More information about the open-ils-commits
mailing list