/[Frey]/trunk/lib/App/RoomReservation/Confirmation.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/App/RoomReservation/Confirmation.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1133 by dpavlin, Tue Jun 30 15:10:55 2009 UTC revision 1134 by dpavlin, Tue Jun 30 15:59:41 2009 UTC
# Line 3  use Moose; Line 3  use Moose;
3    
4  extends 'App::RoomReservation';  extends 'App::RoomReservation';
5    
6    with 'App::RoomReservation::Email';
7    
8  has token => (  has token => (
9          is => 'ro',          is => 'ro',
10          isa => 'Str',          isa => 'Str',
# Line 36  sub verify_as_markup { Line 38  sub verify_as_markup {
38          if ( $sth->rows == 1 ) {          if ( $sth->rows == 1 ) {
39    
40                  $sth = $dbh->prepare(qq{                  $sth = $dbh->prepare(qq{
41                          select ime||' '||prezime,_seat_number                          select ime||' '||prezime,_seat_number,email
42                          from reservation                          from reservation
43                          where md5(id||email) = ? and _confirmed is true and _seat_number is not null                          where md5(id||email) = ? and _confirmed is true and _seat_number is not null
44                  });                  });
45    
46                  $sth->execute( $self->token );                  $sth->execute( $self->token );
47                  my ($name, $seat) = $sth->fetchrow_array;                  my ($name, $seat, $email) = $sth->fetchrow_array;
48    
49                    my $html =
50                  qq|                  qq|
51                          $name, <em>reservation has been confirmed</em> and seat number <big>$seat</big> is waiting for you.                          $name, <em>reservation has been confirmed</em> and seat number <big>$seat</big> is waiting for you.
52                          <br>                          <br>
53                          Please print this notice and show it when entering lecture.                          Please print this notice and show it when entering lecture.
54                  |;                  |;
55    
56                    my $token = $self->token;
57                    $self->send( $email,
58                            "Lecture seat $seat is assigned to you",
59                            $html . <<__EMAIL__
60    
61    If you wish to cancel your reservation please click on link below:
62    
63    http://FREY_HOSTNAME/App::RoomReservation::Confirmation/cancel_as_markup?token=$token
64    __EMAIL__
65                    );
66    
67                    return $html;
68    
69          } else {          } else {
70                  die "Problem with confirmation.\n";                  die "Problem with confirmation.\n";
71          }          }

Legend:
Removed from v.1133  
changed lines
  Added in v.1134

  ViewVC Help
Powered by ViewVC 1.1.26