Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a34c05f3

Von Moritz Bunkus vor fast 10 Jahren hinzugefügt

  • ID a34c05f386bc2abb45a097dcb4d68e8ab2f5af94
  • Vorgänger 7c54e92f
  • Nachfolger 326fa24a

Einkauf/Verkauf: Bemerkungsfeld mit HTML-Editor ausgestattet

Unterschiede anzeigen:

SL/DB/DeliveryOrder.pm
8 8

  
9 9
use SL::DB::MetaSetup::DeliveryOrder;
10 10
use SL::DB::Manager::DeliveryOrder;
11
use SL::DB::Helper::AttrHTML;
11 12
use SL::DB::Helper::FlattenToForm;
12 13
use SL::DB::Helper::LinkedRecords;
13 14
use SL::DB::Helper::TransNumberGenerator;
......
29 30

  
30 31
__PACKAGE__->meta->initialize;
31 32

  
33
__PACKAGE__->attr_html('notes');
34

  
32 35
__PACKAGE__->before_save('_before_save_set_donumber');
33 36

  
34 37
# hooks
SL/DB/Invoice.pm
12 12

  
13 13
use SL::DB::MetaSetup::Invoice;
14 14
use SL::DB::Manager::Invoice;
15
use SL::DB::Helper::AttrHTML;
15 16
use SL::DB::Helper::FlattenToForm;
16 17
use SL::DB::Helper::LinkedRecords;
17 18
use SL::DB::Helper::PriceTaxCalculator;
......
58 59

  
59 60
__PACKAGE__->meta->initialize;
60 61

  
62
__PACKAGE__->attr_html('notes');
63

  
61 64
__PACKAGE__->before_save('_before_save_set_invnumber');
62 65

  
63 66
# hooks
SL/DB/Order.pm
9 9

  
10 10
use SL::DB::MetaSetup::Order;
11 11
use SL::DB::Manager::Order;
12
use SL::DB::Helper::AttrHTML;
12 13
use SL::DB::Helper::FlattenToForm;
13 14
use SL::DB::Helper::LinkedRecords;
14 15
use SL::DB::Helper::PriceTaxCalculator;
......
41 42

  
42 43
__PACKAGE__->meta->initialize;
43 44

  
45
__PACKAGE__->attr_html('notes');
46

  
44 47
__PACKAGE__->before_save('_before_save_set_ord_quo_number');
45 48

  
46 49
# hooks
SL/DB/PurchaseInvoice.pm
6 6

  
7 7
use SL::DB::MetaSetup::PurchaseInvoice;
8 8
use SL::DB::Manager::PurchaseInvoice;
9
use SL::DB::Helper::AttrHTML;
9 10
use SL::DB::Helper::LinkedRecords;
10 11
use SL::Locale::String qw(t8);
11 12

  
......
42 43

  
43 44
__PACKAGE__->meta->initialize;
44 45

  
46
__PACKAGE__->attr_html('notes');
47

  
45 48
sub items { goto &invoiceitems; }
46 49
sub add_items { goto &add_invoiceitems; }
47 50

  
SL/DO.pm
451 451
             $form->{cusordnumber}, conv_date($form->{transdate}),
452 452
             conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
453 453
             conv_date($form->{reqdate}), $form->{shippingpoint}, $form->{shipvia},
454
             $form->{notes}, $form->{intnotes},
454
             $restricter->process($form->{notes}), $form->{intnotes},
455 455
             $form->{closed} ? 't' : 'f', $form->{delivered} ? "t" : "f",
456 456
             conv_i($form->{department_id}), conv_i($form->{language_id}), conv_i($form->{shipto_id}),
457 457
             conv_i($form->{globalproject_id}), conv_i($form->{employee_id}),
SL/IR.pm
722 722
                $form->{invnumber},          $form->{ordnumber},           $form->{quonumber},      conv_date($form->{invdate}),
723 723
      conv_date($form->{orddate}), conv_date($form->{quodate}),     conv_i($form->{vendor_id}),               $amount,
724 724
                $netamount,                  $form->{paid},      conv_date($form->{duedate}),
725
            '1',                             $taxzone_id,                  $form->{notes},          $form->{taxincluded} ? 't' : 'f',
725
            '1',                             $taxzone_id, $restricter->process($form->{notes}),               $form->{taxincluded} ? 't' : 'f',
726 726
                $form->{intnotes},           conv_i($form->{storno_id}),     $form->{storno}      ? 't' : 'f',
727 727
         conv_i($form->{cp_id}),      conv_i($form->{employee_id}), conv_i($form->{department_id}), conv_i($form->{delivery_term_id}),
728 728
         conv_i($form->{globalproject_id}),
SL/IS.pm
1171 1171
             conv_date($form->{"invdate"}),  conv_date($form->{"orddate"}),    conv_date($form->{"quodate"}),    conv_i($form->{"customer_id"}),
1172 1172
                       $amount,                        $netamount,                       $form->{"paid"},
1173 1173
             conv_date($form->{"duedate"}),  conv_date($form->{"deliverydate"}),    '1',                                $form->{"shippingpoint"},
1174
                       $form->{"shipvia"},      conv_i($form->{"terms"}),                $form->{"notes"},              $form->{"intnotes"},
1174
                       $form->{"shipvia"},      conv_i($form->{"terms"}), $restricter->process($form->{"notes"}),       $form->{"intnotes"},
1175 1175
                       $form->{"currency"},     conv_i($form->{"department_id"}), conv_i($form->{"payment_id"}),        $form->{"taxincluded"} ? 't' : 'f',
1176 1176
                       $form->{"type"},         conv_i($form->{"language_id"}),   conv_i($form->{"taxzone_id"}), conv_i($form->{"shipto_id"}),
1177 1177
                conv_i($form->{"employee_id"}), conv_i($form->{"salesman_id"}),   conv_i($form->{storno_id}),           $form->{"storno"} ? 't' : 'f',
SL/OE.pm
634 634
             conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
635 635
             $amount, $netamount, conv_date($reqdate),
636 636
             $form->{taxincluded} ? 't' : 'f', $form->{shippingpoint},
637
             $form->{shipvia}, $form->{notes}, $form->{intnotes},
637
             $form->{shipvia}, $restricter->process($form->{notes}), $form->{intnotes},
638 638
             $form->{currency}, $form->{closed} ? 't' : 'f',
639 639
             $form->{delivered} ? "t" : "f", $form->{proforma} ? 't' : 'f',
640 640
             $quotation, conv_i($form->{department_id}),
bin/mozilla/io.pl
1351 1351
    $form->{TEMPLATE_DRIVER_OPTIONS}->{variable_content_types} = {
1352 1352
      longdescription => 'html',
1353 1353
      partnotes       => 'html',
1354
      notes           => 'html',
1354 1355
    };
1355 1356
  }
1356 1357

  
bin/mozilla/oe.pl
510 510

  
511 511
  $form->{invtotal} = $form->{invsubtotal};
512 512

  
513
  my $rows    = max 2, $form->numtextrows($form->{notes}, 25, 8);
514
  my $introws = max 2, $form->numtextrows($form->{intnotes}, 35, 8);
515
  $rows    = max $rows, $introws;
513
  my $introws = max 5, $form->numtextrows($form->{intnotes}, 35, 8);
516 514

  
517
  $TMPL_VAR{notes}    = qq|<textarea name=notes rows="$rows" cols="25">| . H($form->{notes}) . qq|</textarea>|;
515
  $TMPL_VAR{notes}    = qq|<textarea name="notes" class="texteditor" wrap="soft" style="width: 350px; height: 150px">| . H($form->{notes}) . qq|</textarea>|;
518 516
  $TMPL_VAR{intnotes} = qq|<textarea name=intnotes rows="$introws" cols="35">| . H($form->{intnotes}) . qq|</textarea>|;
519 517

  
520 518
  if( $form->{customer_id} && !$form->{taxincluded_changed_by_user} ) {
sql/Pg-upgrade2/oe_ar_ap_delivery_orders_edit_notes_as_html.pl
1
# @tag: oe_ar_ap_delivery_orders_edit_notes_as_html
2
# @description: Einkaufs- und Verkaufsbelege: Bemerkungsfeld in HTML umwandeln
3
# @depends: requirement_spec_edit_html
4
package SL::DBUpgrade2::oe_ar_ap_delivery_orders_edit_notes_as_html;
5

  
6
use strict;
7
use utf8;
8

  
9
use SL::DBUtils;
10

  
11
use parent qw(SL::DBUpgrade2::Base);
12

  
13
sub convert_column {
14
  my ($self, $table, $column) = @_;
15

  
16
  my $sth = $self->dbh->prepare(qq|UPDATE $table SET $column = ? WHERE id = ?|) || $self->dberror;
17

  
18
  foreach my $row (selectall_hashref_query($::form, $self->dbh, qq|SELECT id, $column FROM $table WHERE $column IS NOT NULL|)) {
19
    next if !$row->{$column} || (($row->{$column} =~ m{^<[a-z]+>}) && ($row->{$column} =~ m{</[a-z]+>$}));
20

  
21
    my $new_content = "" . $::request->presenter->escape($row->{$column});
22
    $new_content    =~ s{\r}{}g;
23
    $new_content    =~ s{\n\n+}{</p><p>}g;
24
    $new_content    =~ s{\n}{<br />}g;
25
    $new_content    =  "<p>${new_content}</p>" if $new_content;
26

  
27
    $sth->execute($new_content, $row->{id}) if $new_content ne $row->{$column};
28
  }
29

  
30
  $sth->finish;
31
}
32

  
33
sub run {
34
  my ($self) = @_;
35

  
36
  $self->convert_column($_, 'notes') for qw(oe delivery_orders ar ap);
37

  
38
  return 1;
39
}
40

  
41
1;
templates/webpages/do/form_footer.html
1 1
[%- USE T8 %]
2
[% USE HTML %][% USE LxERP %][%- USE L -%]
2
[% USE HTML %][% USE LxERP %][%- USE L -%][%- USE P -%]
3 3
 [%- IF delivered %]
4 4
 [%- SET RO = ' readonly' %]
5 5
 [%- END %]
......
13 13
       </tr>
14 14

  
15 15
       <tr valign="top">
16
        <td><textarea name="notes" rows="[% LxERP.numtextrows(notes, 25, 8, 2) %]" cols="25" wrap="soft"[% RO %]>[% HTML.escape(notes) %]</textarea></td>
16
        <td>
17
         [% IF delivered %]
18
          [% L.hidden_tag("notes", notes) %]
19
         <div style="width: 350px; height: 150px; border: 1px solid black">[% P.restricted_html(notes) %]</div>
20
         [% ELSE %]
21
          [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
22
         [% END %]
23
        </td>
17 24
        <td><textarea name="intnotes" rows="[% LxERP.numtextrows(intnotes, 35, 8, 2) %]" cols="35" wrap="soft"[% RO %]>[% HTML.escape(intnotes) %]</textarea></td>
18 25
       </tr>
19 26

  
templates/webpages/ir/form_footer.html
15 15
        </tr>
16 16
        <tr valign="top">
17 17
         <td>
18
          <textarea name="notes" rows="[% rows %]" cols="26" wrap="soft">[% notes %]</textarea>
18
          [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
19 19
         </td>
20 20
         <td>
21 21
          <textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
templates/webpages/is/form_footer.html
15 15
        </tr>
16 16
        <tr valign="top">
17 17
         <td>
18
          <textarea name="notes" rows="[% rows %]" cols="26">[% notes %]</textarea>
18
          [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
19 19
         </td>
20 20
         <td>
21 21
          <textarea name="intnotes" rows="[% rows %]" cols="35">[% intnotes %]</textarea>

Auch abrufbar als: Unified diff