View | Details | Raw Unified | Return to bug 9649
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cataloging-toolbar.inc (-78 lines)
Lines 1-78 Link Here
1
2
3
<div id="toolbar">
4
<script type="text/javascript">
5
	//<![CDATA[
6
7
	// prepare DOM for YUI Toolbar
8
9
	 $(document).ready(function() {
10
	    $("#newmenuc").empty();
11
	    yuiToolbar();
12
        yuiZ3950button();
13
	 });
14
15
	// YUI Toolbar Functions
16
17
	function yuiToolbar() {
18
	
19
		var newmenu = [
20
			{ text: _("Default Framework"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=" },
21
			[% FOREACH frameworkcodeloo IN frameworkcodeloop %]{ text: "[% frameworkcodeloo.frameworktext %]", url: "/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% frameworkcodeloo.value %]"},
22
[% END %]
23
		]
24
25
	    new YAHOO.widget.Button({
26
	        type: "menu",
27
            label: _("New record"),
28
	        name: "newmenubutton",
29
	        menu: newmenu,
30
	        container: "newmenuc"
31
	    });  
32
	}
33
34
    /* this function open a popup to search on z3950 server.  */
35
    function PopupZ3950() {
36
        var strQuery = GetZ3950Terms();
37
        if(strQuery){
38
            window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=760,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
39
        }
40
    }
41
    /* provide Z3950 search points */
42
    function GetZ3950Terms(){
43
        var strQuery="&frameworkcode=";
44
        [% FOREACH z3950_search_param IN z3950_search_params %]
45
            strQuery += "&" + "[% z3950_search_param.name %]" + "=" + "[% z3950_search_param.encvalue %]";
46
        [% END %]
47
        return strQuery;
48
    }
49
    /* prepare DOM for Z39.50 Search Button */
50
    function yuiZ3950button() {
51
        new YAHOO.widget.Button({
52
                id: "z3950search",
53
                type: "button",
54
                label: _("Z39.50 search"),
55
                container: "newmenuc",
56
                onclick: {fn:function(){PopupZ3950()}}
57
        });
58
    }
59
	//]]>
60
	</script>
61
	
62
  <div id="newmenuc">
63
		<form name="f" action="addbiblio.pl" method="post">
64
        <label for="frameworkcode">New record with framework:</label>
65
			<select name="frameworkcode" id="frameworkcode">
66
				<option value="">Default</option>
67
				[% FOREACH frameworkcodeloo IN frameworkcodeloop %]
68
					<option value="[% frameworkcodeloo.value %]">
69
						[% frameworkcodeloo.frameworktext %]
70
					</option>
71
				[% END %]
72
			</select>
73
			<input type="submit" value="Add Record Without Search" />
74
		</form>
75
        <a id="z3950search" onclick="PopupZ3950(); return false;">Z39.50 search</a>
76
77
  </div>
78
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (-5 / +39 lines)
Lines 3-11 Link Here
3
[% INCLUDE 'greybox.inc' %]
3
[% INCLUDE 'greybox.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
<script type="text/javascript">
5
<script type="text/javascript">
6
	$(document).ready(function() {
6
    //<![CDATA[
7
	$('#header_search').tabs();
7
8
 });
8
     $(document).ready(function() {
9
        $("#z3950search").click(function(){
10
            PopupZ3950();
11
            return false;
12
        });
13
     });
14
15
    /* this function open a popup to search on z3950 server.  */
16
    function PopupZ3950() {
17
        var strQuery = GetZ3950Terms();
18
        if(strQuery){
19
            window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=760,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
20
        }
21
    }
22
    /* provide Z3950 search points */
23
    function GetZ3950Terms(){
24
        var strQuery="&frameworkcode=";
25
        [% FOREACH z3950_search_param IN z3950_search_params %]
26
            strQuery += "&" + "[% z3950_search_param.name %]" + "=" + "[% z3950_search_param.encvalue %]";
27
        [% END %]
28
        return strQuery;
29
    }
30
    //]]>
9
</script>
31
</script>
10
</head>
32
</head>
11
<body id="cat_addbooks" class="cat">
33
<body id="cat_addbooks" class="cat">
Lines 19-25 Link Here
19
   <div id="bd">
41
   <div id="bd">
20
	<div id="yui-main">
42
	<div id="yui-main">
21
43
22
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %][% INCLUDE 'cataloging-toolbar.inc' %][% END %]
44
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
45
  <div id="newmenuc" class="btn-toolbar">
46
        <div class="btn-group">
47
            <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-plus"></i> New record <span class="caret"></span></button>
48
            <ul class="dropdown-menu">
49
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
50
                [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
51
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</a></li>
52
                [% END %]
53
            </ul>
54
        </div>
55
        <div class="btn-group"><a id="z3950search" class="btn btn-small" href="/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% FOREACH z3950_search_param IN z3950_search_params %]&amp;[% z3950_search_param.name %]=[% z3950_search_param.encvalue %][% END %]"><i class="icon-search"></i> Z39.50 search</a></div>
56
  </div>
57
[% END %]
23
58
24
	[% IF ( noitemsfound ) %]
59
	[% IF ( noitemsfound ) %]
25
		No results found
60
		No results found
26
- 

Return to bug 9649