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

(-)a/cataloguing/editor.pl (+4 lines)
Lines 29-34 use C4::Context; Link Here
29
use C4::Output;
29
use C4::Output;
30
use DBIx::Class::ResultClass::HashRefInflator;
30
use DBIx::Class::ResultClass::HashRefInflator;
31
use Koha::Database;
31
use Koha::Database;
32
use Koha::MarcSubfieldStructures;
32
33
33
my $input = CGI->new;
34
my $input = CGI->new;
34
35
Lines 56-61 $template->{VARS}->{editable_batches} = [ $schema->resultset('ImportBatch')->sea Link Here
56
# Needed information for cataloging plugins
57
# Needed information for cataloging plugins
57
$template->{VARS}->{DefaultLanguageField008} = pack( 'A3', C4::Context->preference('DefaultLanguageField008') || 'eng' );
58
$template->{VARS}->{DefaultLanguageField008} = pack( 'A3', C4::Context->preference('DefaultLanguageField008') || 'eng' );
58
59
60
my $authtags = Koha::MarcSubfieldStructures->search({ authtypecode => { '!=' => '' }, 'frameworkcode' => '' });
61
$template->{VARS}->{authtags} = $authtags;
62
59
# Z39.50 servers
63
# Z39.50 servers
60
my $dbh = C4::Context->dbh;
64
my $dbh = C4::Context->dbh;
61
$template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
65
$template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js (+24 lines)
Lines 18-23 Link Here
18
 */
18
 */
19
19
20
define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], function( MARC, KohaBackend, Preferences, TextMARC, Widget ) {
20
define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], function( MARC, KohaBackend, Preferences, TextMARC, Widget ) {
21
21
    var NOTIFY_TIMEOUT = 250;
22
    var NOTIFY_TIMEOUT = 250;
22
23
23
    function editorCursorActivity( cm ) {
24
    function editorCursorActivity( cm ) {
Lines 163-168 define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], Link Here
163
            cm.execCommand('deleteLine');
164
            cm.execCommand('deleteLine');
164
        },
165
        },
165
166
167
        'Ctrl-L': function( cm ) {
168
            // Launch the auth search popup
169
            var field = cm.marceditor.getCurrentField();
170
171
            if ( !field ) return;
172
            if ( authInfo[field.tag] == undefined ) return;
173
            authtype = authInfo[field.tag].authtypecode;
174
            index = 'rancor';//+field.line+'|'+field.tag;
175
            var mainmainstring = '';
176
            if( field.getSubfields( authInfo[field.tag].subfield ).length != 0 ){
177
                mainmainstring += field.getSubfields( authInfo[field.tag].subfield )[0].text;
178
            }
179
180
            var subfields = field.getSubfields();
181
            var mainstring= '';
182
            for(i=0;i < subfields.length ;i++){
183
                if ( authInfo[field.tag].subfield == subfields[i].code ) continue;
184
                mainstring += subfields[i].text+' ';
185
            }
186
            newin=window.open("../authorities/auth_finder.pl?source=biblio&authtypecode="+authtype+"&index="+index+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
187
188
        },
189
166
        'Shift-Ctrl-X': function( cm ) {
190
        'Shift-Ctrl-X': function( cm ) {
167
            // Delete subfield
191
            // Delete subfield
168
            var field = cm.marceditor.getCurrentField();
192
            var field = cm.marceditor.getCurrentField();
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (+8 lines)
Lines 3-8 Link Here
3
<script src="[% interface %]/lib/koha/cateditor/marc-mode.js"></script>
3
<script src="[% interface %]/lib/koha/cateditor/marc-mode.js"></script>
4
<script src="[% interface %]/lib/require.js"></script>
4
<script src="[% interface %]/lib/require.js"></script>
5
<script>
5
<script>
6
    var authInfo = {
7
        [%- FOREACH authtag = authtags -%]
8
            [% authtag.tagfield %]: {
9
                subfield: '[% authtag.tagsubfield %]',
10
                authtypecode: '[% authtag.authtypecode %]',
11
                },
12
        [%- END -%]
13
    };
6
require.config( {
14
require.config( {
7
    baseUrl: '[% interface %]/lib/koha/cateditor/',
15
    baseUrl: '[% interface %]/lib/koha/cateditor/',
8
    config: {
16
    config: {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt (-6 / +27 lines)
Lines 19-24 Link Here
19
[% MACRO jsinclude BLOCK %]
19
[% MACRO jsinclude BLOCK %]
20
    <script type="text/javascript">
20
    <script type="text/javascript">
21
        $(document).ready(function(){
21
        $(document).ready(function(){
22
            [% IF tag_number == 'rancor' %]
23
            function RancorReplaceField( new_text ){
24
                var cur_field = opener.opener.jQuery(".CodeMirror")[0].CodeMirror.marceditor.getCurrentField();
25
                cur_field.setText(new_text);
26
                return true;
27
            }
28
                [% IF ( clear ) %]
29
                var new_line = "";
30
                [% ELSE %]
31
                var new_line = "
32
                [%- FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP -%]‡
33
                    [%- SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r    ') -%]
34
                    [%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
35
                        [%- marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') -%]
36
                    [%- END -%]
37
                [%- END -%]‡9[% authid %]";
38
                [% END %]
39
                RancorReplaceField( new_line );
40
            [% ELSE %]
22
            var index_start = "[% index %]";
41
            var index_start = "[% index %]";
23
            var whichfield;
42
            var whichfield;
24
            try {
43
            try {
Lines 88-100 Link Here
88
            }
107
            }
89
108
90
            [% UNLESS ( clear ) %]
109
            [% UNLESS ( clear ) %]
91
            [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
110
                [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
92
                SetSubfieldValues(
111
                    SetSubfieldValues(
93
                    "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
112
                        "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
94
                [% FOREACH marc_value IN SUBFIELD_LOO.marc_values %]
113
                    [% FOREACH marc_value IN SUBFIELD_LOO.marc_values %]
95
                    ,"[% marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
114
                        ,"[% marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
115
                    [% END %]
116
                    );
96
                [% END %]
117
                [% END %]
97
                );
98
            [% END %]
118
            [% END %]
99
                var indicators = field_start.getElementsByClassName('indicator flat');
119
                var indicators = field_start.getElementsByClassName('indicator flat');
100
                [% IF update_ind1 %]
120
                [% IF update_ind1 %]
Lines 124-129 Link Here
124
                [% END %]
144
                [% END %]
125
                }
145
                }
126
            }
146
            }
147
            [% END %]
127
148
128
            opener.close();
149
            opener.close();
129
            window.close();
150
            window.close();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt (-1 / +5 lines)
Lines 6-11 Link Here
6
<link rel="stylesheet" href="[% interface %]/lib/codemirror/codemirror_[% KOHA_VERSION %].css" />
6
<link rel="stylesheet" href="[% interface %]/lib/codemirror/codemirror_[% KOHA_VERSION %].css" />
7
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/humanmsg_[% KOHA_VERSION %].css" />
7
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/humanmsg_[% KOHA_VERSION %].css" />
8
<script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
8
<script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
9
<script src="/intranet-tmpl/prog/js/cataloging.js" type="text/javascript"></script>
9
[% IF ( bidi ) %]
10
[% IF ( bidi ) %]
10
   <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left_[% KOHA_VERSION %].css" />
11
   <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left_[% KOHA_VERSION %].css" />
11
[% END %]
12
[% END %]
Lines 277-282 Link Here
277
            <td>Get help on current subfield</td>
278
            <td>Get help on current subfield</td>
278
        </tr>
279
        </tr>
279
        <tr>
280
        <tr>
281
            <td>Ctrl-L</td>
282
            <td>Link field to authorities</td>
283
        </tr>
284
        <tr>
280
            <td>Ctrl-S</td>
285
            <td>Ctrl-S</td>
281
            <td>Save record</td>
286
            <td>Save record</td>
282
        </tr>
287
        </tr>
283
- 

Return to bug 18904