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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (+65 lines)
Lines 4101-4106 input.renew { Link Here
4101
    }
4101
    }
4102
}
4102
}
4103
4103
4104
#toggle-editor {
4105
    display: flex;
4106
    align-items: center;
4107
    float: right;
4108
4109
    label {
4110
        margin-left: 2px;
4111
        margin-bottom: 0;
4112
    }
4113
4114
    .switch {
4115
        position: relative;
4116
        display: inline-block;
4117
        width: 105px;
4118
        height: 24px;
4119
4120
        input {
4121
            opacity: 0;
4122
            width: 0;
4123
            height: 0;
4124
4125
            &:checked {
4126
                + .slider {
4127
                    background-color: #408540;
4128
                }
4129
                + .slider:before {
4130
                    -webkit-transform: translateX(26px);
4131
                    -ms-transform: translateX(26px);
4132
                    transform: translateX(26px);
4133
                }
4134
            }
4135
        }
4136
4137
    }
4138
4139
    .slider {
4140
        position: absolute;
4141
        cursor: pointer;
4142
        top: 0;
4143
        left: 0;
4144
        right: 0;
4145
        bottom: 0;
4146
        background-color: #ccc;
4147
        -webkit-transition: .4s;
4148
        transition: .4s;
4149
        border-radius: 34px;
4150
4151
        &::before {
4152
            position: absolute;
4153
            content: "";
4154
            height: 16px;
4155
            width: 68px;
4156
            left: 4px;
4157
            bottom: 4px;
4158
            background-color: white;
4159
            -webkit-transition: .4s;
4160
            transition: .4s;
4161
            content: attr(data-editor);
4162
            border-radius: 34px;
4163
            text-align: center;
4164
            font-weight: bold;
4165
        }
4166
    }
4167
}
4168
4104
/* Permissions */
4169
/* Permissions */
4105
4170
4106
#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 1222-1239 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
1222
            return false;
1237
            return false;
1223
        } );
1238
        } );
1224
1239
1225
        $( '#switch-editor' ).click( function() {
1240
        $( '#toggleEditor' ).change( function() {
1226
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
1241
            changeEditor();
1227
1242
        });
1228
            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: 'Lax'} );
1229
1243
1230
            if ( state.backend == 'catalog' ) {
1244
        $( '#switch-editor' ).click( function() {
1231
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;
1245
            changeEditor();
1232
            } else if ( state.backend == 'new' ) {
1233
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl';
1234
            } else {
1235
                humanMsg.displayAlert( _("Cannot open this record in the basic editor"), { className: 'humanError' } );
1236
            }
1237
        } );
1246
        } );
1238
1247
1239
        $( '#show-advanced-search' ).click( function() {
1248
        $( '#show-advanced-search' ).click( function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-15 / +36 lines)
Lines 26-31 Link Here
26
        $("#loading").hide();
26
        $("#loading").hide();
27
    });
27
    });
28
    var Sticky;
28
    var Sticky;
29
30
    function changeEditor() {
31
32
        var breedingid = [% breedingid || "null" | html %];
33
34
        if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
35
36
        Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
37
38
        var biblionumber = [% biblionumber || "null" | html %];
39
40
        if ( biblionumber ) {
41
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
42
        } else {
43
            window.location = '/cgi-bin/koha/cataloguing/editor.pl';
44
        }
45
46
        return false;
47
    }
48
29
    $(document).ready(function() {
49
    $(document).ready(function() {
30
50
31
        [% IF bib_doesnt_exist %]
51
        [% IF bib_doesnt_exist %]
Lines 136-158 Link Here
136
            return false;
156
            return false;
137
        });
157
        });
138
158
139
        $( '#switcheditor' ).click( function() {
159
        $( '#toggleEditor' ).change( function() {
140
            var breedingid = [% breedingid || "null" | html %];
160
            changeEditor();
141
161
        } );
142
            if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
143
144
            Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
145
146
            var biblionumber = [% biblionumber || "null" | html %];
147
148
            if ( biblionumber ) {
149
                window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
150
            } else {
151
                window.location = '/cgi-bin/koha/cataloguing/editor.pl';
152
            }
153
162
154
            return false;
163
        $( '#switcheditor' ).click( function() {
164
            changeEditor();
155
        } );
165
        } );
166
156
        $(".change-framework").on("click", function(){
167
        $(".change-framework").on("click", function(){
157
            var frameworkcode = $(this).data("frameworkcode");
168
            var frameworkcode = $(this).data("frameworkcode");
158
            $("#frameworkcode").val( frameworkcode );
169
            $("#frameworkcode").val( frameworkcode );
Lines 823-828 function PopupMARCFieldDoc(field) { Link Here
823
        <div class="row">
834
        <div class="row">
824
            <div class="col-md-10 col-md-offset-1">
835
            <div class="col-md-10 col-md-offset-1">
825
836
837
                [% IF Koha.Preference('EnableAdvancedCatalogingEditor') %]
838
                    <div id="toggle-editor">
839
                        <label for="toggle-editor">Editor: </label>
840
                        <label class="switch">
841
                            <input id="toggleEditor" type="checkbox">
842
                            <span class="slider" data-editor="Basic"></span>
843
                        </label>
844
                    </div>
845
                [% END %]
846
826
                <div id="check_errors"></div>
847
                <div id="check_errors"></div>
827
848
828
                <h1>
849
                <h1>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (+31 lines)
Lines 130-135 Link Here
130
                                            [% END %]
130
                                            [% END %]
131
                                        </td>
131
                                        </td>
132
                                        <td>
132
                                        <td>
133
                                        [% IF (resultsloo.availablecount ) %]
134
                                            <div class="available_items_loop_items">
135
                                                [% FOREACH items_loo IN resultsloo.available_items_loop %]
136
                                                    [% items_loo.branchname | html %]
137
                                                    [% IF ( items_loo.location ) %]<span class="shelvingloc">[% items_loo.location | html %]</span>[% END %]
138
                                                    [% IF ( items_loo.itemcallnumber ) %][% items_loo.itemcallnumber | html %][% END %]
139
                                                    [% IF ( items_loo.classification ) %]
140
                                                        <a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:[% items_loo.classification |url %]">
141
                                                            [% items_loo.classification | html %]
142
                                                        </a>
143
                                                    [% END %]
144
                                                [% END %]
145
                                            </div>
146
                                        [% END %]
147
                                        [% IF ( resultsloo.onloancount ) %]
148
                                            <div class="onloan_items_loop_items">
149
                                                <div class="results_checkedout">[% resultsloo.onloancount | html %] checked out:</div>
150
                                                [% FOREACH items_loo IN resultsloo.onloan_items_loop %]
151
                                                    [% items_loo.branchname | html %]
152
                                                    [% IF ( items_loo.location ) %]<span class="shelvingloc">[% items_loo.location | html %]</span>[% END %]
153
                                                    [% IF ( items_loo.itemcallnumber ) %][% items_loo.itemcallnumber | html %][% END %]
154
                                                    [% IF ( items_loo.classification ) %]
155
                                                        <a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:[% items_loo.classification |url %]">
156
                                                            [% items_loo.classification | html %]
157
                                                        </a>
158
                                                    [% END %]
159
                                                [% END %]
160
                                            </div>
161
                                        [% END %]
162
                                        <!--
133
                                            [% IF ( resultsloo.available_items_loop ) %]
163
                                            [% IF ( resultsloo.available_items_loop ) %]
134
                                                <span class="available">
164
                                                <span class="available">
135
                                                    [% FOREACH items_loo IN resultsloo.available_items_loop %]
165
                                                    [% FOREACH items_loo IN resultsloo.available_items_loop %]
Lines 159-164 Link Here
159
                                                    [% END %]
189
                                                    [% END %]
160
                                                [% END %]
190
                                                [% END %]
161
                                            </span>
191
                                            </span>
192
-->
162
                                        </td>
193
                                        </td>
163
                                        <td>
194
                                        <td>
164
                                            <div class="dropup">
195
                                            <div class="dropup">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt (-1 / +12 lines)
Lines 1-5 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Editor &rsaquo; Cataloging &rsaquo; Koha</title>
5
<title>Editor &rsaquo; Cataloging &rsaquo; Koha</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
Lines 36-43 Link Here
36
        <div class="col-sm-10 col-sm-push-2">
37
        <div class="col-sm-10 col-sm-push-2">
37
            <main>
38
            <main>
38
39
40
[% IF Koha.Preference('EnableAdvancedCatalogingEditor') %]
41
    <div id="toggle-editor">
42
        <label for="toggle-editor">Editor: </label>
43
        <label class="switch">
44
            <input id="toggleEditor" type="checkbox" checked="checked">
45
            <span class="slider" data-editor="Advanced"></span>
46
        </label>
47
    </div>
48
[% END %]
49
39
<h1 id="title">Cataloging editor</h1>
50
<h1 id="title">Cataloging editor</h1>
40
51
52
41
<div id="editor">
53
<div id="editor">
42
    <input id="import-records-input" type="file" style="display: none">
54
    <input id="import-records-input" type="file" style="display: none">
43
    <div id="toolbar" class="btn-toolbar">
55
    <div id="toolbar" class="btn-toolbar">
44
- 

Return to bug 34275