From 049a5cbd0b94faa084dd4d7ce1d473ca1be1b929 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 9 Nov 2020 12:55:52 +0000 Subject: [PATCH] Bug 26975: Reindent authorities editor template This patch performs general template cleanup to the authorities editor: Make indentation consistent, replace tabs with spaces, and trim trailing whitespace. To test, apply the patch and edit or create a new authority record. Test the functionality of the authority editor and confirm that everything works correctly, including JS interactions like subfield reordering, tag and subfield cloning, and tag and subfield deletion. --- .../prog/en/modules/authorities/authorities.tt | 788 +++++++++++---------- 1 file changed, 403 insertions(+), 385 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt index 601726a25f..61904625f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -29,7 +29,7 @@ if(Check()){ $("#f").submit(); } - }); + }); $("#z3950submit").click(function(){ var strQuery = GetZ3950Terms(); if(strQuery){ @@ -39,423 +39,441 @@ }); }); -/** - * check if z3950 mandatories are set or not - */ -function GetZ3950Terms(){ - var strQuery="&authtypecode="+document.forms['f'].authtypecode.value; - var mandatories = new Array(); - var mandatories_label = new Array(); - [% FOREACH BIG_LOO IN BIG_LOOP %][% FOREACH innerloo IN BIG_LOO.innerloop %][% FOREACH subfield_loo IN innerloo.subfield_loop %][% IF ( subfield_loo.z3950_mandatory ) %]mandatories.push("[% subfield_loo.id | html %]"); - mandatories_label.push("[% subfield_loo.z3950_mandatory | html %]");[% END %][% END %][% END %][% END %] - - for(var i=0,len=mandatories.length; i= 10){ + elem = document.getElementById(divid); + eleminputs = elem.getElementsByTagName('input'); + + for(var j=0,len2=eleminputs.length; j= 10){ - elem = document.getElementById(divid); - eleminputs = elem.getElementsByTagName('input'); - - for(var j=0,len2=eleminputs.length; j -[% Asset.css("css/addbiblio.css") | $raw %] - - - -
-
Loading, please wait...
-
+ function Check(){ + var StrAlert = AreMandatoriesNotOk(); + if( ! StrAlert ){ + document.f.submit(); + return true; + } else { + alert(StrAlert); + return false; + } + } -[% INCLUDE 'header.inc' %] + function AddField(field,cntrepeatfield) { + document.forms['f'].op.value = "addfield"; + document.forms['f'].addfield_field.value=field; + document.forms['f'].repeat_field.value=cntrepeatfield; + document.f.submit(); + } - + function addauthority() { + X = document.forms[0].authtype.value; + window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X; + } -
-
-
+ function searchauthority() { + X = document.forms[0].authtype2.value; + Y = document.forms[0].value.value; + window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains"; + } -[% IF ( authid ) %] -

Modify authority #[% authid | html %] [% authtypetext | html %]

-[% ELSE %] -

Adding authority [% authtypetext | html %]

-[% END %] + function confirmnotdup(redirect){ + $("#confirm_not_duplicate").attr("value","1"); + Check(); + } + +[% Asset.css("css/addbiblio.css") | $raw %] + -[% IF ( duplicateauthid ) %] -
-

Duplicate record suspected

-

Is this a duplicate of [% duplicateauthvalue | html %] ?

+ -
- - -
-
- -
-
-[% END %] - -
- - - - - - - - -
- -
- [% IF ( authid ) %] - Replace record via Z39.50/SRU search - [% ELSE %] - Z39.50/SRU search - [% END %] -
-
- [% IF ( authid ) %] - Cancel - [% ELSE %] - Cancel - [% END %] -
+
+
Loading, please wait...
-
- - -[% FOREACH BIG_LOO IN BIG_LOOP %] -
+ [% INCLUDE 'header.inc' %] - [% previous = "" %] - [% FOREACH innerloo IN BIG_LOO.innerloop %] - [% IF ( innerloo.tag ) %] - [% IF innerloo.tag != previous %] - [% IF previous != "" %] - - [% END %] - [% previous = innerloo.tag %] -
    - [% END %] -
  • -
    - [% UNLESS hide_marc %] - [% IF advancedMARCEditor %] - [% innerloo.tag | html %] - [% ELSE %] - [% innerloo.tag | html %] - [% END %] - [% IF ( innerloo.fixedfield ) %] - - - [% ELSE %] - - - [% END %] - + - [% UNLESS advancedMARCEditor %] - [% innerloo.tag_lib | html %] - [% END %] - - [% IF ( innerloo.repeatable ) %] - - Repeat this Tag - - [% END %] - - Delete this Tag - - - -
    - -
      - [% FOREACH subfield_loo IN innerloo.subfield_loop %] - -
    • +
      +
      +
      - [% UNLESS advancedMARCEditor %] - [% IF ( subfield_loo.fixedfield ) %]
    + [% END %] + [% previous = innerloo.tag %] +
      + [% END %] +
    • +
      + [% UNLESS hide_marc %] + [% IF advancedMARCEditor %] + [% innerloo.tag | html %] + [% ELSE %] + [% innerloo.tag | html %] + [% END %] + + [% IF ( innerloo.fixedfield ) %] + + + [% ELSE %] + + + [% END %] - + [% ELSE %] + [% IF ( innerloo.fixedfield ) %] + + + [% ELSE %] + + + [% END %] + [% END %] + + [% UNLESS advancedMARCEditor %] + [% innerloo.tag_lib | html %] + [% END %] + + + [% IF ( innerloo.repeatable ) %] + + Repeat this Tag + + [% END %] + + Delete this Tag + + +
      + +
        + [% FOREACH subfield_loo IN innerloo.subfield_loop %] + +
      • + + [% UNLESS advancedMARCEditor %] + [% IF ( subfield_loo.fixedfield ) %] +
      • + + [% END %] +
      +
    • + [% END %] + [% END %] +
    +
+ [% END %] +
+ +
+ [% FOREACH hidden_loo IN hidden_loop %] + + + + + [% END %] - [% mv.javascript | $raw %] - [% ELSIF ( mv.type == 'text' ) %] - - [% ELSIF ( mv.type == 'textarea' ) %] - - [% ELSIF ( mv.type == 'hidden' ) %] - - [% ELSIF ( mv.type == 'hidden_simple' ) %] - +
+ + [% IF ( oldauthnumtagfield ) %] + + + + + + + + + [% END %] + - - [% IF ( subfield_loo.repeatable ) %] - - Clone - - - Delete - - [% END %] - - - - [% END %] - - - [% END %] - [% END %] - -
- [% END %] -
- -
-[% FOREACH hidden_loo IN hidden_loop %] - - - - - -[% END %] -
-[% IF ( oldauthnumtagfield ) %] - - - - - - - - - -[% END %] - - - -[% INCLUDE 'modals/cataloguing_create_av.inc' %] + [% INCLUDE 'modals/cataloguing_create_av.inc' %] -
-
+ + [% INCLUDE 'intranet-bottom.inc' %] -- 2.11.0