<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Koha Blog</title>
	<atom:link href="http://www.myacpl.org/koha/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.myacpl.org/koha</link>
	<description></description>
	<lastBuildDate>Wed, 10 Apr 2013 20:04:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>		<item>
		<title>Customizing the display of online resources like eBooks</title>
		<link>http://www.myacpl.org/koha/?p=754</link>
		<comments>http://www.myacpl.org/koha/?p=754#comments</comments>
		<pubDate>Wed, 10 Apr 2013 20:04:52 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha Customizations]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[OPAC]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=754</guid>
		<description><![CDATA[The Athens County Public Libraries are members of the Ohio eBook Project, a consortium of libraries who contribute to and share access to a collection of eBooks and other downloadable material through OverDrive. In order to make these resources more discoverable by our patrons we add MARC records for these titles to Koha. When we [...]]]></description>
				<content:encoded><![CDATA[<p>The Athens County Public Libraries are members of the <a href="http://ohioebooks.com">Ohio eBook Project</a>, a consortium of libraries who contribute to and share access to a collection of eBooks and other downloadable material through OverDrive. In order to make these resources more discoverable by our patrons we add MARC records for these titles to Koha.</p>
<p>When we started doing this we felt that it was important for the patrons to be able to tell very easily that the title they saw in search results was an electronic resource they could download. We already have many records in our catalog for web sites. We were concerned that these two types of resources would be difficult to distinguish.</p>
<div id="attachment_755" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-results-display.png"><img class="size-medium wp-image-755" style="border: 1px solid black;" alt="Electronic resource in search results" src="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-results-display-300x68.png" width="300" height="68" /></a><p class="wp-caption-text">An electronic resource in default OPAC search results</p></div>
<p style="text-align: left;">Since Koha gives us the ability to inject custom JavaScript into our OPAC, a JS-based solution seemed like the best option. The goal was to be able to use JS to examine each search result and look for a clue that any particular result was an Ohio eBook Project record. Luckily all the OEP records have something in common: A URL (stored in the MARC 856u) beginning with &#8220;http://ohdbks.&#8221; Here&#8217;s the JavaScript I came up with:</p>
<p style="text-align: left;">
<pre class="brush: javascript">$(&quot;#userresults&quot;).ready(function(){
$(&quot;#userresults table td&quot;).each(function(i){
td = $(this);
var ohdbks_link = td.find(&quot;a[href^=&#039;http://ohdbks&#039;]&quot;);
var linkc = ohdbks_link.parent();
var ohdbks_link = ohdbks_link.attr(&quot;href&quot;);
if(ohdbks_link){
$(&quot;td:eq(&quot;+i+&quot;) span.availability,td:eq(&quot;+i+&quot;) span.actions&quot;).hide();
linkc.html(&#039;&lt;a class=&quot;ebook&quot; href=&quot;&#039;+ohdbks_link+&#039;&quot;&gt;Check the Ohio e-Book Project for availability&lt;/a&gt;&#039;);
}
});
});</pre>
</p>
<p style="text-align: left;">Stepping through this code:</p>
<ol>
<li>The script is triggered when <strong>#userresults</strong> is ready.</li>
<li>We loop through each td within the table inside <strong>#userresults</strong>, storing the index of each iteration as <strong>i</strong>.</li>
<li>The matched td is stored as a variable for easy reference.</li>
<li>The script finds an anchor tag which matches the string we&#8217;re looking for and stores that in a variable.</li>
<li>We want to refer later to the &lt;a&gt; tag&#8217;s parent container, so we use jQuery&#8217;s parent() to store that as <strong>linkc.</strong></li>
<li>We pull the <strong>href</strong> attribute value for the previously select &lt;a&gt; tag.</li>
<li>If an href was found&#8230;</li>
<li>&#8230;hide the availability and &#8220;actions&#8221; (&#8220;Place hold,&#8221; &#8220;Add to cart&#8221;, etc.) elements which we don&#8217;t consider relevant to e-resource records.</li>
<li>Replace the contents of the original anchor tag&#8217;s container with new html which uses the previously-saved href attribute but changes the text of the link and adds a special CSS class.</li>
</ol>
<p>We chose to label each eBook link &#8220;Check the Ohio e-Book Project for availability&#8221; because Koha has no way of knowing whether a particular title is checked out. The link is styled by CSS added to Koha&#8217;s <strong>OPACUserCSS</strong> system preference:</p>
<pre class="brush: css">a.ebook {
background: url(&quot;http://www.myacpl.org/files/image/opac-results-download-ebook.png&quot;) no-repeat scroll 5px 5px transparent;
border: 1px solid #8BC45C;
border-radius: 5px 5px 5px 5px;
font-size: 135%;
font-weight: bold;
line-height: 175%;
padding: 4px 4px 4px 25px;
text-decoration: none;
}</pre>
<p>The result:</p>
<div id="attachment_764" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-results-customized-display.png"><img class="size-medium wp-image-764" style="border: 1px solid black;" alt="Electronic resource in customized search results" src="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-results-customized-display-300x53.png" width="300" height="53" /></a><p class="wp-caption-text">An electronic resource in customized OPAC search results</p></div>
<h3>Electronic resource detail page</h3>
<p>When the patron clicks to view more information about one of those electronic resource titles they come to a detail page which presents additional opportunities to simplify the display for this type of record.</p>
<p style="text-align: left;">Since this kind of title is available only through the Ohio eBook Project web site we don&#8217;t actually have any local holdings, but when we add MARC records for these resources we include a dummy item to which we can attach some additional information. One reason for this is to be able to have a searchable collection code attached to each record. But showing holdings information to the patron isn&#8217;t very useful because none of it is relevant:</p>
<div id="attachment_765" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-holdings.png"><img class="size-medium wp-image-765 " style="border: 1px solid black;" alt="Holdings information displayed by default for electronic resources" src="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-holdings-300x54.png" width="300" height="54" /></a><p class="wp-caption-text">Holdings information displayed by default for electronic resources</p></div>
<p style="text-align: left;">Another aspect of the detail page which is less than ideal is that the link to the Ohio eBook Project is pretty well hidden in the other details about the title like publisher, subject headings, etc. We again turned to JavaScript to solve both of these problems at once:</p>
<p style="text-align: left;">
<pre class="brush: javascript">$(&quot;span.online_resources&quot;).ready(function(){
var ohdbks_link = $(&quot;span.online_resources a[href^=&#039;http://ohdbks&#039;]&quot;).attr(&quot;href&quot;);
if(ohdbks_link){
$(&quot;#holdings&quot;).html(&#039;&lt;a href=&quot;&#039;+ohdbks_link+&#039;&quot;&gt;&lt;img src=&quot;http://www.myacpl.org/files/image/opac-download-ebook.png&quot; alt=&quot;Check the Ohio e-Book Project for availability&quot; /&gt;&lt;/a&gt;&#039;);
}
});</pre>
</p>
<p style="text-align: left;">This code is very similar to what we used on the search results page, but a little simpler.</p>
<ol>
<li>Again we trigger this function when this particular area of the page (&#8220;span.online_resources&#8221;) has completed loading.</li>
<li>We find the link to the Ohio eBook Project download page and store the <strong>href</strong> attribute.</li>
<li>If an <strong>href</strong> was found&#8230;</li>
<li>Replace the holdings table (identified by the<strong> </strong>ID <strong>#holdings</strong>) with an image which links to the OEP download page.<strong></strong></li>
</ol>
<p>In four lines of JavaScript both goals are accomplished: The meaningless holdings table is gone, and a prominent link is added to the Ohio eBook Project download page for the title the patron is looking at.</p>
<p>Here&#8217;s the result:</p>
<div id="attachment_768" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-customized-holdings.png"><img class="size-medium wp-image-768 " style="border: 1px solid black;" alt="A customized link to the electronic resource download page" src="http://www.myacpl.org/koha/wp-content/uploads/2013/04/electronic-resource-customized-holdings-300x77.png" width="300" height="77" /></a><p class="wp-caption-text">A customized link to the electronic resource download page</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=754</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cart and Lists buttons revisited</title>
		<link>http://www.myacpl.org/koha/?p=736</link>
		<comments>http://www.myacpl.org/koha/?p=736#comments</comments>
		<pubDate>Wed, 28 Mar 2012 16:43:00 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha Customizations]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[OPAC]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=736</guid>
		<description><![CDATA[It&#8217;s been almost three years since I wrote Colorizing the Cart and Lists buttons. My conclusion then was that we needed a fairly complex combination of markup, CSS, and background images to create the appearance of the buttons. This works fairly well in Firefox, Safari, and Chrome. Unfortunately, it fails not only in Internet Explorer [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been almost three years since I wrote <a href="http://www.myacpl.org/koha/?p=217">Colorizing the Cart and Lists buttons</a>. My conclusion then was that we needed a fairly complex combination of markup, CSS, and background images to create the appearance of the buttons.</p>
<blockquote><p>This works fairly well in Firefox, Safari, and Chrome. Unfortunately, it fails not only in Internet Explorer 6, 7, and 8, but all versions of Opera too. For the time being, our more-complex process gives the desired result to a wider audience.</p></blockquote>
<p>The time has come for the simpler version. My patch for Koha bug 7584, &#8220;<span id="summary_alias_container"><span id="short_desc_nonedit_display">Update cart and lists buttons style using CSS3 features&#8221; has just appeared in Koha&#8217;s master branch, the development version which precedes an official release.</span></span></p>
<p><span id="summary_alias_container"><span id="short_desc_nonedit_display">What has changed? Firefox, Safari, and Chrome have had updates since then, which has at the very least expanded the number of users of those browsers who are on a more recent version. Opera, one of the holdbacks in 2009, now supports the features required. Internet Explorer 6, 7, and 8 still linger of course, but Internet Explorer 9 is available now. IE9 offers better support for the features we need.</span></span></p>
<p><span id="summary_alias_container"><span id="short_desc_nonedit_display">For me what has changed is that I now think that Koha should be a little more aggressive about taking advantage of the features of up to date browsers even if that means the experience isn&#8217;t the same for users of older browsers. </span></span></p>
<h3><span id="summary_alias_container"><span id="short_desc_nonedit_display">The new style</span></span></h3>
<p><span id="summary_alias_container"><span id="short_desc_nonedit_display">Let&#8217;s take a look at the revised markup. Where the previous version needed a lot of extra elements (&lt;i&gt;, &lt;span&gt;, etc) the new version doesn&#8217;t:</span></span></p>
<pre class="brush: html">

&lt;a id=&quot;cartmenulink&quot; href=&quot;#&quot;&gt;Cart&lt;/a&gt;

&lt;a id=&quot;listsmenulink&quot; href=&quot;#&quot;&gt;Lists&lt;/a&gt;

</pre>
<p>I&#8217;ll quote the relevant declarations from the CSS. First, both buttons are assigned rounded corners:</p>
<pre class="brush: css">

#cartmenulink, #listsmenulink {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

</pre>
<p>Notice the variations: &#8220;-webkit-border-radius&#8221; is specific to Chrome and Safari. &#8220;-moz-border-radius&#8221; is specific to Mozilla-based browsers like Firefox. When we specify a single value like &#8220;5px&#8221; the value is applied equally to all four corners. You can also specify different values:</p>
<pre class="brush: css">

#cartmenulink, #listsmenulink {
-webkit-border-radius: 4px 15px 4px 15px;
-moz-border-radius: 4px 15px 4px 15px;
border-radius: 4px 15px 4px 15px;
}

</pre>
<p>The values are applied clockwise starting with the upper left-hand corner.</p>
<h3>Background Gradients</h3>
<p>The other primary aspect of the buttons are their background colors. Previously we used a transparent image to give the button background a gradient. With CSS3 we can specify the gradient values right in our CSS. The easiest way to accomplish this is using the <a href="http://www.colorzilla.com/gradient-editor/">Ultimate CSS Gradient Generator</a>.</p>
<div id="attachment_744" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.colorzilla.com/gradient-editor/"><img class="size-medium wp-image-744" title="css-graident-generator" src="http://www.myacpl.org/koha/wp-content/uploads/2012/03/css-graident-generator-300x165.png" alt="" width="300" height="165" /></a><p class="wp-caption-text">A web-based tool for designing CSS gradients</p></div>
<p>With the CSS Gradient Generator you can use the visual tools for creating a gradient and the CSS will be generated for you. It generates CSS declarations specific to several major browser versions including Internet Explorer. There is even an option to upload a gradient image and have the Generator automatically match the colors.</p>
<p>Here&#8217;s the gradient CSS for the Cart button:</p>
<pre class="brush: css">

#cartmenulink {
background: #98CB58; /* Old browsers */
background: url(&quot;../../images/cart.gif&quot;),-moz-linear-gradient(top, #d5eaba 0%, #b7db8a 50%, #98cb59 100%); /* FF3.6+ */
background: url(&quot;../../images/cart.gif&quot;),-webkit-gradient(linear, left top, left bottom, color-stop(0%,#d5eaba), color-stop(50%,#b7db8a), color-stop(100%,#98cb59)); /* Chrome,Safari4+ */
background: url(&quot;../../images/cart.gif&quot;),-webkit-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* Chrome10+,Safari5.1+ */
background: url(&quot;../../images/cart.gif&quot;),-o-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* Opera 11.10+ */
background: url(&quot;../../images/cart.gif&quot;),-ms-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* IE10+ */
background: url(&quot;../../images/cart.gif&quot;),linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=&#039;#d5eaba&#039;, endColorstr=&#039;#98cb59&#039;,GradientType=0 ); /* IE6-9 */

}

</pre>
<p>Eight lines of CSS each doing the same thing for different browsers, starting with a solid background color for browsers which don&#8217;t support CSS3. This is the same kind of code which will be generated by the CSS Gradient Generator with one exception: The OPAC CSS also includes a background image for the Cart button in order to display the little cart icon.</p>
<p>There&#8217;s more to the styling of the buttons than rounded corners and background-gradients, but nothing which we haven&#8217;t seen before. Fire up Firebug (or your favorite browser&#8217;s DOM inspection tool) and inspect the buttons for more information.</p>
<h3>What have we gained?</h3>
<p>Just looking at the HTML markup it would seem we&#8217;ve gained a lot of efficiency over the &lt;span&gt;-heavy buttons in the older version. But the multiple lines of CSS more than make up for it. What advantages does the new design offer? Importantly, flexibility. We don&#8217;t have to create custom-colored 24-bit transparent images when changing the background color of the search bar. We can make all our changes, including changes to the Cart icon, right in the CSS. Border color, border radius, background-color (or gradient), it&#8217;s now 100% CSS and can be affected by a custom stylesheet or by changes to the <code>OPACUserCSS</code> system preference.</p>
<p>This change is going to require some revisions if your library has existing CSS customizations to these areas of the OPAC, but I think going forward these changes are going to prove to be beneficial to those seeking to customize their OPAC&#8217;s appearance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=736</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQueryUI and Koha</title>
		<link>http://www.myacpl.org/koha/?p=701</link>
		<comments>http://www.myacpl.org/koha/?p=701#comments</comments>
		<pubDate>Tue, 08 Nov 2011 20:25:17 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha UI]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=701</guid>
		<description><![CDATA[There&#8217;s another project I&#8217;ve been working on for almost as long as I haven&#8217;t posted to this blog: Incorporating the jQueryUI JavaScript library into Koha. This change would replace the YUI Library which currently powers such interface widgets as buttons, menus, and autocomplete. When I helped develop the new templates for Koha 3.0 I evaluated [...]]]></description>
				<content:encoded><![CDATA[<p>There&#8217;s another project I&#8217;ve been working on for almost as long as I haven&#8217;t posted to this blog: Incorporating the jQueryUI JavaScript library into Koha. This change would replace the YUI Library which currently powers such interface widgets as buttons, menus, and autocomplete.</p>
<p>When I helped develop the new templates for Koha 3.0 I evaluated several different options for creating some application-like interactions in the Koha staff client including <a href="http://developer.yahoo.com/yui/2/">YUI </a>, <a href="http://en.wikipedia.org/wiki/Ext_JS">Ext JS</a>, and similar jQuery <a href="http://p.sohei.org/jquery-plugins/clickmenu/">plugins</a>. The goal was to have options for creating cross-platform, cross-browser interface widgets. After much testing I settled on YUI. Though I found its syntax difficult to work with, the results worked well and seemed robust. The most visible example of YUI is in the staff client interface, where &#8220;toolbars&#8221; appear on most pages for displaying actions:</p>
<p style="text-align: center;"><a href="http://www.myacpl.org/koha/wp-content/uploads/2011/11/yui-toolbar.png"><img class="aligncenter size-medium wp-image-702" style="border: 1px solid black;" title="yui-toolbar" src="http://www.myacpl.org/koha/wp-content/uploads/2011/11/yui-toolbar-300x64.png" alt="" width="300" height="64" /></a></p>
<p> YUI also drives some autocomplete form fields in the staff client and menus in the OPAC.</p>
<p>In addition to YUI, Koha uses the <a href="http://jquery.com/">jQuery</a> JavaScript library and some jQuery plugins like <a href="http://tablesorter.com/docs/">Tablesorter</a> and a pre-jQueryUI version of  <a href="http://jqueryui.com/demos/tabs/">Tabs</a>. Since the release of Koha 3.0 over three years ago a lot has changed with these projects. The YUI library released <a href="http://yuilibrary.com/">version 3</a> with enough syntax changes to make an upgrade mean totally rewriting our existing YUI code. At the same time the <a href="http://jqueryui.com">jQueryUI library</a> made great advances, adding a lot of the same functionality for which we depended on the YUI library.</p>
<p>In November 2010 <a href="http://drupal.biblibre.com/en">BibLibre </a>founder and CEO Paul Poulain proposed <a href="http://lists.koha-community.org/pipermail/koha-devel/2010-November/034555.html">getting rid of YUI</a> in favor of jQueryUI and the response on the Koha developer&#8217;s list was positive. Shortly after I filed a bug, <a href="http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5481">Replace YUI JS libraries with Jquery UI</a> and began working on a branch to do just that.</p>
<p>Since then I&#8217;ve gotten two major components migrated from YUI to jQueryUI: tabs and autocomplete. Here&#8217;s an example of jQueryUI tabs in the OPAC:</p>
<p style="text-align: center;"><a href="http://www.myacpl.org/koha/wp-content/uploads/2011/11/OPAC-tabs-jqueryUI.png"><img class="aligncenter size-medium wp-image-707" style="border: 1px solid black;" title="OPAC-tabs-jqueryUI" src="http://www.myacpl.org/koha/wp-content/uploads/2011/11/OPAC-tabs-jqueryUI-300x106.png" alt="" width="300" height="106" /></a></p>
<p>Here are the search tabs in the staff client:</p>
<p style="text-align: center;"><a href="http://www.myacpl.org/koha/wp-content/uploads/2011/11/circ-search-form.png"><img class="aligncenter size-medium wp-image-708" style="border: 1px solid black;" title="circ-search-form" src="http://www.myacpl.org/koha/wp-content/uploads/2011/11/circ-search-form-300x65.png" alt="" width="300" height="65" /></a></p>
<p>And here&#8217;s autocomplete in action in the staff client:</p>
<p style="text-align: center;"><a href="http://www.myacpl.org/koha/wp-content/uploads/2011/11/circ-autocomplete.png"><img class="aligncenter size-medium wp-image-709" style="border: 1px solid black;" title="circ-autocomplete" src="http://www.myacpl.org/koha/wp-content/uploads/2011/11/circ-autocomplete-300x102.png" alt="" width="300" height="102" /></a></p>
<p>As part of this project I have also replaced the calendar widget we have been using with Koha. Since that widget was added to Koha it <a href="http://www.dynarch.com/projects/calendar/">stopped being open source</a>, so it makes sense to abandon it in favor of functionality built into jQueryUI.</p>
<div id="attachment_711" class="wp-caption aligncenter" style="width: 265px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2011/11/date-picker-jqueryUI1.png"><img class="size-medium wp-image-711" title="date-picker-jqueryUI" src="http://www.myacpl.org/koha/wp-content/uploads/2011/11/date-picker-jqueryUI1-255x300.png" alt="" width="255" height="300" /></a><p class="wp-caption-text">Calendar pop-up on the check-out screen</p></div>
<p>Also on my list of things to implement is a replacement of the modal window system used in some places in Koha, for which we&#8217;re currently using a <a href="http://orangoo.com/labs/GreyBox/">standalone JS plugin</a>. This can be eliminated in favor of the jQueryUI-native Dialog widget.</p>
<p>Unfortunately we are still waiting for one element for which we depend on YUI which jQueryUI lacks: A menu widget. Their menu widget has been in <a href="http://wiki.jqueryui.com/w/page/12137997/Menu">alpha stage</a> for almost as long as I&#8217;ve been working on this jQueryUI branch. Without it we can&#8217;t reproduce the toolbars we build now in YUI. For this reason my work has been stalled for a while. I&#8217;m keeping my branch up to date and in sync with the master branch, and I&#8217;m keeping my eye on the status of the menu widget.</p>
<p>I&#8217;m frustrated with the wait, but I&#8217;m also excited about the improvements we&#8217;ll be able to make to the Koha interface once jQueryUI is our standard go-to library.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=701</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An update on Recent Comments</title>
		<link>http://www.myacpl.org/koha/?p=693</link>
		<comments>http://www.myacpl.org/koha/?p=693#comments</comments>
		<pubDate>Tue, 08 Nov 2011 17:16:54 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha UI]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=693</guid>
		<description><![CDATA[It&#8217;s been far too long since my last post. I&#8217;m happy to say that my Recent Comments feature didn&#8217;t take quite so long to get incorporated into Koha, although it wasn&#8217;t until recently that it was obvious it was there. The page itself made it into Koha in a commit in December 2010, and was [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been far too long since my last post. I&#8217;m happy to say that my <a title="Proposed feature: A recent comments view in the OPAC" href="http://www.myacpl.org/koha/?p=677">Recent Comments feature</a> didn&#8217;t take quite so long to get incorporated into Koha, although it wasn&#8217;t until recently that it was obvious it was there. The page itself made it into Koha in a commit in December 2010, and was in Koha 3.2.3. What it lacked was a link in the interface pointing to the page, so you had to know where it was to get to it. This problem was fixed in a commit in October of this year which adds a new system preference, <strong><code><label for="pref_OpacShowRecentComments"> OpacShowRecentComments</label></code></strong>, which controls whether a link to the recent comments view should appear in the OPAC&#8217;s search bar. The option will be available to users of Koha 3.6.</p>
<p><a href="http://www.myacpl.org/koha/wp-content/uploads/2011/11/opac-show-recent-comments-preference.png"><img class="aligncenter size-medium wp-image-695" title="opac-show-recent-comments-preference" src="http://www.myacpl.org/koha/wp-content/uploads/2011/11/opac-show-recent-comments-preference-300x15.png" alt="" width="300" height="15" /></a></p>
<p>A long an roundabout path, but hopefully a useful feature.<a href="http://www.myacpl.org/koha/wp-content/uploads/2011/11/opac-show-recent-comments-link.png"><img class="aligncenter size-medium wp-image-697" title="opac-show-recent-comments-link" src="http://www.myacpl.org/koha/wp-content/uploads/2011/11/opac-show-recent-comments-link-300x55.png" alt="" width="300" height="55" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=693</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Proposed feature: A recent comments view in the OPAC</title>
		<link>http://www.myacpl.org/koha/?p=677</link>
		<comments>http://www.myacpl.org/koha/?p=677#comments</comments>
		<pubDate>Fri, 01 Oct 2010 16:27:25 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[OPAC]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=677</guid>
		<description><![CDATA[Koha&#8217;s OPAC has a feature which lets logged-in users leave comments about records in your catalog. This feature was originally branded as &#8220;Reviews,&#8221; but was changed to &#8220;Comments&#8221; in order to align it with the familiar feature allowing users to comment on content in blogs, on YouTube, etc. If you haven&#8217;t seen it before, here&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>Koha&#8217;s OPAC has a feature which lets logged-in users leave comments about records in your catalog. This feature was originally branded as &#8220;Reviews,&#8221; but was changed to &#8220;Comments&#8221; in order to align it with the familiar feature allowing users to comment on content in blogs, on YouTube, etc. If you haven&#8217;t seen it before, here&#8217;s what it looks like to a logged-in user:</p>
<div id="attachment_678" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/10/opac-comments-screenshot.png"><img class="size-medium wp-image-678" title="opac-comments-screenshot" src="http://www.myacpl.org/koha/wp-content/uploads/2010/10/opac-comments-screenshot-300x221.png" alt="" width="300" height="221" /></a><p class="wp-caption-text">A catalog record with comments</p></div>
<p>If you visit the <a href="http://search.myacpl.org">Athens County Public Library catalog</a> you&#8217;ll find that comments are enabled, but few users have taken advantage of the feature. I&#8217;ve often wondered what we could do to encourage people to add their comments, and one of the ideas I had was to feature recent comments&#8211;perhaps on the OPAC or library web site home page.</p>
<p>I&#8217;m not an experienced Perl programmer. Most of the changes I make to Koha&#8217;s Perl code are minor or cut-and-paste. Adding a feature as unformed as a recent comments view was a little daunting, but I think it turned out well, and I hope I did it right! I&#8217;m quite pleased with the result:</p>
<div id="attachment_679" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/10/opac-recent-comments-view.png"><img class="size-medium wp-image-679" title="opac-recent-comments-view" src="http://www.myacpl.org/koha/wp-content/uploads/2010/10/opac-recent-comments-view-300x201.png" alt="" width="300" height="201" /></a><p class="wp-caption-text">Recent comments</p></div>
<p>The page shows the latest comments added to any title in the catalog in descending order by date. The page also offers an RSS feed of recent comments. This offers two benefits: First, patron can subscribe to recent comments if they want to find out what others are talking about; and second, the library can use that feed to pull content into their own web site. If my library site&#8217;s content management system can process an RSS feed, I can add those recent comments on my library&#8217;s web site too.</p>
<p>Of course it&#8217;s too late in the development cycle for this feature to make it into 3.2, but I hope it will arrive with 3.4.</p>
<h3>A collaborative process</h3>
<p>There&#8217;s one more thing I wanted to share about the development of this little feature: When I was creating the RSS feed I was testing it with the <a href="http://validator.w3.org/feed/">W3C&#8217;s feed validator</a> to make sure I had constructed the markup for the feed correctly. The only error I didn&#8217;t know how to fix was one with date-formatting. The validator told me I needed to  format my date according to <a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a>, but Koha didn&#8217;t include a way to format dates that way. I put out a plea on the <a href="http://koha-community.org/get-involved/irc/">Koha IRC channel</a> which was answered by <a href="https://www.ohloh.net/accounts/cnighswonger">Chris Nighswonger</a>. He very generously added the code I needed and I was able to include a valid RSS feed.</p>
<p>This anecdote shows the very best kind of interaction possible when you work with an open community of developers. I&#8217;m not suggesting that in the Koha world all one has to do is ask and free code will be provided. But sometimes you catch someone at the right moment, or the challenge appeals to them, and they pitch in. Many thanks to Chris for doing so when I needed help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=677</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Showing item type counts on the checkout screen</title>
		<link>http://www.myacpl.org/koha/?p=658</link>
		<comments>http://www.myacpl.org/koha/?p=658#comments</comments>
		<pubDate>Fri, 30 Jul 2010 15:08:02 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha Customizations]]></category>
		<category><![CDATA[circulation]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[staff client]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=658</guid>
		<description><![CDATA[Does your library limit your patrons to a certain number of checkouts for certain item types? At the Athens County Public Libraries, for instance, we limit patrons to 10 audio books, 10 music CDs, 10 videos, and 5 DVDs at a time. If a patron tries to check out more than 5 DVDs, Koha will [...]]]></description>
				<content:encoded><![CDATA[<p>Does your library limit your patrons to a certain number of checkouts for certain item types? At the Athens County Public Libraries, for instance, we limit patrons to 10 audio books, 10 music CDs, 10 videos, and 5 DVDs at a time. If a patron tries to check out more than 5 DVDs, Koha will show a warning. But what if you want to be able to tell at a glance how many a patron has?</p>
<p>This functionality was available to us in our 2.x installation, but when we upgraded to 3.0 our support company at the time told us it wasn&#8217;t a customization they would support. This wasn&#8217;t a feature we were willing to give up, so I set out to duplicate it using the tools available to me: system preferences and JavaScript.</p>
<h3>Information there for the taking</h3>
<p>All the information we need can be found on the patron checkout screen, we just need to figure out how to get it. The page lists all the items checked out to the patron, and it shows the item type for each:</p>
<div id="attachment_659" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/07/items-checked-out.png"><img class="size-medium wp-image-659" title="items-checked-out" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/items-checked-out-300x123.png" alt="" width="300" height="123" /></a><p class="wp-caption-text">List of items checked out on the checkout screen</p></div>
<p>With this available to us we can use jQuery to count each instance of each item type. We need to build a count for each item type in our system, so the script isn&#8217;t very portable. It looks for table cells (&#8220;<code>&lt;td&gt;</code>&#8220;) containing the description of each of our item types:</p>
<pre class="brush: javascript">

var itypes = {&#039;circ&#039;: 0, &#039;avid&#039;: 0, &#039;avbk&#039;: 0, &#039;avmu&#039;: 0, &#039;advd&#039;:0 };
$(&quot;#issuest td:contains(&#039;Circulating&#039;)&quot;).each(function(){
itypes[&quot;circ&quot;]++;
});
$(&quot;#issuest td:contains(&#039;Videos&#039;)&quot;).each(function(){
itypes[&quot;avid&quot;]++;
});
$(&quot;#issuest td:contains(&#039;DVDs&#039;)&quot;).each(function(){
itypes[&quot;advd&quot;]++;
});
$(&quot;#issuest td:contains(&#039;Audio Books&#039;)&quot;).each(function(){
itypes[&quot;avbk&quot;]++;
});
$(&quot;#issuest td:contains(&#039;Music CDs&#039;)&quot;).each(function(){
itypes[&quot;avmu&quot;]++;
});

</pre>
<p>The script starts by setting up an array of all my item types (&#8220;circ,&#8221; &#8220;avid,&#8221; etc.) and giving each a value of zero. Then the script looks for instances of each item type description on the page,  &#8220;Circulating,&#8221; &#8220;Videos,&#8221; etc., using jQuery&#8217;s <a href="http://api.jquery.com/contains-selector/">:contains</a> selector. Each time it finds an instance of one of those text strings the script increments the count for that item type. At the end of the process the script will have the count for each item type.</p>
<h3>Displaying the counts on the page</h3>
<p>In order to show the item type counts on the page we need to lay some groundwork by adding some markup. I want to add the count information right after the &#8220;Checking out to&#8230;&#8221; heading, so I&#8217;ll find that element&#8217;s ID using FireBug and jQuery&#8217;s <a href="http://api.jquery.com/after/">after()</a> function:</p>
<pre class="brush: javascript">

$(&quot;#circ_circulation_issue label[for=&#039;barcode&#039;]&quot;).after( ... );

</pre>
<p>The HTML I&#8217;m going to add is the default state, so it shows a zero count for everything:</p>
<pre class="brush: html">

&lt;p style=&quot;margin-top:1em;&quot;&gt;
&lt;span id=&quot;avmuout&quot;&gt;0&lt;/span&gt; Music CDs out, &lt;span id=&quot;avmuok&quot;&gt;10&lt;/span&gt; More Allowed
&lt;/p&gt;
&lt;p&gt;
&lt;span id=&quot;avbkout&quot;&gt;0&lt;/span&gt; Audio Books out, &lt;span id=&quot;avbkok&quot;&gt;10&lt;/span&gt; More Allowed
&lt;/p&gt;
&lt;p&gt;
&lt;span id=&quot;avidout&quot;&gt;0&lt;/span&gt; Videos out, &lt;span id=&quot;avidok&quot;&gt;10&lt;/span&gt; More Allowed
&lt;/p&gt;
&lt;p style=&quot;margin-bottom:1em;&quot;&gt;
&lt;span id=&quot;advdout&quot;&gt;0&lt;/span&gt; DVDs out, &lt;span id=&quot;advdok&quot;&gt;5&lt;/span&gt; More Allowed
&lt;/p&gt;

</pre>
<p>I&#8217;ve  included unique IDs for the &#8220;count&#8221; spans so that I can easily update them with my script:</p>
<pre class="brush: javascript">

$(&quot;#avidout&quot;).html(String(itypes[&quot;avid&quot;]));
$(&quot;#advdout&quot;).html(String(itypes[&quot;advd&quot;]));
$(&quot;#avbkout&quot;).html(String(itypes[&quot;avbk&quot;]));
$(&quot;#avmuout&quot;).html(String(itypes[&quot;avmu&quot;]));

$(&quot;#avidok&quot;).html( 10 - itypes[&quot;avid&quot;] );
$(&quot;#advdok&quot;).html( 5 - itypes[&quot;advd&quot;] );
$(&quot;#avbkok&quot;).html( 10 - itypes[&quot;avbk&quot;] );
$(&quot;#avmuok&quot;).html( 10 - itypes[&quot;avmu&quot;] );

</pre>
<p>In the first of the two sections above I take the count I got earlier,<code> itypes['avid']</code> and set the content of the corresponding <code>&lt;span&gt;</code> using the <a href="http://api.jquery.com/html/">html()</a> function. I also want to show how many more the patron can check out, so I subtract the count from the limits I&#8217;ve set in my Koha installation.</p>
<p>If you have patrons who have exceeded their checkout limit you&#8217;ll see a problem: The page will tell you they&#8217;re allowed to check out a negative number more items. We can correct the script to accommodate:</p>
<pre class="brush: javascript">

$(&quot;#avidok&quot;).html((10-itypes[&quot;avid&quot;] &gt; 0) ? 10-itypes[&quot;avid&quot;] : 0);
$(&quot;#advdok&quot;).html((5-itypes[&quot;advd&quot;] &gt; 0) ? 5-itypes[&quot;advd&quot;] : 0);
$(&quot;#avbkok&quot;).html((10-itypes[&quot;avbk&quot;] &gt; 0) ? 10-itypes[&quot;avbk&quot;] : 0);
$(&quot;#avmuok&quot;).html((10-itypes[&quot;avmu&quot;] &gt; 0) ? 10-itypes[&quot;avmu&quot;] : 0);

</pre>
<h3>Final version</h3>
<p>Here&#8217;s what the results look like:</p>
<p><img class="aligncenter size-full wp-image-673" title="item-type-limits" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/item-type-limits.png" alt="" width="456" height="212" /></p>
<p>The final version includes proper escaping of the HTML content and wraps the whole process into a function (&#8220;itemTypeCount&#8221;). This function will be called on page load only if jQuery finds that the table of checkouts, which has an ID &#8220;issuest&#8221; is being displayed. The whole script goes into Koha&#8217;s <strong>intranetuserjs</strong> system preference.</p>
<pre class="brush: javascript">

function itemTypeCount(){
$(&quot;#circ_circulation_issue label[for=&#039;barcode&#039;]&quot;).after(&quot;&lt;p style=\&quot;margin-top:1em;\&quot; class=\&quot;icount\&quot;&gt;&lt;span id=\&quot;avmuout\&quot;&gt;0&lt;/span&gt; Music CDs out, &lt;span id=\&quot;avmuok\&quot;&gt;10&lt;/span&gt; More Allowed&lt;/p&gt; &lt;p class=\&quot;icount\&quot;&gt;&lt;span id=\&quot;avbkout\&quot;&gt;0&lt;/span&gt; Audio Books out, &lt;span id=\&quot;avbkok\&quot;&gt;10&lt;/span&gt; More Allowed&lt;/p&gt; &lt;p class=\&quot;icount\&quot;&gt;&lt;span id=\&quot;avidout\&quot;&gt;0&lt;/span&gt; Videos out, &lt;span id=\&quot;avidok\&quot;&gt;10&lt;/span&gt; More Allowed&lt;/p&gt; &lt;p style=\&quot;margin-bottom:1em;\&quot; class=\&quot;icount\&quot;&gt;&lt;span id=\&quot;advdout\&quot;&gt;0&lt;/span&gt; DVDs out, &lt;span id=\&quot;advdok\&quot;&gt;5&lt;/span&gt; More Allowed&lt;/p&gt;&quot;);

var itypes = {&#039;circ&#039;: 0, &#039;avid&#039;: 0, &#039;avbk&#039;: 0, &#039;avmu&#039;: 0, &#039;advd&#039;:0 };
$(&quot;#issuest td:contains(&#039;Circulating&#039;)&quot;).each(function(){
itypes[&quot;circ&quot;]++;
});
$(&quot;#issuest td:contains(&#039;Videos&#039;)&quot;).each(function(){
itypes[&quot;avid&quot;]++;
});
$(&quot;#issuest td:contains(&#039;DVD&#039;)&quot;).each(function(){
itypes[&quot;advd&quot;]++;
});
$(&quot;#issuest td:contains(&#039;Audio Books&#039;)&quot;).each(function(){
itypes[&quot;avbk&quot;]++;
});
$(&quot;#issuest td:contains(&#039;Music CDs&#039;)&quot;).each(function(){
itypes[&quot;avmu&quot;]++;
});
$(&quot;#avidout&quot;).html(String(itypes[&quot;avid&quot;]));
$(&quot;#advdout&quot;).html(String(itypes[&quot;advd&quot;]));
$(&quot;#avbkout&quot;).html(String(itypes[&quot;avbk&quot;]));
$(&quot;#avmuout&quot;).html(String(itypes[&quot;avmu&quot;]));
$(&quot;#avidok&quot;).html((10-itypes[&quot;avid&quot;] &gt; 0) ? 10-itypes[&quot;avid&quot;] : 0);
$(&quot;#advdok&quot;).html((5-itypes[&quot;advd&quot;] &gt; 0) ? 5-itypes[&quot;advd&quot;] : 0);
$(&quot;#avbkok&quot;).html((10-itypes[&quot;avbk&quot;] &gt; 0) ? 10-itypes[&quot;avbk&quot;] : 0);
$(&quot;#avmuok&quot;).html((10-itypes[&quot;avmu&quot;] &gt; 0) ? 10-itypes[&quot;avmu&quot;] : 0);
}
$(document).ready(function(){
if(document.getElementById(&quot;issuest&quot;)){
itemTypeCount();
}
});

</pre>
<h3>Caveats</h3>
<p>This system works very well for my library, but it comes with a few caveats:</p>
<p><strong>It requires that you hard-code, in the script, handling for each of your Koha item types.</strong></p>
<p>Besides being tedious, it also requires that you modify the script each time you change your item types.</p>
<p><strong>It requires that you hard-code the correct item type limits.</strong></p>
<p>Also tedious, and requires that you modify the script each time you change your circulation rules.</p>
<p><strong>It creates a potential collision with both call numbers and titles.</strong></p>
<p>If my item type description is &#8220;DVD&#8221; and my call number includes the text &#8220;DVD&#8221; as well I&#8217;ll get an inaccurate count. If my item type description is &#8220;Audio Books&#8221; and a patron has checked out a print book entitled <em>Audio Books for long trips</em> I&#8217;ll get an inaccurate count.</p>
<p>For us the disadvantages are not unwieldy and the collision problem has never caused a problem. The advantage we get is being able to tell at a glance whether the patron is going to be able to check out that stack of DVDs or whether we need to ask them to put some back. Better to ask them to pick their favorites up front rather than after we&#8217;ve already checked out some of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=658</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Developing with branches</title>
		<link>http://www.myacpl.org/koha/?p=558</link>
		<comments>http://www.myacpl.org/koha/?p=558#comments</comments>
		<pubDate>Thu, 22 Jul 2010 20:21:03 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=558</guid>
		<description><![CDATA[There was recently some discussion on the Koha mailing list about how &#8220;branches&#8221; fit into the development process. I replied with a description of how I use branches in my development process, and this post is an expansion of that. In my discussion of Koha&#8217;s bug-reporting process I mentioned that a developer who wants to [...]]]></description>
				<content:encoded><![CDATA[<p>There was recently some discussion on the Koha mailing list about how &#8220;branches&#8221; fit into the development process. I replied with a description of how I use branches in my development process, and this post is an expansion of that.</p>
<p>In my discussion of <a href="http://www.myacpl.org/koha/?p=555">Koha&#8217;s bug-reporting process</a> I mentioned that a developer who wants to work on a bug will &#8220;accepts&#8221; a bug in Bugzilla before beginning work on it. There is a lot more to the developer&#8217;s workflow going on behind the scenes. I&#8217;ll describe what my process is.</p>
<p>When I first begin to work on fixing a bug, I create a &#8220;branch&#8221; in the git version control system. When I do so git creates a separate working copy of the main branch, &#8220;master.&#8221;  This copy is of the very latest version of Koha available. I create a separate branch for each distinct change I want to make to Koha. That change might be defined as a bug fix for a particular bug, or a new feature. The changes to each branch might include modifications to many different files, but the changes should all be related to that one subject.</p>
<p>It&#8217;s vitally important that I keep my branches clean and  separate from each other because the Release Manager is relying on me to  make it easy for him to apply and test my patches. If I submit a patch  that covers more than one &#8220;subject,&#8221; that makes it all the more  difficult to test it properly. If I introduce a bug to one aspect of my  update, the whole patch may have to be rejected. Keeping things as  simple as possible makes it easier for everyone.</p>
<p>To see how this looks in my workflow, here&#8217;s a selection of my current working branches:</p>
<p>ip-Bug-3125-IE-selects-2010-05-18<br />
ip-Bug-4173-restricted-status-2010-03-18<br />
ip-Bug-4901-Zotero-subtitles-2010-07-09<br />
ip-hold-interface-test-2010-07-19<br />
* master<br />
ps-Bug-2307-calendar-i8n-2010-07-13<br />
ps-Bug-2704-440-Display-2010-07-13<br />
ps-Bug-2981-alternate-solution-2010-05-18<br />
ps-Bug-3459-topissues-2010-06-29</p>
<p>When I first sit down to work I create a branch with a prefix &#8220;ip-&#8221;  for &#8220;in progress,&#8221; give it a short title and bug number if I have one,  and add the date I started working on it. You can see I might have quite a view branches in progress at a time. This might be because I&#8217;m working on a big update which is time-consuming, or it might mean I&#8217;m stumped about what the solution is.</p>
<p>Each time I sit down to do more work on a bug I switch to that branch, download the latest updates which have been submitted and approved on the master branch, and tell git to &#8220;rebase&#8221; my branch. The rebase process merges my changes with the latest updates. If there are any problems with the merge git will warn me and ask me to make manual changes. Usually the process is automatic. I do this every time I sit down to work on an in-progress branch. This ensures that the changes I&#8217;m making are compatible with the latest version of Koha.</p>
<p>Once I have finished my work I check it and test it as carefully as I can. I make sure I&#8217;ve rebased against the very latest update in git, and I submit a patch. Submitting a patch takes the changes I&#8217;ve made and distills them down to a <a href="http://lists.koha-community.org/pipermail/koha-patches/2010-July/012292.html">single text file</a> which can be &#8220;applied&#8221; by the Release Manager or any other Koha developer to their own git installations. I also attach a copy of my patch to the bug report, if there is one, as I described in my bug reporting post. This is another way to get the patch out into the open where others can review it and test it.</p>
<p>After I&#8217;ve submitted a patch I rename the branch I was working on with &#8220;ps-&#8221; for &#8220;patch sent&#8221;  and keep the branch until my patch is approved (fingers-crossed).</p>
<p>All this is on my computer in a virtual machine, so in my case I&#8217;m  not being open as I might. If I had the resources to work on a real  server, or if I kept my work on a service like <a href="http://github.com/">GitHub</a> I could <a href="http://wiki.koha-community.org/wiki/Public_Git_Repositories">share all  these branches with everyone</a>, from the time I first started working on  it to the time my patch was submitted.</p>
<p>If some time has passed and I see that my patch from one of my  &#8220;patch sent&#8221; branches hasn&#8217;t been approved I&#8217;ll switch to that branch  and rebase: I&#8217;ll tell git to grab the most  recent Koha commits and merge them with the changes in my patch. If not  too much time has passed, or the files I changed haven&#8217;t been worked on  by others the rebase will be successful and I&#8217;ll know I&#8217;m still on  track. If not I might have to manually make changes to my original  commit so that it fits in again with the work others have been doing. If manually merging was required, that tells me the Release Manager would have to do the same. I should consider resubmitting a revised version of my patch which can apply cleanly to the latest version.</p>
<p>Keeping all my &#8220;patch sent&#8221; branches intact until my patch has been approved is important to my workflow because it&#8217;s the easiest way for me to keep track of what has been approved and what hasn&#8217;t. I can see at a glance which patches of mine have not been approved. If it&#8217;s been a while, I might try to find out why not. If there was a problem with the patch I might be able to revise it to the RM&#8217;s satisfaction.</p>
<p>I can&#8217;t submit a patch and expect it to automatically work a month  from now, a week from now, or even a day from now.<strong> I&#8217;m responsible for  keeping up</strong>.</p>
<p>I&#8217;m not a git expert, and I&#8217;ve had lots of help and advice along the way to get me to this workflow. It works really well for me, and I hope it works as well from the point of view of our Release Manager and fellow developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=558</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Customizing the staff client login logo: Addendum</title>
		<link>http://www.myacpl.org/koha/?p=642</link>
		<comments>http://www.myacpl.org/koha/?p=642#comments</comments>
		<pubDate>Thu, 22 Jul 2010 18:59:13 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha Customizations]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[staff client]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=642</guid>
		<description><![CDATA[I left something out of my post on Customizing the staff client login logo that I wanted to be sure to add: Once you&#8217;ve changed the logo you may want to change where it links to as well. By default it links to the Koha web site (or the deprecated version if your installation is [...]]]></description>
				<content:encoded><![CDATA[<p>I left something out of my post on <a href="http://www.myacpl.org/koha/?p=612">Customizing the staff client login logo</a> that I wanted to be sure to add: Once you&#8217;ve changed the logo you may want to change where it links to as well. By default it links to the <a href="http://www.koha-community.org">Koha web site</a> (or the <a href="http://www.koha.org">deprecated version</a> if your installation is an older one). We can use a little snippet of jQuery to change that link.</p>
<h3>Using jQuery to change the URL to which the staff client logo links</h3>
<pre class="brush: javascript">
$(&quot;#login h1 a&quot;).attr(&quot;href&quot;,&quot;http://www.myacpl.org&quot;);
</pre>
<p>That looks for an <code>&lt;a&gt;</code> tag inside an <code>&lt;h1&gt;</code> inside <code>&lt;div id="login"&gt;</code>, which is specific enough to only catch the login form. This snippet goes inside your <strong>intranetuserjs</strong> system preference. Assuming the only thing you&#8217;ve added to intranetuserjs is the code I covered in the previous post, this would be the revised version:</p>
<pre class="brush: css">
$(document).ready(function(){
$(&quot;#login h1 a&quot;).attr(&quot;href&quot;,&quot;http://www.myacpl.org&quot;);
});
// ]]&gt;

&lt;!--
/* Custom styles here */
#login h1 a {
height:71px;
}
#login h1 {
background:url(&quot;http://www.myacpl.org/sites/all/themes/npl/logo.png&quot;) no-repeat scroll center top transparent;
}
--&gt;
&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
// &lt;![CDATA[
</pre>
<p>The revised version adds our new JavaScript snippet inside jQuery's standard "$(document).ready()" to be triggered upon page load.<br />
]]&gt;</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=642</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Customizing the staff client login logo</title>
		<link>http://www.myacpl.org/koha/?p=612</link>
		<comments>http://www.myacpl.org/koha/?p=612#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:54:50 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha Customizations]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[staff client]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=612</guid>
		<description><![CDATA[A Koha user (from Tanzania!) asked today on the Koha mailing list, &#8220;I need some help on how to customize the staff client login page/replace koha logo with a new one.&#8221; I haven&#8217;t heard this request before, so it&#8217;s a good opportunity to investigate. If this were the OPAC we could use a system preference, [...]]]></description>
				<content:encoded><![CDATA[<p>A Koha user (from Tanzania!) asked today on the <a href="http://lists.katipo.co.nz/mailman/listinfo/koha">Koha mailing list</a>, &#8220;<strong>I need some help on how to customize the staff client login page/replace koha logo with a new one</strong>.&#8221; I haven&#8217;t heard this request before, so it&#8217;s a good opportunity to investigate.</p>
<p>If this were the OPAC we could use a system preference, <strong>opacsmallimage</strong>, to change the logo. We don&#8217;t have that option in the staff client, so we&#8217;ll have to see if we can use the available customization options to accomplish the same thing.</p>
<p>Our first stop, as usual, is <a href="http://getfirebug.com">FireBug</a>. I opened up the staff client to examine how the default Koha logo is displayed on the login form. Using the <strong>Inspect</strong> tool I highlight the logo and view the results in the FireBug HTML inspector window:</p>
<div id="attachment_613" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/07/staff-client-login-firebug-detail-1.png"><img class="size-medium wp-image-613" title="staff-client-login-firebug-detail-1" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/staff-client-login-firebug-detail-1-300x57.png" alt="" width="300" height="57" /></a><p class="wp-caption-text">FireBug details for the login logo anchor tag</p></div>
<p style="text-align: center;">
<p>The logo is constructed by nesting a link (&#8220;anchor&#8221;) tag (<code>&lt;a&gt;</code>) inside a top-level heading tag (<code>&lt;h1&gt;</code>). The above screenshot shows the HTML and style details for the <code>&lt;a&gt;</code>, here are the results for the <code>&lt;h1&gt;</code>:</p>
<div id="attachment_615" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/07/staff-client-login-firebug-detail-2.png"><img class="size-medium wp-image-615" title="staff-client-login-firebug-detail-2" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/staff-client-login-firebug-detail-2-300x58.png" alt="" width="300" height="58" /></a><p class="wp-caption-text">FireBug details for the login logo heading tag</p></div>
<p>From this we can collect all the CSS information we need to control the display of the login logo:</p>
<pre class="brush: css">
#login h1 a {
border-bottom:medium none;
display:block;
height:74px;
text-indent:-1000px;
}

#login h1 {
background:url(&quot;../../img/koha-logo.gif&quot;) no-repeat scroll center top transparent;
margin-bottom:0.5em;
margin-top:0;
}
</pre>
<p>The staff client logo is displayed using an <a href="http://css-discuss.incutio.com/?page=ImageReplacement">image-replacement</a> technique similar to the one used to display the <a href="http://www.myacpl.org/koha/?p=3">Koha logo in the OPAC</a>. The style of the anchor tag sets an explicit height which matches the logo image, and it sets a negative <strong>text-indent</strong> property which moves the text contents of the tag off the screen. These two properties create a blank space inside the anchor tag in which to display the logo.</p>
<p>The style of the heading tag does the work of displaying the logo. The <strong>background</strong> property points to the URL of the logo image. In the default case this is an image file on the Koha server&#8217;s file system. The URL doesn&#8217;t have to be a relative one, though. It can be a full URL pointing to anywhere on the internet.</p>
<h3>Customizing the logo CSS</h3>
<p>In order to change the image we need to make very simple changes to two CSS properties:</p>
<ol>
<li>The background-image of the <code>&lt;h1&gt;</code> tag.</li>
<li>The height of the <code>&lt;a&gt;</code> tag.</li>
</ol>
<p>Let&#8217;s use as an example the logo on the <a href="http://www.myacpl.org/">Athens County Public Libraries</a> site. I can right-click the image in Firefox and choose &#8220;View image&#8221; to find the details I need. The location bar shows the URL I need, and the title bar shows the dimensions of the image. I just need to note the height.</p>
<p>Since we only need to change two properties, our custom CSS is simpler than the original. We only need to specify the properties which we need to override:</p>
<pre class="brush: css">
#login h1 a {
height:71px;
}

#login h1 {
background:url(&quot;http://www.myacpl.org/sites/all/themes/npl/logo.png&quot;) no-repeat scroll center top transparent;
}
</pre>
<h3>Applying the custom CSS</h3>
<p>We&#8217;ve got our custom CSS, now what do we do with it? We don&#8217;t have an <strong>opacsmallimage</strong> preference for the staff client, and we don&#8217;t even have an option like <strong>OPACUserCSS</strong>. We do have a couple of options which will work.</p>
<h4>intranetcolorstylesheet</h4>
<p>If you have access to your Koha server&#8217;s file system you can add a stylesheet there and tell Koha to apply it in addition to the default staff client stylesheet. For example, you could create a new CSS file called <code>custom.css</code> and save it alongside <code>staff-global.css</code> and the other staff client CSS files. Then you can specify that filename, <code>custom.css</code>, in the <strong>intranetcolorstylesheet</strong> system preference.</p>
<h4>intranetuserjs</h4>
<p>If you don&#8217;t have access to your Koha server&#8217;s file system, there&#8217;s a way to insert custom CSS into your staff client pages, but it&#8217;s a bit of a hack. Lacking an &#8220;intranetusercss&#8221; preference we&#8217;re going to hijack an existing preference, <strong>intranetuserjs</strong>, to do the job for us.</p>
<p>When you insert custom JavaScript into the intranetuserjs preference, Koha detects this and adds it to the header of each staff client page, wrapped in the appropriate <code>&lt;script&gt;</code> tags:</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot;&gt;
// &lt;![CDATA[
/* BEGIN INTRANETUSERJS CONTENTS */
$(document).ready(function(){
alert(&quot;Hello world!&quot;);     });
/* END INTRANETUSERJS CONTENTS */
// ]]&gt;
&lt;/script&gt;

</pre>
<p>Since Koha automatically wraps the intranetuserjs content in opening and closing &lt;script&gt; tags, we&#8217;ll have to do a little bit of roundabout coding to embed a &lt;style&gt; block:</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot;&gt;
//&lt;![CDATA[
/* BEGIN INTRANETUSERJS CONTENTS */
// ]]&gt;
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* Custom styles here */
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
// &lt;![CDATA[
/* END INTRANETUSERJS CONTENTS */
// ]]&gt;
&lt;/script&gt;
</pre>
<p>Let&#8217;s run down what&#8217;s happening here. Lines 1 and 2 have been inserted automatically by Koha in order to properly embed the custom JavaScript it expects from the intranetuserjs preference. Line 3 is the first line of the contents of intranetuserjs. Lines 4 and 5 we have added manually to <em>close</em> the automatically-embedded <code>&lt;script&gt;</code> tag. With the script tag closed we can go on to add just about any HTML we want, really, but this is all inside the <code>&lt;head&gt;</code> of the HTML document, so few things would be valid.</p>
<p>Lines 6, 7, and 8 show the <code>&lt;style&gt;</code> tag we&#8217;re adding. This is where we&#8217;re going to put our custom CSS. Lines 9, 10, and 11 are the last lines of our custom intranetuserjs. Knowing that Koha wants to close the <code>&lt;script&gt;</code> tag it opened on line 1, we have to <em>re-open</em> a new <code>&lt;script&gt;</code> tag so that when Koha closes it we&#8217;ll have valid markup.</p>
<p>Putting it all together, here&#8217;s what the contents of our intranetuserjs preference will be:</p>
<pre class="brush: css">
// ]]&gt;
&lt;/script&gt;

&lt;style type=&quot;text/css&quot;&gt;
/* Custom styles here */
#login h1 a {
height:71px;
}
#login h1 {
background:url(&quot;http://www.myacpl.org/sites/all/themes/npl/logo.png&quot;) no-repeat scroll center top transparent;
}
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
// &lt;![CDATA[
</pre>
<p>If all goes well, this is what you should see when you log out and look at your login screen:</p>
<div id="attachment_633" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/07/staff-client-login-results.png"><img class="size-medium wp-image-633" title="staff-client-login-results" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/staff-client-login-results-300x281.png" alt="" width="300" height="281" /></a><p class="wp-caption-text">Customized login form</p></div>
<div style="padding: 0.5em; background-color: #ffffcc; margin-top: 1em;"><strong>Note:</strong> I've published a quick addendum to this post which covers <a href="http://www.myacpl.org/koha/?p=642">using jQuery to change the URL to which the logo links</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=612</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interface test: Placing a quick hold</title>
		<link>http://www.myacpl.org/koha/?p=593</link>
		<comments>http://www.myacpl.org/koha/?p=593#comments</comments>
		<pubDate>Mon, 19 Jul 2010 19:39:35 +0000</pubDate>
		<dc:creator>oleonard</dc:creator>
				<category><![CDATA[Koha]]></category>
		<category><![CDATA[Koha UI]]></category>
		<category><![CDATA[holds]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.myacpl.org/koha/?p=593</guid>
		<description><![CDATA[I was thinking about ease of use, and what we could to to improve the Koha OPAC from the point of view of the patrons, and the first thing my mind jumped to was the process of placing holds. For many patrons placing a hold is the goal of their visit to the OPAC. They&#8217;re [...]]]></description>
				<content:encoded><![CDATA[<p>I was thinking about ease of use, and what we could to to improve the Koha OPAC from the point of view of the patrons, and the first thing my mind jumped to was the process of placing holds. For many patrons placing a hold is the goal of their visit to the OPAC. They&#8217;re looking for something they want, they find it in the catalog, and they want to get it. On Amazon.com the next step would be to buy it. In the OPAC they can place a hold.</p>
<p>What&#8217;s the first thing they see when they click one of those &#8220;place hold&#8221; links? Potentially this:</p>
<div id="attachment_594" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/07/place-holds-interface.png"><img class="size-medium wp-image-594" title="place-holds-interface" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/place-holds-interface-300x109.png" alt="" width="300" height="109" /></a><p class="wp-caption-text">Place hold interface with all options turned on</p></div>
<p>I hate it. It&#8217;s an ugly table with too many options. True, you can turn off some of those options for a simpler process. Turn off the <strong>OPACItemHolds </strong><a href="http://koha-community.org/documentation/3-2-manual/?ch=c19">system preference</a> to eliminate the option of choosing a specific copy. Turn off <strong>OPACAllowHoldDateInFuture </strong>to hide the <strong>Hold Starts on Date</strong> column. Turn off <strong>OPACDisplayRequestPriority </strong>to hide the hold request&#8217;s rank in the queue. Now it&#8217;s a little simpler:</p>
<div id="attachment_597" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myacpl.org/koha/wp-content/uploads/2010/07/place-holds-interface-simpler.png"><img class="size-medium wp-image-597" title="place-holds-interface-simpler" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/place-holds-interface-simpler-300x80.png" alt="" width="300" height="80" /></a><p class="wp-caption-text">With optional settings turned off</p></div>
<p>I&#8217;m still not crazy about it, and that&#8217;s why holds came to mind when I thought about what we could do to improve interactions in Koha. How can we make that interaction simpler? How about [<a href="http://en.wikipedia.org/wiki/1-Click">almost]</a> one-click &#8220;ordering?&#8221;</p>
<div id="attachment_600" class="wp-caption aligncenter" style="width: 310px"><a href="http://myacpl.org/koha/examples/opac-detail-quickhold.html"><img class="size-medium wp-image-600" title="quick-hold-screenshot-2010-07-19" src="http://www.myacpl.org/koha/wp-content/uploads/2010/07/quick-hold-screenshot-2010-07-19-300x195.png" alt="" width="300" height="195" /></a><p class="wp-caption-text">Click the &quot;Place hold&quot; link in the right sidebar</p></div>
<p>When you click the &#8220;Place hold&#8221; link you can see my idea demonstrated. Clicking the link would use JavaScript to display a simple form: <strong>Place hold? Yes/No</strong>. Embedded in the HTML would be all the required form fields, hidden, for placing a single hold with no options set, using the patron&#8217;s home library as the destination for the hold. If the patron wanted to set additional options they could click the &#8220;more options&#8221; link and be taken to the standard form.</p>
<p>How hard would this be to implement? It depends how far you want to take it. I could see  this being a JavaScript-only enhancement, assuming all the information we need is found on this page. In this version clicking the &#8220;Yes&#8221; button would submit the form to the same script the standard form does, but bypass the hold confirmation screen. The user would be redirected to their summary page showing current holds.</p>
<p>A fancier version would submit the form in the background. Clicking the &#8220;Yes&#8221; button would triggers a sequence of events:</p>
<ol>
<li>The hold would be submitted in the background.</li>
<li>The interface would display some kind of <a href="http://en.wikipedia.org/wiki/Throbber#Spinning_wheel">&#8220;Working&#8221; indicator</a>.</li>
<li>Upon completion of the background submission, the interface would indicate success.</li>
</ol>
<p>This is more complicated because the reserve script would have to be modified to work in new way. Error-handling would have to be incorporated so that if for some reason the hold couldn&#8217;t be processed the user could be warned. The advantage to this interaction is that the user never leaves the page, making it easier for them to find their way back to their original search&#8211;something which, incidentally, is also on our <a href="http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=3075">to-do list of ways to make things easier for the user</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myacpl.org/koha/?feed=rss2&#038;p=593</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
