View | Details | Raw Unified | Return to bug 10629
Collapse All | Expand All

(-)a/C4/Branch.pm (-11 lines)
Lines 182-188 sub GetBranchName { Link Here
182
    $sth = $dbh->prepare("Select branchname from branches where branchcode=?");
182
    $sth = $dbh->prepare("Select branchname from branches where branchcode=?");
183
    $sth->execute($branchcode);
183
    $sth->execute($branchcode);
184
    my $branchname = $sth->fetchrow_array;
184
    my $branchname = $sth->fetchrow_array;
185
    $sth->finish;
186
    return ($branchname);
185
    return ($branchname);
187
}
186
}
188
187
Lines 278-284 sub ModBranch { Link Here
278
"insert into branchrelations (branchcode, categorycode) values(?, ?)"
277
"insert into branchrelations (branchcode, categorycode) values(?, ?)"
279
          );
278
          );
280
        $sth->execute( $branchcode, $cat );
279
        $sth->execute( $branchcode, $cat );
281
        $sth->finish;
282
    }
280
    }
283
    foreach my $cat (@removecats) {
281
    foreach my $cat (@removecats) {
284
        my $sth =
282
        my $sth =
Lines 286-292 sub ModBranch { Link Here
286
            "delete from branchrelations where branchcode=? and categorycode=?"
284
            "delete from branchrelations where branchcode=? and categorycode=?"
287
          );
285
          );
288
        $sth->execute( $branchcode, $cat );
286
        $sth->execute( $branchcode, $cat );
289
        $sth->finish;
290
    }
287
    }
291
}
288
}
292
289
Lines 422-428 sub GetBranchesInCategory { Link Here
422
	while (my $branch = $sth->fetchrow) {
419
	while (my $branch = $sth->fetchrow) {
423
		push @branches, $branch;
420
		push @branches, $branch;
424
	}
421
	}
425
	$sth->finish();
426
	return( \@branches );
422
	return( \@branches );
427
}
423
}
428
424
Lines 467-477 sub GetBranchInfo { Link Here
467
        while ( my ($cat) = $nsth->fetchrow_array ) {
463
        while ( my ($cat) = $nsth->fetchrow_array ) {
468
            push( @cats, $cat );
464
            push( @cats, $cat );
469
        }
465
        }
470
        $nsth->finish;
471
        $data->{'categories'} = \@cats;
466
        $data->{'categories'} = \@cats;
472
        push( @results, $data );
467
        push( @results, $data );
473
    }
468
    }
474
    $sth->finish;
475
    return \@results;
469
    return \@results;
476
}
470
}
477
471
Lines 486-492 sub DelBranch { Link Here
486
    my $dbh = C4::Context->dbh;
480
    my $dbh = C4::Context->dbh;
487
    my $sth = $dbh->prepare("delete from branches where branchcode = ?");
481
    my $sth = $dbh->prepare("delete from branches where branchcode = ?");
488
    $sth->execute($branchcode);
482
    $sth->execute($branchcode);
489
    $sth->finish;
490
}
483
}
491
484
492
=head2 ModBranchCategoryInfo
485
=head2 ModBranchCategoryInfo
Lines 503-515 sub ModBranchCategoryInfo { Link Here
503
	# we are doing an insert
496
	# we are doing an insert
504
  my $sth   = $dbh->prepare("INSERT INTO branchcategories (categorycode,categoryname,codedescription,categorytype,show_in_pulldown) VALUES (?,?,?,?,?)");
497
  my $sth   = $dbh->prepare("INSERT INTO branchcategories (categorycode,categoryname,codedescription,categorytype,show_in_pulldown) VALUES (?,?,?,?,?)");
505
        $sth->execute(uc( $data->{'categorycode'} ),$data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'},$data->{'show_in_pulldown'} );
498
        $sth->execute(uc( $data->{'categorycode'} ),$data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'},$data->{'show_in_pulldown'} );
506
	$sth->finish();		
507
    }
499
    }
508
    else {
500
    else {
509
	# modifying
501
	# modifying
510
        my $sth = $dbh->prepare("UPDATE branchcategories SET categoryname=?,codedescription=?,categorytype=?,show_in_pulldown=? WHERE categorycode=?");
502
        my $sth = $dbh->prepare("UPDATE branchcategories SET categoryname=?,codedescription=?,categorytype=?,show_in_pulldown=? WHERE categorycode=?");
511
        $sth->execute($data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'},$data->{'show_in_pulldown'},uc( $data->{'categorycode'} ) );
503
        $sth->execute($data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'},$data->{'show_in_pulldown'},uc( $data->{'categorycode'} ) );
512
	$sth->finish();
513
    }
504
    }
514
}
505
}
515
506
Lines 546-552 sub DelBranchCategory { Link Here
546
    my $dbh = C4::Context->dbh;
537
    my $dbh = C4::Context->dbh;
547
    my $sth = $dbh->prepare("delete from branchcategories where categorycode = ?");
538
    my $sth = $dbh->prepare("delete from branchcategories where categorycode = ?");
548
    $sth->execute($categorycode);
539
    $sth->execute($categorycode);
549
    $sth->finish;
550
}
540
}
551
541
552
=head2 CheckBranchCategorycode
542
=head2 CheckBranchCategorycode
553
- 

Return to bug 10629