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 8f428016de..027f66de74 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -66,7 +66,14 @@ [% IF uploadcategories %]
Note: For temporary uploads do not select a category.
[% ELSE %] -
Note: No upload categories are defined. Add values to the UPLOAD authorized value category otherwise all uploads will be marked as temporary.
+
+ Note: No upload categories are defined. + [% IF ( CAN_user_parameters_manage_auth_values ) -%] + Add values to the UPLOAD authorized value category 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 %] +
[% END %] [% END %]