Bugzilla – Attachment 43561 Details for
Bug 13632
Make permission descriptions translatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Script to generate the permissions include file
Script-to-generate-the-permissions-include-file.patch (text/plain), 1.57 KB, created by
Katrin Fischer
on 2015-10-18 10:33:51 UTC
(
hide
)
Description:
Script to generate the permissions include file
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-10-18 10:33:51 UTC
Size:
1.57 KB
patch
obsolete
>From 7f0a390fa5e4f99ff8832a44d49f662f59dfd7e7 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] 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 > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >http://bugs.koha-community.org/show_bug.cgi?id=13622 >--- > 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; >-- >1.9.1
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