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 4083-4088 input.renew { Link Here
4083
    }
4083
    }
4084
}
4084
}
4085
4085
4086
#toggle-editor {
4087
    display: flex;
4088
    align-items: center;
4089
    float: right;
4090
4091
    label {
4092
        margin-left: 2px;
4093
        margin-bottom: 0;
4094
    }
4095
4096
    .switch {
4097
        position: relative;
4098
        display: inline-block;
4099
        width: 105px;
4100
        height: 24px;
4101
                
4102
        input {
4103
            opacity: 0;
4104
            width: 0;
4105
            height: 0;
4106
4107
            &:checked {
4108
                + .slider {
4109
                    background-color: #408540;
4110
                }
4111
                + .slider:before {
4112
                    -webkit-transform: translateX(26px);
4113
                    -ms-transform: translateX(26px);
4114
                    transform: translateX(26px);
4115
                }
4116
            }
4117
        }
4118
4119
    }
4120
4121
    .slider {
4122
        position: absolute;
4123
        cursor: pointer;
4124
        top: 0;
4125
        left: 0;
4126
        right: 0;
4127
        bottom: 0;
4128
        background-color: #ccc;
4129
        -webkit-transition: .4s;
4130
        transition: .4s;
4131
        border-radius: 34px;
4132
4133
        &::before {
4134
            position: absolute;
4135
            content: "";
4136
            height: 16px;
4137
            width: 68px;
4138
            left: 4px;
4139
            bottom: 4px;
4140
            background-color: white;
4141
            -webkit-transition: .4s;
4142
            transition: .4s;
4143
            content: attr(data-editor);
4144
            border-radius: 34px;
4145
            text-align: center;
4146
            font-weight: bold;
4147
        }
4148
    }
4149
}
4150
4086
/* Permissions */
4151
/* Permissions */
4087
4152
4088
#permissionstree {
4153
#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 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 138-160 Link Here
138
            return false;
158
            return false;
139
        });
159
        });
140
160
141
        $( '#switcheditor' ).click( function() {
161
        $( '#toggleEditor' ).change( function() {
142
            var breedingid = [% breedingid || "null" | html %];
162
            changeEditor();
143
163
        } );
144
            if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
145
146
            Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
147
148
            var biblionumber = [% biblionumber || "null" | html %];
149
150
            if ( biblionumber ) {
151
                window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber;
152
            } else {
153
                window.location = '/cgi-bin/koha/cataloguing/editor.pl';
154
            }
155
164
156
            return false;
165
        $( '#switcheditor' ).click( function() {
166
            changeEditor();
157
        } );
167
        } );
168
158
        $(".change-framework").on("click", function(){
169
        $(".change-framework").on("click", function(){
159
            var frameworkcode = $(this).data("frameworkcode");
170
            var frameworkcode = $(this).data("frameworkcode");
160
            $("#frameworkcode").val( frameworkcode );
171
            $("#frameworkcode").val( frameworkcode );
Lines 812-817 function PopupMARCFieldDoc(field) { Link Here
812
        <div class="row">
823
        <div class="row">
813
            <div class="col-md-10 col-md-offset-1">
824
            <div class="col-md-10 col-md-offset-1">
814
825
826
                [% IF Koha.Preference('EnableAdvancedCatalogingEditor') %]
827
                    <div id="toggle-editor">
828
                        <label for="toggle-editor">Editor: </label>
829
                        <label class="switch">
830
                            <input id="toggleEditor" type="checkbox">
831
                            <span class="slider" data-editor="Basic"></span>
832
                        </label>
833
                    </div>
834
                [% END %]
835
815
                <div id="check_errors"></div>
836
                <div id="check_errors"></div>
816
837
817
                <h1>
838
                <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