Bugzilla – Attachment 42756 Details for
Bug 13632
Make permission descriptions translatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[DO NOT PUSH] Script to generate the permissions include file
DO-NOT-PUSH-Script-to-generate-the-permissions-inc.patch (text/plain), 1.48 KB, created by
Jonathan Druart
on 2015-09-22 09:00:45 UTC
(
hide
)
Description:
[DO NOT PUSH] Script to generate the permissions include file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-09-22 09:00:45 UTC
Size:
1.48 KB
patch
obsolete
>From 3259a2cdf30ed27c6d2fcae8457a9dbaf9f765fe Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 22 Sep 2015 09:44:31 +0100 >Subject: [PATCH] [DO NOT PUSH] Script to generate the permissions include file > >perl build_permissions_file.pl > koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc > >http://bugs.koha-community.org/show_bug.cgi?id=13632 >--- > build_permissions_file.pl | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > create mode 100755 build_permissions_file.pl > >diff --git a/build_permissions_file.pl b/build_permissions_file.pl >new file mode 100755 >index 0000000..480c7e8 >--- /dev/null >+++ b/build_permissions_file.pl >@@ -0,0 +1,22 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use C4::Context; >+my $dbh = C4::Context->dbh; >+ >+my $flags = $dbh->selectall_arrayref(q|SELECT * FROM userflags|, { Slice => {} }); >+my $permissions = $dbh->selectall_arrayref(q|SELECT * FROM permissions|, { Slice => {} }); >+ >+my $content = qq|[%- BLOCK main_permissions -%]\n [% SWITCH name %]\n|; >+for my $f ( @$flags ) { >+ $content .= q| [%- CASE '| . $f->{flag} . q|' -%]<span>| . $f->{flagdesc} . qq|</span>\n|; >+} >+$content .= qq| [%- END -%]\n[%- END -%]\n\n|; >+ >+$content .= qq|[%- BLOCK sub_permissions -%]\n [% SWITCH name %]\n|; >+for my $p ( @$permissions ) { >+ $content .= qq| [%- CASE '| . $p->{code} . q|' -%]<span>| . $p->{description} . qq|</span>\n|; >+} >+$content .= qq| [%- END -%]\n[%- END -%]|; >+ >+say $content; >-- >2.1.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 13632
:
35569
|
35595
|
35761
|
35776
|
42756
|
42757
|
42758
|
42759
|
42760
|
43528
|
43529
|
43530
|
43531
|
43532
|
43561
|
43562
|
43563
|
43564
|
43565
|
43566
|
43599