Revision cf7153b0
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/Controller/CustomerVendor.pm | ||
---|---|---|
943 | 943 |
$::request->{layout}->add_javascripts('kivi.CustomerVendor.js'); |
944 | 944 |
$::request->{layout}->add_javascripts('kivi.File.js'); |
945 | 945 |
|
946 |
$self->_setup_form_action_bar; |
|
947 |
} |
|
948 |
|
|
949 |
sub _setup_form_action_bar { |
|
950 |
my ($self) = @_; |
|
951 |
|
|
946 | 952 |
for my $bar ($::request->layout->get('actionbar')) { |
947 |
$bar->add_actions("combobox"); |
|
948 |
$bar->actions->[-1]->add_actions([ t8('Save'), |
|
949 |
submit => [ '#form', { action_save => 1 } ], |
|
950 |
checks => [ 'check_taxzone_and_ustid' ], |
|
951 |
]); |
|
952 |
$bar->actions->[-1]->add_actions([ t8('Save and Close'), |
|
953 |
submit => [ '#form', { action_save_and_close => 1 } ], |
|
954 |
checks => [ 'check_taxzone_and_ustid' ], |
|
955 |
]); |
|
956 |
$bar->add_actions('combobox'); |
|
957 |
$bar->actions->[-1]->add_actions([ t8('Workflow'), |
|
958 |
disabled => 1, |
|
959 |
]); |
|
960 |
$bar->actions->[-1]->add_actions([ t8('Save and AP Transaction'), |
|
961 |
submit => [ '#form', { action_save_and_ap_transaction => 1 } ], |
|
962 |
checks => [ 'check_taxzone_and_ustid' ], |
|
963 |
]) if $self->is_vendor; |
|
964 |
$bar->actions->[-1]->add_actions([ t8('Save and AR Transaction'), |
|
965 |
submit => [ '#form', { action_save_and_ar_transaction => 1 } ], |
|
966 |
checks => [ 'check_taxzone_and_ustid' ], |
|
967 |
]) if !$self->is_vendor; |
|
968 |
$bar->actions->[-1]->add_actions([ t8('Save and Invoice'), |
|
969 |
submit => [ '#form', { action_save_and_invoice => 1 } ], |
|
970 |
checks => [ 'check_taxzone_and_ustid' ], |
|
971 |
]); |
|
972 |
$bar->actions->[-1]->add_actions([ t8('Save and Order'), |
|
973 |
submit => [ '#form', { action_save_and_order => 1 } ], |
|
974 |
checks => [ 'check_taxzone_and_ustid' ], |
|
975 |
]); |
|
976 |
$bar->actions->[-1]->add_actions([ t8('Save and RFQ'), |
|
977 |
submit => [ '#form', { action_save_and_rfq => 1 } ], |
|
978 |
checks => [ 'check_taxzone_and_ustid' ], |
|
979 |
]) if $self->is_vendor; |
|
980 |
$bar->actions->[-1]->add_actions([ t8('Save and Quotation'), |
|
981 |
submit => [ '#form', { action_save_and_quotation => 1 } ], |
|
982 |
checks => [ 'check_taxzone_and_ustid' ], |
|
983 |
]) if !$self->is_vendor; |
|
984 |
$bar->add_actions([ t8('Delete'), |
|
985 |
submit => [ '#form', { action_delete => 1 } ], |
|
986 |
confirm => t8('Do you really want to delete this object?'), |
|
987 |
disabled => !$self->{cv}->id || !$self->is_orphaned, |
|
988 |
]); |
|
989 |
$bar->add_actions('separator'); |
|
990 |
$bar->add_actions([ t8('History'), |
|
991 |
call => [ 'kivi.CustomerVendor.showHistoryWindow', $self->{cv}->id ], |
|
992 |
disabled => !$self->{cv}->id, |
|
993 |
]); |
|
953 |
$bar->add( |
|
954 |
combobox => [ |
|
955 |
action => [ |
|
956 |
t8('Save'), |
|
957 |
submit => [ '#form', { action_save => 1 } ], |
|
958 |
checks => [ 'check_taxzone_and_ustid' ], |
|
959 |
], |
|
960 |
action => [ |
|
961 |
t8('Save and Close'), |
|
962 |
submit => [ '#form', { action_save_and_close => 1 } ], |
|
963 |
checks => [ 'check_taxzone_and_ustid' ], |
|
964 |
], |
|
965 |
], # end of combobox "Save" |
|
966 |
|
|
967 |
combobox => [ |
|
968 |
action => [ t8('Workflow') ], |
|
969 |
(action => [ |
|
970 |
t8('Save and AP Transaction'), |
|
971 |
submit => [ '#form', { action_save_and_ap_transaction => 1 } ], |
|
972 |
checks => [ 'check_taxzone_and_ustid' ], |
|
973 |
]) x !!$self->is_vendor, |
|
974 |
(action => [ |
|
975 |
t8('Save and AR Transaction'), |
|
976 |
submit => [ '#form', { action_save_and_ar_transaction => 1 } ], |
|
977 |
checks => [ 'check_taxzone_and_ustid' ], |
|
978 |
]) x !$self->is_vendor, |
|
979 |
action => [ |
|
980 |
t8('Save and Invoice'), |
|
981 |
submit => [ '#form', { action_save_and_invoice => 1 } ], |
|
982 |
checks => [ 'check_taxzone_and_ustid' ], |
|
983 |
], |
|
984 |
action => [ |
|
985 |
t8('Save and Order'), |
|
986 |
submit => [ '#form', { action_save_and_order => 1 } ], |
|
987 |
checks => [ 'check_taxzone_and_ustid' ], |
|
988 |
], |
|
989 |
(action => [ |
|
990 |
t8('Save and RFQ'), |
|
991 |
submit => [ '#form', { action_save_and_rfq => 1 } ], |
|
992 |
checks => [ 'check_taxzone_and_ustid' ], |
|
993 |
]) x !!$self->is_vendor, |
|
994 |
(action => [ |
|
995 |
t8('Save and Quotation'), |
|
996 |
submit => [ '#form', { action_save_and_quotation => 1 } ], |
|
997 |
checks => [ 'check_taxzone_and_ustid' ], |
|
998 |
]) x !$self->is_vendor, |
|
999 |
], # end of combobox "Workflow" |
|
1000 |
|
|
1001 |
action => [ |
|
1002 |
t8('Delete'), |
|
1003 |
submit => [ '#form', { action_delete => 1 } ], |
|
1004 |
confirm => t8('Do you really want to delete this object?'), |
|
1005 |
disabled => !$self->{cv}->id ? t8('This object has not been saved yet.') |
|
1006 |
: !$self->is_orphaned ? t8('This object has already been used.') |
|
1007 |
: undef, |
|
1008 |
], |
|
1009 |
|
|
1010 |
'separator', |
|
1011 |
|
|
1012 |
action => [ |
|
1013 |
t8('History'), |
|
1014 |
call => [ 'kivi.CustomerVendor.showHistoryWindow', $self->{cv}->id ], |
|
1015 |
disabled => !$self->{cv}->id ? t8('This object has not been saved yet.') : undef, |
|
1016 |
], |
|
1017 |
); |
|
994 | 1018 |
} |
995 | 1019 |
} |
996 | 1020 |
|
Auch abrufbar als: Unified diff
ActionBar: CustomerVendor-Controller: API-Umstellung & Tooltips für deaktivierte