Bug 13632: Do not use userflags.flagdesc and permissions.description
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 22 Sep 2015 08:48:27 +0000 (09:48 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 19 Oct 2015 12:38:04 +0000 (09:38 -0300)
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>
C4/Auth.pm
members/member-flags.pl

index 284cfe7..d799683 100644 (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;
 }
index 68c52aa..1206f12 100755 (executable)
@@ -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};
                 }