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

(-)a/installer/data/mysql/atomicupdate/bug_22660_add_NewsToolEditor_system_preference.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('NewsToolEditor','tinymce', 'Choose tool for editing News','tinymce|codemirror','Choice')" );
4
5
    NewVersion( $DBversion, 22660, "Adds NewsToolEditor system preference");
6
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 330-335 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
330
('minPasswordLength','8',NULL,'Specify the minimum length of a patron/staff password','free'),
330
('minPasswordLength','8',NULL,'Specify the minimum length of a patron/staff password','free'),
331
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
331
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
332
('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'),
332
('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'),
333
('NewsToolEditor','tinymce','tinymce|codemirror','Choose tool for editing News.', 'Choice'),
333
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
334
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
334
('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before check outs are blocked','Integer'),
335
('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before check outs are blocked','Integer'),
335
('noItemTypeImages','0',NULL,'If ON, disables itemtype images in the staff interface','YesNo'),
336
('noItemTypeImages','0',NULL,'If ON, disables itemtype images in the staff interface','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref (-1 / +7 lines)
Lines 36-42 Tools: Link Here
36
                  opac: "OPAC only"
36
                  opac: "OPAC only"
37
                  staff: "Staff client only"
37
                  staff: "Staff client only"
38
                  both: "Both OPAC and staff client"
38
                  both: "Both OPAC and staff client"
39
            -
39
        -
40
            - Use
41
            - pref: NewsToolEditor
42
              choices:
43
                  tinymce: "TinyMCE (WYSIWYG)"
44
                  codemirror: "CodeMirror"
45
            - when editing News.
40
    Upload:
46
    Upload:
41
        -
47
        -
42
            - Automatically delete temporary uploads older than
48
            - Automatically delete temporary uploads older than
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (-1 / +17 lines)
Lines 4-9 Link Here
4
[% USE Branches %]
4
[% USE Branches %]
5
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% Asset.css("lib/codemirror/codemirror.css") | $raw %]
8
<style>
9
.CodeMirror {
10
    resize: vertical;
11
}
12
</style>
7
<title>Koha &rsaquo; Tools &rsaquo; News</title>
13
<title>Koha &rsaquo; Tools &rsaquo; News</title>
8
[% INCLUDE 'doc-head-close.inc' %]
14
[% INCLUDE 'doc-head-close.inc' %]
9
[% IF ( opac_news_count ) %]
15
[% IF ( opac_news_count ) %]
Lines 206-211 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
206
[% MACRO jsinclude BLOCK %]
212
[% MACRO jsinclude BLOCK %]
207
    [% INCLUDE 'calendar.inc' %]
213
    [% INCLUDE 'calendar.inc' %]
208
    [% Asset.js("js/tools-menu.js") | $raw %]
214
    [% Asset.js("js/tools-menu.js") | $raw %]
215
    [% Asset.js("lib/d3c3/d3.min.js") | $raw %]
216
    [% Asset.js("lib/d3c3/c3.min.js") | $raw %]
209
    [% IF ( opac_news_count ) %]
217
    [% IF ( opac_news_count ) %]
210
        [% INCLUDE 'datatables.inc' %]
218
        [% INCLUDE 'datatables.inc' %]
211
        <script>
219
        <script>
Lines 292-300 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
292
            });
300
            });
293
        </script>
301
        </script>
294
    [% END %]
302
    [% END %]
303
    [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
295
    [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %]
304
    [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %]
296
    [% INCLUDE 'str/tinymce_i18n.inc' %]
305
    [% INCLUDE 'str/tinymce_i18n.inc' %]
297
    <script>
306
    <script>
307
        [% IF Koha.Preference('NewsToolEditor') == 'codemirror' %]
308
        var editor = CodeMirror.fromTextArea(document.getElementById('content'), {
309
            lineNumbers: true,
310
            mode: "text/html",
311
            lineWrapping: true
312
        });
313
        [% ELSE %]
298
        tinyMCE.init({
314
        tinyMCE.init({
299
            verify_html: false,
315
            verify_html: false,
300
            force_br_newlines : false,
316
            force_br_newlines : false,
Lines 311-316 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
311
                "table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code visualaid help"
327
                "table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code visualaid help"
312
            ],
328
            ],
313
        });
329
        });
330
        [% END %]
314
    </script>
331
    </script>
315
[% END %]
332
[% END %]
316
333
317
- 

Return to bug 22660