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 4102-4107 input.renew { Link Here
4102
    }
4102
    }
4103
}
4103
}
4104
4104
4105
#toggle-editor {
4106
    display: flex;
4107
    align-items: center;
4108
    float: right;
4109
4110
    label {
4111
        margin-left: 2px;
4112
        margin-bottom: 0;
4113
    }
4114
4115
    .switch {
4116
        position: relative;
4117
        display: inline-block;
4118
        width: 60px;
4119
        height: 24px;
4120
4121
        input {
4122
            opacity: 0;
4123
            width: 0;
4124
            height: 0;
4125
4126
            &:checked {
4127
                + .slider {
4128
                    background-color: #408540;
4129
                }
4130
                + .slider:before {
4131
                    -webkit-transform: translateX(26px);
4132
                    -ms-transform: translateX(26px);
4133
                    transform: translateX(26px);
4134
                }
4135
            }
4136
        }
4137
4138
    }
4139
4140
    .slider {
4141
        position: absolute;
4142
        cursor: pointer;
4143
        top: 0;
4144
        left: 0;
4145
        right: 0;
4146
        bottom: 0;
4147
        background-color: #ccc;
4148
        -webkit-transition: .4s;
4149
        transition: .4s;
4150
        border-radius: 34px;
4151
4152
        &::before {
4153
            position: absolute;
4154
            content: "";
4155
            height: 16px;
4156
            width: 25px;
4157
            left: 4px;
4158
            bottom: 4px;
4159
            background-color: white;
4160
            -webkit-transition: .4s;
4161
            transition: .4s;
4162
            border-radius: 34px;
4163
            text-align: center;
4164
            font-weight: bold;
4165
        }
4166
    }
4167
}
4168
4105
/* Permissions */
4169
/* Permissions */
4106
4170
4107
#permissionstree {
4171
#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 / +36 lines)
Lines 35-40 Link Here
35
        $("#loading").hide();
35
        $("#loading").hide();
36
    });
36
    });
37
    var Sticky;
37
    var Sticky;
38
39
    function changeEditor() {
40
41
        var breedingid = [% breedingid || "null" | html %];
42
43
        if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
44
45
        Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
46
47
        var biblionumber = [% biblionumber || "null" | html %];
48
49
        if ( biblionumber ) {
50
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
51
        } else {
52
            window.location = '/cgi-bin/koha/cataloguing/editor.pl';
53
        }
54
55
        return false;
56
    }
57
38
    $(document).ready(function() {
58
    $(document).ready(function() {
39
59
40
        [% IF bib_doesnt_exist %]
60
        [% IF bib_doesnt_exist %]
Lines 147-169 Link Here
147
            return false;
167
            return false;
148
        });
168
        });
149
169
150
        $( '#switcheditor' ).click( function() {
170
        $( '#toggleEditor' ).change( function() {
151
            var breedingid = [% breedingid || "null" | html %];
171
            changeEditor();
152
172
        } );
153
            if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
154
155
            Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
156
157
            var biblionumber = [% biblionumber || "null" | html %];
158
159
            if ( biblionumber ) {
160
                window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
161
            } else {
162
                window.location = '/cgi-bin/koha/cataloguing/editor.pl';
163
            }
164
173
165
            return false;
174
        $( '#switcheditor' ).click( function() {
175
            changeEditor();
166
        } );
176
        } );
177
167
        $(".change-framework").on("click", function(){
178
        $(".change-framework").on("click", function(){
168
            var frameworkcode = $(this).data("frameworkcode");
179
            var frameworkcode = $(this).data("frameworkcode");
169
            $("#frameworkcode").val( frameworkcode );
180
            $("#frameworkcode").val( frameworkcode );
Lines 837-842 $(document).ready(function(){ Link Here
837
        <div class="row">
848
        <div class="row">
838
            <div class="col-md-10 col-md-offset-1">
849
            <div class="col-md-10 col-md-offset-1">
839
850
851
                [% IF Koha.Preference('EnableAdvancedCatalogingEditor') %]
852
                    <div id="toggle-editor">
853
                        <label for="toggle-editor">Advanced editor: </label>
854
                        <label class="switch">
855
                            <input id="toggleEditor" type="checkbox">
856
                            <span class="slider"></span>
857
                        </label>
858
                    </div>
859
                [% END %]
860
840
                <div id="check_errors"></div>
861
                <div id="check_errors"></div>
841
862
842
                <h1>
863
                <h1>
(-)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