Bugzilla – Attachment 116221 Details for
Bug 27598
Add UPLOAD as a built-in system authorized value category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27598: Add UPLOAD as a built-in system authorized value category
Bug-27598-Add-UPLOAD-as-a-built-in-system-authoriz.patch (text/plain), 4.05 KB, created by
Owen Leonard
on 2021-02-02 16:58:57 UTC
(
hide
)
Description:
Bug 27598: Add UPLOAD as a built-in system authorized value category
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-02-02 16:58:57 UTC
Size:
4.05 KB
patch
obsolete
>From 5f9828d78da150e2673a233148dc6214eb9fb57e Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 2 Feb 2021 16:42:03 +0000 >Subject: [PATCH] Bug 27598: Add UPLOAD as a built-in system authorized value > category > >This patch updates the database so that it includes an "UPLOAD" >authorized value category with the "is_system" flag set to 1. > >The upload tool template is updated to add a link to the authorized >value category from the hint which appears if no authorized values exist >in the UPLOAD category. > >To test, apply the patch and run the database update. > >- If you have manually added an UPLOAD category it should now be > classified as a system category. >- If you did not have an UPLOAD category it should have been created for > you. >- With no authorized values in the UPLOAD category, go to Tools -> > Upload. > - Logged in as a user with permission to manage authorized values you > should see a note, "No upload categories are defined..." It should > contain a link directly to the UPLOAD category of authorized values. > - Logged in as a user without authorized value permission you should > see a similar note without the link. >- Add an authorized value in the UPLOAD category and confirm that the > note disappears. >--- > ...598_add_default_upload_authorised_value_category.perl | 16 ++++++++++++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt | 9 ++++++++- > 2 files changed, 24 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_27598_add_default_upload_authorised_value_category.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_27598_add_default_upload_authorised_value_category.perl b/installer/data/mysql/atomicupdate/bug_27598_add_default_upload_authorised_value_category.perl >new file mode 100644 >index 0000000000..05f59c1386 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27598_add_default_upload_authorised_value_category.perl >@@ -0,0 +1,16 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $sth = $dbh->prepare("SELECT category_name FROM authorised_value_categories WHERE category_name='UPLOAD'"); >+ $sth->execute; >+ my ($value) = $sth->fetchrow; >+ if( $value ){ >+ print "The UPLOAD authorized value category exists. Update the 'is_system' value to 1.\n"; >+ $dbh->do( "UPDATE authorised_value_categories SET is_system = 1 WHERE category_name = 'UPLOAD'" ); >+ } else { >+ print "The UPLOAD authorized value category does not exist. Create it.\n"; >+ $dbh->do( "INSERT IGNORE INTO authorised_value_categories (category_name, is_system) VALUES ('UPLOAD', 1)" ); >+ } >+ >+ # Always end with this (adjust the bug info) >+ NewVersion( $DBversion, 27598, "Add UPLOAD as a built-in system authorized value category"); >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >index 3ed10dcae3..7e73795a73 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >@@ -65,7 +65,14 @@ > [% IF uploadcategories %] > <div class="hint">Note: For temporary uploads do not select a category.</div> > [% ELSE %] >- <div class="hint">Note: No upload categories are defined. Add values to the UPLOAD authorized value category otherwise all uploads will be marked as temporary.</div> >+ <div class="hint"> >+ Note: No upload categories are defined. >+ [% IF ( CAN_user_parameters_manage_auth_values ) -%] >+ Add values to the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=UPLOAD">UPLOAD authorized value category</a> otherwise all uploads will be marked as temporary. >+ [% ELSE -%] >+ An administrator must add values to the UPLOAD authorized value category otherwise all uploads will be marked as temporary. >+ [% END %] >+ </div> > [% END %] > </li> > [% END %] >-- >2.11.0
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 27598
:
116221
|
116428
|
116447
|
116502
|
116860
|
116861