From 1b0da1c7dee714d598c04d499e30268d270571a7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 27 Jul 2012 10:32:47 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 3374 - Display patron attributes in the same format as other patron data This patch revises the interface for displaying and editing patron attributes so that it is consistent with other similar interfaces. Display of patron attributes should match the display of other kinds of patron data, and codes should be omitted in favor of descriptions. Entry of patron attributes should match other patron entry forms and should also omit codes in favor of descriptions. To test, view and edit patron attributes. Special functions like "Clear" and "New" should function as before. Signed-off-by: Nicole C. Engard Tested by viewing patrons with attributes, editing those attributes and editing the entire patron record. In all places the editing/adding works and the display is improved. --- .../intranet-tmpl/prog/en/css/staff-global.css | 17 ++++- .../prog/en/modules/members/memberentrygen.tt | 74 +++++++------------- .../prog/en/modules/members/moremember.tt | 36 ++++------ koha-tmpl/intranet-tmpl/prog/img/clear-field.png | Bin 0 -> 279 bytes koha-tmpl/intranet-tmpl/prog/img/clone-field.png | Bin 0 -> 262 bytes 5 files changed, 55 insertions(+), 72 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/img/clear-field.png create mode 100644 koha-tmpl/intranet-tmpl/prog/img/clone-field.png diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 436b728..49491f1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -634,8 +634,9 @@ fieldset.rows label, fieldset.rows span.label { } fieldset.rows fieldset { + background-color: #FFF; border-width : 1px; - margin : 0 0 .5em 0; + margin : 1em; padding : .3em; } @@ -734,6 +735,10 @@ fieldset.action, div.action { width: auto; } +div.rows+div.rows { + margin-top : .6em; +} + div.rows { float : left; clear : left; @@ -1184,6 +1189,16 @@ div.alert strong { list-style-position:inside; } +a.clear-field { + background : transparent url("../../img/clear-field.png") center left no-repeat; + padding-left : 16px; +} + +a.clone-field { + background : transparent url("../../img/clone-field.png") center left no-repeat; + padding-left : 20px; +} + a.document { background-position : left middle; background-repeat : no-repeat; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index bd62f58..f4734c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -36,49 +36,39 @@ }); function clear_entry(node) { - var original = node.parentNode.parentNode; + var original = node.parentNode; $("input[type=text]", original).attr('value', ''); $("select", original).attr('value', ''); } function clone_entry(node) { - var original = node.parentNode.parentNode; - var clone = original.cloneNode(true); + var original = $(node).parent(); + var clone = original.clone(); + var newId = 50 + parseInt(Math.random() * 100000); - $("input", clone).attr('id', function() { + $("input,select,textarea", clone).attr('id', function() { return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId); }); - $("input", clone).attr('name', function() { + $("input,select,textarea", clone).attr('name', function() { return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId); }); - $("select", clone).attr('id', function() { - return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId); - }); - $("select", clone).attr('name', function() { - return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId); + $("label", clone).attr('for', function() { + return $(this).attr("for").replace(/patron_attr_\d+/, 'patron_attr_' + newId); }); $("input#patron_attr_" + newId, clone).attr('value',''); $("select#patron_attr_" + newId, clone).attr('value',''); - original.parentNode.insertBefore(clone, original.nextSibling); + $(original).after(clone); + return false; } function update_category_code(category_code) { if ( $(category_code).is("select") ) { category_code = $("#categorycode").find("option:selected").val(); } - var mytables = $(".attributes_table>tbody"); - - mytables.find("tr").each(function(){ - $(this).hide() - }); - - mytables.find("tr[data-category_code="+category_code+"]").each(function(){ - $(this).show(); - }); - mytables.find("tr[data-category_code='']").each(function(){ - $(this).show(); - }); - + var mytables = $(".attributes_table"); + $(mytables).find("li").hide(); + $(mytables).find(" li[data-category_code="+category_code+"]").show(); + $(mytables).find(" li[data-category_code='']").show(); } var MSG_SEPARATOR = _("Separator must be / in field "); @@ -1345,24 +1335,13 @@ Additional attributes and identifiers [% FOREACH pa_loo IN patron_attributes %] [% IF pa_loo.class %] - - - [% ELSE %] -
[% pa_loo.lib %]
+
+ [% pa_loo.lib %] [% END %] -
- - - - - - +
    [% FOREACH patron_attribute IN pa_loo.items %] -
- - - - + [% END %] - -
TypeValue
- [% patron_attribute.code %] ([% patron_attribute.description %]) - +
  • + [% IF ( patron_attribute.use_dropdown ) %] Password: ) [% END %] -
  • - Clear + Clear [% IF ( patron_attribute.repeatable ) %] - New + New [% END %] -
    + + [% IF pa_loo.class %][% END %] [% END %] [% END %][% END %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index b6df1b3..11bb33f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -290,32 +290,24 @@ function validate1(date) {

    Additional attributes and identifiers

    [% FOREACH attribute IN attributes_loop %] [% IF attribute.class %] -

    [% attribute.lib %]

    - +
    [% ELSE %] -
    +
    [% END %] -
    - - - - - - - +

    [% attribute.lib %]

    +
      [% FOREACH item IN attribute.items %] -
    - - - - +
  • + [% item.description %]: + [% IF ( item.value_description ) %] + [% item.value_description %] + [% ELSE %] + [% item.value %] + [% END %] +
  • [% END %] - -
    TypeDescriptionValue
    [% item.code %][% item.description %][% item.value %] - [% IF ( item.value_description ) %] - ([% item.value_description %]) - [% END %] -
    + + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/img/clear-field.png b/koha-tmpl/intranet-tmpl/prog/img/clear-field.png new file mode 100644 index 0000000000000000000000000000000000000000..80287bf8fbeb5d5085cddb5b73d838d970ac1dd9 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl10!aP82hXjxq1`J<%S!eGE3a9`&fWgz%&t;ucLK6Tp0Zjh@ literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/clone-field.png b/koha-tmpl/intranet-tmpl/prog/img/clone-field.png new file mode 100644 index 0000000000000000000000000000000000000000..702efb35de7c88b62456c4285bf058b3236f3cee GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl}1CAcv&Fdk{pV-RqVU}9iwQ3Ns^7}+csI2l+3JQ_H; z4gf`2#1dMV)6yCknm7(zVPIuo;>clB7G@Sc!83uufuZrM;%WvCg${;El0X9<@-;9V h5&-gf7?Bvv46gf_3S|`(WPo-vc)I$ztaD0e0suGuMLYli literal 0 HcmV?d00001 -- 1.7.2.3