Revision 5d497700
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/common.pl | ||
---|---|---|
53 | 53 |
|
54 | 54 |
# ------------------------------------------------------------------------- |
55 | 55 |
|
56 |
sub select_part { |
|
57 |
$main::lxdebug->enter_sub(); |
|
58 |
|
|
59 |
my ($callback_sub, @parts) = @_; |
|
60 |
|
|
61 |
my $form = $main::form; |
|
62 |
my $locale = $main::locale; |
|
63 |
|
|
64 |
my $remap_parts_id = 0; |
|
65 |
if (defined($parts[0]->{parts_id}) && !defined($parts[0]->{id})) { |
|
66 |
$remap_parts_id = 1; |
|
67 |
map { $_->{id} = $_->{parts_id}; } @parts; |
|
68 |
} |
|
69 |
|
|
70 |
my $remap_partnumber = 0; |
|
71 |
if (defined($parts[0]->{partnumber}) && !defined($parts[0]->{number})) { |
|
72 |
$remap_partnumber = 1; |
|
73 |
map { $_->{number} = $_->{partnumber}; } @parts; |
|
74 |
} |
|
75 |
|
|
76 |
my $has_charge = 0; |
|
77 |
if (defined($parts[0]->{chargenumber})) { |
|
78 |
$has_charge = 1; |
|
79 |
map { $_->{has_charge} = 1; } @parts; |
|
80 |
} |
|
81 |
my $has_bestbefore = 0; |
|
82 |
if (defined($parts[0]->{bestbefore})) { |
|
83 |
$has_bestbefore = 1; |
|
84 |
map { $_->{has_bestbefore} = 1; } @parts; |
|
85 |
} |
|
86 |
my $has_ean = 0; |
|
87 |
if (defined($parts[0]->{ean})) { |
|
88 |
$has_ean = 1; |
|
89 |
map { $_->{has_ean} = 1; } @parts; |
|
90 |
} |
|
91 |
|
|
92 |
my $old_form = save_form(); |
|
93 |
|
|
94 |
$form->header(); |
|
95 |
print $form->parse_html_template("generic/select_part", |
|
96 |
{ "PARTS" => \@parts, |
|
97 |
"old_form" => $old_form, |
|
98 |
"title" => $locale->text("Select a part"), |
|
99 |
"nextsub" => "select_part_internal", |
|
100 |
"callback_sub" => $callback_sub, |
|
101 |
"has_charge" => $has_charge, |
|
102 |
"has_bestbefore" => $has_bestbefore, |
|
103 |
"has_ean" => $has_ean, |
|
104 |
"remap_parts_id" => $remap_parts_id, |
|
105 |
"remap_partnumber" => $remap_partnumber }); |
|
106 |
|
|
107 |
$main::lxdebug->leave_sub(); |
|
108 |
} |
|
109 |
|
|
110 |
sub select_part_internal { |
|
111 |
$main::lxdebug->enter_sub(); |
|
112 |
|
|
113 |
my $form = $main::form; |
|
114 |
|
|
115 |
my ($new_item, $callback_sub); |
|
116 |
|
|
117 |
my $re = "^new_.*_$form->{selection}\$"; |
|
118 |
|
|
119 |
foreach (grep /$re/, keys %{ $form }) { |
|
120 |
my $new_key = $_; |
|
121 |
$new_key =~ s/^new_//; |
|
122 |
$new_key =~ s/_\d+$//; |
|
123 |
$new_item->{$new_key} = $form->{$_}; |
|
124 |
} |
|
125 |
|
|
126 |
if ($form->{remap_parts_id}) { |
|
127 |
$new_item->{parts_id} = $new_item->{id}; |
|
128 |
delete $new_item->{id}; |
|
129 |
} |
|
130 |
|
|
131 |
if ($form->{remap_partnumber}) { |
|
132 |
$new_item->{partnumber} = $new_item->{number}; |
|
133 |
delete $new_item->{number}; |
|
134 |
} |
|
135 |
|
|
136 |
$callback_sub = $form->{callback_sub}; |
|
137 |
|
|
138 |
restore_form($form->{old_form}); |
|
139 |
|
|
140 |
call_sub($callback_sub, $new_item); |
|
141 |
|
|
142 |
$main::lxdebug->leave_sub(); |
|
143 |
} |
|
144 |
|
|
145 |
sub part_selection_internal { |
|
146 |
$main::lxdebug->enter_sub(); |
|
147 |
|
|
148 |
my $form = $main::form; |
|
149 |
my %myconfig = %main::myconfig; |
|
150 |
my $locale = $main::locale; |
|
151 |
|
|
152 |
my $order_by = "description"; |
|
153 |
$order_by = $form->{"order_by"} if (defined($form->{"order_by"})); |
|
154 |
my $order_dir = 1; |
|
155 |
$order_dir = $form->{"order_dir"} if (defined($form->{"order_dir"})); |
|
156 |
|
|
157 |
my %options; |
|
158 |
|
|
159 |
foreach my $opt (split m/:/, $form->{options}) { |
|
160 |
if ($opt =~ /=/) { |
|
161 |
my ($key, $value) = split m/=/, $opt, 2; |
|
162 |
$options{$key} = $value; |
|
163 |
|
|
164 |
} else { |
|
165 |
$options{$opt} = 1; |
|
166 |
} |
|
167 |
} |
|
168 |
|
|
169 |
map { $form->{$_} = $options{$_} if ($options{$_}) } qw(no_services no_assemblies assemblies click_button); |
|
170 |
|
|
171 |
my $parts = Common->retrieve_parts(\%myconfig, $form, $order_by, $order_dir); |
|
172 |
|
|
173 |
if (0 == scalar(@{$parts})) { |
|
174 |
$form->show_generic_information($locale->text("No part was found matching the search parameters.")); |
|
175 |
} elsif (1 == scalar(@{$parts})) { |
|
176 |
$::request->{layout}->add_javascripts_inline("part_selected('1')"); |
|
177 |
} |
|
178 |
|
|
179 |
map { $parts->[$_]->{selected} = $_ ? 0 : 1; } (0..$#{$parts}); |
|
180 |
|
|
181 |
my $callback = build_std_url('action=part_selection_internal', qw(partnumber description input_partnumber input_description input_partsid), |
|
182 |
grep({ /^[fl]_/ } keys %{ $form })); |
|
183 |
|
|
184 |
my @header_sort = qw(partnumber description); |
|
185 |
my %header_title = ( "partnumber" => $locale->text("Part Number"), |
|
186 |
"description" => $locale->text("Part Description"), |
|
187 |
); |
|
188 |
|
|
189 |
my @header = |
|
190 |
map(+{ "column_title" => $header_title{$_}, |
|
191 |
"column" => $_, |
|
192 |
"callback" => $callback . "order_by=${_}&order_dir=" . ($order_by eq $_ ? 1 - $order_dir : $order_dir), |
|
193 |
}, |
|
194 |
@header_sort); |
|
195 |
|
|
196 |
$form->{formname} ||= 'Form'; |
|
197 |
|
|
198 |
$form->{title} = $locale->text("Select a part"); |
|
199 |
$form->header(no_layout => 1); |
|
200 |
print $form->parse_html_template("generic/part_selection", { "HEADER" => \@header, |
|
201 |
"PARTS" => $parts, }); |
|
202 |
|
|
203 |
$main::lxdebug->leave_sub(); |
|
204 |
} |
|
205 |
|
|
206 |
# ------------------------------------------------------------------------- |
|
207 |
|
|
208 | 56 |
sub delivery_customer_selection { |
209 | 57 |
$main::lxdebug->enter_sub(); |
210 | 58 |
|
bin/mozilla/wh.pl | ||
---|---|---|
178 | 178 |
"bin_id" => $form->{bin_id}, |
179 | 179 |
"chargenumber" => $form->{chargenumber}, |
180 | 180 |
"bestbefore" => $form->{bestbefore}, |
181 |
"partnumber" => $form->{partnumber}, |
|
182 |
"ean" => $form->{ean}, |
|
183 |
"description" => $form->{description}); |
|
181 |
"partsid" => $form->{part_id}, |
|
182 |
"ean" => $form->{ean}); |
|
184 | 183 |
|
185 | 184 |
if (0 == scalar(@contents)) { |
186 | 185 |
$form->show_generic_error($locale->text("The selected warehouse is empty, or no stocked items where found that match the filter settings.")); |
... | ... | |
313 | 312 |
# -------------------------------------------------------------------- |
314 | 313 |
|
315 | 314 |
sub transfer_assembly_update_part { |
316 |
$main::lxdebug->enter_sub(); |
|
317 |
|
|
318 | 315 |
my $form = $main::form; |
319 | 316 |
my %myconfig = %main::myconfig; |
320 | 317 |
my $locale = $main::locale; |
... | ... | |
322 | 319 |
$form->{trans_type} = 'assembly'; |
323 | 320 |
$form->{qty} = $form->parse_amount(\%myconfig, $form->{qty}); |
324 | 321 |
|
325 |
if (!$form->{partnumber} && !$form->{description}) {
|
|
326 |
delete @{$form}{qw(parts_id partunit)};
|
|
322 |
if (!$form->{parts_id}) {
|
|
323 |
delete $form->{partunit};
|
|
327 | 324 |
transfer_warehouse_selection(); |
325 |
return; |
|
328 | 326 |
|
329 |
} elsif (($form->{partnumber} && ($form->{partnumber} ne $form->{old_partnumber})) || $form->{description}) { |
|
330 |
$form->{assemblies} = 1; |
|
331 |
$form->{no_assemblies} = 0; |
|
332 |
my $parts = Common->retrieve_parts(\%myconfig, $form, 'description', 1); |
|
333 |
if (scalar @{ $parts } == 1) { |
|
334 |
@{$form}{qw(parts_id partnumber description)} = @{$parts->[0]}{qw(id partnumber description)}; |
|
335 |
transfer_stock_get_partunit(); |
|
336 |
transfer_warehouse_selection(); |
|
337 |
} else { |
|
338 |
select_part('transfer_stock_part_selected', @{ $parts }); |
|
339 |
} |
|
340 |
|
|
341 |
} else { |
|
342 |
transfer_stock_get_partunit(); |
|
343 |
transfer_warehouse_selection(); |
|
344 | 327 |
} |
345 | 328 |
|
346 |
# hier die oben benannte idee |
|
347 |
# my $maxcreate = Common->check_assembly_max_create(assembly_id => $form->{parts_id}, dbh => $my_dbh); |
|
348 |
$main::lxdebug->leave_sub(); |
|
329 |
my $part = SL::DB::Part->new(id => $::form->{parts_id})->load; |
|
330 |
@{$form}{qw(parts_id partnumber description)} = ($part->id, $part->partnumber, $part->description); |
|
331 |
|
|
332 |
transfer_stock_get_partunit(); |
|
333 |
transfer_warehouse_selection(); |
|
349 | 334 |
} |
350 | 335 |
|
351 | 336 |
sub transfer_stock_part_selected { |
js/part_selection.js | ||
---|---|---|
1 |
function part_selection_window(input_partnumber, input_description, input_partsid, allow_creation, formname, options) { |
|
2 |
var width = allow_creation ? 1000 : 800; |
|
3 |
var parm = centerParms(width,500) + ",width=" + width + ",height=500,status=yes,scrollbars=yes"; |
|
4 |
var partnumber = document.getElementsByName(input_partnumber)[0].value; |
|
5 |
var description = document.getElementsByName(input_description)[0].value; |
|
6 |
var action_on_part_selected = document.getElementsByName("action_on_part_selected")[0]; |
|
7 |
var form = (formname == undefined) ? document.forms[0] : document.getElementsByName(formname)[0]; |
|
8 |
var filter = document.getElementsByName(input_partnumber + "_filter")[0]; |
|
9 |
var input_partnotes = ""; |
|
10 |
|
|
11 |
if (input_partnumber.match(/_\d+$/)) { |
|
12 |
input_partnotes = input_partnumber; |
|
13 |
input_partnotes = input_partnotes.replace(/partnumber/, "partnotes"); |
|
14 |
if (input_partnotes == input_partnumber) |
|
15 |
input_partnotes = ""; |
|
16 |
} |
|
17 |
|
|
18 |
if (filter) |
|
19 |
filter = filter.value; |
|
20 |
else |
|
21 |
filter = ""; |
|
22 |
|
|
23 |
if (!options) |
|
24 |
options = ""; |
|
25 |
|
|
26 |
url = "common.pl?" + |
|
27 |
"INPUT_ENCODING=UTF-8&" + |
|
28 |
"action=part_selection_internal&" + |
|
29 |
"partnumber=" + encodeURIComponent(partnumber) + "&" + |
|
30 |
"description=" + encodeURIComponent(description) + "&" + |
|
31 |
"input_partnumber=" + encodeURIComponent(input_partnumber) + "&" + |
|
32 |
"input_description=" + encodeURIComponent(input_description) + "&" + |
|
33 |
"input_partsid=" + encodeURIComponent(input_partsid) + "&" + |
|
34 |
"input_partnotes=" + encodeURIComponent(input_partnotes) + "&" + |
|
35 |
"filter=" + encodeURIComponent(filter) + "&" + |
|
36 |
"options=" + encodeURIComponent(options) + "&" + |
|
37 |
"formname=" + encodeURIComponent(formname) + "&" + |
|
38 |
"allow_creation=" + (allow_creation ? "1" : "0") + "&" + |
|
39 |
"action_on_part_selected=" + (null == action_on_part_selected ? "" : action_on_part_selected.value); |
|
40 |
//alert(url); |
|
41 |
window.open(url, "_new_part_selection", parm); |
|
42 |
} |
|
43 |
|
locale/de/all | ||
---|---|---|
248 | 248 |
'Allow direct creation of new purchase delivery orders' => 'Direktes Anlegen neuer Einkaufslieferscheine zulassen', |
249 | 249 |
'Allow direct creation of new purchase invoices' => 'Direktes Anlegen neuer Einkaufsrechnungen zulassen', |
250 | 250 |
'Allow the following users access to my follow-ups:' => 'Erlaube den folgenden Benutzern Zugriff auf meine Wiedervorlagen:', |
251 |
'Alternatively you can create a new part which will then be selected.' => 'Sie können auch einen neuen Artikel anlegen, der dann automatisch ausgewählt wird.', |
|
252 | 251 |
'Always save orders with a projectnumber (create new projects)' => 'Aufträge immer mit Projektnummer speichern (neue Projekt erstellen)', |
253 | 252 |
'Amended Advance Turnover Tax Return' => 'Berichtigte Anmeldung', |
254 | 253 |
'Amount' => 'Betrag', |
... | ... | |
304 | 303 |
'Assemblies' => 'Erzeugnisse', |
305 | 304 |
'Assembly' => 'Erzeugnis', |
306 | 305 |
'Assembly (typeabbreviation)' => 'E', |
307 |
'Assembly Description' => 'Erzeugnis-Beschreibung', |
|
308 |
'Assembly Number' => 'Erzeugnis-Nummer', |
|
309 | 306 |
'Assembly Number missing!' => 'Erzeugnisnummer fehlt!', |
310 | 307 |
'Assembly items' => 'Erzeugnisbestandteile', |
311 | 308 |
'Asset' => 'Aktiva/Mittelverwendung', |
... | ... | |
1428 | 1425 |
'Hourly Rate' => 'Stundensatz', |
1429 | 1426 |
'Hourly rate' => 'Stundensatz', |
1430 | 1427 |
'How many do you want to create and print?' => 'Wie viele wollen Sie erstellen und drucken?', |
1431 |
'However, you can create a new part which will then be selected.' => 'Sie können jedoch einen neuen Artikel anlegen, der dann automatisch ausgewählt wird.', |
|
1432 | 1428 |
'I' => 'I', |
1433 | 1429 |
'IBAN' => 'IBAN', |
1434 | 1430 |
'ID' => 'Buchungsnummer', |
... | ... | |
1797 | 1793 |
'New filter for tax accounts' => 'Neue Filter für Steuerkonten', |
1798 | 1794 |
'New invoice' => 'Neue Rechnung', |
1799 | 1795 |
'New name' => 'Neuer Name', |
1800 |
'New part' => 'Neue Ware', |
|
1801 | 1796 |
'New row, description' => 'Neue Zeile, Artikelbeschreibung', |
1802 | 1797 |
'New row, partnumber' => 'Neue Zeile, Nummer', |
1803 | 1798 |
'New row, qty' => 'Neue Zeile, Menge', |
... | ... | |
1845 | 1840 |
'No internal phone extensions have been configured yet.' => 'Es wurden noch keine internen Durchwahlen konfiguriert.', |
1846 | 1841 |
'No invoices have been selected.' => 'Es wurden keine Rechnungen ausgewählt.', |
1847 | 1842 |
'No or an unknown authenticantion module specified in "config/kivitendo.conf".' => 'Es wurde kein oder ein unbekanntes Authentifizierungsmodul in "config/kivitendo.conf" angegeben.', |
1848 |
'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.', |
|
1849 | 1843 |
'No part was selected.' => 'Es wurde kein Artikel ausgewählt', |
1850 | 1844 |
'No parts classification has been created yet.' => 'Keine Artikel-Klassifizierung erzeugt.', |
1851 | 1845 |
'No payment term has been created yet.' => 'Es wurden noch keine Zahlungsbedingungen angelegt.', |
... | ... | |
2120 | 2114 |
'Please read the file' => 'Bitte lesen Sie die Datei', |
2121 | 2115 |
'Please select a customer from the list below.' => 'Bitte einen Endkunden aus der Liste auswählen', |
2122 | 2116 |
'Please select a customer.' => 'Bitte wählen Sie einen Kunden aus.', |
2123 |
'Please select a part from the list below.' => 'Bitte wählen Sie einen Artikel aus der Liste aus.', |
|
2124 | 2117 |
'Please select a vendor from the list below.' => 'Bitte einen Händler aus der Liste auswählen', |
2125 | 2118 |
'Please select a vendor.' => 'Bitte wählen Sie einen Lieferanten aus.', |
2126 | 2119 |
'Please select the dataset you want to delete:' => 'Bitte wählen Sie die zu löschende Datenbank aus:', |
... | ... | |
2517 | 2510 |
'Select Mulit-Item Options' => 'Multi-Treffer Auswahlliste', |
2518 | 2511 |
'Select a Customer' => 'Endkunde auswählen', |
2519 | 2512 |
'Select a customer' => 'Einen Kunden auswählen', |
2520 |
'Select a part' => 'Artikel auswählen', |
|
2521 |
'Select a part or assembly' => 'Artikel oder Erzeugnis auswählen', |
|
2522 | 2513 |
'Select a period' => 'Bitte Zeitraum auswählen', |
2523 | 2514 |
'Select a vendor' => 'Einen Lieferanten auswählen', |
2524 | 2515 |
'Select all' => 'Alle auswählen', |
templates/webpages/generic/part_selection.html | ||
---|---|---|
1 |
[%- USE T8 %] |
|
2 |
[%- USE HTML %] |
|
3 |
<h1>[% title %]</h1> |
|
4 |
|
|
5 |
<form action="[% HTML.escape(script) %]" method="post" name="Form"> |
|
6 |
|
|
7 |
<input type="hidden" name="input_partnumber" value="[% HTML.escape(input_partnumber) %]"> |
|
8 |
<input type="hidden" name="input_description" value="[% HTML.escape(input_description) %]"> |
|
9 |
<input type="hidden" name="input_partsid" value="[% HTML.escape(input_partsid) %]"> |
|
10 |
<input type="hidden" name="input_partnotes" value="[% HTML.escape(input_partnotes) %]"> |
|
11 |
<input type="hidden" name="allow_creation" value="[% HTML.escape(allow_creation) %]"> |
|
12 |
<input type="hidden" name="action_on_part_selected" value="[% HTML.escape(action_on_part_selected) %]"> |
|
13 |
<input type="hidden" name="filter" value="[% HTML.escape(filter) %]"> |
|
14 |
<input type="hidden" name="options" value="[% HTML.escape(options) %]"> |
|
15 |
<input type="hidden" name="new_description" value="[% HTML.escape(description) %]"> |
|
16 |
|
|
17 |
<table width="100%"> |
|
18 |
<tr> |
|
19 |
<td> |
|
20 |
[% IF no_parts_found %] |
|
21 |
[% 'No part was found matching the search parameters.' | $T8 %] |
|
22 |
[% IF allow_creation %] |
|
23 |
[% 'However, you can create a new part which will then be selected.' | $T8 %] |
|
24 |
[% END %] |
|
25 |
[% ELSE %] |
|
26 |
[% 'Please select a part from the list below.' | $T8 %] |
|
27 |
[% IF allow_creation %] |
|
28 |
[% 'Alternatively you can create a new part which will then be selected.' | $T8 %] |
|
29 |
[% END %] |
|
30 |
[% END %] |
|
31 |
</td> |
|
32 |
</tr> |
|
33 |
|
|
34 |
[% UNLESS no_parts_found %] |
|
35 |
<tr> |
|
36 |
<td> |
|
37 |
<table> |
|
38 |
<tr class="listheading"> |
|
39 |
<th class="listheading"> </th> |
|
40 |
[% FOREACH header = HEADER %] |
|
41 |
<th nowrap class="listheading"><a href="[% HTML.escape(header.callback) %]">[% header.column_title %]</a></th> |
|
42 |
[% END %] |
|
43 |
</tr> |
|
44 |
|
|
45 |
[% FOREACH part = PARTS %] |
|
46 |
<tr class="listrow[% IF loop.count % 2 %]1[% ELSE %]0[% END %]"> |
|
47 |
<td><button type="button" onclick="part_selected('[% loop.count %]')">[% 'Select' | $T8 %]</button></td> |
|
48 |
<td> |
|
49 |
<input type="hidden" id="partsid_[% loop.count %]" name="partsid_[% loop.count %]" value="[% HTML.escape(part.id) %]"> |
|
50 |
<input type="hidden" id="partnumber_[% loop.count %]" name="partnumber_[% loop.count %]" value="[% HTML.escape(part.partnumber) %]"> |
|
51 |
[% HTML.escape(part.partnumber) %] |
|
52 |
</td> |
|
53 |
<td> |
|
54 |
<input type="hidden" id="description_[% loop.count %]" name="description_[% loop.count %]" value="[% HTML.escape(part.description) %]"> |
|
55 |
<input type="hidden" id="partnotes_[% loop.count %]" name="partnotes_[% loop.count %]" value="[% HTML.escape(part.partnotes) %]"> |
|
56 |
[% HTML.escape(part.description) %] |
|
57 |
</td> |
|
58 |
<!-- <td> --> |
|
59 |
<!-- <input type="hidden" id="onhand_[% loop.count %]" name="onhand_[% loop.count %]" value="[% HTML.escape(part.onhand) %]"> --> |
|
60 |
<!-- [% HTML.escape(part.onhand) %] --> |
|
61 |
<!-- </td> --> |
|
62 |
</tr> |
|
63 |
[% END %] |
|
64 |
</table> |
|
65 |
</td> |
|
66 |
</tr> |
|
67 |
[% END %] |
|
68 |
</table> |
|
69 |
|
|
70 |
[% IF allow_creation %] |
|
71 |
<p><input type="submit" name="action" value="[% 'New part' | $T8 %]"></p> |
|
72 |
[% END %] |
|
73 |
|
|
74 |
</form> |
|
75 |
|
|
76 |
<script type="text/javascript"> |
|
77 |
<!-- |
|
78 |
function part_selected(selected) { |
|
79 |
var partnumber = document.getElementsByName("partnumber_" + selected)[0].value; |
|
80 |
var description = document.getElementsByName("description_" + selected)[0].value; |
|
81 |
var partsid = document.getElementsByName("partsid_" + selected)[0].value; |
|
82 |
var partnotes = document.getElementsByName("partnotes_" + selected)[0].value; |
|
83 |
var pnum_name = document.Form.input_partnumber.value; |
|
84 |
window.opener.document.getElementsByName(pnum_name)[0].value = partnumber; |
|
85 |
window.opener.document.getElementsByName(document.Form.input_description.value)[0].value = description; |
|
86 |
if (document.Form.input_partsid.value != "") { |
|
87 |
window.opener.document.getElementsByName(document.Form.input_partsid.value)[0].value = partsid; |
|
88 |
} |
|
89 |
if (document.Form.input_partnotes.value != "") { |
|
90 |
var el = window.opener.document.getElementsByName(document.Form.input_partnotes.value)[0]; |
|
91 |
if (el) |
|
92 |
el.value = partnotes; |
|
93 |
} |
|
94 |
if (document.Form.action_on_part_selected.value != "") { |
|
95 |
window.opener.document.getElementsByName("action")[0].value = document.Form.action_on_part_selected.value; |
|
96 |
window.opener.document.[% formname %].submit(); |
|
97 |
} |
|
98 |
|
|
99 |
|
|
100 |
var prefix = ""; |
|
101 |
if (pnum_name.substr(0, 2) == "f_") { |
|
102 |
prefix = "f_"; |
|
103 |
pnum_name = pnum_name.substr(2); |
|
104 |
} |
|
105 |
pnum_name = prefix + "old_" + pnum_name; |
|
106 |
var input = window.opener.document.getElementsByName(pnum_name)[0]; |
|
107 |
if (input) { |
|
108 |
input.value = name; |
|
109 |
} |
|
110 |
|
|
111 |
[%- IF click_button %] |
|
112 |
window.opener.document.[% formname %].[% click_button %].click(); |
|
113 |
[%- END %] |
|
114 |
|
|
115 |
self.close(); |
|
116 |
} |
|
117 |
//--> |
|
118 |
</script> |
|
119 |
|
templates/webpages/generic/select_part.html | ||
---|---|---|
1 |
[%- USE T8 %] |
|
2 |
[%- USE HTML %] |
|
3 |
<form method="post" action="[% HTML.escape(script) %]"> |
|
4 |
|
|
5 |
<input type="hidden" name="nextsub" value="[% HTML.escape(nextsub) %]"> |
|
6 |
<input type="hidden" name="callback_sub" value="[% HTML.escape(callback_sub) %]"> |
|
7 |
|
|
8 |
<input type="hidden" name="old_form" value="[% HTML.escape(old_form) %]"> |
|
9 |
<input type="hidden" name="remap_parts_id" value="[% HTML.escape(remap_parts_id) %]"> |
|
10 |
<input type="hidden" name="remap_partnumber" value="[% HTML.escape(remap_partnumber) %]"> |
|
11 |
|
|
12 |
<h1>[% 'Select a part or assembly' | $T8 %]</h1> |
|
13 |
|
|
14 |
<p> |
|
15 |
<table> |
|
16 |
<tr> |
|
17 |
<th class="listheading"> </th> |
|
18 |
<th class="listheading">[% 'Number' | $T8 %]</th> |
|
19 |
<th class="listheading">[% 'Description' | $T8 %]</th> |
|
20 |
[% IF has_charge %] |
|
21 |
<th class="listheading">[% 'Charge number' | $T8 %]</th> |
|
22 |
[% END %] |
|
23 |
[% IF has_bestbefore %] |
|
24 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
25 |
<th class="listheading">[% 'Best Before' | $T8 %]</th> |
|
26 |
[% END %] |
|
27 |
[% END %] |
|
28 |
[% IF has_ean %] |
|
29 |
<th class="listheading">[% 'EAN' | $T8 %]</th> |
|
30 |
[% END %] |
|
31 |
</tr> |
|
32 |
|
|
33 |
[% FOREACH part = PARTS %] |
|
34 |
<tr class="listrow[% loop.count % 2 %]"> |
|
35 |
<td> |
|
36 |
<input type="radio" name="selection" value="[% loop.count %]"[% IF loop.first %] checked[% END %]> |
|
37 |
</td> |
|
38 |
|
|
39 |
<td> |
|
40 |
<input type="hidden" name="new_id_[% loop.count %]" value="[% HTML.escape(part.id) %]"> |
|
41 |
<input type="hidden" name="new_number_[% loop.count %]" value="[% HTML.escape(part.number) %]"> |
|
42 |
<input type="hidden" name="new_warehouse_id_[% loop.count %]" value="[% HTML.escape(part.warehouse_id) %]"> |
|
43 |
<input type="hidden" name="new_bin_id_[% loop.count %]" value="[% HTML.escape(part.bin_id) %]"> |
|
44 |
[% HTML.escape(part.number) %] |
|
45 |
</td> |
|
46 |
|
|
47 |
<td> |
|
48 |
<input type="hidden" name="new_description_[% loop.count %]" value="[% HTML.escape(part.description) %]"> |
|
49 |
[% HTML.escape(part.description) %] |
|
50 |
</td> |
|
51 |
|
|
52 |
[% IF has_charge %] |
|
53 |
<td> |
|
54 |
<input type="hidden" name="new_charge_id_[% loop.count %]" value="[% HTML.escape(part.charge_id) %]"> |
|
55 |
<input type="hidden" name="new_chargenumber_[% loop.count %]" value="[% HTML.escape(part.chargenumber) %]"> |
|
56 |
[% HTML.escape(part.chargenumber) %] |
|
57 |
</td> |
|
58 |
[% END %] |
|
59 |
[% IF has_bestbefore %] |
|
60 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
61 |
<td> |
|
62 |
<input type="hidden" name="new_bestbefore_id_[% loop.count %]" value="[% HTML.escape(part.bestbefore_id) %]"> |
|
63 |
<input type="hidden" name="new_bestbefore_[% loop.count %]" value="[% HTML.escape(part.bestbefore) %]"> |
|
64 |
[% HTML.escape(part.bestbefore) %] |
|
65 |
</td> |
|
66 |
[% END %] |
|
67 |
[% END %] |
|
68 |
[% IF has_ean %] |
|
69 |
<td> |
|
70 |
<input type="hidden" name="new_ean_[% loop.count %]" value="[% HTML.escape(part.ean) %]"> |
|
71 |
[% HTML.escape(part.ean) %] |
|
72 |
[% END %] |
|
73 |
</td> |
|
74 |
</tr> |
|
75 |
[% END %] |
|
76 |
</table> |
|
77 |
</p> |
|
78 |
|
|
79 |
<p> |
|
80 |
<input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]"> |
|
81 |
</p> |
|
82 |
|
|
83 |
</form> |
|
84 |
|
templates/webpages/wh/warehouse_selection.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 | 2 |
[%- USE HTML %] |
3 | 3 |
[%- USE L %] |
4 |
[%- USE JavaScript %] |
|
4 |
[%- USE JavaScript %][%- USE P -%]
|
|
5 | 5 |
<h1>[% title %]</h1> |
6 | 6 |
|
7 |
<script type="text/javascript" src="js/common.js"></script> |
|
8 |
<script type="text/javascript" src="js/part_selection.js"></script> |
|
9 | 7 |
<script type="text/javascript"> |
10 | 8 |
<!-- |
11 | 9 |
warehouses = new Array(); |
... | ... | |
98 | 96 |
</tr> |
99 | 97 |
|
100 | 98 |
<tr> |
101 |
<th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
|
|
99 |
<th align="right" nowrap>[% 'Part' | $T8 %]</th> |
|
102 | 100 |
<td> |
103 |
<input type="hidden" name="parts_id" id="parts_id"> |
|
104 |
<input name="partnumber" id="partnumber" size="30"> |
|
105 |
</td> |
|
106 |
</tr> |
|
107 |
|
|
108 |
<tr> |
|
109 |
<th align="right" nowrap>[% 'Part Description' | $T8 %]</th> |
|
110 |
<td> |
|
111 |
<input name="description" size="30"> |
|
112 |
<input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', '')" value="?"> |
|
101 |
[% P.part_picker("part_id", '', size="30", part_type="part,assembly") %] |
|
113 | 102 |
</td> |
114 | 103 |
</tr> |
115 | 104 |
|
templates/webpages/wh/warehouse_selection_assembly.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 | 2 |
[%- USE L %] |
3 |
[%- USE HTML %][%- USE JavaScript %][%- USE LxERP %] |
|
3 |
[%- USE HTML %][%- USE JavaScript %][%- USE LxERP %][%- USE P -%]
|
|
4 | 4 |
<h1>[% title %]</h1> |
5 | 5 |
|
6 |
<script type="text/javascript" src="js/common.js"></script> |
|
7 |
<script type="text/javascript" src="js/part_selection.js"></script> |
|
8 | 6 |
<script type="text/javascript"> |
9 | 7 |
<!-- |
10 | 8 |
warehouses = new Array(); |
... | ... | |
85 | 83 |
</tr> |
86 | 84 |
|
87 | 85 |
<tr> |
88 |
<th align="right" nowrap>[% 'Assembly Number' | $T8 %]</th>
|
|
86 |
<th align="right" nowrap>[% 'Assembly' | $T8 %]</th> |
|
89 | 87 |
<td> |
90 |
<input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]"> |
|
91 |
<input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]"> |
|
92 |
<input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]"> |
|
93 |
</td> |
|
94 |
</tr> |
|
95 |
|
|
96 |
<tr> |
|
97 |
<th align="right" nowrap>[% 'Assembly Description' | $T8 %]</th> |
|
98 |
<td> |
|
99 |
<input name="description" size="30" value="[% HTML.escape(description) %]"> |
|
100 |
<input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'assemblies:click_button=update_button')" value="?"> |
|
88 |
[% P.part_picker("parts_id", parts_id, part_type="assembly") %] |
|
101 | 89 |
</td> |
102 | 90 |
</tr> |
103 | 91 |
|
Auch abrufbar als: Unified diff
Lager: Umstellung auf Verwendung vom Part-Picker
Dadurch wurden mehrere alte Artikel-Auswahl-Routinen und -Vorlagen
überflüssig, die gleich entfernt wurden.