Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2e07a0cd

Von Thomas Kasulke vor mehr als 17 Jahren hinzugefügt

  • ID 2e07a0cdb14d031d325b20f05e916105f385ac19
  • Vorgänger a4518c4d
  • Nachfolger fb37acdc

"Als bezahlt markieren" Button-Funktion in die common.pl verlegt.

Unterschiede anzeigen:

SL/Form.pm
2706 2706
  $main::lxdebug->leave_sub();
2707 2707
}
2708 2708

  
2709
sub mark_as_paid {
2710
  $main::lxdebug->enter_sub();
2711
    
2712
  my ($self, $myconfig, $db_name) = @_;
2713

  
2714
  if($self->{mark_as_paid}) {
2715
    my $dbh ||= $self->get_standard_dbh($myconfig);
2716
    my $query = qq|UPDATE $db_name SET paid = amount WHERE id = ?|;
2717
    do_query($self, $dbh, $query, $self->{id});
2718
    $dbh->commit();
2719
    $self->redirect($main::locale->text("Marked as paid"));
2720
  }
2721
  else {
2722
    my $referer = $ENV{HTTP_REFERER};
2723
    $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$self->{login}\&password\=$self->{password}\&id\=$self->{id}\&$2/;
2724
    $self->header();
2725
    print qq|<body>|;
2726
    print qq|<p><b>|.$main::locale->text('Mark as paid?').qq|</b></p>|;
2727
    print qq|<input type="button" value="|.$main::locale->text('yes').qq|" onclick="document.location.href='|.$referer.qq|'">&nbsp;|;
2728
    print qq|<input type="button" value="|.$main::locale->text('no').qq|" onclick="javascript:history.back();">|;
2729
    print qq|</body></html>|;
2730
  }
2731
  
2732
  $main::lxdebug->leave_sub();
2733
}
2734

  
2735 2709
1;

Auch abrufbar als: Unified diff