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 155-160 define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], Link Here
155
            cm.execCommand('deleteLine');
156
            cm.execCommand('deleteLine');
156
        },
157
        },
157
158
159
        'Ctrl-L': function( cm ) {
160
            // Launch the auth search popup
161
            var field = cm.marceditor.getCurrentField();
162
163
            if ( !field ) return;
164
            if ( authInfo[field.tag] == undefined ) return;
165
            authtype = authInfo[field.tag].authtypecode;
166
            index = 'rancor';//+field.line+'|'+field.tag;
167
            var mainmainstring = '';
168
            if( field.getSubfields( authInfo[field.tag].subfield ).length != 0 ){
169
                mainmainstring += field.getSubfields( authInfo[field.tag].subfield )[0].text;
170
            }
171
172
            var subfields = field.getSubfields();
173
            var mainstring= '';
174
            for(i=0;i < subfields.length ;i++){
175
                if ( authInfo[field.tag].subfield == subfields[i].code ) continue;
176
                mainstring += subfields[i].text+' ';
177
            }
178
            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');
179
180
        },
181
158
        'Shift-Ctrl-X': function( cm ) {
182
        'Shift-Ctrl-X': function( cm ) {
159
            // Delete subfield
183
            // Delete subfield
160
            var field = cm.marceditor.getCurrentField();
184
            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 (-15 / +33 lines)
Lines 4-9 Link Here
4
<script type="text/javascript">
4
<script type="text/javascript">
5
//<![CDATA[
5
//<![CDATA[
6
    $(document).ready(function(){
6
    $(document).ready(function(){
7
        [% IF tag_number == 'rancor' %]
8
        function RancorReplaceField( new_text ){
9
           var cur_field = opener.opener.jQuery(".CodeMirror")[0].CodeMirror.marceditor.getCurrentField();
10
           cur_field.setText(new_text);
11
           return true;
12
        }
13
            [% IF ( clear ) %]
14
            var new_line = "";
15
            [% ELSE %]
16
            var new_line = "
17
            [%- FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP -%]‡
18
                [%- SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r    ') -%] 
19
                [%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
20
                    [%- marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') -%]
21
                [%- END -%]
22
            [%- END -%]‡9[% authid %]";
23
            [% END %]
24
            RancorReplaceField( new_line );
25
        [% ELSE %]
7
        var index_start = "[% index %]";
26
        var index_start = "[% index %]";
8
        var whichfield;
27
        var whichfield;
9
        try {
28
        try {
Lines 21-27 Link Here
21
            if(nb <= 1) {
40
            if(nb <= 1) {
22
                return true;
41
                return true;
23
            }
42
            }
24
            
43
25
            // Find the subfield we want to clone
44
            // Find the subfield we want to clone
26
            var re = new RegExp('^subfield' + subfield_name,'g');
45
            var re = new RegExp('^subfield' + subfield_name,'g');
27
            var subfields = $(field_start).children('div').filter( function() {
46
            var subfields = $(field_start).children('div').filter( function() {
Lines 52-58 Link Here
52
            // Create the correct number of form fields for all values
71
            // Create the correct number of form fields for all values
53
            // If the field cloning failed, only the first value will be added to the form.
72
            // If the field cloning failed, only the first value will be added to the form.
54
            SetSubfieldNumber(subfield_name, values.length);
73
            SetSubfieldNumber(subfield_name, values.length);
55
            
74
56
            // Find the subfields where we will add the new values
75
            // Find the subfields where we will add the new values
57
            var re = new RegExp('^subfield' + subfield_name,'g');
76
            var re = new RegExp('^subfield' + subfield_name,'g');
58
            var subfields = $(field_start).children('div').filter( function() {
77
            var subfields = $(field_start).children('div').filter( function() {
Lines 71-91 Link Here
71
                i++;
90
                i++;
72
            });
91
            });
73
        }
92
        }
74
75
        [% UNLESS ( clear ) %]
93
        [% UNLESS ( clear ) %]
76
        [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
94
            [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
77
            SetSubfieldValues(
95
                SetSubfieldValues(
78
                "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
96
                    "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
79
            [% FOREACH marc_value IN SUBFIELD_LOO.marc_values %]
97
                [% FOREACH marc_value IN SUBFIELD_LOO.marc_values %]
80
                ,"[% marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
98
                    ,"[% marc_value |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
99
                [% END %]
100
                );
81
            [% END %]
101
            [% END %]
82
            );
102
                var indicators = field_start.getElementsByClassName('indicator flat');
103
                indicators[0].value="[% indicator1 %]";
104
                indicators[1].value="[% indicator2 %]";
83
        [% END %]
105
        [% END %]
84
            var indicators = field_start.getElementsByClassName('indicator flat');
85
            indicators[0].value="[% indicator1 %]";
86
            indicators[1].value="[% indicator2 %]";
87
        [% END %]
88
89
        // browse all its subfields (clear and $9)
106
        // browse all its subfields (clear and $9)
90
        var subfields = field_start.getElementsByTagName('input');
107
        var subfields = field_start.getElementsByTagName('input');
91
        var re = /^tag_\d*_code_/;
108
        var re = /^tag_\d*_code_/;
Lines 105-112 Link Here
105
            [% END %]
122
            [% END %]
106
            }
123
            }
107
        }
124
        }
125
        [% END %]
108
126
109
      	opener.close();
127
       	opener.close();
110
       	window.close();
128
       	window.close();
111
            
129
            
112
       	return false;
130
       	return false;
(-)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.css" />
6
<link rel="stylesheet" href="[% interface %]/lib/codemirror/codemirror.css" />
7
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/humanmsg.css" />
7
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/humanmsg.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.css" />
11
   <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
11
[% END %]
12
[% END %]
Lines 269-274 Link Here
269
            <td>Get help on current subfield</td>
270
            <td>Get help on current subfield</td>
270
        </tr>
271
        </tr>
271
        <tr>
272
        <tr>
273
            <td>Ctrl-L</td>
274
            <td>Link field to authorities</td>
275
        </tr>
276
        <tr>
272
            <td>Ctrl-S</td>
277
            <td>Ctrl-S</td>
273
            <td>Save record</td>
278
            <td>Save record</td>
274
        </tr>
279
        </tr>
275
- 

Return to bug 18904