@@ -, +, @@ News Tool --- ...bug_22660_add_NewsToolEditor_system_preference.perl | 6 ++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/tools.pref | 8 +++++++- .../intranet-tmpl/prog/en/modules/tools/koha-news.tt | 18 ++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_22660_add_NewsToolEditor_system_preference.perl --- a/installer/data/mysql/atomicupdate/bug_22660_add_NewsToolEditor_system_preference.perl +++ a/installer/data/mysql/atomicupdate/bug_22660_add_NewsToolEditor_system_preference.perl @@ -0,0 +1,6 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES,('NewsToolEditor','tinymce', 'Choose tool for editing News','tinymce|codemirror','Choice')" ); + + NewVersion( $DBversion, XXXXX, "Description"); +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -329,6 +329,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('minPasswordLength','8',NULL,'Specify the minimum length of a patron/staff password','free'), ('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''), ('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'), +('NewsToolEditor','tinymce','tinymce|codemirror','Choose tool for editing News.', 'Choice'), ('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'), ('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before check outs are blocked','Integer'), ('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 +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref @@ -36,7 +36,13 @@ Tools: opac: "OPAC only" staff: "Staff client only" both: "Both OPAC and staff client" - - + - + - Use + - pref: NewsToolEditor + choices: + tinymce: "TinyMCE (WYSIWYG)" + codemirror: "CodeMirror" + - when editing News. Upload: - - Automatically delete temporary uploads older than --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -4,6 +4,12 @@ [% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] +[% Asset.css("lib/codemirror/codemirror.css") | $raw %] + Koha › Tools › News [% INCLUDE 'doc-head-close.inc' %] [% IF ( opac_news_count ) %] @@ -206,6 +212,8 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% MACRO jsinclude BLOCK %] [% INCLUDE 'calendar.inc' %] [% Asset.js("js/tools-menu.js") | $raw %] + [% Asset.js("lib/d3c3/d3.min.js") | $raw %] + [% Asset.js("lib/d3c3/c3.min.js") | $raw %] [% IF ( opac_news_count ) %] [% INCLUDE 'datatables.inc' %] [% END %] + [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %] [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] [% INCLUDE 'str/tinymce_i18n.inc' %] [% END %] --