X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=koha-tmpl%2Fintranet-tmpl%2Fprog%2Fen%2Fmodules%2Fadmin%2Fpatron-attr-types.tt;h=bd76e4c85046ac707e3cb2ae8c331f385f4c08e1;hb=6b626b64944dff0ba0adff99da26e3bbe8eb7544;hp=d70bdbd23b92f83c920a65256a45d207a7be0e5e;hpb=e901ae15de6717f8594bd80ecfb0c5e8a23b8af5;p=koha.git diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt index d70bdbd23b..bd76e4c850 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt @@ -1,3 +1,4 @@ +[% USE AuthorisedValues %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Patron attribute types [% IF ( attribute_type_form ) %] @@ -20,38 +21,12 @@ $(document).ready(function() { $("#branches option:first").attr("selected", "selected"); } } ); - -function DoCancel(f) { - f.op.value=''; - document.Aform.submit(); -} - -function CheckAttributeTypeForm(f) { - var ok=1; - var _alertString=""; - var alertString2; - if (f.code.value.length==0) { - _alertString += "\n- " + _("Patron attribute type code missing"); - } - if (f.description.value.length==0) { - _alertString += "\n- " + _("Description missing"); - } - if (_alertString.length==0) { - document.Aform.submit(); - } else { - alertString2 = _("Form not submitted because of the following problem(s)"); - alertString2 += "\n------------------------------------------------------------------------------------\n"; - alertString2 += _alertString; - alert(alertString2); - } -} - //]]> </script> </head> <body id="admin_patron-attr-types" class="admin"> [% INCLUDE 'header.inc' %] -[% INCLUDE 'cat-search.inc' %] +[% INCLUDE 'prefs-admin-search.inc' %] <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( display_list ) %]Patron attribute types[% ELSE %]<a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a>[% END %] [% IF ( attribute_type_form ) %] @@ -87,7 +62,7 @@ function CheckAttributeTypeForm(f) { — one with that code already exists. </div> [% END %] -<form action="[% script_name %]" name="Aform" method="post"> +<form action="[% script_name %]" class="validated" method="post"> <input type="hidden" name="op" value="[% confirm_op %]" /> <fieldset class="rows"> <ol> @@ -97,13 +72,14 @@ function CheckAttributeTypeForm(f) { <input type="hidden" name="code" value="[% code |html %]" /> [% code |html %] [% ELSE %] - <label for="code">Patron attribute type code: </label> - <input type="text" id="code" name="code" size="10" maxlength="10" /> + <label for="code" class="required">Patron attribute type code: </label> + <input type="text" id="code" name="code" required="required" class="required" size="10" maxlength="10" /> + <span class="required">Required</span> [% END %] </li> - <li><label for="description">Description: </label> - <input type="text" id="description" name="description" size="50" maxlength="250" - value="[% description |html %]" /> + <li><label for="description" class="required">Description: </label> + <input type="text" id="description" name="description" required="required" class="required" size="50" maxlength="250" value="[% description |html %]" /> + <span class="required">Required</span> </li> <li><label for="repeatable">Repeatable: </label> [% IF ( repeatable_checked ) %] @@ -139,14 +115,6 @@ function CheckAttributeTypeForm(f) { <span>If checked, attribute will be a unique identifier — if a value is given to a patron record, the same value cannot be given to a different record. This setting cannot be changed after an attribute is defined.</span> </li> - <li><label for="password_allowed">Allow password: </label> - [% IF ( password_allowed_checked ) %] - <input type="checkbox" id="password_allowed" name="password_allowed" checked="checked" /> - [% ELSE %] - <input type="checkbox" id="password_allowed" name="password_allowed" /> - [% END %] - <span>Check to make it possible to associate a password with this attribute.</span> - </li> <li><label for="opac_display">Display in OPAC: </label> [% IF ( opac_display_checked ) %] <input type="checkbox" id="opac_display" name="opac_display" checked="checked" /> @@ -175,17 +143,7 @@ function CheckAttributeTypeForm(f) { <li><label for="authorised_value_category">Authorized value category: </label> <select name="authorised_value_category" id="authorised_value_category"> <option value=""></option> - [% FOREACH authorised_value_categorie IN authorised_value_categories %] - [% IF ( authorised_value_categorie.selected ) %] - <option value="[% authorised_value_categorie.category %]" selected="selected"> - [% authorised_value_categorie.category %] - </option> - [% ELSE %] - <option value="[% authorised_value_categorie.category %]"> - [% authorised_value_categorie.category %] - </option> - [% END %] - [% END %] + [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value_category ) %] </select> <span>Authorized value category; if one is selected, the patron record input page will only allow values to be chosen from the authorized value list. However, an authorized value list is not @@ -202,7 +160,7 @@ function CheckAttributeTypeForm(f) { [% END %] [% END %] </select> - <span>Select All if this attribute type must to be displayed all the time. Otherwise select librairies you want to associate with this value. + <span>Select All if this attribute type must to be displayed all the time. Otherwise select libraries you want to associate with this value. </span> </li> <li> @@ -217,10 +175,10 @@ function CheckAttributeTypeForm(f) { </li> <li> <label for="class">Class: </label> - <select name="class"> - <option value="" /> + <select name="class" id="class"> + <option value=""></option> [% FOREACH class IN classes_val_loop %] - [% IF ( class.selected ) %] + [% IF class.authorised_value == category_class %] <option value="[% class.authorised_value %]" selected="selected"> [% class.lib %] </option> @@ -231,51 +189,36 @@ function CheckAttributeTypeForm(f) { [% END %] [% END %] </select> - <span>Group attributes types with a block title (based on Authorised values category 'PA_CLASS')</span> + <span>Group attributes types with a block title (based on authorized values category 'PA_CLASS')</span> </li> </ol> </fieldset> <fieldset class="action"> - [% IF ( edit_attribute_type ) %] - <input type="button" value="Save" - onclick="CheckAttributeTypeForm(this.form)" /> - [% ELSE %] - <input type="button" value="Save" - onclick="CheckAttributeTypeForm(this.form)" /> - [% END %] + <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a> </fieldset> </form> [% END %] [% IF ( delete_attribute_type_form ) %] -<div class="dialog alert"><h3>Confirm deletion of patron attribute type <span class="ex">'[% code |html %]' ([% description %])</span>?</h3> -<form action="[% script_name %]" name="Aform" method="post"> - <input type="hidden" name="op" value="[% confirm_op %]" /> - <input type="hidden" name="code" value="[% code |html %]" /> - <input type="submit" value="Delete patron attribute type" class="approve" /></form> - <form action="[% script_name %]" method="get"> - <input type="submit" value="No, Do Not Delete" class="deny" /> -</form></div> + <div class="dialog alert"> + <h3>Confirm deletion of patron attribute type <span class="ex">'[% code |html %]' ([% description %])</span>?</h3> + <form action="[% script_name %]" name="Aform" method="post"> + <input type="hidden" name="op" value="[% confirm_op %]" /> + <input type="hidden" name="code" value="[% code |html %]" /> + <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete patron attribute type</button> + </form> + <form action="[% script_name %]" method="get"> + <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button> + </form> + </div> [% END %] [% IF ( display_list ) %] -<div id="toolbar"> - <script type="text/javascript"> - //<![CDATA[ - // prepare DOM for YUI Toolbar - $(document).ready(function() { - yuiToolbar(); - }); - // YUI Toolbar Functions - function yuiToolbar() { - new YAHOO.widget.Button("newrule"); - } //]]> - </script> - <ul class="toolbar"> - <li><a id="newrule" href="[% script_name %]?op=add_attribute_type">New patron attribute type</a></li> -</ul></div> +<div id="toolbar" class="btn-toolbar"> + <a class="btn btn-default btn-sm" id="newrule" href="[% script_name %]?op=add_attribute_type"><i class="fa fa-plus"></i> New patron attribute type</a> +</div> <h2>Patron attribute types</h2> [% IF ( added_attribute_type ) %] @@ -315,7 +258,7 @@ function CheckAttributeTypeForm(f) { <td>[% item.code |html %]</td> <td>[% item.description %]</td> <td> - [% IF item.branches.size > 0 %] + [% IF ( item.branches && item.branches.size > 0 ) %] [% branches_str = "" %] [% FOREACH branch IN item.branches %] [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %] @@ -331,9 +274,9 @@ function CheckAttributeTypeForm(f) { No limitation [% END %] </td> - <td> - <a href="[% item.script_name %]?op=edit_attribute_type&code=[% item.code |html %]">Edit</a> - <a href="[% item.script_name %]?op=delete_attribute_type&code=[% item.code |html %]">Delete</a> + <td class="actions"> + <a class="btn btn-default btn-xs" href="[% item.script_name %]?op=edit_attribute_type&code=[% item.code |html %]"><i class="fa fa-pencil"></i> Edit</a> + <a class="btn btn-default btn-xs" href="[% item.script_name %]?op=delete_attribute_type&code=[% item.code |html %]"><i class="fa fa-trash"></i> Delete</a> </td> </tr> [% END %]