Revision 573d7fd1
Von Jan Büren vor etwa 8 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
2591 | 2591 |
} |
2592 | 2592 |
|
2593 | 2593 |
sub new_lastmtime { |
2594 |
my ($self, $table, $option) = @_; |
|
2594 |
$main::lxdebug->enter_sub(); |
|
2595 |
|
|
2596 |
my ($self, $table, $provided_dbh) = @_; |
|
2595 | 2597 |
|
2598 |
my $dbh = $provided_dbh ? $provided_dbh : $self->get_standard_dbh; |
|
2596 | 2599 |
return unless $self->{id}; |
2597 | 2600 |
croak ("wrong call, no valid table defined") unless $table =~ /^(oe|ar|ap|delivery_orders|parts)$/; |
2598 | 2601 |
|
2599 | 2602 |
my $query = "SELECT mtime, itime FROM " . $table . " WHERE id = ?"; |
2600 |
my $ref = selectfirst_hashref_query($self, $self->get_standard_dbh, $query, $self->{id});
|
|
2603 |
my $ref = selectfirst_hashref_query($self, $dbh, $query, $self->{id}); |
|
2601 | 2604 |
$ref->{mtime} ||= $ref->{itime}; |
2602 | 2605 |
$self->{lastmtime} = $ref->{mtime}; |
2603 | 2606 |
$main::lxdebug->message(LXDebug->DEBUG2(),"new lastmtime=".$self->{lastmtime}); |
2607 |
|
|
2608 |
$main::lxdebug->leave_sub(); |
|
2604 | 2609 |
} |
2605 | 2610 |
|
2606 | 2611 |
sub mtime_ischanged { |
Auch abrufbar als: Unified diff
new_lastmtime um optionalen dbh erweitert