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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (+64 lines)
Lines 4210-4215 input.renew { Link Here
4210
    }
4210
    }
4211
}
4211
}
4212
4212
4213
#toggle-editor {
4214
    display: flex;
4215
    align-items: center;
4216
    float: right;
4217
4218
    label {
4219
        margin-left: 2px;
4220
        margin-bottom: 0;
4221
    }
4222
4223
    .switch {
4224
        position: relative;
4225
        display: inline-block;
4226
        width: 60px;
4227
        height: 24px;
4228
4229
        input {
4230
            opacity: 0;
4231
            width: 0;
4232
            height: 0;
4233
4234
            &:checked {
4235
                + .slider {
4236
                    background-color: #408540;
4237
                }
4238
                + .slider:before {
4239
                    -webkit-transform: translateX(26px);
4240
                    -ms-transform: translateX(26px);
4241
                    transform: translateX(26px);
4242
                }
4243
            }
4244
        }
4245
4246
    }
4247
4248
    .slider {
4249
        position: absolute;
4250
        cursor: pointer;
4251
        top: 0;
4252
        left: 0;
4253
        right: 0;
4254
        bottom: 0;
4255
        background-color: #ccc;
4256
        -webkit-transition: .4s;
4257
        transition: .4s;
4258
        border-radius: 34px;
4259
4260
        &::before {
4261
            position: absolute;
4262
            content: "";
4263
            height: 16px;
4264
            width: 25px;
4265
            left: 4px;
4266
            bottom: 4px;
4267
            background-color: white;
4268
            -webkit-transition: .4s;
4269
            transition: .4s;
4270
            border-radius: 34px;
4271
            text-align: center;
4272
            font-weight: bold;
4273
        }
4274
    }
4275
}
4276
4213
/* Permissions */
4277
/* Permissions */
4214
4278
4215
#permissionstree {
4279
#permissionstree {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-11 / +20 lines)
Lines 976-981 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
976
            });
976
            });
977
    }
977
    }
978
978
979
    function changeEditor() {
980
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
981
982
            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: 'Lax'} );
983
984
            if ( state.backend == 'catalog' ) {
985
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;
986
            } else if ( state.backend == 'new' ) {
987
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl';
988
            } else {
989
                humanMsg.displayAlert( _("Cannot open this record in the basic editor"), { className: 'humanError' } );
990
            }
991
    }
992
979
    $(".macro_shared").change(function(){
993
    $(".macro_shared").change(function(){
980
        if(this.checked){
994
        if(this.checked){
981
            saveMacro(true);
995
            saveMacro(true);
Lines 987-992 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
987
    // END Macro functions
1001
    // END Macro functions
988
1002
989
    $(document).ready( function() {
1003
    $(document).ready( function() {
1004
990
        // Editor setup
1005
        // Editor setup
991
        editor = new MARCEditor( {
1006
        editor = new MARCEditor( {
992
            onCursorActivity: function() {
1007
            onCursorActivity: function() {
Lines 1223-1240 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
1223
            return false;
1238
            return false;
1224
        } );
1239
        } );
1225
1240
1226
        $( '#switch-editor' ).click( function() {
1241
        $( '#toggleEditor' ).change( function() {
1227
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
1242
            changeEditor();
1228
1243
        });
1229
            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: 'Lax'} );
1230
1244
1231
            if ( state.backend == 'catalog' ) {
1245
        $( '#switch-editor' ).click( function() {
1232
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;
1246
            changeEditor();
1233
            } else if ( state.backend == 'new' ) {
1234
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl';
1235
            } else {
1236
                humanMsg.displayAlert( _("Cannot open this record in the basic editor"), { className: 'humanError' } );
1237
            }
1238
        } );
1247
        } );
1239
1248
1240
        $( '#show-advanced-search' ).click( function() {
1249
        $( '#show-advanced-search' ).click( function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-15 / +26 lines)
Lines 36-41 Link Here
36
        $("#loading").hide();
36
        $("#loading").hide();
37
    });
37
    });
38
    var Sticky;
38
    var Sticky;
39
40
    function changeEditor() {
41
42
        var breedingid = [% breedingid || "null" | html %];
43
44
        if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
45
46
        Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
47
48
        var biblionumber = [% biblionumber || "null" | html %];
49
50
        if ( biblionumber ) {
51
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
52
        } else {
53
            window.location = '/cgi-bin/koha/cataloguing/editor.pl';
54
        }
55
56
        return false;
57
    }
58
39
    $(document).ready(function() {
59
    $(document).ready(function() {
40
60
41
        [% IF bib_doesnt_exist %]
61
        [% IF bib_doesnt_exist %]
Lines 151-173 Link Here
151
            return false;
171
            return false;
152
        });
172
        });
153
173
154
        $( '#switcheditor' ).click( function() {
174
        $( '#toggleEditor' ).change( function() {
155
            var breedingid = [% breedingid || "null" | html %];
175
            changeEditor();
156
176
        } );
157
            if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
158
159
            Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
160
161
            var biblionumber = [% biblionumber || "null" | html %];
162
163
            if ( biblionumber ) {
164
                window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
165
            } else {
166
                window.location = '/cgi-bin/koha/cataloguing/editor.pl';
167
            }
168
177
169
            return false;
178
        $( '#switcheditor' ).click( function() {
179
            changeEditor();
170
        } );
180
        } );
181
171
        $(".change-framework").on("click", function(){
182
        $(".change-framework").on("click", function(){
172
            var frameworkcode = $(this).data("frameworkcode");
183
            var frameworkcode = $(this).data("frameworkcode");
173
            $("#frameworkcode").val( frameworkcode );
184
            $("#frameworkcode").val( frameworkcode );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt (-1 / +12 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% PROCESS 'i18n.inc' %]
3
[% PROCESS 'i18n.inc' %]
4
[% USE Koha %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% FILTER collapse %]
6
<title>[% FILTER collapse %]
6
    [% t("Editor") | html %] &rsaquo;
7
    [% t("Editor") | html %] &rsaquo;
Lines 41-48 Link Here
41
        <div class="col-sm-10 col-sm-push-2">
42
        <div class="col-sm-10 col-sm-push-2">
42
            <main>
43
            <main>
43
44
45
[% IF Koha.Preference('EnableAdvancedCatalogingEditor') %]
46
    <div id="toggle-editor">
47
        <label for="toggle-editor">Advanced editor: </label>
48
        <label class="switch">
49
            <input id="toggleEditor" type="checkbox" checked="checked">
50
            <span class="slider"></span>
51
        </label>
52
    </div>
53
[% END %]
54
44
<h1 id="title">Cataloging editor</h1>
55
<h1 id="title">Cataloging editor</h1>
45
56
57
46
<div id="editor">
58
<div id="editor">
47
    <input id="import-records-input" type="file" style="display: none">
59
    <input id="import-records-input" type="file" style="display: none">
48
    <div id="toolbar" class="btn-toolbar">
60
    <div id="toolbar" class="btn-toolbar">
49
- 

Return to bug 34275