Bug 13632: Do not use userflags.flagdesc and permissions.description

These 2 fields are not used anymore, but we want to keep them anyway.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2015-09-22 09:48:27 +01:00 committed by Tomas Cohen Arazi
parent 8d70ea9487
commit a3b4b33e46
2 changed files with 5 additions and 8 deletions

View file

@ -1900,14 +1900,14 @@ of the subpermission.
sub get_all_subpermissions {
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare( "SELECT flag, code, description
my $sth = $dbh->prepare( "SELECT flag, code
FROM permissions
JOIN userflags ON (module_bit = bit)" );
$sth->execute();
my $all_perms = {};
while ( my $perm = $sth->fetchrow_hashref ) {
$all_perms->{ $perm->{'flag'} }->{ $perm->{'code'} } = $perm->{'description'};
$all_perms->{ $perm->{'flag'} }->{ $perm->{'code'} } = 1;
}
return $all_perms;
}

View file

@ -89,10 +89,10 @@ if ($input->param('newflags')) {
my $dbh=C4::Context->dbh();
my $all_perms = get_all_subpermissions();
my $user_perms = get_user_subpermissions($bor->{'userid'});
my $sth=$dbh->prepare("SELECT bit,flag,flagdesc FROM userflags ORDER BY bit");
my $sth=$dbh->prepare("SELECT bit, flag FROM userflags ORDER BY bit");
$sth->execute;
my @loop;
while (my ($bit, $flag, $flagdesc) = $sth->fetchrow) {
while (my ($bit, $flag) = $sth->fetchrow) {
my $checked='';
if ($accessflags->{$flag}) {
$checked= 1;
@ -101,7 +101,7 @@ if ($input->param('newflags')) {
my %row = ( bit => $bit,
flag => $flag,
checked => $checked,
flagdesc => $flagdesc );
);
my @sub_perm_loop = ();
my $expand_parent = 0;
@ -113,7 +113,6 @@ if ($input->param('newflags')) {
id => "${flag}_$sub_perm",
perm => "$flag:$sub_perm",
code => $sub_perm,
description => $all_perms->{$flag}->{$sub_perm},
checked => 1
};
}
@ -127,7 +126,6 @@ if ($input->param('newflags')) {
id => "${flag}_$sub_perm",
perm => "$flag:$sub_perm",
code => $sub_perm,
description => $all_perms->{$flag}->{$sub_perm},
checked => 1
};
}
@ -139,7 +137,6 @@ if ($input->param('newflags')) {
id => "${flag}_$sub_perm",
perm => "$flag:$sub_perm",
code => $sub_perm,
description => $all_perms->{$flag}->{$sub_perm},
checked => 0
} unless exists $user_perms->{$flag} and exists $user_perms->{$flag}->{$sub_perm};
}