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

(-)a/Koha/Template/Plugin/Koha.pm (+20 lines)
Lines 87-92 sub MultivaluePreference { Link Here
87
    return C4::Context->multivalue_preference($pref);
87
    return C4::Context->multivalue_preference($pref);
88
}
88
}
89
89
90
=head3 debug_flag
91
92
This method checks if the currently logged in user is allowed
93
access to the new debug ui permission. It should return
94
0 if no one is logged in or context is unavailable for some other reason
95
    or they do not have the permission
96
1 if they are a superlibrarian
97
1<<31 if they do have the permission
98
99
=cut
100
101
sub debug_flag {
102
    return 0 unless C4::Context->userenv();
103
    return 1 if C4::Context->IsSuperLibrarian();
104
    my $flags = C4::Context->userenv()->{'flags'};
105
    my $mask  = 1 << 31;
106
    return $flags & $mask;
107
108
}
109
90
=head3 CSVDelimiter
110
=head3 CSVDelimiter
91
111
92
The delimiter option 'tabs' is stored in the DB as 'tabulation' to avoid issues
112
The delimiter option 'tabs' is stored in the DB as 'tabulation' to avoid issues
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc (+10 lines)
Lines 186-191 Link Here
186
    [% END %]
186
    [% END %]
187
[% END %]
187
[% END %]
188
188
189
[% IF Koha.debug_flag %]
190
    <div style="position: fixed; bottom: 0;">
191
        <button onclick="window.location.search += '&DISABLE_SYSPREF_IntranetUserCSS=yes&DISABLE_SYSPREF_OPACUserCSS=yes'">Disable User CSS</button>
192
        <button onclick="window.location.search += '&DISABLE_SYSPREF_IntranetUserJS=yes&DISABLE_SYSPREF_OPACUserJS=yes'">Disable User JS</button>
193
        <button onclick="window.location.search += '&DISABLE_SYSPREF_OpacAdditionalStylesheet=yes&DISABLE_SYSPREF_opaclayoutstylesheet=yes&DISABLE_SYSPREF_intranetcolorstylesheet=yes&DISABLE_SYSPREF_intranetstylesheet=yes'"
194
            >Load only default stylesheets</button
195
        >
196
    </div>
197
[% END # IF %]
198
189
[% IF ( footerjs ) %]
199
[% IF ( footerjs ) %]
190
    [% INCLUDE js_includes.inc %]
200
    [% INCLUDE js_includes.inc %]
191
    [% jsinclude | $raw # Parse the page template's JavaScript block if necessary %]
201
    [% jsinclude | $raw # Parse the page template's JavaScript block if necessary %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (-1 / +3 lines)
Lines 87-92 Link Here
87
    [%- CASE 'preservation' -%]
87
    [%- CASE 'preservation' -%]
88
        <span class="main_permission preservation_permission">Manage the preservation module</span>
88
        <span class="main_permission preservation_permission">Manage the preservation module</span>
89
        <span class="permissioncode">([% name | html %])</span>
89
        <span class="permissioncode">([% name | html %])</span>
90
    [%- CASE 'debug' -%]
91
        <span class="main_permission debug_permission">Display the Debug UI</span>
92
        <span class="permissioncode">([% name | html %])</span>
90
    [%- END -%]
93
    [%- END -%]
91
[%- END -%]
94
[%- END -%]
92
95
93
- 

Return to bug 39142