View | Details | Raw Unified | Return to bug 27598
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_27598_add_default_upload_authorised_value_category.perl (+16 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $sth = $dbh->prepare("SELECT category_name FROM authorised_value_categories WHERE category_name='UPLOAD'");
4
    $sth->execute;
5
    my ($value) = $sth->fetchrow;
6
    if( $value ){
7
        print "The UPLOAD authorized value category exists. Update the 'is_system' value to 1.\n";
8
        $dbh->do( "UPDATE authorised_value_categories SET is_system = 1 WHERE category_name = 'UPLOAD'" );
9
    } else {
10
        print "The UPLOAD authorized value category does not exist. Create it.\n";
11
        $dbh->do( "INSERT IGNORE INTO authorised_value_categories (category_name, is_system) VALUES ('UPLOAD', 1)" );
12
    }
13
14
    # Always end with this (adjust the bug info)
15
    NewVersion( $DBversion, 27598, "Add UPLOAD as a built-in system authorized value category");
16
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt (-2 / +8 lines)
Lines 65-71 Link Here
65
            [% IF uploadcategories %]
65
            [% IF uploadcategories %]
66
                <div class="hint">Note: For temporary uploads do not select a category.</div>
66
                <div class="hint">Note: For temporary uploads do not select a category.</div>
67
            [% ELSE %]
67
            [% ELSE %]
68
                <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>
68
                <div class="hint">
69
                    Note: No upload categories are defined.
70
                    [% IF ( CAN_user_parameters_manage_auth_values ) -%]
71
                        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.
72
                    [% ELSE -%]
73
                        An administrator must add values to the UPLOAD authorized value category otherwise all uploads will be marked as temporary.
74
                    [% END %]
75
                </div>
69
            [% END %]
76
            [% END %]
70
            </li>
77
            </li>
71
        [% END %]
78
        [% END %]
72
- 

Return to bug 27598