Revision 486d0a3b
Von Bernd Bleßmann vor mehr als 4 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
54 | 54 |
use SL::GenericTranslations; |
55 | 55 |
use SL::Helper::UserPreferences::PositionsScrollbar; |
56 | 56 |
use SL::Helper::UserPreferences::PartPickerSearch; |
57 |
use SL::Helper::UserPreferences::UpdatePositions; |
|
57 | 58 |
|
58 | 59 |
use strict; |
59 | 60 |
|
... | ... | |
541 | 542 |
SL::Helper::UserPreferences::PartPickerSearch->new()->get_sales_search_customer_partnumber(); |
542 | 543 |
} |
543 | 544 |
|
545 |
sub positions_show_update_button { |
|
546 |
SL::Helper::UserPreferences::UpdatePositions->new()->get_show_update_button(); |
|
547 |
} |
|
548 |
|
|
544 | 549 |
sub save_preferences { |
545 | 550 |
$main::lxdebug->enter_sub(); |
546 | 551 |
|
... | ... | |
575 | 580 |
if (exists $form->{sales_search_customer_partnumber}) { |
576 | 581 |
SL::Helper::UserPreferences::PartPickerSearch->new()->store_sales_search_customer_partnumber($form->{sales_search_customer_partnumber}) |
577 | 582 |
} |
583 |
if (exists $form->{positions_show_update_button}) { |
|
584 |
SL::Helper::UserPreferences::UpdatePositions->new()->store_show_update_button($form->{positions_show_update_button}) |
|
585 |
} |
|
578 | 586 |
|
579 | 587 |
$main::lxdebug->leave_sub(); |
580 | 588 |
|
SL/Controller/Order.pm | ||
---|---|---|
26 | 26 |
use SL::Helper::PrintOptions; |
27 | 27 |
use SL::Helper::ShippedQty; |
28 | 28 |
use SL::Helper::UserPreferences::PositionsScrollbar; |
29 |
use SL::Helper::UserPreferences::UpdatePositions; |
|
29 | 30 |
|
30 | 31 |
use SL::Controller::Helper::GetModels; |
31 | 32 |
|
... | ... | |
40 | 41 |
use Rose::Object::MakeMethods::Generic |
41 | 42 |
( |
42 | 43 |
scalar => [ qw(item_ids_to_delete) ], |
43 |
'scalar --get_set_init' => [ qw(order valid_types type cv p multi_items_models all_price_factors search_cvpartnumber) ], |
|
44 |
'scalar --get_set_init' => [ qw(order valid_types type cv p multi_items_models all_price_factors search_cvpartnumber show_update_button) ],
|
|
44 | 45 |
); |
45 | 46 |
|
46 | 47 |
|
... | ... | |
795 | 796 |
TYPE => $self->type, |
796 | 797 |
ALL_PRICE_FACTORS => $self->all_price_factors, |
797 | 798 |
SEARCH_CVPARTNUMBER => $self->search_cvpartnumber, |
799 |
SHOW_UPDATE_BUTTON => $self->show_update_button, |
|
798 | 800 |
); |
799 | 801 |
|
800 | 802 |
$self->js |
... | ... | |
823 | 825 |
TYPE => $self->type, |
824 | 826 |
ALL_PRICE_FACTORS => $self->all_price_factors, |
825 | 827 |
SEARCH_CVPARTNUMBER => $self->search_cvpartnumber, |
828 |
SHOW_UPDATE_BUTTON => $self->show_update_button, |
|
826 | 829 |
); |
827 | 830 |
$self->js |
828 | 831 |
->append('#row_table_id', $row_as_html); |
... | ... | |
906 | 909 |
TYPE => $self->type, |
907 | 910 |
ALL_PRICE_FACTORS => $self->all_price_factors, |
908 | 911 |
SEARCH_CVPARTNUMBER => $self->search_cvpartnumber, |
912 |
SHOW_UPDATE_BUTTON => $self->show_update_button, |
|
909 | 913 |
); |
910 | 914 |
|
911 | 915 |
$self->js->append('#row_table_id', $row_as_html); |
... | ... | |
1208 | 1212 |
return $search_cvpartnumber; |
1209 | 1213 |
} |
1210 | 1214 |
|
1215 |
sub init_show_update_button { |
|
1216 |
my ($self) = @_; |
|
1217 |
|
|
1218 |
!!SL::Helper::UserPreferences::UpdatePositions->new()->get_show_update_button(); |
|
1219 |
} |
|
1220 |
|
|
1211 | 1221 |
sub init_p { |
1212 | 1222 |
SL::Presenter->get; |
1213 | 1223 |
} |
SL/Helper/UserPreferences/UpdatePositions.pm | ||
---|---|---|
1 |
package SL::Helper::UserPreferences::UpdatePositions; |
|
2 |
|
|
3 |
use strict; |
|
4 |
use parent qw(Rose::Object); |
|
5 |
|
|
6 |
use Carp; |
|
7 |
use List::MoreUtils qw(none); |
|
8 |
|
|
9 |
use SL::Helper::UserPreferences; |
|
10 |
|
|
11 |
use Rose::Object::MakeMethods::Generic ( |
|
12 |
'scalar --get_set_init' => [ qw(user_prefs) ], |
|
13 |
); |
|
14 |
|
|
15 |
sub get_show_update_button { |
|
16 |
!!$_[0]->user_prefs->get('show_update_button'); |
|
17 |
} |
|
18 |
|
|
19 |
sub store_show_update_button { |
|
20 |
$_[0]->user_prefs->store('show_update_button', $_[1]); |
|
21 |
} |
|
22 |
|
|
23 |
sub init_user_prefs { |
|
24 |
SL::Helper::UserPreferences->new( |
|
25 |
namespace => $_[0]->namespace, |
|
26 |
) |
|
27 |
} |
|
28 |
|
|
29 |
# read only stuff |
|
30 |
sub namespace { 'UpdatePositions' } |
|
31 |
sub version { 1 } |
|
32 |
|
|
33 |
1; |
|
34 |
|
|
35 |
__END__ |
|
36 |
|
|
37 |
=pod |
|
38 |
|
|
39 |
=encoding utf-8 |
|
40 |
|
|
41 |
=head1 NAME |
|
42 |
|
|
43 |
SL::Helper::UserPreferences::UpdatePositions - preferences intended |
|
44 |
to store user settings for displaying an update button for the postions |
|
45 |
of document forms to update the positions (parts) from master data. |
|
46 |
|
|
47 |
=head1 SYNOPSIS |
|
48 |
|
|
49 |
use SL::Helper::UserPreferences::UpdatePositions; |
|
50 |
my $prefs = SL::Helper::UserPreferences::UpdatePositions->new(); |
|
51 |
|
|
52 |
$prefs->store_show_update_button(1); |
|
53 |
my $value = $prefs->get_show_update_button; |
|
54 |
|
|
55 |
=head1 DESCRIPTION |
|
56 |
|
|
57 |
This module manages storing the user's choise for displaying an update button |
|
58 |
in the positions area in forms (new order controller). |
|
59 |
|
|
60 |
=head1 BUGS |
|
61 |
|
|
62 |
None yet :) |
|
63 |
|
|
64 |
=head1 AUTHOR |
|
65 |
|
|
66 |
Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt> |
|
67 |
|
|
68 |
=cut |
bin/mozilla/am.pl | ||
---|---|---|
663 | 663 |
$form->{positions_scrollbar_height} = AM->positions_scrollbar_height(); |
664 | 664 |
$form->{purchase_search_makemodel} = AM->purchase_search_makemodel(); |
665 | 665 |
$form->{sales_search_customer_partnumber} = AM->sales_search_customer_partnumber(); |
666 |
$form->{positions_show_update_button} = AM->positions_show_update_button(); |
|
666 | 667 |
|
667 | 668 |
$myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details})); |
668 | 669 |
$form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password(); |
locale/de/all | ||
---|---|---|
2959 | 2959 |
'Show the picture in the part form' => 'Bild in Warenmaske anzeigen', |
2960 | 2960 |
'Show the pictures in the result for search parts' => 'Bilder in Suchergebnis für Stammdaten -> Berichte -> Waren anzeigen', |
2961 | 2961 |
'Show the weights of articles and the total weight in orders, invoices and delivery notes?' => 'Sollen Warengewichte und Gesamtgewicht in Aufträgen, Rechnungen und Lieferscheinen angezeigt werden?', |
2962 |
'Show update button for positions in order forms' => 'Aktualisieren-Knopf bei Positionen in Belegen anzeigen (neuer Auftrags-Controller)', |
|
2962 | 2963 |
'Show weights' => 'Gewichte anzeigen', |
2963 | 2964 |
'Show your TODO list after logging in' => 'Aufgabenliste nach dem Anmelden anzeigen', |
2964 | 2965 |
'Show »not delivered qty/value« column in sales and purchase orders' => 'Spalte »Nicht gelieferte Menge/Wert« in Aufträgen anzeigen', |
locale/en/all | ||
---|---|---|
2959 | 2959 |
'Show the picture in the part form' => '', |
2960 | 2960 |
'Show the pictures in the result for search parts' => '', |
2961 | 2961 |
'Show the weights of articles and the total weight in orders, invoices and delivery notes?' => '', |
2962 |
'Show update button for positions in order forms' => '', |
|
2962 | 2963 |
'Show weights' => '', |
2963 | 2964 |
'Show your TODO list after logging in' => '', |
2964 | 2965 |
'Show »not delivered qty/value« column in sales and purchase orders' => '', |
templates/webpages/am/config.html | ||
---|---|---|
168 | 168 |
[%- 'This also enables displaying a column with the customer partnumber (new order controller).' | $T8 %] |
169 | 169 |
</td> |
170 | 170 |
</tr> |
171 |
<tr> |
|
172 |
<th align="right">[% 'Show update button for positions in order forms' | $T8 %]</th> |
|
173 |
<td> |
|
174 |
[% L.yes_no_tag('positions_show_update_button', positions_show_update_button) %] |
|
175 |
</td> |
|
176 |
</tr> |
|
171 | 177 |
[%- END -%] |
172 | 178 |
|
173 | 179 |
<tr> |
templates/webpages/order/tabs/_row.html | ||
---|---|---|
32 | 32 |
LxERP.t8("X"), |
33 | 33 |
confirm=LxERP.t8("Are you sure?")) %] |
34 | 34 |
</td> |
35 |
[%- IF SHOW_UPDATE_BUTTON -%] |
|
35 | 36 |
<td align="center"> |
36 | 37 |
[%- L.img_tag(src="image/rotate_cw.svg", |
37 | 38 |
alt=LxERP.t8('Update from master data'), |
... | ... | |
39 | 40 |
onclick="if (!confirm('" _ LxERP.t8("Are you sure to update this position from master data?") _ "')) return false; kivi.Order.update_row_from_master_data(this);", |
40 | 41 |
id='update_from_master') %] |
41 | 42 |
</td> |
43 |
[%- END -%] |
|
42 | 44 |
<td> |
43 | 45 |
<div name="partnumber">[% HTML.escape(ITEM.part.partnumber) %]</div> |
44 | 46 |
</td> |
templates/webpages/order/tabs/basic_data.html | ||
---|---|---|
213 | 213 |
<th class="listheading" nowrap width="3" >[%- 'position' | $T8 %] </th> |
214 | 214 |
<th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th> |
215 | 215 |
<th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th> |
216 |
[%- IF SELF.show_update_button -%] |
|
216 | 217 |
<th class="listheading" style='text-align:center' nowrap width="1"> |
217 | 218 |
[%- L.img_tag(src="image/rotate_cw.svg", |
218 | 219 |
alt=LxERP.t8('Update from master data'), |
... | ... | |
220 | 221 |
onclick="if (!confirm('" _ LxERP.t8("Are you sure to update all positions from master data?") _ "')) return false; kivi.Order.update_all_rows_from_master_data();", |
221 | 222 |
id='update_from_master') %] |
222 | 223 |
</th> |
224 |
[%- END %] |
|
223 | 225 |
<th id="partnumber_header_id" class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("partnumber")'> [%- 'Partnumber' | $T8 %]</a></th> |
224 | 226 |
[%- IF SELF.search_cvpartnumber -%] |
225 | 227 |
<th id="cvpartnumber_header_id" class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("cvpartnumber")' > [%- SELF.cv == "customer" ? LxERP.t8('Customer Part Number') : LxERP.t8('Model') %]</a></th> |
... | ... | |
240 | 242 |
</thead> |
241 | 243 |
|
242 | 244 |
[%- FOREACH item = SELF.order.items_sorted %] |
243 |
[%- PROCESS order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id) TYPE=SELF.type ALL_PRICE_FACTORS=SELF.all_price_factors SEARCH_CVPARTNUMBER=SELF.search_cvpartnumber %] |
|
245 |
[%- PROCESS order/tabs/_row.html |
|
246 |
ITEM=item |
|
247 |
ID=(item.id||item.new_fake_id) |
|
248 |
TYPE=SELF.type |
|
249 |
ALL_PRICE_FACTORS=SELF.all_price_factors |
|
250 |
SEARCH_CVPARTNUMBER=SELF.search_cvpartnumber |
|
251 |
SHOW_UPDATE_BUTTON=SELF.show_update_button |
|
252 |
-%] |
|
244 | 253 |
[%- END %] |
245 | 254 |
|
246 | 255 |
</table> |
Auch abrufbar als: Unified diff
Auftrags-Controller: Benutzereinstellung: Positions-Update aus Artikel-Stamm