Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 642d2475

Von Sven Schöling vor mehr als 8 Jahren hinzugefügt

  • ID 642d2475100c11355670cac075d8f4b2433f6013
  • Vorgänger 0a50b37c
  • Nachfolger 69f51bf0

Rechnungen löschen mit confirm nachfragen, und nicht mit Extrarequest

Unterschiede anzeigen:

bin/mozilla/is.pl
993 993

  
994 994
}
995 995

  
996
sub delete {
997
  $main::lxdebug->enter_sub();
998

  
999
  my $form     = $main::form;
1000
  my $locale   = $main::locale;
1001

  
1002
  $main::auth->assert('invoice_edit');
1003

  
1004
  if ($form->{second_run}) {
1005
    $form->{print_and_post} = 0;
1006
  }
1007
  $form->header;
1008

  
1009
  print qq|
1010
<form method="post" action="$form->{script}">
1011
|;
1012

  
1013
  # delete action variable
1014
  map { delete $form->{$_} } qw(action header);
1015

  
1016
  foreach my $key (keys %$form) {
1017
    next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
1018
    $form->{$key} =~ s/\"/&quot;/g;
1019
    print qq|<input type="hidden" name="$key" value="$form->{$key}">\n|;
1020
  }
1021

  
1022
  print qq|
1023
<h2 class="confirm">| . $locale->text('Confirm!') . qq|</h2>
1024

  
1025
<h4>|
1026
    . $locale->text('Are you sure you want to delete Invoice Number')
1027
    . qq| $form->{invnumber}
1028
</h4>
1029

  
1030
<p>
1031
<input name="action" class="submit" type="submit" value="|
1032
    . $locale->text('Yes') . qq|">
1033
</form>
1034
|;
1035

  
1036
  $main::lxdebug->leave_sub();
1037
}
1038

  
1039 996
sub credit_note {
1040 997
  $main::lxdebug->enter_sub();
1041 998

  
......
1124 1081
  $::lxdebug->leave_sub;
1125 1082
}
1126 1083

  
1127
sub yes {
1128
  $main::lxdebug->enter_sub();
1129

  
1130
  my $form     = $main::form;
1131
  my %myconfig = %main::myconfig;
1132
  my $locale   = $main::locale;
1133

  
1134
  $main::auth->assert('invoice_edit');
1084
sub delete {
1085
  $::auth->assert('invoice_edit');
1135 1086

  
1136
  if (IS->delete_invoice(\%myconfig, \%$form)) {
1087
  if (IS->delete_invoice(\%::myconfig, $::form)) {
1137 1088
    # saving the history
1138
    if(!exists $form->{addition}) {
1139
      $form->{snumbers}  = 'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
1140
      $form->{what_done} = 'invoice';
1141
      $form->{addition}  = "DELETED";
1142
      $form->save_history;
1089
    if(!exists $::form->{addition}) {
1090
      $::form->{snumbers}  = 'invnumber' .'_'. $::form->{invnumber};
1091
      $::form->{what_done} = 'invoice';
1092
      $::form->{addition}  = "DELETED";
1093
      $::form->save_history;
1143 1094
    }
1144 1095
    # /saving the history
1145
    $form->redirect($locale->text('Invoice deleted!'));
1096
    $::form->redirect($::locale->text('Invoice deleted!'));
1146 1097
  }
1147
  $form->error($locale->text('Cannot delete invoice!'));
1148

  
1149
  $main::lxdebug->leave_sub();
1098
  $::form->error($::locale->text('Cannot delete invoice!'));
1150 1099
}
1151 1100

  
1152 1101
sub post_and_e_mail {
locale/de/all
944 944
  'Do you really want to delete AR transaction #1?' => 'Wollen Sie wirklich die Debitorenbuchung #1 löschen?',
945 945
  'Do you really want to delete GL transaction #1?' => 'Wollen Sie wirklich die Dialogbuchung #1 löschen?',
946 946
  'Do you really want to delete the selected links?' => 'Wollen Sie wirklich die ausgewählten Verknüpfungen löschen?',
947
  'Do you really want to delete this invoice?' => 'Wollen Sie diese Rechnung wirklich löschen?',
947 948
  'Do you really want to delete this object?' => 'Wollen Sie dieses Objekt wirklich löschen?',
948 949
  'Do you really want to delete this warehouse?' => 'Wollen Sie dieses Lager wirklich l&ouml;schen?',
949 950
  'Do you really want to revert to this version?' => 'Wollen Sie wirklich auf diese Version zurücksetzen?',
templates/webpages/is/form_footer.html
155 155

  
156 156
<p>[% print_options %]</p>
157 157
  <input type="hidden" name="action" value="dispatcher">
158
  [% IF id %]
159 158

  
159
  [% IF id %]
160 160
    <input class="submit" type="submit" accesskey="u" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
161 161
    <input class="submit" type="submit" name="action_ship_to" value="[% 'Ship to' | $T8 %]">
162 162
    <input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
......
171 171
    <input class="submit" type="submit" name="action_credit_note" value="[% 'Credit Note' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
172 172
[% END %]
173 173
[% IF show_delete && (!storno || storno_id) %]
174
    <input class="submit" type="submit" name="action_delete" value="[% 'Delete' | $T8 %]">
174
    [% L.submit_tag("action_delete", LxERP.t8("Delete"), confirm=LxERP.t8('Do you really want to delete this invoice?')) %]
175 175
[% END %]
176 176
[% IF show_delete && !storno %]
177 177
    <input class="submit" type="submit" name="action_post" value="[% 'Post' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">

Auch abrufbar als: Unified diff