Bug 19878: Move template JavaScript to the footer: UNIMARC editor plugins, part 7
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / unimarc_field_225a.tt
index 7f9e144..68a2ff2 100644 (file)
@@ -1,27 +1,42 @@
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-    <title>UNIMARC Field 225a builder</title>
+    <title>UNIMARC field 225a builder</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
-<body style="padding:1em;">
-<h3>UNIMARC Field 225a builder</h3>
+
+<body id="cat_unimarc_field_225a" class="cat" style="padding:1em;">
+<h3>UNIMARC field 225a builder</h3>
     <div id="mainbloc">
         <form name="f_pop" onsubmit="report()" action="">
             <h2 class="authority">Collection</h2>
-            <p><label>Select a collection</label>[% collection %]</p>
+            <p><label>Select a collection</label>
+                <select name="f1" id="f1" size="1">
+                [% FOREACH value IN collection.values %]
+                  [% IF ( value == collection.default ) %]
+                    <option value="[% value %]" selected="selected">[% value %]</option>
+                  [% ELSE %]
+                    <option value="[% value %]">[% value %]</option>
+                  [% END %]
+                [% END %]
+                </select>
+            </p>
+            OR new collection: <input type="text" value="" name="f2"/>
+            <br/>
             <input type="submit" value="OK" class="button authority" />
         </form>
     </div>
-    
-<script type="text/javascript">
-//<![CDATA[
-function report() {
-            var doc   = opener.document; 
+
+
+[% MACRO jsinclude BLOCK %]
+    <script type="text/javascript">
+        function report() {
+            var doc   = opener.document;
             var field = doc.getElementById("[% index %]");
-            field.value =  document.f_pop.f1.value;
+            field.value = document.f_pop.f2.value || document.f_pop.f1.value;
             window.close();
             return false;
         }
-    //]]>
-</script>
+    </script>
+[% END %]
 
-[% INCLUDE 'popup-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]