use SL::DB::Default;
use SL::DB::DeliveryTerm;
use SL::ReportGenerator;
+use SL::Locale::String qw(t8);
use SL::MoreCommon qw(uri_encode);
require "bin/mozilla/common.pl";
$form->{title} = $form->{IS_CUSTOMER} ? $locale->text('Customers') : $locale->text('Vendors');
+ setup_ct_search_action_bar();
+
$form->header();
print $form->parse_html_template('ct/search');
'include_value' => 'Y');
$::form->{title} = $::locale->text('Search contacts');
+
+ setup_ct_search_contact_action_bar();
$::form->header;
print $::form->parse_html_template('ct/search_contact');
$report->add_data($row);
}
- $report->generate_with_headers();
+ setup_ct_list_names_action_bar();
+ $report->generate_with_headers(action_bar => 1);
$main::lxdebug->leave_sub();
}
$report->add_data($row);
}
- $report->generate_with_headers;
+ $report->generate_with_headers(action_bar => 1);
$::lxdebug->leave_sub;
}
+sub setup_ct_search_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Continue'),
+ submit => [ '#form', { action => 'list_names' } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_ct_list_names_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ $::form->{db} eq 'customer' ? t8('New customer') : t8('New vendor'),
+ submit => [ '#new_form', { action => 'CustomerVendor/add' } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_ct_search_contact_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Continue'),
+ submit => [ '#form', { action => 'list_contacts' } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
sub continue { call_sub($main::form->{nextsub}); }
[% USE T8 %][% USE HTML %]
-<form method="post" action="controller.pl?action=CustomerVendor/add">
+<form method="post" action="controller.pl" id="new_form">
<input name="callback" type="hidden" value="[% HTML.escape(callback) %]">
<input name="db" type="hidden" value="[% HTML.escape(db) %]">
-
- [% IF IS_CUSTOMER %][% 'New customer' | $T8 %][% ELSE %][% 'New vendor' | $T8 %][% END %]<br>
-
- <input class="submit" type="submit" value="[%- 'Add' | $T8 %]">
</form>
[%- USE HTML %]
<h1>[% title %]</h1>
- <form method="post" action="ct.pl" name="Form">
+ <form method="post" action="ct.pl" name="Form" id="form">
<input type="hidden" name="db" value="[% HTML.escape(db) %]">
</td>
</tr>
</table>
-
- <input type="hidden" name="nextsub" value="list_names">
-
- <input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]">
</form>