Changeset 1091 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
- Timestamp:
- 08/03/12 09:07:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
r1071 r1091 487 487 =head2 list_requests 488 488 489 List user request currently waiting in base489 list user request currently waiting in base 490 490 491 491 =cut … … 500 500 }); 501 501 $sth->execute; 502 my @ids; 503 while (my $res = $sth->fetchrow_hashref) { 504 push(@ids, $res->{id}); 505 } 506 507 @ids 508 } 509 510 =head2 list_requests_by_submitter ($id) 511 512 list user request currently waiting in base ask by user C<$id> 513 514 =cut 515 516 sub list_requests_by_submitter { 517 my ($self, $id) = @_; 518 519 my $sth = $self->db->prepare(q{ 520 select id from request 521 where done is null and user = ? 522 order by apply 523 }); 524 $sth->execute($id); 525 my @ids; 526 while (my $res = $sth->fetchrow_hashref) { 527 push(@ids, $res->{id}); 528 } 529 530 @ids 531 } 532 533 534 =head2 list_request_by_object ($otype, $id) 535 536 Return the list of pending request for a specific object 537 538 =cut 539 540 sub list_request_by_object { 541 my ($self, $otype, $id) = @_; 542 543 my $sth = $self->db->prepare(q{ 544 select * from request join 545 accreq on request.name = accreq.name 546 join accreq_attributes on accreq_attributes.okey = accreq.ikey 547 where 548 request.applied is NULL and 549 accreq_attributes.attr = 'oType' and 550 accreq_attributes.value = ? 551 and request.object = ? 552 order by apply 553 }); 554 $sth->execute($otype, $id); 502 555 my @ids; 503 556 while (my $res = $sth->fetchrow_hashref) {
Note: See TracChangeset
for help on using the changeset viewer.