Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 30723c32

Von Thomas Heck vor fast 11 Jahren hinzugefügt

  • ID 30723c32d3a1d71b665f69777edd93c672f03c04
  • Vorgänger c0cd58d9
  • Nachfolger 1168e9c9

Kundennotizen auflisten und ändern

fixt #2388

Unterschiede anzeigen:

SL/Controller/CustomerVendor.pm
147 147
      employee_id => SL::DB::Manager::Employee->current->id,
148 148
      addition => 'SAVED',
149 149
    )->save();
150

  
151
    if ( $::form->{delete_notes} ) {
152
      foreach my $note_id (@{ $::form->{delete_notes} }) {
153
        my $note = SL::DB::Note->new(id => $note_id)->load();
154
        if ( $note->follow_up ) {
155
          if ( $note->follow_up->follow_up_link ) {
156
            $note->follow_up->follow_up_link->delete(cascade => 'delete');
157
          }
158
          $note->follow_up->delete(cascade => 'delete');
159
        }
160
        $note->delete(cascade => 'delete');
161
      }
162
    }
150 163
  }) || die($db->error);
151 164

  
152 165
}
......
622 635

  
623 636
  if ( $::form->{note}->{id} ) {
624 637
    $self->{note} = SL::DB::Note->new(id => $::form->{note}->{id})->load();
625

  
626
    $self->{note_followup_link} = SL::DB::Manager::FollowUpLink->get_all(
627
      query => [
628
        'follow_up.note_id' => $self->{note}->id,
629
        trans_id => $self->{cv}->id,
630
        trans_type => ($self->is_vendor() ? 'vendor' : 'customer'),
631
      ],
632
      with_objects => ['follow_up'],
633
    )->[0];
634

  
635
    $self->{note_followup} = $self->{note_followup_link}->follow_up;
638
    $self->{note_followup} = $self->{note}->follow_up;
639
    $self->{note_followup_link} = $self->{note_followup}->follow_up_link;
636 640
  } else {
637 641
    $self->{note} = SL::DB::Note->new();
638 642
    $self->{note_followup} = SL::DB::FollowUp->new();
......
687 691

  
688 692
  if ( $::form->{note_id} ) {
689 693
    $self->{note} = SL::DB::Note->new(id => $::form->{note_id})->load();
690

  
691
    $self->{note_followup_link} = SL::DB::Manager::FollowUpLink->get_all(
692
      query => [
693
        'follow_up.note_id' => $self->{note}->id,
694
        trans_id => $self->{cv}->id,
695
        trans_type => ($self->is_vendor() ? 'vendor' : 'customer'),
696
      ],
697
      with_objects => ['follow_up'],
698
    )->[0];
699

  
700
    $self->{note_followup} = $self->{note_followup_link}->follow_up;
694
    $self->{note_followup} = $self->{note}->follow_up;
695
    $self->{note_followup_link} = $self->{note_followup}->follow_up_link;
701 696
  } else {
702 697
    $self->{note} = SL::DB::Note->new();
703 698
    $self->{note_followup} = SL::DB::FollowUp->new();
......
832 827
  $self->{shiptos} = $self->{cv}->shipto;
833 828
  $self->{shiptos} ||= [];
834 829

  
830
  $self->{notes} = SL::DB::Manager::Note->get_all(
831
    query => [
832
      trans_id => $self->{cv}->id,
833
      trans_module => 'ct',
834
    ],
835
    with_objects => ['follow_up'],
836
  );
837

  
835 838
  $self->{template_args} ||= {};
836 839

  
837 840
  $::request->{layout}->add_javascripts('autocomplete_customer.js');

Auch abrufbar als: Unified diff