Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
2010-07-15 22:05:19 -04:00

71 lines
2.5 KiB
HTML

<div id="toolbar">
<script type="text/javascript">
//<![CDATA[
// prepare DOM for YUI Toolbar
$(document).ready(function() {
<!--TMPL_IF Name="AddPatronLists_categorycode"-->
<!--TMPL_ELSE-->
$("#addchild").parent().remove();
$("#addprofessional").parent().remove();
$("#addorganisation").parent().remove();
$("#addstaff").parent().remove();
$("#addstatistical").parent().remove();
<!--/TMPL_IF-->
$("#newmenuc").empty();
yuiToolbar();
});
// YUI Toolbar Functions
function yuiToolbar() {
var newmenu = [
<!--TMPL_IF Name="AddPatronLists_categorycode"-->
<!--TMPL_LOOP Name="categories"-->
{ text: "<!--TMPL_VAR Name="description"-->", url: "/cgi-bin/koha/members/memberentry.pl?op=add&amp;categorycode=<!--TMPL_VAR Name="categorycode"-->" },
<!--/TMPL_LOOP-->
<!--TMPL_ELSE-->
{ text: _("Adult Patron"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&amp;category_type=A" },
{ text: _("Child Patron"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&amp;category_type=C" },
{ text: _("Professional Patron"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&amp;category_type=P" },
{ text: _("Organization"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&amp;category_type=I" },
{ text: _("Staff"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&amp;category_type=S" },
{ text: _("Statistical"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&amp;category_type=X" },
<!--/TMPL_IF-->
]
new YAHOO.widget.Button({
type: "menu",
label: _("New"),
name: "newmenubutton",
menu: newmenu,
container: "newmenuc"
});
}
//]]>
</script>
<ul class="toolbar">
<li id="newmenuc">
<form action="/cgi-bin/koha/members/memberentry.pl" method="get">
<input type="hidden" name="op" value="add" />
<label for="newcategorycode">New Patron: </label><select name="categorycode" id="newcategorycode">
<!--TMPL_IF Name="AddPatronLists_categorycode"-->
<!--TMPL_LOOP Name="categories"--><option value="<!--TMPL_VAR Name="categorycode"-->"><!--TMPL_VAR Name="description"--></option><!--/TMPL_LOOP-->
<!-- TMPL_ELSE -->
<option value="A">Adult Patron</option>
<option value="C">Child Patron</option>
<option value="P">Professional Patron</option>
<option value="I">Organization</option>
<option value="S">Staff</option>
<option value="X">Statistical</option>
<!--/TMPL_IF-->
</select>
<input type="submit" class="submit" value="Go" />
</form>
</li>
</ul>
</div>