]> wagnertech.de Git - kivitendo-erp.git/commitdiff
setupPoints und setupDateFormat in ein partial Layout verschoben
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 18 Sep 2012 13:32:32 +0000 (15:32 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 17 Oct 2012 14:00:02 +0000 (16:00 +0200)
21 files changed:
SL/Controller/Layout/Classic.pm
SL/Controller/Layout/Javascript.pm
SL/Controller/Layout/None.pm
SL/Controller/Layout/V3.pm
SL/Controller/Layout/V4.pm
SL/Form.pm
bin/mozilla/ap.pl
bin/mozilla/ar.pl
bin/mozilla/ca.pl
bin/mozilla/cp.pl
bin/mozilla/dn.pl
bin/mozilla/gl.pl
templates/webpages/ap/search.html
templates/webpages/ar/search.html
templates/webpages/do/form_header.html
templates/webpages/dunning/add.html
templates/webpages/generic/javascript_setup.html [new file with mode: 0644]
templates/webpages/ir/form_header.html
templates/webpages/is/form_header.html
templates/webpages/oe/form_footer.html
templates/webpages/vk/search_invoice.html

index a4d99b4519a5632643a0efdbbec27cd0ab178c32..b7438740c4c33e2ea5125d5401f3587870a7c8ab 100644 (file)
@@ -14,6 +14,7 @@ sub new {
   $self->add_sub_layouts([
     SL::Controller::Layout::Top->new,
     SL::Controller::Layout::MenuLeft->new,
   $self->add_sub_layouts([
     SL::Controller::Layout::Top->new,
     SL::Controller::Layout::MenuLeft->new,
+    SL::Controller::Layout::None->new,
   ]);
 
   $self;
   ]);
 
   $self;
index 590c53e22e7c86bf5a195960240fef5fd3bd244b..f9ee831bf74afb0a51a355ce2e3ae41b5d7d0264 100644 (file)
@@ -6,6 +6,18 @@ use parent qw(SL::Controller::Layout::Base);
 use List::Util qw(max);
 use URI;
 
 use List::Util qw(max);
 use URI;
 
+sub new {
+  my ($class, @slurp) = @_;
+
+  my $self = $class->SUPER::new(@slurp);
+
+  $self->add_sub_layouts([
+    SL::Controller::Layout::None->new,
+  ]);
+
+  $self;
+}
+
 sub pre_content {
   &display
 }
 sub pre_content {
   &display
 }
index f3fc79ffacc325fda3d81933724a99b3a9b6b87a..2d9e2e85eaa6b3700ab984a2248fe23d17a4c682 100644 (file)
@@ -3,4 +3,8 @@ package SL::Controller::Layout::None;
 use strict;
 use parent qw(SL::Controller::Layout::Base);
 
 use strict;
 use parent qw(SL::Controller::Layout::Base);
 
+sub javascripts_inline {
+  $::form->parse_html_template('generic/javascript_setup')
+}
+
 1;
 1;
index e545b72c609640e0976ab27f71a7036303c0f724..3a2c9848b4261a621d602f2f464b92ad218adc72 100644 (file)
@@ -6,6 +6,18 @@ use SL::Controller::Layout::Css;
 
 use URI;
 
 
 use URI;
 
+sub new {
+  my ($class, @slurp) = @_;
+
+  my $self = $class->SUPER::new(@slurp);
+
+  $self->add_sub_layouts([
+    SL::Controller::Layout::None->new,
+  ]);
+
+  $self;
+}
+
 sub pre_content {
   &render;
 }
 sub pre_content {
   &render;
 }
index df61836faf5de2afb5a72d64c5c089199fd68b36..a89b4148a4a9e9553fd5ee72ece6ce19f02ec611 100644 (file)
@@ -11,7 +11,10 @@ sub new {
   my ($class, @slurp) = @_;
 
   my $self = $class->SUPER::new(@slurp);
   my ($class, @slurp) = @_;
 
   my $self = $class->SUPER::new(@slurp);
-  $self->add_sub_layouts(SL::Controller::Layout::Top->new);
+  $self->add_sub_layouts(
+    SL::Controller::Layout::Top->new
+    SL::Controller::Layout::None->new,
+  );
   $self;
 }
 
   $self;
 }
 
index 46b1905800128c4c608827d9ada1d499211cf36a..186e661511cb108499bd6480707799251fd88870 100644 (file)
@@ -537,7 +537,7 @@ sub footer {
   print $::request->{layout}->post_content;
 
   if (my @inline_scripts = $::request->{layout}->javascripts_inline) {
   print $::request->{layout}->post_content;
 
   if (my @inline_scripts = $::request->{layout}->javascripts_inline) {
-    print "<script type='text/javascript'>$_</script>\n" for @inline_scripts;
+    print "<script type='text/javascript'>@inline_scripts</script>\n";
   }
 
   print <<EOL
   }
 
   print <<EOL
index 564b3db714757819182406a9c44c13b246c49864..d7e9a4d1027b50969efffd6d5a14853f566b6dbc 100644 (file)
@@ -409,8 +409,6 @@ sub form_header {
                          '-default' => $form->{"globalproject_id"} ));
 
   $form->header;
                          '-default' => $form->{"globalproject_id"} ));
 
   $form->header;
-  my $onload = qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
-  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
   print qq|
 <body onLoad="$onload">
 
   print qq|
 <body onLoad="$onload">
 
index ced49fda2a612592d8152a0fe29ade88a5a0a749..1e6c6780f1895d550d062583504fd1a3208b5679 100644 (file)
@@ -327,7 +327,6 @@ sub form_header {
     qq|<script type="text/javascript" src="js/follow_up.js"></script>|;
 
   $onload = qq|focus()|;
     qq|<script type="text/javascript" src="js/follow_up.js"></script>|;
 
   $onload = qq|focus()|;
-  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
 
 #  $amount  = $locale->text('Amount');
 #  $project = $locale->text('Project');
 
 #  $amount  = $locale->text('Amount');
 #  $project = $locale->text('Project');
index af6c6c8241e4de3eda394d9d2abd174cfcf22432..b22ed29cd5bc60aa096372a13f6e163eff3bde8e 100644 (file)
@@ -155,8 +155,6 @@ sub list {
   $::form->{title} = $::locale->text('List Transactions') . " - " . $::locale->text('Account') . " $::form->{accno}";
 
   my $onload = qq|focus()|;
   $::form->{title} = $::locale->text('List Transactions') . " - " . $::locale->text('Account') . " $::form->{accno}";
 
   my $onload = qq|focus()|;
-  $onload .= qq|;setupDateFormat('$::myconfig{dateformat}', '|. $::locale->text("Falsches Datumsformat!") .qq|')|;
-  $onload .= qq|;setupPoints('$::myconfig{numberformat}', '|. $::locale->text("wrongformat") .qq|')|;
 
   $::form->header;
   print $::form->parse_html_template('ca/list', {
 
   $::form->header;
   print $::form->parse_html_template('ca/list', {
index a8caa526b1f1d3eda12614bd57f9f2b94a730197..7825ed63940d88198114d7aa765f72a50235b73a 100644 (file)
@@ -84,7 +84,7 @@ sub payment {
 
   # Standard Konto für Umlaufvermögen
   my $accno_arap = IS->get_standard_accno_current_assets(\%myconfig, \%$form);
 
   # Standard Konto für Umlaufvermögen
   my $accno_arap = IS->get_standard_accno_current_assets(\%myconfig, \%$form);
-  # Entsprechend präventiv die Auswahlliste für Kontonummer 
+  # Entsprechend präventiv die Auswahlliste für Kontonummer
   # auch mit value= zusammenbauen (s.a. oben bugfix 1771)
   # Wichtig: Auch das Template anpassen, damit hidden input korrekt die "
   # escaped.
   # auch mit value= zusammenbauen (s.a. oben bugfix 1771)
   # Wichtig: Auch das Template anpassen, damit hidden input korrekt die "
   # escaped.
@@ -114,7 +114,7 @@ sub payment {
   $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} =
     $curr[0];
 
   $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} =
     $curr[0];
 
-  # Entsprechend präventiv die Auswahlliste für Währungen 
+  # Entsprechend präventiv die Auswahlliste für Währungen
   # auch mit value= zusammenbauen (s.a. oben bugfix 1771)
   $form->{selectcurrency} = "";
   map { $form->{selectcurrency} .= "<option value=\"$_\">$_</option>\n" } @curr;
   # auch mit value= zusammenbauen (s.a. oben bugfix 1771)
   $form->{selectcurrency} = "";
   map { $form->{selectcurrency} .= "<option value=\"$_\">$_</option>\n" } @curr;
@@ -168,8 +168,6 @@ sub form_header {
 
   $arap = lc $form->{ARAP};
   $onload = qq|focus()|;
 
   $arap = lc $form->{ARAP};
   $onload = qq|focus()|;
-  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
-  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
 
   print $::form->parse_html_template('cp/form_header', {
     is_customer => $form->{vc}   eq 'customer',
 
   print $::form->parse_html_template('cp/form_header', {
     is_customer => $form->{vc}   eq 'customer',
@@ -278,8 +276,8 @@ sub update {
     $form->{customer_id} = $form->{AR}[0]{customer_id};
   }
 
     $form->{customer_id} = $form->{AR}[0]{customer_id};
   }
 
-  # search by invoicenumber, 
-  if ($form->{invnumber}) { 
+  # search by invoicenumber,
+  if ($form->{invnumber}) {
     $form->{open} ='Y'; # only open invoices
     if ($form->{ARAP} eq 'AR'){
       # ar_transactions automatically searches by $form->{customer_id} or else
     $form->{open} ='Y'; # only open invoices
     if ($form->{ARAP} eq 'AR'){
       # ar_transactions automatically searches by $form->{customer_id} or else
index 627f6963340f74c548de25cc519839ecc22383fd..92db5d87527bc38e0753709368df26e6ae098492 100644 (file)
@@ -317,8 +317,6 @@ sub search {
   $form->header();
 
   $form->{onload} = qq|focus()|
   $form->header();
 
   $form->{onload} = qq|focus()|
-    . qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|
-    . qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
 
   print $form->parse_html_template("dunning/search");
 
 
   print $form->parse_html_template("dunning/search");
 
index e217aee3f4918f86a76cea71c9fbfd21df99721a..8cf990099754403dc013ca7367014a64457d691e 100644 (file)
@@ -221,8 +221,6 @@ sub search {
   $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
 
   my $onload = "focus()"
   $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
 
   my $onload = "focus()"
-             . qq|;setupDateFormat('|. $::myconfig{dateformat} . qq|', '| . $::locale->text("Falsches Datumsformat!") . qq|')|
-             . qq|;setupPoints('|. $::myconfig{numberformat} .   qq|', '| . $::locale->text("wrongformat") . qq|')|;
 
   $::form->header;
   print $::form->parse_html_template('gl/search', {
 
   $::form->header;
   print $::form->parse_html_template('gl/search', {
index a89b9b2452cf3d6d8d0c2e1350681f976d874bfc..91ebc325dbadc0589e9a3078ef7a26634a3654c9 100644 (file)
  <!--
    $(document).ready(function(){
     focus();
  <!--
    $(document).ready(function(){
     focus();
-    setupDateFormat('[% dateformat | html %]','[% 'Falsches Datumsformat!' | $T8 %]');
-    setupPoints('[% numberformat | html %]','[% 'wrongformat' | $T8 %]');
    })
  //-->
  </script>
    })
  //-->
  </script>
index ddd6881771930575c7a5b76752ca347e34b85aa4..07f2fc1f18c33e4dee0801e1dd30b151b66f9c37 100644 (file)
  <!--
    $(document).ready(function(){
     $('customer').focus();
  <!--
    $(document).ready(function(){
     $('customer').focus();
-    setupDateFormat('[% dateformat | html %]','[% 'Falsches Datumsformat!' | $T8 %]');
-    setupPoints('[% numberformat | html %]','[% 'wrongformat' | $T8 %]');
    })
  //-->
  </script>
    })
  //-->
  </script>
index 848fa898ea252a699692744f29760b35cccbbe88..5c513297770f892b20212e506db85bb45785514c 100644 (file)
@@ -18,8 +18,6 @@
   <!--
       function on_load() {
         [% IF onload %][% onload %];[% END %]
   <!--
       function on_load() {
         [% IF onload %][% onload %];[% END %]
-        setupDateFormat('[% myconfig_dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
-        setupPoints('[% myconfig_numberformat %]', '[% 'wrongformat' | $T8 %]');
       }
     -->
  </script>
       }
     -->
  </script>
index 889432a9597982f4a269515c5f270d7bdc1a1f42..62a11a4f9f325d9ba1522d1474ba4f480a5f3dbc 100644 (file)
@@ -4,8 +4,6 @@
  <!--
      function setup_controls() {
        fokus();
  <!--
      function setup_controls() {
        fokus();
-       setupDateFormat('[% myconfig_dateformat %]', '[% 'Wrong date format!' | $T8 %]');
-       setupPoints('[% myconfig_numberformat %]', '[% 'wrongformat' | $T8 %]');
      }
    -->
 </script>
      }
    -->
 </script>
diff --git a/templates/webpages/generic/javascript_setup.html b/templates/webpages/generic/javascript_setup.html
new file mode 100644 (file)
index 0000000..49ecb0a
--- /dev/null
@@ -0,0 +1,5 @@
+[%- USE T8 %]
+$(function() {
+  setupPoints('[% myconfig.numberformat %]', '[% 'wrongformat' | $T8 %]');
+  setupDateFormat('[% myconfig.dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
+})
index 53acb60eec5e205722af58b63427f02845fb69af..f444c6d4797828c1d64e6ba03b1ab5c09b2dea60 100644 (file)
 [% ELSE %]
        focus();
 [% END %]
 [% ELSE %]
        focus();
 [% END %]
-       setupDateFormat('[% dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
-       setupPoints('[% numberformat %]', '[% 'wrongformat' | $T8 %]');
      });
      function set_duedate() {
        $.ajax({
      });
      function set_duedate() {
        $.ajax({
index c2cfa0664aaa609cab3430124c8672129f888771..416fea852eefef10f95b326139098929d33d2cbb 100644 (file)
 [% ELSE %]
        focus();
 [% END %]
 [% ELSE %]
        focus();
 [% END %]
-       setupDateFormat('[% dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
-       setupPoints('[% numberformat %]', '[% 'wrongformat' | $T8 %]');
      });
      function set_duedate() {
        $.ajax({
      });
      function set_duedate() {
        $.ajax({
index 61a6060e8d26678cd3bc89cfeaeeb6caa65bb8fb..ddf4a53d2b544310958e51035116ee016379f65f 100644 (file)
 [% END %]
 
 </form>
 [% END %]
 
 </form>
-
-
-    <script type="text/javascript">
-     <!--
-       $('document').ready(function(){
-         setupDateFormat('[% dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
-         setupPoints('[% numberformat %]', '[% 'wrongformat' | $T8 %]');
-       });
-     //-->
-    </script>
index 0b34502ca021d31a815430ff000c432e5d3f3e5a..95a4b6141bbbe04e9a2c3c7ff62647af77467771 100644 (file)
@@ -52,7 +52,7 @@
            <th align="right">[% 'Item mode' | $T8 %]</th>
            <td colspan="3" align=left><input name="l_parts" class=checkbox type=checkbox value=Y> ([%'Show items from invoices individually' | $T8 %]) </td>
           </tr>
            <th align="right">[% 'Item mode' | $T8 %]</th>
            <td colspan="3" align=left><input name="l_parts" class=checkbox type=checkbox value=Y> ([%'Show items from invoices individually' | $T8 %]) </td>
           </tr>
-          <tr> 
+          <tr>
            <th align="right">
              [% 'Total sum' | $T8 %]
            </th>
            <th align="right">
              [% 'Total sum' | $T8 %]
            </th>
            <td align=left><input name="l_lastcost_total" class=checkbox type=checkbox value=Y checked>[% 'Purchase price total' | $T8 %]</td>
            <td align=left><input name="l_marge_total" class=checkbox type=checkbox value=Y checked>[% 'Margetotal' | $T8 %]</td>
            <td colspan="4"> ([% 'Single values in item mode, cumulated values in invoice mode' | $T8 %])
            <td align=left><input name="l_lastcost_total" class=checkbox type=checkbox value=Y checked>[% 'Purchase price total' | $T8 %]</td>
            <td align=left><input name="l_marge_total" class=checkbox type=checkbox value=Y checked>[% 'Margetotal' | $T8 %]</td>
            <td colspan="4"> ([% 'Single values in item mode, cumulated values in invoice mode' | $T8 %])
-           
+
           </tr>
           <tr>
            <td align=left><input name="l_sellprice" class=checkbox type=checkbox value=Y checked>[% 'Sales price' | $T8 %]</td>
           </tr>
           <tr>
            <td align=left><input name="l_sellprice" class=checkbox type=checkbox value=Y checked>[% 'Sales price' | $T8 %]</td>
     </th>
     </tr>
         [% CUSTOM_VARIABLES_INCLUSION_CODE_CT %]
     </th>
     </tr>
         [% CUSTOM_VARIABLES_INCLUSION_CODE_CT %]
+
      <tr><td colspan="7">&nbsp;</td></tr>
     <tr>
     <th colspan="4" align="left">
      <tr><td colspan="7">&nbsp;</td></tr>
     <tr>
     <th colspan="4" align="left">
  <!--
    $(document).ready(function(){
     $('customer').focus();
  <!--
    $(document).ready(function(){
     $('customer').focus();
-    setupDateFormat('[% dateformat | html %]','[% 'Falsches Datumsformat!' | $T8 %]');
-    setupPoints('[% numberformat | html %]','[% 'wrongformat' | $T8 %]');
    })
  //-->
  </script>
    })
  //-->
  </script>