Revision 9c29f718
Von Sven Schöling vor fast 7 Jahren hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
19 | 19 |
use SL::CVar; |
20 | 20 |
use SL::MoreCommon qw(save_form); |
21 | 21 |
use Carp; |
22 |
use SL::Presenter::EscapedText qw(escape is_escaped); |
|
22 | 23 |
|
23 | 24 |
use Rose::Object::MakeMethods::Generic ( |
24 | 25 |
'scalar --get_set_init' => [ qw(parts models part p warehouses multi_items_models |
... | ... | |
408 | 409 |
my $count = $_[0]->multi_items_models->count; |
409 | 410 |
|
410 | 411 |
if ($count == 0) { |
411 |
my $text = SL::Presenter::EscapedText->new(text => $::locale->text('No results.'));
|
|
412 |
my $text = escape($::locale->text('No results.'));
|
|
412 | 413 |
$_[0]->render($text, { layout => 0 }); |
413 | 414 |
} elsif ($count > $max_count) { |
414 |
my $text = SL::Presenter::EscapedText->new(text => $::locale->text('Too many results (#1 from #2).', $count, $max_count));
|
|
415 |
my $text = escpae($::locale->text('Too many results (#1 from #2).', $count, $max_count));
|
|
415 | 416 |
$_[0]->render($text, { layout => 0 }); |
416 | 417 |
} else { |
417 | 418 |
my $multi_items = $_[0]->multi_items_models->get; |
SL/IC.pm | ||
---|---|---|
45 | 45 |
use SL::TransNumber; |
46 | 46 |
use SL::Util qw(trim); |
47 | 47 |
use SL::DB; |
48 |
use SL::Presenter::Part qw(type_abbreviation classification_abbreviation separate_abbreviation); |
|
48 | 49 |
use Carp; |
49 | 50 |
|
50 | 51 |
use strict; |
... | ... | |
640 | 641 |
} |
641 | 642 |
|
642 | 643 |
$j++; |
643 |
$form->{"type_and_classific_$j"} = $::request->presenter->type_abbreviation($ref->{part_type}).
|
|
644 |
$::request->presenter->classification_abbreviation($ref->{classification_id});
|
|
644 |
$form->{"type_and_classific_$j"} = type_abbreviation($ref->{part_type}). |
|
645 |
classification_abbreviation($ref->{classification_id}); |
|
645 | 646 |
$form->{"id_$j"} = $ref->{id}; |
646 | 647 |
$form->{"partnumber_$j"} = $ref->{partnumber}; |
647 | 648 |
$form->{"description_$j"} = $ref->{description}; |
... | ... | |
938 | 939 |
my $id = $form->{"${prefix}${i}"}; |
939 | 940 |
next unless $id; |
940 | 941 |
my $prt = $parts_by_id{$id}; |
941 |
my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type);
|
|
942 |
my $type_abbr = type_abbreviation($prt->part_type); |
|
942 | 943 |
push @{ $template_arrays{part_type} }, $prt->part_type; |
943 | 944 |
push @{ $template_arrays{part_abbreviation} }, $type_abbr; |
944 |
push @{ $template_arrays{type_and_classific}}, $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id);
|
|
945 |
push @{ $template_arrays{separate} }, $::request->presenter->separate_abbreviation($prt->classification_id);
|
|
945 |
push @{ $template_arrays{type_and_classific}}, $type_abbr . classification_abbreviation($prt->classification_id);
|
|
946 |
push @{ $template_arrays{separate} }, separate_abbreviation($prt->classification_id); |
|
946 | 947 |
} |
947 | 948 |
|
948 | 949 |
$main::lxdebug->leave_sub(); |
bin/mozilla/ic.pl | ||
---|---|---|
41 | 41 |
use SL::IC; |
42 | 42 |
use SL::Helper::Flash qw(flash); |
43 | 43 |
use SL::HTML::Util; |
44 |
use SL::Presenter::Part; |
|
44 | 45 |
use SL::ReportGenerator; |
45 | 46 |
|
46 | 47 |
#use SL::PE; |
... | ... | |
556 | 557 |
map { $row->{$_}{link} = $ref->{$_} } qw(drawing microfiche); |
557 | 558 |
|
558 | 559 |
$row->{notes}{data} = SL::HTML::Util->strip($ref->{notes}); |
559 |
$row->{type_and_classific}{data} = $::request->presenter->type_abbreviation($ref->{part_type}).
|
|
560 |
$::request->presenter->classification_abbreviation($ref->{classification_id});
|
|
560 |
$row->{type_and_classific}{data} = SL::Presenter::Part::type_abbreviation($ref->{part_type}).
|
|
561 |
SL::Presenter::Part::classification_abbreviation($ref->{classification_id});
|
|
561 | 562 |
|
562 | 563 |
$report->add_data($row); |
563 | 564 |
|
templates/webpages/ic/search.html | ||
---|---|---|
54 | 54 |
</tr> |
55 | 55 |
<tr> |
56 | 56 |
<th align="right" nowrap>[% 'Part Classification' | $T8 %]:</th> |
57 |
<td>[% P.select_classification('classification_id', style=style) %]</td> |
|
57 |
<td>[% P.part.select_classification('classification_id', style=style) %]</td>
|
|
58 | 58 |
</tr> |
59 | 59 |
<tr> |
60 | 60 |
<th align="right" nowrap>[% 'Part Description' | $T8 %]</th> |
templates/webpages/part/_assembly.html | ||
---|---|---|
2 | 2 |
[%- USE HTML %] |
3 | 3 |
[%- USE LxERP %] |
4 | 4 |
[%- USE L %] |
5 |
[%- USE P %] |
|
5 | 6 |
|
6 | 7 |
<div id="assembly" name="assembly"> |
7 | 8 |
|
... | ... | |
41 | 42 |
<td></td> |
42 | 43 |
<td></td> |
43 | 44 |
<td align="right">[% 'Part' | $T8 %]:</td> |
44 |
<td>[% L.part_picker('add_items[+].parts_id', '', style='width: 300px', multiple=1, id='assembly_picker', action={set_multi_items='kivi.Part.set_multi_assembly_items', commit_one='kivi.Part.add_assembly_item'}) %]</td>
|
|
45 |
<td>[% P.part.picker('add_items[+].parts_id', '', style='width: 300px', multiple=1, id='assembly_picker', action={set_multi_items='kivi.Part.set_multi_assembly_items', commit_one='kivi.Part.add_assembly_item'}) %]</td>
|
|
45 | 46 |
<td>[%- L.button_tag("kivi.Part.add_assembly_item()", LxERP.t8("Add")) %]</td> |
46 | 47 |
<td>[% L.button_tag('$("#assembly_picker").data("part_picker").open_dialog()', LxERP.t8('Add multiple items')) %]</td> |
47 | 48 |
<td>[% L.hidden_tag('add_items[].qty_as_number', 1) %]</td> |
templates/webpages/part/_assembly_row.html | ||
---|---|---|
22 | 22 |
<img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop"> |
23 | 23 |
</td> |
24 | 24 |
<td nowrap> |
25 |
[% P.part(ITEM.part) %]
|
|
25 |
[% ITEM.part.presenter.part %]
|
|
26 | 26 |
</td> |
27 | 27 |
<td nowrap> |
28 |
[% P.type_abbreviation(ITEM.part.part_type) %][% P.classification_abbreviation(ITEM.part.classification_id) %] |
|
28 |
[% P.part.type_abbreviation(ITEM.part.part_type) %][% P.classification_abbreviation(ITEM.part.classification_id) %]
|
|
29 | 29 |
</td> |
30 | 30 |
<td> |
31 | 31 |
[% HTML.escape(ITEM.part.description) %] |
templates/webpages/part/_assortment.html | ||
---|---|---|
2 | 2 |
[%- USE HTML %] |
3 | 3 |
[%- USE LxERP %] |
4 | 4 |
[%- USE L %] |
5 |
[%- USE P %] |
|
5 | 6 |
|
6 | 7 |
<div id="assortment" name="assortment"> |
7 | 8 |
|
... | ... | |
40 | 41 |
<td></td> |
41 | 42 |
<td></td> |
42 | 43 |
<td align="right">[% 'Part' | $T8 %]:</td> |
43 |
<td>[% L.part_picker('add_items[+].parts_id', '', style='width: 300px', multiple=1, id='assortment_picker', action={set_multi_items='kivi.Part.set_multi_assortment_items'}) %]</td>
|
|
44 |
<td>[% P.part.picker('add_items[+].parts_id', '', style='width: 300px', multiple=1, id='assortment_picker', action={set_multi_items='kivi.Part.set_multi_assortment_items'}) %]</td>
|
|
44 | 45 |
<td>[%- L.button_tag("kivi.Part.add_assortment_item()", LxERP.t8("Add")) %]</td> |
45 | 46 |
<td>[% L.button_tag('$("#assortment_picker").data("part_picker").open_dialog()', LxERP.t8('Add multiple items')) %]</td> |
46 | 47 |
<td>[% L.hidden_tag('add_items[].qty_as_number', 1) %]</td> |
templates/webpages/part/_assortment_row.html | ||
---|---|---|
22 | 22 |
<img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop"> |
23 | 23 |
</td> |
24 | 24 |
<td nowrap> |
25 |
[% P.part(ITEM.part) %]
|
|
25 |
[% ITEM.part.presenter.part %]
|
|
26 | 26 |
</td> |
27 | 27 |
<td> |
28 | 28 |
[% HTML.escape(ITEM.part.description) %] |
templates/webpages/part/_basic_data.html | ||
---|---|---|
23 | 23 |
</tr> |
24 | 24 |
<tr> |
25 | 25 |
<th align="right">[% 'Part Classification' | $T8 %]</th> |
26 |
<td>[% P.select_classification('part.classification_id', default => SELF.part.classification_id, type => SELF.parts_classification_filter ) %]</td> |
|
26 |
<td>[% P.part.select_classification('part.classification_id', default => SELF.part.classification_id, type => SELF.parts_classification_filter ) %]</td>
|
|
27 | 27 |
</tr> |
28 | 28 |
<tr> |
29 | 29 |
<th align="right">[% 'Part Description' | $T8 %]</th> |
templates/webpages/part/_makemodel.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 | 2 |
[%- USE L %] |
3 |
[%- USE P %] |
|
3 | 4 |
[%- USE HTML %] |
4 | 5 |
[%- USE LxERP %] |
5 | 6 |
<tr> |
... | ... | |
30 | 31 |
<td></td> |
31 | 32 |
<td></td> |
32 | 33 |
<td align="right">[% 'Vendor' | $T8 %]</td> |
33 |
<td rowspan="2">[% L.customer_vendor_picker('add_makemodel', '', type='vendor', style='width: 300px', class="add_makemodel_input") %]</td>
|
|
34 |
<td rowspan="2">[% P.customer_vendor.picker('add_makemodel', '', type='vendor', style='width: 300px', class="add_makemodel_input") %]</td>
|
|
34 | 35 |
<td rowspan="2" align="right">[% L.button_tag('kivi.Part.add_makemodel_row()', LxERP.t8('Add')) %]</td> |
35 | 36 |
</tr> |
36 | 37 |
</tbody> |
templates/webpages/part/_multi_items_result.html | ||
---|---|---|
25 | 25 |
class = 'multi_items_qty numeric') %] |
26 | 26 |
</td> |
27 | 27 |
<td>[% HTML.escape(item.unit) %]</td> |
28 |
<td>[% P.part(item) %] [% HTML.escape(item.description) %]</td>
|
|
28 |
<td>[% item.presenter.part %] [% HTML.escape(item.description) %]</td>
|
|
29 | 29 |
<td class="numeric">[% HTML.escape(item.sellprice_as_number) %]</td> |
30 | 30 |
<td class="numeric">[% HTML.escape(item.partsgroup.partsgroup) %]</td> |
31 | 31 |
</tr> |
templates/webpages/part/_part_picker_result.html | ||
---|---|---|
16 | 16 |
<span class='ppp_block_description'>[% part.description | html %]</span> |
17 | 17 |
<div style='clear:both;'></div> |
18 | 18 |
<span class='ppp_block_sellprice'>[% 'Sellprice' | $T8 %]: [% part.sellprice_as_number | html %]</span> |
19 |
<span class='ppp_block_description'>[% P.typeclass_abbreviation(part) %]</span>
|
|
19 |
<span class='ppp_block_description'>[% part.presenter.typeclass_abbreviation %]</span>
|
|
20 | 20 |
</div> |
21 | 21 |
[%- END %] |
22 | 22 |
|
templates/webpages/part/test_page.html | ||
---|---|---|
1 | 1 |
[% USE L %] |
2 |
[% USE P %] |
|
2 | 3 |
|
3 | 4 |
<h1>Part Picker Testpage</h1> |
4 | 5 |
|
5 | 6 |
<br> |
6 | 7 |
Alle: <br> |
7 |
[% L.part_picker('part_id') %] text<br>
|
|
8 |
[% P.part.picker('part_id') %] text<br>
|
|
8 | 9 |
Nur Waren: <br> |
9 |
[% L.part_picker('part_id2', undef, part_type='part') %]<br>
|
|
10 |
[% P.part.picker('part_id2', undef, part_type='part') %]<br>
|
|
10 | 11 |
Nur Dienstleistungen: <br> |
11 |
[% L.part_picker('part_id3', undef, part_type='service') %]<br>
|
|
12 |
[% P.part.picker('part_id3', undef, part_type='service') %]<br>
|
|
12 | 13 |
Nur Erzeugnisse: <br> |
13 |
[% L.part_picker('part_id4', undef, part_type='assembly') %]<br>
|
|
14 |
[% P.part.picker('part_id4', undef, part_type='assembly') %]<br>
|
|
14 | 15 |
Waren und Dienstleistungen: <br> |
15 |
[% L.part_picker('part_id5', undef, part_type='part,service') %]<br>
|
|
16 |
[% P.part.picker('part_id5', undef, part_type='part,service') %]<br>
|
|
16 | 17 |
Artikel-Klassifizierung: Einkauf <br> |
17 |
[% L.part_picker('part_id10', undef, classification_id='1') %]<br>
|
|
18 |
[% P.part.picker('part_id10', undef, classification_id='1') %]<br>
|
|
18 | 19 |
Artikel-Klassifizierung: Verkauf <br> |
19 |
[% L.part_picker('part_id11', undef, classification_id='2') %]<br>
|
|
20 |
[% P.part.picker('part_id11', undef, classification_id='2') %]<br>
|
|
20 | 21 |
Artikel-Klassifizierung: Handelsware <br> |
21 |
[% L.part_picker('part_id12', undef, classification_id='3') %]<br>
|
|
22 |
[% P.part.picker('part_id12', undef, classification_id='3') %]<br>
|
|
22 | 23 |
Artikel-Klassifizierung: Produktion <br> |
23 |
[% L.part_picker('part_id13', undef, classification_id='4') %]<br>
|
|
24 |
[% P.part.picker('part_id13', undef, classification_id='4') %]<br>
|
|
24 | 25 |
Artikel-Klassifizierung: Eink.,Verk.,Prod. <br> |
25 |
[% L.part_picker('part_id14', undef, classification_id='1,2,4') %]<br>
|
|
26 |
[% P.part.picker('part_id14', undef, classification_id='1,2,4') %]<br>
|
|
26 | 27 |
Pre-filled:<br> |
27 |
[% L.part_picker('part_id6', pre_filled_part) %]<br>
|
|
28 |
[% P.part.picker('part_id6', pre_filled_part) %]<br>
|
|
28 | 29 |
Convertible unit 'Std': (only select parts with unit Tag/Std/Min)<br> |
29 |
[% L.part_picker('part_id7', undef, convertible_unit='Std') %]<br>
|
|
30 |
[% P.part.picker('part_id7', undef, convertible_unit='Std') %]<br>
|
|
30 | 31 |
|
31 | 32 |
With multi select popup<br> |
32 |
[% L.part_picker('part_id8', undef, multiple=1) %]<br>
|
|
33 |
[% P.part.picker('part_id8', undef, multiple=1) %]<br>
|
|
33 | 34 |
|
34 | 35 |
<h2>Styling</h2> |
35 | 36 |
|
36 | 37 |
In a span: |
37 |
<span>Leading text: [% L.part_picker('p1', undef, part_type='part,service') %] and text after with spacing</span><br>
|
|
38 |
<span>Leading text:[% L.part_picker('p2', undef, part_type='part,service') %]and text after without spacing</span><br>
|
|
39 |
<div>Leading text: [% L.part_picker('p3', undef, part_type='part,service') %] and text after with spacing with div</div><br>
|
|
40 |
<div>Leading text:[% L.part_picker('p4', undef, part_type='part,service') %]and text after with spacing with div</div><br>
|
|
38 |
<span>Leading text: [% P.part.picker('p1', undef, part_type='part,service') %] and text after with spacing</span><br>
|
|
39 |
<span>Leading text:[% P.part.picker('p2', undef, part_type='part,service') %]and text after without spacing</span><br>
|
|
40 |
<div>Leading text: [% P.part.picker('p3', undef, part_type='part,service') %] and text after with spacing with div</div><br>
|
|
41 |
<div>Leading text:[% P.part.picker('p4', undef, part_type='part,service') %]and text after with spacing with div</div><br>
|
|
41 | 42 |
|
42 |
<span>Picker + input next to each other: [% L.part_picker('p5', undef, part_type='part,service', width="100%") %]<input type=text></span>
|
|
43 |
<span>Picker + input next to each other: [% P.part.picker('p5', undef, part_type='part,service', width="100%") %]<input type=text></span>
|
|
43 | 44 |
|
44 |
<div>[% L.part_picker('p6', undef, part_type='part,service', style="width:500px") %] 500px width</div>
|
|
45 |
<div>[% L.part_picker('p7', undef, part_type='part,service', style="width:200px") %] 200px width</div>
|
|
46 |
<div>[% L.part_picker('p8', undef, part_type='part,service', style="height:40px") %] 40px height</div>
|
|
45 |
<div>[% P.part.picker('p6', undef, part_type='part,service', style="width:500px") %] 500px width</div>
|
|
46 |
<div>[% P.part.picker('p7', undef, part_type='part,service', style="width:200px") %] 200px width</div>
|
|
47 |
<div>[% P.part.picker('p8', undef, part_type='part,service', style="height:40px") %] 40px height</div>
|
|
47 | 48 |
|
48 | 49 |
[%# FOREACH i IN 1..50 %] |
49 |
[%# L.part_picker('part_id_' _ i) %] <br>
|
|
50 |
[%# P.part.picker('part_id_' _ i) %] <br>
|
|
50 | 51 |
[%# END %] |
51 | 52 |
|
52 | 53 |
<h2>In tables</h2> |
... | ... | |
56 | 57 |
<table> |
57 | 58 |
<tr> |
58 | 59 |
<th>Part picker in table heading</th> |
59 |
<th>[% L.part_picker('p9', undef, part_type='part,service') %]</th>
|
|
60 |
<th>[% P.part.picker('p9', undef, part_type='part,service') %]</th>
|
|
60 | 61 |
</tr> |
61 | 62 |
<tr> |
62 | 63 |
<td>Part picker in table cell</td> |
63 |
<td>[% L.part_picker('p10', undef, part_type='part,service') %]</td>
|
|
64 |
<td>[% P.part.picker('p10', undef, part_type='part,service') %]</td>
|
|
64 | 65 |
</tr> |
65 | 66 |
</table> |
66 | 67 |
|
... | ... | |
69 | 70 |
<table> |
70 | 71 |
<tr class=listheading> |
71 | 72 |
<th>Part picker in table heading</th> |
72 |
<th>[% L.part_picker('p11', undef, part_type='part,service') %]</th>
|
|
73 |
<th>[% P.part.picker('p11', undef, part_type='part,service') %]</th>
|
|
73 | 74 |
</tr> |
74 | 75 |
<tr class=listrow> |
75 | 76 |
<td>Part picker in table cell</td> |
76 |
<td>[% L.part_picker('p12', undef, part_type='part,service') %]</td>
|
|
77 |
<td>[% P.part.picker('p12', undef, part_type='part,service') %]</td>
|
|
77 | 78 |
</tr> |
78 | 79 |
</table> |
Auch abrufbar als: Unified diff
Presenter: Neue Struktur im Warenstamm umgesetzt