Koha/koha-tmpl/intranet-tmpl/prog/en/includes
Jonathan Druart 89ade834d6 Bug 24387: Rename "News" with "Additional contents"
One big patch for one big move.

The "News" feature (opac_news) has been hijacked to handle some system
preferences (bug 26050). The goal was to take profit of the UI (editor)
and the ability to translate the value.

Disclaimer: This patch is NOT offering the best implementation but, as
we still don't have bug 24975, it cannot be done now. And no, we don't
want to wait for it to move forward here. This patch is going into the
right direction anyway.

This enhancement is going to rename the "News" with a more genertic
"Additional contents". We have two different "categories" of content:
"news" and "html customizations".

What does it bring?
- A split on the UI for disambigate the two types of content (news and
syspref/html customizations)
- A simplification of the edit form: all languages will be translatable
on the same view (like the "notice templates")
- Ground will be prepared for different types of content (if needed later)
- Staff news can be translated

How was the "News" area working before this patch?
The opac_news DB table contained a (very inconsistent) 'lang' column.
The different values were:
- '' => news to display at the OPAC and staff interfaces
- 'koha' => news for staff only
- 'slip' => news for slip notices
- $lang => news for OPAC only, translated in $lang ('en', 'es-ES', etc.)
- "$location_$lang" => A syspref moved to this "news" area. The syspref
is $location, and is translated in $lang. Eg. OpacLoginInstructions_en,
OpacLoginInstructions_fr-FR, opacheader_es-ES

This patch is improving the DB structure with the following changes:
- renaming 'opac_news' with 'additional_contents'
- new 'category' column
 => 'news' or 'html_customizations'
- new 'location' column
 => For 'news': 'staff_and_opac', 'staff_only', 'slip'
 => For 'html_customizations': the old syspref name (eg. 'OpacLoginInstructions').
- new 'code' column (see later for more info)
- the 'lang' column will only contain the language code ('en', 'es-ES',
etc.). BUT a 'default' entry will ALWAYS exist for fallback behaviour.

We are getting closer to the 'notice template' table structure because
we want to match its UI. The 'code' column will bring us the ability to
group the different 'additional_contents' rows. The code for a given
news will be the same, but the (lang, title, content) will differ.
Examples:
  News 1 will have, for each of the translated versions
  (category, code,    location, branchcode)
  ('news',   'News1', $location, $branchcode||undef)
  And the 3 following columns will differ:
  (title,              content,               lang)
  ('title for news 1', 'content for news 1', 'default')
  ('titulo para 1',    'contenido para 1',   'es-ES')

Note that the "category" is not strictely necessary, but it seems better
to have the ability to split the different content by category/type
easily.

Additional changes:
- Syspref 'NewsToolEditor' is renamed 'AdditionalContentsEditor'
- Koha::NewItem => Koha::AdditionalContent
- Koha::News => Koha::AdditionalContents
- Script and template renamed from koha-news to additional-contents
- Foreign keys have been renamed
- Subpermission edit_news has been renamed edit_additional_contents
- The UI can now be accessed via a "News" or "HTML customizations" link
from the tools module. The related contents will then be displayed (both
categories are now split)

Changes not done here:
- Primary key 'idnew' could be renamed 'id'

Limitations of the upgrade:
News cannot be grouped by a unique code for existing translations.
=> A given news will be now displayed several times on the translated
interface
Any ideas to improve the upgrade behaviour?
We will have to add a warning in the release notes to tell libraries to
review their news.

Test plan:
0. Don't apply the patches
1. Translate the interfaces in some languages
. Create some news for staff and OPAC
. Create some content for different entry of HTML customizations
Note that you are forced to define a 'default'.
Also note that you are only forced to fill the title (not the content).
This is certainly problematic (see FIXME in the code) as sometime only
the content is displayed.
. Play with the interface (edit, delete, filter)
. Go to the different places the news are displayed, and confirm they
are displayed correctly (staff home, opac home, opac rss)
. Create 1+ news for 'slip', check an item out and 'print slip' (from
the circulation page). You must see the news.
. Go to the different places you are expecting the HTML customizations
to be present and confirm that you see them.
. Switch the lang of the interface and confirm that you now see the
content in the translated version
. Generate the templates in another language, don't translate the
content
. Use this language for the interface and confirm that the 'default'
version is displauyed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-08-16 11:55:55 +02:00
..
catalogue Bug 27486: Rename system preference delimiter to CSVDelimiter 2021-01-29 09:03:45 +01:00
csv_headers Bug 16486: Display the timestamp when an accountline is updated 2021-05-06 15:52:41 +02:00
mana Bug 26703: (follow-up) Reverse title for mana report search results 2021-04-21 11:16:35 +02:00
modals Bug 26274: Update register.tt to use the API 2021-02-12 12:33:41 +01:00
str Bug 15788: Use delete_borrowers permission 2021-06-21 13:50:26 +02:00
virtualshelves/merge
about-team.inc Bug 28442: Fix 'accessibility_advocate' for current release 2021-05-27 14:12:24 +02:00
accounts.inc Bug 22435: Update accountline-details page to show all history 2021-08-04 14:06:43 +02:00
acquisitions-add-to-basket.inc
acquisitions-menu.inc Bug 27498: (follow-up) Update to display logic 2021-06-21 14:01:51 +02:00
acquisitions-search.inc Bug 28508: Use "Invoice number" instead of "Invoice no" on the invoice search filter 2021-06-21 14:01:51 +02:00
acquisitions-toolbar.inc
additional-fields-display.inc
additional-fields-entry.inc
admin-items-search-field-form.inc
admin-menu.inc Bug 28733: Correct position of desks link in admin menu 2021-07-30 16:07:38 +02:00
adv-search.inc Bug 25954: Replace paragraph tags with labels in header search forms 2021-01-04 14:06:27 +01:00
auth-finder-search.inc Bug 26533: Fix 'is exactly' search for authorities 2021-04-21 10:51:29 +02:00
authorities-search-results.inc Bug 12533: Improve authority search result display 2020-11-04 12:59:33 +01:00
authorities-search.inc Bug 28475: Fix searching all headings 2021-05-28 08:29:38 +02:00
authorities-toolbar.inc Bug 28542: Move new authority from Z39.50/SRU to a button 2021-06-21 10:10:01 +02:00
authorities.inc
authorities_js.inc Bug 26606: Correctly URI-encode query string in URL loaded after deleting an authority record 2020-10-26 00:16:14 +01:00
av-build-dropbox.inc
biblio-title-head.inc
biblio-title.inc Bug 23852: Merge biblio-title.inc and biblio-default-view.inc 2020-10-08 15:01:29 +02:00
biblio-view-menu.inc
blocked-fines.inc Bug 27811: Hide payment buttons if not enough permission 2021-04-30 17:07:31 +02:00
blocking_errors.inc Bug 10921: Prevent an order from a closed basket to be edited 2020-09-18 11:49:29 +02:00
borrower_debarments.inc Bug 27873: Improve message consistency: checkout and patron detail pages 2021-07-12 15:47:34 +02:00
branch-selector.inc
budget_planning.inc
budgets-active-currency.inc Bug 25744: replace <b> with <strong> in the staff interface 2020-09-18 11:08:35 +02:00
budgets-admin-search.inc Bug 25954: Replace paragraph tags with labels in header search forms 2021-01-04 14:06:27 +01:00
budgets-admin-toolbar.inc
calendar.inc Bug 26261: Split calendar.inc into include file and JavaScript file 2020-09-29 14:28:19 +02:00
cat-menu.inc
cat-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
cat-toolbar.inc Bug 27985: Add option to send a record to batch modification from details page 2021-07-12 15:47:34 +02:00
catalog-strings.inc Bug 26441: Move translatable strings out of catalog-strings.inc into catalog.js 2020-09-29 14:28:18 +02:00
cataloging-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
cateditor-ui.inc Bug 26964: Newly created macros should be selected in the Advanced editor 2021-03-08 15:15:52 +01:00
cateditor-widgets-marc21.inc Bug 27739: Advanced editor should use DefaultCountryField008 preference 2021-04-16 12:28:17 +02:00
category-out-of-age-limit.inc
chart.inc
checkin-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
checkouts-table-footer.inc Bug 19351: Add items.copynumber to the checkouts table 2020-11-04 12:59:34 +01:00
checkouts-table.inc Bug 28271: Preselect the current item lost value 2021-06-21 10:50:09 +02:00
circ-menu.inc Bug 27811: Hide the Accounting tab if needed 2021-04-30 17:07:31 +02:00
circ-nav.inc Bug 24201: (QA follow-up) IndependentBranches 2020-08-07 16:54:40 +02:00
circ-patron-search-results.inc Bug 27926: (QA follow-up) Switch to using data-order 2021-04-06 15:56:30 +02:00
circ-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
cities-admin-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
clubs-table.inc
columns_settings.inc Bug 28055: (follow-up) Revert changes to aoColumnDefs option name 2021-04-14 09:56:22 +02:00
contracts-admin-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
country-list.inc
currencies-admin-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
datatables.inc
date-format.inc
delimiter_text.inc Bug 27486: Rename system preference delimiter to CSVDelimiter 2021-01-29 09:03:45 +01:00
desks-admin-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
doc-head-close-receipt.inc
doc-head-close.inc Bug 28091: Only show for logged in users 2021-05-12 17:39:36 +02:00
doc-head-open.inc
empty_line.inc
facets.inc Bug 26860: facets.inc refactor availability facet 2021-06-21 13:27:32 +02:00
filter-orders.inc Bug 28508: Use "Invoice number" instead of "Invoice no" on the invoice search filter 2021-06-21 14:01:51 +02:00
form-blocks.inc
format_price.inc
greybox.inc
guided-reports-view.inc
header.inc Bug 27699: Add register information to responsive staff interface header menu 2021-03-09 15:05:26 +01:00
holds_table.inc Bug 26988: (follow-up) Fix filter and encode api values and escape rendered values 2020-11-13 14:20:11 +01:00
home-search.inc Bug 25954: Replace paragraph tags with labels in header search forms 2021-01-04 14:06:27 +01:00
html_helpers.inc Bug 24665: (QA follow-up) Fix selection default 2020-11-06 15:55:17 +01:00
i18n.inc Bug 26816: Chomp whitespace around i18n strings 2020-11-02 11:03:09 +01:00
ill-availability-table.inc
ill-list-table-strings.inc
ill-list-table.inc
ill-toolbar.inc
installer-doc-head-close.inc
installer-intranet-bottom.inc
installer-strings.inc
intranet-bottom.inc Bug 24201: (follow-up) add desk choice with library choice 2020-08-07 16:54:40 +02:00
intranetstylesheet.inc
js-date-format.inc
js_includes.inc Bug 27031: Use Koha.Preference() more often in header.inc and js_includes.inc 2021-01-04 13:29:56 +01:00
keyboard_shortcuts.inc
labels-toolbar.inc
langmenu-staff-top.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
last-borrower.inc
letters-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
member-alt-address-style.inc Bug 18112: Use GetAuthValueDropbox from the template 2021-05-11 15:37:42 +02:00
member-alt-contact-style.inc Bug 27232: Add missing space between : and </label> in member-alt-contact-style.inc 2021-04-21 10:51:29 +02:00
member-display-address-style.inc Bug 26666: (QA follow-up) Add 'USE raw' in template 2020-10-26 00:14:41 +01:00
member-display-alt-address-style.inc
member-main-address-style.inc Bug 18112: Use GetAuthValueDropbox from the template 2021-05-11 15:37:42 +02:00
members-toolbar.inc Bug 15788: Use delete_borrowers permission 2021-06-21 13:50:26 +02:00
merge-record.inc
messaging-preference-form.inc Bug 13613: (follow-up) Add tooltip when disabled 2021-05-11 15:09:19 +02:00
noadd-warnings.inc
onboarding_messages.inc
page-numbers.inc
password_check.inc Bug 23816: Fix patron edition 2020-09-10 09:57:53 +02:00
patron-age.inc Bug 27717: Display date of birth even if the patron is under 1 2021-03-05 13:38:58 +01:00
patron-article-requests.inc Bug 20472: Add format field to the interface 2021-07-12 15:47:34 +02:00
patron-return-claims.inc
patron-search-box.inc Bug 25954: Replace paragraph tags with labels in header search forms 2021-01-04 14:06:27 +01:00
patron-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
patron-title.inc
patron-toolbar.inc
patron_messages.inc Bug 28073: Patron modifications should auto-open panel for referring patron record 2021-07-26 12:46:32 +02:00
patroncards-errors.inc
patroncards-toolbar.inc
patronfields.inc
patrons-admin-search.inc Bug 25954: Prevent two elements with id="description" in the DOM 2021-01-04 15:14:26 +01:00
permissions.inc Bug 24387: Rename "News" with "Additional contents" 2021-08-16 11:55:55 +02:00
popup-bottom.inc
pos-menu.inc Bug 27583: Proposed terminology changes 2021-07-26 12:46:32 +02:00
prefs-admin-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
prefs-menu.inc Bug 27336: Sanitize correctly HTML id 2021-01-11 10:27:37 +01:00
relatives-issues-table.inc Bug 28047: Standardize: Call number, callnumber, Call no. etc. 2021-04-06 15:56:31 +02:00
renew_results.inc
renew_strings.inc
reports-menu.inc
reports-toolbar.inc Bug 26165: Fix duplication of large saved reports 2020-08-12 11:46:30 +02:00
resort_form.inc
rotating-collections-toolbar.inc
search_indexes.inc Bug 25954: Replace paragraph tags with labels in header search forms 2021-01-04 14:06:27 +01:00
select2.inc Bug 25727: (follow-up) Some style updates, JS i18n 2020-08-24 11:19:03 +02:00
serials-menu.inc Bug 28719: Change somes links in the serials page to avoid them leading to nothing 2021-08-16 09:56:37 +02:00
serials-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
serials-toolbar.inc
slip-print.inc Bug 27282: fix all occurrences 2021-04-21 10:51:29 +02:00
stockrotation-toolbar.inc
subscriptions-search.inc
subtypes_unimarc.inc
suggestions-add-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
timepicker.inc
tools-item-action.inc Bug 26336: Add hint before and remove select after staging with no items 2020-12-04 15:40:58 +01:00
tools-menu.inc Bug 24387: Rename "News" with "Additional contents" 2021-08-16 11:55:55 +02:00
tools-nomatch-action.inc
tools-overlay-action.inc
transaction_types.inc Bug 27796: (QA follow-up) Missing filters 2021-04-16 12:28:17 +02:00
transfer_reasons.inc Bug 22569: (QA follow-up) Make 'reason' translatable 2021-03-11 11:51:40 +01:00
validator-strings.inc
vendor-menu.inc
virtualshelves-toolbar.inc
waiting_holds.inc Bug 24412: (follow-up) bad desk printing 2020-11-06 15:55:17 +01:00
wysiwyg-systempreferences.inc
xslt-handler.inc
z3950-admin-search.inc Bug 25954: (follow-up) Correct label "for" attribute 2021-01-04 14:06:27 +01:00
z3950_search.inc Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js 2020-09-29 14:28:19 +02:00