Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/stetienne/ft/MT6531' into dev/st…
Browse files Browse the repository at this point in the history
…etienne

Solved conflicts:
	C4/Acquisition.pm
	acqui/basket.pl
	acqui/booksellers.pl
	koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
	koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl
	kohaversion.pl
  • Loading branch information
jajm committed May 17, 2011
2 parents de91c91 + ee2f674 commit db77c09
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 9 deletions.
8 changes: 7 additions & 1 deletion C4/Acquisition.pm
Expand Up @@ -681,7 +681,13 @@ sub GetBasketUsers {
$sth->execute($basketno);
my $results = $sth->fetchall_arrayref( {} );
$sth->finish();
return $results;

my @tab = ();
foreach ( @$results ) {
push @tab, $_->{'borrowernumber'};
}

return @tab;
}

#------------------------------------------------------------#
Expand Down
6 changes: 1 addition & 5 deletions acqui/basket.pl
Expand Up @@ -271,11 +271,7 @@ =head1 CGI PARAMETERS
$debug
and warn sprintf "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
$basket->{creationdate}, $basket->{authorisedby};
my $basketusers_ids = GetBasketUsers($basketno);
my @basketusers_ids;
foreach (@$basketusers_ids) {
push @basketusers_ids, $_->{'borrowernumber'};
}
my @basketusers_ids = GetBasketUsers($basketno);
my @basketusers;
foreach my $basketuser_id (@basketusers_ids) {
my $basketuser = GetMember(borrowernumber => $basketuser_id);
Expand Down
6 changes: 3 additions & 3 deletions acqui/booksellers.pl
Expand Up @@ -109,10 +109,10 @@ =head1 CGI PARAMETERS
my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if $loggedinuser;
for ( my $i2 = 0 ; $i2 < $ordcount ; $i2++ ) {
# Check if the user belong to basket users list
my $basketusers = GetBasketUsers( $orders->[$i2]{'basketno'} );
my @basketusers_ids = GetBasketUsers( $orders->[$i2]{'basketno'} );
my $isabasketuser = 0;
foreach (@$basketusers) {
if( $loggedinuser == $_->{borrowernumber} ){
foreach (@basketusers_ids) {
if( $loggedinuser == $_ ){
$isabasketuser = 1;
last;
}
Expand Down
31 changes: 31 additions & 0 deletions installer/data/mysql/updatedatabase.pl
Expand Up @@ -5874,6 +5874,37 @@
SetVersion($DBversion);
}

$DBversion = "3.06.00.020";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("DROP TABLE IF EXISTS `aqbasketusers`");
$dbh->do("
CREATE TABLE `aqbasketusers` (
`basketno` int(11) NOT NULL,
`borrowernumber` int(11) NOT NULL,
PRIMARY KEY (`basketno`,`borrowernumber`),
CONSTRAINT `aqbasketusers_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`),
CONSTRAINT `aqbasketusers_ibfk_2` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
print "Upgrade to $DBversion done (Add aqbasketusers table)\n";
SetVersion($DBversion);
}

$DBversion = "3.06.00.021";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("INSERT INTO `permissions` (module_bit, code, description)
VALUES (11, 'order_manage_all', 'Manage all orders & baskets')");
print "Upgrade to $DBversion done (Add order_manage_all permission)\n";
SetVersion($DBversion);
}

$DBversion = "3.06.00.022";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("ALTER TABLE `aqbasket` ADD `branch` varchar(10) default NULL");
print "Upgrade to $DBversion done (Add branch field in aqbasket table)\n";
SetVersion($DBversion);
}

=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
Expand Down
3 changes: 3 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl
Expand Up @@ -245,7 +245,10 @@
<input type="hidden" id="op" name="op" value="mod_users" />
<input type="button" id="add_user" onclick="basketUserSearchPopup(); return false;" value="Add user" />
<input type="submit" value="Save changes" />
<<<<<<< HEAD
</form>
=======
>>>>>>> origin/stetienne/ft/MT6531
<!-- TMPL_IF NAME="creationdate" --><p>Opened on: <!-- TMPL_VAR NAME="creationdate" --></p><!-- /TMPL_IF -->
<!-- TMPL_IF name="closedate" -->
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
Expand Down

0 comments on commit db77c09

Please sign in to comment.