Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7d020076

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 7d020076fcfe27c34c9a68e97df7d969f33c08e2
  • Vorgänger 2d587c41
  • Nachfolger 72613664

ActionBar: Verwendung im neuen Auftrags-Controller

Unterschiede anzeigen:

SL/Controller/Order.pm
1097 1097
  }
1098 1098

  
1099 1099
  $::request->{layout}->use_javascript("${_}.js")  for qw(kivi.SalesPurchase kivi.Order kivi.File ckeditor/ckeditor ckeditor/adapters/jquery);
1100
  $self->_setup_edit_action_bar;
1101
}
1102

  
1103
sub _setup_edit_action_bar {
1104
  my ($self, %params) = @_;
1105

  
1106
  my $deletion_allowed = (($self->cv eq 'customer') && $::instance_conf->get_sales_order_show_delete)
1107
                      || (($self->cv eq 'vendor')   && $::instance_conf->get_purchase_order_show_delete);
1108

  
1109
  for my $bar ($::request->layout->get('actionbar')) {
1110
    $bar->add(
1111
      combobox => [
1112
        action => [
1113
          t8('Save'),
1114
          call      => [ 'kivi.Order.save', $::instance_conf->get_order_warn_duplicate_parts ],
1115
          accesskey => 'enter',
1116
        ],
1117
        action => [
1118
          t8('Save and Delivery Order'),
1119
          call      => [ 'kivi.Order.save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts ],
1120
          accesskey => 'enter',
1121
        ],
1122

  
1123
      ], # end of combobox "Save"
1124

  
1125
      combobox => [
1126
        action => [
1127
          t8('Export'),
1128
        ],
1129
        action => [
1130
          t8('Print'),
1131
          call => [ 'kivi.Order.show_print_options' ],
1132
        ],
1133
        action => [
1134
          t8('E-mail'),
1135
          call => [ 'kivi.Order.email' ],
1136
        ],
1137
      ], # end of combobox "Export"
1138

  
1139
      action => [
1140
        t8('Delete'),
1141
        call     => [ 'kivi.Order.delete_order' ],
1142
        confirm  => $::locale->text('Do you really want to delete this object?'),
1143
        disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
1144
        only_if  => $deletion_allowed,
1145
      ],
1146
    );
1147
  }
1100 1148
}
1101 1149

  
1102 1150
sub _create_pdf {
templates/webpages/order/form.html
41 41
      [%- LxERP.t8("Loading...") %]
42 42
    </div>
43 43
  </div>
44

  
45
  <br>
46

  
47
  [% L.hidden_tag('action', 'Order/dispatch') %]
48

  
49
  [% L.button_tag('kivi.Order.save(' _ INSTANCE_CONF.get_order_warn_duplicate_parts _ ')', LxERP.t8('Save')) %]
50
  [% L.button_tag('kivi.Order.show_print_options()', LxERP.t8('Print')) %]
51
  [% L.button_tag('kivi.Order.email()', LxERP.t8('E-mail')) %]
52
  [% L.button_tag('kivi.Order.save_and_delivery_order(' _ INSTANCE_CONF.get_order_warn_duplicate_parts _ ')', LxERP.t8('Save and Delivery Order')) %]
53
[%- IF SELF.order.id && ( (SELF.cv == 'customer' && INSTANCE_CONF.get_sales_order_show_delete) || (SELF.cv == 'vendor' && INSTANCE_CONF.get_purchase_order_show_delete) ) %]
54
  [% L.button_tag('kivi.Order.delete_order()', LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %]
55
[%- END %]
56
[%- IF SELF.order.id && INSTANCE_CONF.get_doc_storage %]
57
  [% L.button_tag('kivi.File.downloadOrderitemsFiles(\'' _ SELF.order.type _'\',' _ SELF.order.id _')',LxERP.t8('Download all Attachments')) %]
58
[%- END %]
59

  
60 44
</form>

Auch abrufbar als: Unified diff