Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2e3bdf1a

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 2e3bdf1ae149f89f0cd9dbdda70372de38247f77
  • Vorgänger d3b2be26
  • Nachfolger 65a06b57

Verwaltung von Kundenquellen entfernt

Diese Funktionalität wird in der ERP nicht genutzt.

Unterschiede anzeigen:

SL/AM.pm
410 410
  return 1;
411 411
}
412 412

  
413
sub lead {
414
  $main::lxdebug->enter_sub();
415

  
416
  my ($self, $myconfig, $form) = @_;
417

  
418
  my $dbh = SL::DB->client->dbh;
419

  
420
  my $query = qq|SELECT id, lead
421
                 FROM leads
422
                 ORDER BY 2|;
423

  
424
  my $sth = $dbh->prepare($query);
425
  $sth->execute || $form->dberror($query);
426

  
427
  while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
428
    push @{ $form->{ALL} }, $ref;
429
  }
430

  
431
  $sth->finish;
432

  
433
  $main::lxdebug->leave_sub();
434
}
435

  
436
sub get_lead {
437
  $main::lxdebug->enter_sub();
438

  
439
  my ($self, $myconfig, $form) = @_;
440

  
441
  my $dbh = SL::DB->client->dbh;
442

  
443
  my $query =
444
    qq|SELECT l.id, l.lead | .
445
    qq|FROM leads l | .
446
    qq|WHERE l.id = ?|;
447
  my $sth = $dbh->prepare($query);
448
  $sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})");
449

  
450
  my $ref = $sth->fetchrow_hashref("NAME_lc");
451

  
452
  map { $form->{$_} = $ref->{$_} } keys %$ref;
453

  
454
  $sth->finish;
455

  
456
  $main::lxdebug->leave_sub();
457
}
458

  
459
sub save_lead {
460
  $main::lxdebug->enter_sub();
461

  
462
  my ($self, $myconfig, $form) = @_;
463
  my ($query);
464

  
465
  my $dbh = SL::DB->client->dbh;
466

  
467
  my @values = ($form->{description});
468
  # id is the old record
469
  if ($form->{id}) {
470
    $query = qq|UPDATE leads SET
471
                lead = ?
472
                WHERE id = ?|;
473
    push(@values, $form->{id});
474
  } else {
475
    $query = qq|INSERT INTO leads
476
                (lead)
477
                VALUES (?)|;
478
  }
479
  do_query($form, $dbh, $query, @values);
480

  
481
  $main::lxdebug->leave_sub();
482
}
483

  
484
sub delete_lead {
485
  $main::lxdebug->enter_sub();
486

  
487
  my ($self, $myconfig, $form) = @_;
488
  my ($query);
489

  
490
  SL::DB->client->with_transaction(sub {
491
    $query = qq|DELETE FROM leads WHERE id = ?|;
492
    do_query($form, SL::DB->client->dbh, $query, $form->{id});
493
    1;
494
  }) or do { die SL::DB->client->error };
495

  
496
  $main::lxdebug->leave_sub();
497
}
498

  
499 413
sub language {
500 414
  $main::lxdebug->enter_sub();
501 415

  
bin/mozilla/am.pl
614 614
  $main::lxdebug->leave_sub();
615 615
}
616 616

  
617
sub add_lead {
618
  $main::lxdebug->enter_sub();
619

  
620
  my $form     = $main::form;
621

  
622
  $main::auth->assert('config');
623

  
624
  $form->{title} = "Add";
625

  
626
  $form->{callback} = "am.pl?action=add_lead" unless $form->{callback};
627

  
628
  &lead_header;
629
  &form_footer;
630

  
631
  $main::lxdebug->leave_sub();
632
}
633

  
634
sub edit_lead {
635
  $main::lxdebug->enter_sub();
636

  
637
  my $form     = $main::form;
638
  my %myconfig = %main::myconfig;
639

  
640
  $main::auth->assert('config');
641

  
642
  $form->{title} = "Edit";
643

  
644
  AM->get_lead(\%myconfig, \%$form);
645

  
646
  &lead_header;
647

  
648
  $form->{orphaned} = 1;
649
  &form_footer;
650

  
651
  $main::lxdebug->leave_sub();
652
}
653

  
654
sub list_lead {
655
  $::lxdebug->enter_sub;
656
  $::auth->assert('config');
657

  
658
  AM->lead(\%::myconfig, $::form);
659

  
660
  $::form->{callback} = "am.pl?action=list_lead";
661
  $::form->{title}    = $::locale->text('Lead');
662

  
663
  $::form->header;
664
  print $::form->parse_html_template('am/lead_list');
665

  
666
  $::lxdebug->leave_sub;
667
}
668

  
669
sub lead_header {
670
  $::lxdebug->enter_sub;
671
  $::auth->assert('config');
672

  
673
  # $locale->text('Add Lead')
674
  # $locale->text('Edit Lead')
675
  $::form->{title} = $::locale->text("$::form->{title} Lead");
676

  
677
  $::form->header;
678
  print $::form->parse_html_template('am/lead_header');
679

  
680
  $::lxdebug->leave_sub;
681
}
682

  
683
sub save_lead {
684
  $main::lxdebug->enter_sub();
685

  
686
  my $form     = $main::form;
687
  my %myconfig = %main::myconfig;
688
  my $locale   = $main::locale;
689

  
690
  $main::auth->assert('config');
691

  
692
  $form->isblank("description", $locale->text('Description missing!'));
693
  AM->save_lead(\%myconfig, \%$form);
694
  $form->redirect($locale->text('lead saved!'));
695

  
696
  $main::lxdebug->leave_sub();
697
}
698

  
699
sub delete_lead {
700
  $main::lxdebug->enter_sub();
701

  
702
  my $form     = $main::form;
703
  my %myconfig = %main::myconfig;
704
  my $locale   = $main::locale;
705

  
706
  $main::auth->assert('config');
707

  
708
  AM->delete_lead(\%myconfig, \%$form);
709
  $form->redirect($locale->text('lead deleted!'));
710

  
711
  $main::lxdebug->leave_sub();
712
}
713

  
714 617
sub add_language {
715 618
  $main::lxdebug->enter_sub();
716 619

  
locale/de/all
161 161
  'Add Follow-Up for #1'        => 'Wiedervorlage für #1 erstellen',
162 162
  'Add General Ledger Transaction' => 'Dialogbuchen',
163 163
  'Add Language'                => 'Sprache hinzufügen',
164
  'Add Lead'                    => 'Kundenquelle erfassen',
165 164
  'Add Letter'                  => 'Brief hinzufügen',
166 165
  'Add Part'                    => 'Ware erfassen',
167 166
  'Add Price Factor'            => 'Preisfaktor erfassen',
......
1068 1067
  'Edit Follow-Up for #1'       => 'Wiedervorlage für #1 bearbeiten',
1069 1068
  'Edit General Ledger Transaction' => 'Buchung im Hauptbuch bearbeiten',
1070 1069
  'Edit Language'               => 'Sprache bearbeiten',
1071
  'Edit Lead'                   => 'Kundenquelle bearbeiten',
1072 1070
  'Edit Letter'                 => 'Brief bearbeiten',
1073 1071
  'Edit Part'                   => 'Ware bearbeiten',
1074 1072
  'Edit Preferences for #1'     => 'Einstellungen von #1 bearbeiten',
......
1627 1625
  'Last transaction'            => 'Letzte Buchung',
1628 1626
  'Lastcost'                    => 'Einkaufspreis',
1629 1627
  'Lastcost (with X being a number)' => 'Einkaufspreis (X ist eine fortlaufende Zahl)',
1630
  'Lead'                        => 'Kundenquelle',
1631
  'Leads'                       => 'Kundenquellen',
1632 1628
  'Left'                        => 'Links',
1633 1629
  'Letter'                      => 'Brief',
1634 1630
  'Letter Draft'                => 'Briefentwurf',
......
3668 3664
  'kivitendo v#1 administration' => 'kivitendo v#1 Administration',
3669 3665
  'kivitendo website (external)' => 'kivitendo-Webseite (extern)',
3670 3666
  'kivitendo will then update the database automatically.' => 'kivitendo wird die Datenbank daraufhin automatisch aktualisieren.',
3671
  'lead deleted!'               => 'Kundenquelle gelöscht',
3672
  'lead saved!'                 => 'Kundenquelle geichert',
3673 3667
  'letters_list'                => 'briefliste',
3674 3668
  'list_of_payments'            => 'zahlungsausgaenge',
3675 3669
  'list_of_receipts'            => 'zahlungseingaenge',
menus/user/00-erp.yaml
1110 1110
  order: 1400
1111 1111
  params:
1112 1112
    action: Business/list
1113
- parent: system
1114
  id: system_leads
1115
  name: Leads
1116
  order: 1500
1117
  module: am.pl
1118
  params:
1119
    action: list_lead
1120 1113
- parent: system
1121 1114
  id: system_project_types
1122 1115
  name: Project Types
templates/webpages/am/lead_header.html
1
[%- USE HTML %]
2
[%- USE T8 %]
3
<h1>[% title | html %]</h1>
4

  
5
<form method=post action=am.pl>
6

  
7
<input type=hidden name=id value='[% id | html %]'>
8
<input type=hidden name=type value=lead>
9

  
10
<table width=100%>
11
  <tr>
12
    <th align=right>[% 'Description' | $T8 %]</th>
13
    <td><input name=description size=50 value="[% lead | html %]"></td>
14
  </tr>
15
    <td colspan=2><hr size=3 noshade></td>
16
  </tr>
17
</table>
templates/webpages/am/lead_list.html
1
[%- USE T8 %]
2
[%- USE HTML %]
3
[%- USE LxERP %]
4
[%- USE L %]
5
<h1>[% title | html %]</h1>
6

  
7
<table width=100%>
8
  <tr class=listheading>
9
    <th class=listheading width=100%>[% 'Description' | $T8 %]</th>
10
  </tr>
11
[%- FOREACH row = ALL  %]
12
  <tr valign=top class=listrow[% loop.count % 2 %]>
13
    <td><a href="am.pl?action=edit_lead&id=[% row.id | html %]&callback=[% callback | html %]">[% row.lead | html %]</a></td>
14
  </tr>
15
[%- END %]
16
  <tr>
17
  <td><hr size=3 noshade></td>
18
  </tr>
19
</table>
20

  
21
<br>
22

  
23
  <a href="am.pl?action=add&type=lead&callback=[% HTML.url(callback) %]">[%- 'Add' | $T8 %]</a>

Auch abrufbar als: Unified diff