Revision abaf49cc
Von Sven Schöling vor fast 8 Jahren hinzugefügt
SL/Controller/CustomerVendor.pm | ||
---|---|---|
101 | 101 |
|
102 | 102 |
$self->_pre_render(); |
103 | 103 |
$self->{cv}->assign_attributes(hourly_rate => $::instance_conf->get_customer_hourly_rate) if $self->{cv}->is_customer; |
104 |
|
|
104 | 105 |
$self->render( |
105 | 106 |
'customer_vendor/form', |
106 | 107 |
title => ($self->is_vendor() ? $::locale->text('Add Vendor') : $::locale->text('Add Customer')), |
... | ... | |
941 | 942 |
$::request->{layout}->add_javascripts('autocomplete_customer.js'); |
942 | 943 |
$::request->{layout}->add_javascripts('kivi.CustomerVendor.js'); |
943 | 944 |
$::request->{layout}->add_javascripts('kivi.File.js'); |
945 |
|
|
946 |
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 |
]); |
|
994 |
} |
|
944 | 995 |
} |
945 | 996 |
|
946 | 997 |
sub _prepare_cvar_configs_for_ajaj { |
templates/webpages/customer_vendor/form.html | ||
---|---|---|
57 | 57 |
<br> |
58 | 58 |
|
59 | 59 |
[% L.hidden_tag('action', 'CustomerVendor/dispatch') %] |
60 |
|
|
61 |
[% L.submit_tag('action_save', LxERP.t8('Save'), onclick = "return check_taxzone_and_ustid()", accesskey = "s") %] |
|
62 |
[% L.submit_tag('action_save_and_close', LxERP.t8('Save and Close'), onclick = "return check_taxzone_and_ustid()") %] |
|
63 |
|
|
64 |
[%- IF ( SELF.is_vendor ) %] |
|
65 |
[% L.submit_tag('action_save_and_ap_transaction', LxERP.t8('Save and AP Transaction'), onclick = "return check_taxzone_and_ustid()") %] |
|
66 |
[%- ELSE %] |
|
67 |
[% L.submit_tag('action_save_and_ar_transaction', LxERP.t8('Save and AR Transaction'), onclick = "return check_taxzone_and_ustid()") %] |
|
68 |
[%- END %] |
|
69 |
|
|
70 |
[% L.submit_tag('action_save_and_invoice', LxERP.t8('Save and Invoice'), onclick = "return check_taxzone_and_ustid()") %] |
|
71 |
[% L.submit_tag('action_save_and_order', LxERP.t8('Save and Order'), onclick = "return check_taxzone_and_ustid()") %] |
|
72 |
|
|
73 |
[%- IF ( SELF.is_vendor ) %] |
|
74 |
[% L.submit_tag('action_save_and_rfq', LxERP.t8('Save and RFQ'), onclick = "return check_taxzone_and_ustid()") %] |
|
75 |
[%- ELSE %] |
|
76 |
[% L.submit_tag('action_save_and_quotation', LxERP.t8('Save and Quotation'), onclick = "return check_taxzone_and_ustid()") %] |
|
77 |
[%- END %] |
|
78 |
|
|
79 |
[%- IF ( SELF.cv.id && SELF.is_orphaned ) %] |
|
80 |
[% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm => LxERP.t8('Do you really want to delete this object?')) %] |
|
81 |
[%- END %] |
|
82 |
|
|
83 |
[%- IF ( SELF.cv.id ) %] |
|
84 |
<input type="button" class="submit" onclick="kivi.CustomerVendor.showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
85 |
[%- END %] |
|
86 |
|
|
87 | 60 |
</form> |
88 | 61 |
|
89 | 62 |
<script type="text/javascript"> |
Auch abrufbar als: Unified diff
ActionBar: CustomerVendor