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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_set_mappings.tt (-17 / +31 lines)
Lines 1-10 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Admin &rsaquo; OAI set mappings</title>
2
<title>Koha &rsaquo; Administration &rsaquo; OAI sets &rsaquo; OAI set mappings</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript">
4
<script type="text/javascript">
5
//<![CDATA[
5
//<![CDATA[
6
$(document).ready(function() {
6
$(document).ready(function() {
7
    // Some JS
7
    $("#mappingform").submit(function(){
8
      hideDialogBox();
9
    });
10
    $("#ORbutton").live("click", function(){
11
       newCondition();
12
       return false;
13
    });
14
    $(".clear-field").live("click",function(e){
15
        clearRow(e.target);
16
    });
8
});
17
});
9
18
10
function newCondition() {
19
function newCondition() {
Lines 13-26 function newCondition() { Link Here
13
    $("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
22
    $("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
14
    $(tr).parent('tbody').append(clone);
23
    $(tr).parent('tbody').append(clone);
15
}
24
}
16
25
function clearRow(link){
26
    var tr = $(link).parent().parent();
27
    var found = tr.find('#ORbutton');
28
    if( found.length ){
29
      tr.find('input[type="text"]').attr("value","");
30
    } else {
31
      tr.find('input[type="text"]').attr("value","").end().hide();
32
    }
33
}
17
function hideDialogBox() {
34
function hideDialogBox() {
18
    $('div.dialog').remove();
35
    $('div.dialog').remove();
19
}
36
}
20
21
function returnToSetsPage() {
22
    window.location.href = "/cgi-bin/koha/admin/oai_sets.pl";
23
}
24
//]]>
37
//]]>
25
</script>
38
</script>
26
</head>
39
</head>
Lines 29-35 function returnToSetsPage() { Link Here
29
[% INCLUDE 'header.inc' %]
42
[% INCLUDE 'header.inc' %]
30
[% INCLUDE 'cat-search.inc' %]
43
[% INCLUDE 'cat-search.inc' %]
31
44
32
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Admin</a> &rsaquo; <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% id %]">OAI set mappings</a></div>
45
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets</a> &rsaquo; <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% id %]">OAI set mappings</a></div>
33
46
34
<div id="doc3" class="yui-t2">
47
<div id="doc3" class="yui-t2">
35
48
Lines 37-52 function returnToSetsPage() { Link Here
37
  <div id="yui-main">
50
  <div id="yui-main">
38
    <div class="yui-b">
51
    <div class="yui-b">
39
      [% IF ( mappings_saved ) %]
52
      [% IF ( mappings_saved ) %]
40
        <div class="dialog">
53
        <div class="dialog message">
41
          <p>Mappings have been saved</p>
54
          <h4>Mappings have been saved</h4>
42
          <p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
55
          <p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
43
        </div>
56
        </div>
44
      [% END %]
57
      [% END %]
45
      <h1>Mappings for set '[% setName %]' ([% setSpec %])</h1>
58
      <h1>Mappings for set '[% setName %]' ([% setSpec %])</h1>
46
      [% UNLESS ( mappings ) %]
59
      [% UNLESS ( mappings ) %]
47
        <p class="warning">Warning: no mappings defined for this set</p>
60
        <div class="dialog alert"><p><strong>Warning:</strong> No mappings have been defined for this set</p></div>
48
      [% END %]
61
      [% END %]
49
      <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" onsubmit="hideDialogBox();">
62
      <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
50
        <table id="mappings">
63
        <table id="mappings">
51
          <thead>
64
          <thead>
52
            <tr>
65
            <tr>
Lines 55-60 function returnToSetsPage() { Link Here
55
              <th>&nbsp;</th>
68
              <th>&nbsp;</th>
56
              <th>Value</th>
69
              <th>Value</th>
57
              <th>&nbsp;</th>
70
              <th>&nbsp;</th>
71
              <th>&nbsp;</th>
58
            </tr>
72
            </tr>
59
          </thead>
73
          </thead>
60
          <tbody>
74
          <tbody>
Lines 67-77 function returnToSetsPage() { Link Here
67
                  <td><input type="text" name="marcvalue" value="[% mapping.marcvalue %]" /></td>
81
                  <td><input type="text" name="marcvalue" value="[% mapping.marcvalue %]" /></td>
68
                  <td style="text-align:center">
82
                  <td style="text-align:center">
69
                    [% IF ( loop.last ) %]
83
                    [% IF ( loop.last ) %]
70
                      <input type="button" id="ORbutton" value="OR" onclick="newCondition()"/>
84
                      <input type="button" id="ORbutton" value="OR" title="Add another condition" />
71
                    [% ELSE %]
85
                    [% ELSE %]
72
                      OR
86
                      OR
73
                    [% END %]
87
                    [% END %]
74
                  </td>
88
                  </td>
89
                  <td><a class="clear-field" href="#">Clear</a></td>
75
                </tr>
90
                </tr>
76
              [% END %]
91
              [% END %]
77
            [% ELSE %]
92
            [% ELSE %]
Lines 80-96 function returnToSetsPage() { Link Here
80
                <td style="text-align:center"><input type="text" name="marcsubfield" size="1" /></td>
95
                <td style="text-align:center"><input type="text" name="marcsubfield" size="1" /></td>
81
                <td>is equal to</td>
96
                <td>is equal to</td>
82
                <td><input type="text" name="marcvalue" /></td>
97
                <td><input type="text" name="marcvalue" /></td>
83
                <td><input type="button" id="ORbutton" value="OR" onclick="newCondition()"/></td>
98
                <td><input type="button" id="ORbutton" value="OR" /></td>
99
                <td><a class="clear-field" href="#">Clear</a></td>
84
              </tr>
100
              </tr>
85
            [% END %]
101
            [% END %]
86
          </tbody>
102
          </tbody>
87
        </table>
103
        </table>
88
        <p class="hint">Hint: to delete a line, empty at least one of the text fields in this line</p>
89
        <input type="hidden" name="id" value="[% id %]" />
104
        <input type="hidden" name="id" value="[% id %]" />
90
        <input type="hidden" name="op" value="save" />
105
        <input type="hidden" name="op" value="save" />
91
        <fieldset class="action">
106
        <fieldset class="action">
92
            <input type="submit" value="Save" />
107
            <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
93
            <input type="button" value="Cancel" onclick="returnToSetsPage();" />
94
        </fieldset>
108
        </fieldset>
95
      </form>
109
      </form>
96
110
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_sets.tt (-55 / +43 lines)
Lines 1-13 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Admin &rsaquo; OAI sets</title>
2
<title>Koha &rsaquo; Administration &rsaquo; [% IF ( op_new ) %]OAI sets configuration &rsaquo; Add a new OAI set[% ELSE %]OAI sets configuration[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript">
4
<script type="text/javascript">
5
//<![CDATA[
5
//<![CDATA[
6
function newDescField() {
6
function newDescField() {
7
    $("#descriptionlist").append(
7
    $("#adddescription").before(
8
        '<li>' +
8
        '<li><label>setDescription: </label>' +
9
        '<textarea style="vertical-align:middle" name="description"></textarea>' +
9
        '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
10
        '<a style="cursor:pointer" onclick="delDescField(this)">&nbsp;&times;</a>' +
10
        '<a onclick="delDescField(this); return false;" class="clear-field" href="#">Remove</a>' +
11
        '</li>'
11
        '</li>'
12
    );
12
    );
13
}
13
}
Lines 18-24 function delDescField(minusButton) { Link Here
18
}
18
}
19
19
20
$(document).ready(function() {
20
$(document).ready(function() {
21
    // Some JS
21
    new YAHOO.widget.Button("newoaiset");
22
});
22
});
23
//]]>
23
//]]>
24
</script>
24
</script>
Lines 28-94 $(document).ready(function() { Link Here
28
[% INCLUDE 'header.inc' %]
28
[% INCLUDE 'header.inc' %]
29
[% INCLUDE 'cat-search.inc' %]
29
[% INCLUDE 'cat-search.inc' %]
30
30
31
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Admin</a> &rsaquo; OAI sets</div>
31
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF ( op_new ) %]<a href="http://localhost:8888/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> &rsaquo; Add a new OAI set[% ELSIF ( op_mod ) %]<a href="http://localhost:8888/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> &rsaquo; Modify OAI set '[% spec %]'[% ELSE %] OAI sets configuration[% END %]</div>
32
32
33
<div id="doc3" class="yui-t2">
33
<div id="doc3" class="yui-t2">
34
34
35
<div id="bd">
35
<div id="bd">
36
  <div id="yui-main">
36
  <div id="yui-main">
37
    <div class="yui-b">
37
    <div class="yui-b">
38
      <h1>OAI sets configuration</h1>
38
        [% IF ( op_new || op_mod ) %]
39
40
        [% IF op_new %]
41
            <h2>Add a new set</h2>
42
            <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
39
            <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
40
            [% IF ( op_new ) %]
41
                <h2>Add a new OAI set</h2>
43
                <input type="hidden" name="op" value="savenew" />
42
                <input type="hidden" name="op" value="savenew" />
44
                <fieldset>
43
            [% ELSIF ( op_mod ) %]
45
                    <label for="spec">setSpec</label>
44
                <h2>Modify OAI set '[% spec %]'</h2>
46
                    <input type="text" id="spec" name="spec" />
45
                    <input type="hidden" name="op" value="savemod" />
47
                    <br />
46
                    <input type="hidden" name="id" value="[% id %]" />
48
                    <label for="name">setName</label>
47
            [% END %]
49
                    <input type="text" id="name" name="name" />
48
                <fieldset id="oaidetails" class="rows">
50
                    <br />
49
                    <ol>
51
                    <label>setDescriptions</label>
50
                        <li>
52
                    <ul id="descriptionlist">
51
                            <label for="spec" class="required">setSpec: </label>
53
                    </ul>
52
                            <input type="text" id="spec" name="spec" value="[% spec %]" />
54
                    <a style="cursor:pointer" onclick='newDescField()'>Add description</a>
53
                        </li>
55
                </fieldset>
54
                        <li>
56
                <input type="submit" value="Save" />
55
                            <label for="name" class="required">setName: </label>
57
                <input type="button" value="Cancel" onclick="window.location.href = '/cgi-bin/koha/admin/oai_sets.pl'" />
56
                            <input type="text" id="name" name="name" value="[% name %]" />
58
            </form>
57
                        </li>
59
        [% ELSE %][% IF op_mod %]
60
            <h2>Modify set '[% spec %]'</h2>
61
            <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
62
                <input type="hidden" name="op" value="savemod" />
63
                <input type="hidden" name="id" value="[% id %]" />
64
                <fieldset>
65
                    <label for="spec">setSpec</label>
66
                    <input type="text" id="spec" name="spec" value="[% spec %]" />
67
                    <br />
68
                    <label for="name">setName</label>
69
                    <input type="text" id="name" name="name" value="[% name %]" />
70
                    <br />
71
                    <label>setDescriptions</label>
72
                    <ul id="descriptionlist">
73
                        [% FOREACH desc IN descriptions %]
58
                        [% FOREACH desc IN descriptions %]
74
                            <li>
59
                            <li>
75
                                <textarea style="vertical-align:middle" name="description">[% desc.description %]</textarea>
60
                                <label>setDescription: </label>
76
                                <a style="cursor:pointer" onclick="delDescField(this)">&nbsp;&times;</a>
61
                                <textarea style="vertical-align:middle" rows="2" cols="30" name="description">[% desc.description %]</textarea>
62
                                <a onclick="delDescField(this); return false;" class="clear-field" href="#">Remove</a>
77
                            </li>
63
                            </li>
78
                        [% END %]
64
                        [% END %]
79
                    </ul>
65
                        <li id="adddescription"><span class="label">&nbsp;</span><a class="clone-field" href="#" onclick='newDescField(); return false;'>Add description</a></li>
80
                    <a style="cursor:pointer" onclick='newDescField()'>Add description</a>
66
67
                    </ol>
68
                </fieldset>
69
                <fieldset class="action">
70
                    <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
81
                </fieldset>
71
                </fieldset>
82
                <input type="submit" value="Save" />
83
                <input type="button" value="Cancel" onclick="window.location.href = '/cgi-bin/koha/admin/oai_sets.pl'" />
84
            </form>
72
            </form>
85
        [% END %]
73
        [% ELSE %]
86
        [% END %]
87
74
88
        <h2>List of sets</h2>
75
        <div id="toolbar">
89
        [% UNLESS ( op_new ) %]
76
            <ul class="toolbar">
90
            <a href="/cgi-bin/koha/admin/oai_sets.pl?op=new">Add a new set</a>
77
            <li><a id="newoaiset" href="/cgi-bin/koha/admin/oai_sets.pl?op=new">New set</a></li>
91
        [% END %]
78
        </ul></div>
79
80
        <h2>OAI sets</h2>
92
        [% IF sets_loop %]
81
        [% IF sets_loop %]
93
            <table>
82
            <table>
94
                <thead>
83
                <thead>
Lines 127-135 $(document).ready(function() { Link Here
127
                </tbody>
116
                </tbody>
128
            </table>
117
            </table>
129
        [% ELSE %]
118
        [% ELSE %]
130
            <p>There is no set defined.</p>
119
            <div class="dialog message"><p>There are no sets defined.</p></div>
120
        [% END %]
131
        [% END %]
121
        [% END %]
132
133
122
134
    </div>
123
    </div>
135
  </div>
124
  </div>
136
- 

Return to bug 8906