Bug 29509: (QA follow-up) Tidy atomic update
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0505531cde)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
b33b9b5f61
commit
95082c34db
|
|
@ -30,10 +30,10 @@ return {
|
|||
my $sth3 = $dbh->prepare("SELECT borrowernumber FROM user_permissions WHERE code = 'manage_bookings'");
|
||||
$sth3->execute();
|
||||
my @manage_bookings = map { $_->[0] } @{ $sth3->fetchall_arrayref };
|
||||
my $sth3_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<1)");
|
||||
my $sth3_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<1)");
|
||||
$sth3_1->execute();
|
||||
my @circulate = map { $_->[0] } @{ $sth3_1->fetchall_arrayref };
|
||||
my @bookings = (@manage_bookings, @circulate);
|
||||
my @bookings = ( @manage_bookings, @circulate );
|
||||
@rows_to_insert = ( map { [ $_, 4, "list_borrowers" ] } array_minus( @bookings, @exclusions ) );
|
||||
foreach my $row (@rows_to_insert) { $insert_sth->execute( @{$row} ); }
|
||||
say $out "list_borrowers added to all users with manage_bookings";
|
||||
|
|
@ -42,10 +42,10 @@ return {
|
|||
my $sth4 = $dbh->prepare("SELECT borrowernumber FROM user_permissions WHERE code = 'label_creator'");
|
||||
$sth4->execute();
|
||||
my @label_creator = map { $_->[0] } @{ $sth4->fetchall_arrayref };
|
||||
my $sth4_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<13)");
|
||||
my $sth4_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<13)");
|
||||
$sth4_1->execute();
|
||||
my @tools = map { $_->[0] } @{ $sth4_1->fetchall_arrayref };
|
||||
my @labels = (@label_creator, @tools);
|
||||
my @tools = map { $_->[0] } @{ $sth4_1->fetchall_arrayref };
|
||||
my @labels = ( @label_creator, @tools );
|
||||
@rows_to_insert = ( map { [ $_, 4, "list_borrowers" ] } array_minus( @labels, @exclusions ) );
|
||||
foreach my $row (@rows_to_insert) { $insert_sth->execute( @{$row} ); }
|
||||
say $out "list_borrowers added to all users with label_creator";
|
||||
|
|
@ -54,10 +54,10 @@ return {
|
|||
my $sth5 = $dbh->prepare("SELECT borrowernumber FROM user_permissions WHERE code = 'routing'");
|
||||
$sth5->execute();
|
||||
my @routing = map { $_->[0] } @{ $sth5->fetchall_arrayref };
|
||||
my $sth5_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<15)");
|
||||
my $sth5_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<15)");
|
||||
$sth5_1->execute();
|
||||
my @serials = map { $_->[0] } @{ $sth5_1->fetchall_arrayref };
|
||||
my @routing_lists = (@routing, @serials);
|
||||
my @serials = map { $_->[0] } @{ $sth5_1->fetchall_arrayref };
|
||||
my @routing_lists = ( @routing, @serials );
|
||||
@rows_to_insert = ( map { [ $_, 4, "list_borrowers" ] } array_minus( @routing_lists, @exclusions ) );
|
||||
foreach my $row (@rows_to_insert) { $insert_sth->execute( @{$row} ); }
|
||||
say $out "list_borrowers added to all users with routing";
|
||||
|
|
@ -66,10 +66,10 @@ return {
|
|||
my $sth6 = $dbh->prepare("SELECT borrowernumber FROM user_permissions WHERE code = 'order_manage'");
|
||||
$sth6->execute();
|
||||
my @order_manage = map { $_->[0] } @{ $sth6->fetchall_arrayref };
|
||||
my $sth6_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<11)");
|
||||
my $sth6_1 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE flags & (1<<11)");
|
||||
$sth6_1->execute();
|
||||
my @acquisitions = map { $_->[0] } @{ $sth6_1->fetchall_arrayref };
|
||||
my @orders = (@order_manage, @acquisitions);
|
||||
my @orders = ( @order_manage, @acquisitions );
|
||||
@rows_to_insert = ( map { [ $_, 4, "list_borrowers" ] } array_minus( @orders, @exclusions ) );
|
||||
foreach my $row (@rows_to_insert) { $insert_sth->execute( @{$row} ); }
|
||||
say $out "list_borrowers added to all users with order_manage";
|
||||
|
|
|
|||
Loading…
Reference in New Issue