Bugzilla – Attachment 40982 Details for
Bug 11584
Add wysiwyg editor to system preferences dealing with HTML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11584 - Add wysiwyg editor to system preferences dealing with HTML (add system preference)
Bug-11584---Add-wysiwyg-editor-to-system-preferenc.patch (text/plain), 15.14 KB, created by
David Cook
on 2015-07-14 07:16:53 UTC
(
hide
)
Description:
Bug 11584 - Add wysiwyg editor to system preferences dealing with HTML (add system preference)
Filename:
MIME Type:
Creator:
David Cook
Created:
2015-07-14 07:16:53 UTC
Size:
15.14 KB
patch
obsolete
>From 63e17d34d299d1543d5423ca396b5c3e7afb263c Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 14 Jul 2015 17:02:17 +1000 >Subject: [PATCH] Bug 11584 - Add wysiwyg editor to system preferences dealing > with HTML (add system preference) > >This patch adds a system preference "UseWYSIWYGinSystemPreferences" to the Staff Client tab. > >By default, it is off, which means that the TinyMCE WYSIWYG editor won't be shown for system >preferences with a type of "htmlarea". > >However, when it's on, it will show the editor for "Local Use" preferences with a "htmlarea" >type, and for other system preferences in the "Opac", "Circulation", and "Staff Client" tabs, >which I have re-assigned. (Basically, I grepped for HTML and changed the type for all >the system preferences I found except for "IntranetNav", "OpacCustomSearch", and "OPACSearchForTitleIn", >as a WYSIWYG editor would potentially break the output for these system preferences or >add no value to them...) > >_TEST PLAN_ > >0) Run `perl installer/data/mysql/updatedatabase.pl` after setting your environmental variables >1) Check the Opac tab to make sure that the WYSIWYG is nowhere to be seen >2) Change the "UseWYSIWYGinSystemPreferences" preference in "Staff Client" to "Show" >3) Refresh the Opac tab and notice that many system preferences now have a WYSIWYG editor > >4) Try typing some text into these fields >5) Note that it gets marked as "modified" >6) Save the preference, and refresh the page >7) Note that the content has been saved >8) Take a look at how it's rendered on the actual webpage! >--- > ...4-add_UseWYSIWYGinSystemPreferences_syspref.sql | 1 + > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences.tt | 13 ++++++++----- > .../en/modules/admin/preferences/circulation.pref | 2 +- > .../prog/en/modules/admin/preferences/opac.pref | 22 +++++++++++----------- > .../en/modules/admin/preferences/staff_client.pref | 8 +++++++- > .../prog/en/modules/admin/systempreferences.tt | 22 +++++++++++++--------- > 7 files changed, 42 insertions(+), 27 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_11584-add_UseWYSIWYGinSystemPreferences_syspref.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_11584-add_UseWYSIWYGinSystemPreferences_syspref.sql b/installer/data/mysql/atomicupdate/bug_11584-add_UseWYSIWYGinSystemPreferences_syspref.sql >new file mode 100644 >index 0000000..08eed5e >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_11584-add_UseWYSIWYGinSystemPreferences_syspref.sql >@@ -0,0 +1 @@ >+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index a343571..5aceea0 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -468,6 +468,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('UseKohaPlugins','0','','Enable or disable the ability to use Koha Plugins.','YesNo'), > ('UseQueryParser','0',NULL,'If enabled, try to use QueryParser for queries.','YesNo'), > ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), >+('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'), > ('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'), > ('viewLabeledMARC','0','','Allow display of labeled MARC view of bibiographic records','YesNo'), > ('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >index 88c2a7d..21b8c20 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › System preferences</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -134,11 +135,13 @@ > <select name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "choice" %]" multiple="multiple"> > [% FOREACH CHOICE IN CHUNK.CHOICES %][% IF ( CHOICE.selected ) %]<option value="[% CHOICE.value %]" selected="selected">[% ELSE %]<option value="[% CHOICE.value %]">[% END %][% CHOICE.text %]</option>[% END %] > </select> >- [% ELSIF ( CHUNK.type_textarea ) %] >- <a class="expand-textarea" style="display: none" href="#">Click to Edit</a> >- <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" rows="10" cols="40">[% CHUNK.value %]</textarea> >- [% ELSIF ( CHUNK.type_htmlarea ) %] >- <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %] mce" rows="20" cols="60">[% CHUNK.value %]</textarea> >+ [% ELSIF ( CHUNK.type_textarea ) || ( CHUNK.type_htmlarea )%] >+ [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %] >+ <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %] mce" rows="20" cols="60">[% CHUNK.value %]</textarea> >+ [% ELSE %] >+ <a class="expand-textarea" style="display: none" href="#">Click to Edit</a> >+ <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" rows="10" cols="40">[% CHUNK.value %]</textarea> >+ [% END %] > [% ELSIF ( CHUNK.type_languages ) %] > <dl> > [% FOREACH language IN CHUNK.languages %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index f9cd822..df72493 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -663,7 +663,7 @@ Circulation: > - > - "Include the following HTML in the Help page of the web-based self checkout system:" > - pref: SelfCheckHelpMessage >- type: textarea >+ type: htmlarea > class: code > - > - pref: AutoSelfCheckAllowed >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index ad0f26f..da7a88c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -203,32 +203,32 @@ OPAC: > - > - "Show the following HTML in its own column on the main page of the OPAC:" > - pref: OpacMainUserBlock >- type: textarea >+ type: htmlarea > class: code > - > - "Show the following HTML on the left hand column of the main page and patron account on the OPAC (generally navigation links):" > - pref: OpacNav >- type: textarea >+ type: htmlarea > class: code > - > - "Show the following HTML in the right hand column of the main page under the main login form:" > - pref: OpacNavRight >- type: textarea >+ type: htmlarea > class: code > - > - "Show the following HTML on the left hand column of the main page and patron account on the OPAC, after OpacNav, and before patron account links if available:" > - pref: OpacNavBottom >- type: textarea >+ type: htmlarea > class: code > - > - "Include the following HTML in the header of all pages in the OPAC:" > - pref: opacheader >- type: textarea >+ type: htmlarea > class: code > - > - "Include the following HTML in the footer of all pages in the OPAC:" > - pref: opaccredits >- type: textarea >+ type: htmlarea > class: code > - > - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):' >@@ -240,7 +240,7 @@ OPAC: > - 'Include a "Links" column on the "my summary" and "my reading history" tabs when a user is logged in to the OPAC, with the following HTML (leave blank to disable):' > - '<br />Note: The placeholders {BIBLIONUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.' > - pref: OPACMySummaryHTML >- type: textarea >+ type: htmlarea > class: code > - > - "Note to display on the patron summary page. This note only appears if the patron is logged in:" >@@ -249,7 +249,7 @@ OPAC: > - > - "Include the following HTML under the facets in OPAC search results:" > - pref: OPACResultsSidebar >- type: textarea >+ type: htmlarea > class: code > - > - pref: OpacAddMastheadLibraryPulldown >@@ -261,7 +261,7 @@ OPAC: > - 'Display this HTML when no results are found for a search in the OPAC:' > - '<br />Note: You can insert placeholders {QUERY_KW} that will be replaced with the keywords of the query.' > - pref: OPACNoResultsFound >- type: textarea >+ type: htmlarea > class: code > - > - 'Display the URI in the 856u field as an image on: ' >@@ -310,7 +310,7 @@ OPAC: > - > - "Show the following HTML on the OPAC login form when a patron is not logged in:" > - pref: NoLoginInstructions >- type: textarea >+ type: htmlarea > class: code > - > - "Replace the search box at the top of OPAC pages with the following HTML:" >@@ -667,7 +667,7 @@ OPAC: > - > - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):" > - pref: PatronSelfRegistrationAdditionalInstructions >- type: textarea >+ type: htmlarea > class: html > Advanced Search Options: > - >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >index 17f06c5..0663c2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >@@ -38,7 +38,7 @@ Staff Client: > - > - "Show the following HTML in its own column on the main page of the staff client:" > - pref: IntranetmainUserblock >- type: textarea >+ type: htmlarea > class: code > - > - "Show the following HTML to the left of the More menu at the top of each page on the staff client (should be a list of links or blank):" >@@ -128,3 +128,9 @@ Staff Client: > yes: Enable > no: Disable > - item selection in record detail page. >+ - >+ - pref: UseWYSIWYGinSystemPreferences >+ choices: >+ yes: Show >+ no: "Don't show" >+ - WYSIWYG editor when editing certain HTML system preferences. >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt >index e955011..09b348d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › [% IF ( add_form ) %] System preferences › [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] System preferences › Data added[% END %] > [% IF ( delete_confirm ) %] System preferences › [% searchfield %] › Confirm deletion of parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] System preferences › Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</title> >@@ -110,10 +111,12 @@ > <textarea id="value" name="value" cols="[% fieldlength %]">[% value |html %]</textarea> > [% ELSIF ( type_upload ) %] > <input type="file" name="value" /> >- [% ELSIF ( type_htmlarea ) %] >- <textarea class="mce" name="value" id="value" rows="[% rows %]" cols="[% cols %]">[% value |html %]</textarea> >- [% ELSIF ( type_textarea ) %] >+ [% ELSIF ( type_textarea || type_htmlarea ) %] >+ [% IF ( type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %] >+ <textarea class="mce" name="value" id="value" rows="[% rows %]" cols="[% cols %]">[% value |html %]</textarea> >+ [% ELSE %] > <textarea name="value" id="value" rows="[% rows %]" cols="[% cols %]">[% value |html %]</textarea> >+ [% END %] > [% ELSIF ( type_choice ) %] > <select name="value" id="value"> > [% FOREACH option IN options %] >@@ -287,12 +290,13 @@ > [% IF ( loo.type_upload ) %] > <input type="file" name="value" value="[% loo.value |html %]" /> > [% END %] >- [% IF ( loo.type_textarea ) %] >- <a class="expand-textarea" style="display: none" href="#">Click to edit</a> >- <textarea name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea> >- [% END %] >- [% IF ( loo.type_htmlarea ) %] >- <textarea class="mce" name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea> >+ [% IF ( loo.type_textarea ) || ( loo.type_htmlarea ) %] >+ [% IF ( loo.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %] >+ <textarea class="mce" name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea> >+ [% ELSE %] >+ <a class="expand-textarea" style="display: none" href="#">Click to edit</a> >+ <textarea name="value" rows="[% loo.rows %]" cols="[% loo.cols %]">[% loo.value |html %]</textarea> >+ [% END %] > [% END %] > [% IF ( loo.type_choice ) %] > <select name="value"> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11584
:
40509
|
40694
|
40959
|
40980
|
40981
|
40982
|
41515
|
41516
|
41517
|
41518
|
41519
|
41520
|
41521
|
41671
|
41672
|
41673
|
41674
|
42124