Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d735aab3

Von Martin Helmling mh@waldpark.octosoft.eu vor etwa 9 Jahren hinzugefügt

  • ID d735aab3fc2987d555c63ce0dc8e24626ca30654
  • Vorgänger 13a71e41
  • Nachfolger d2af074a

Prüfen beim Speichern, ob Dokument geändert wurde.

Allgemeine Funktion in Forms zum Lesen und Vergleichen der mtime

überall Form variable lastmtime da mtime mehrfach auftaucht

Conflicts:
templates/webpages/ar/form_header.html
templates/webpages/do/form_header.html

Unterschiede anzeigen:

SL/Form.pm
2603 2603
  $main::lxdebug->leave_sub();
2604 2604
}
2605 2605

  
2606
sub mtime_ischanged {
2607
  my ($self, $relation,$option) = @_;
2608
  #$main::lxdebug->message(LXDebug->DEBUG2(),"mtime_ischanged from rel=".$relation." id=".$id);
2609
  if ( ! $self->{id} ) { return ; }
2610

  
2611
  my $query = "SELECT mtime, itime FROM ".$relation." WHERE id = ?";
2612
  my $ref = selectfirst_hashref_query($self, $self->get_standard_dbh, $query, $self->{id});
2613
  $ref->{mtime} = $ref->{itime} if !$ref->{mtime};
2614
  #$main::lxdebug->message(LXDebug->DEBUG2(),"my  mtime=".$self->{lastmtime}." new mtime=".$ref->{mtime});
2615
  if ($self->{lastmtime} && $self->{lastmtime} ne $ref->{mtime} ) {
2616
      my $etxt = $main::locale->text("The document has been changed from other user. Please reopen it in another window and copy the changes to the new window");
2617
      $etxt = $main::locale->text("The document has been changed from other user. No mail was sent. Please reopen it in another window and copy the changes to the new window")
2618
				  if  defined $option && $option eq 'mail';
2619
      $self->error($main::locale->text($etxt));
2620
    ::end_of_request();
2621
  }
2622
}
2623

  
2606 2624
sub language_payment {
2607 2625
  $main::lxdebug->enter_sub();
2608 2626

  
......
2754 2772
      qq|SELECT
2755 2773
           a.cp_id, a.invnumber, a.transdate, a.${table}_id, a.datepaid,
2756 2774
           a.duedate, a.ordnumber, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.notes,
2775
           a.mtime,a.itime,
2757 2776
           a.intnotes, a.department_id, a.amount AS oldinvtotal,
2758 2777
           a.paid AS oldtotalpaid, a.employee_id, a.gldate, a.type,
2759 2778
           a.globalproject_id, ${extra_columns}
......
2770 2789
    foreach my $key (keys %$ref) {
2771 2790
      $self->{$key} = $ref->{$key};
2772 2791
    }
2773

  
2792
    $self->{mtime} = $self->{itime} if ! $self->{mtime};
2793
    $self->{lastmtime} = $self->{mtime};
2774 2794
    my $transdate = "current_date";
2775 2795
    if ($self->{transdate}) {
2776 2796
      $transdate = $dbh->quote($self->{transdate});

Auch abrufbar als: Unified diff