am/lead_header auf template umgestellt.
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 20 Jan 2012 20:11:09 +0000 (21:11 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 20 Jan 2012 20:11:09 +0000 (21:11 +0100)
bin/mozilla/am.pl
templates/webpages/am/lead_header.html [new file with mode: 0644]

index 77b8e4d..10ab280 100644 (file)
@@ -633,48 +633,17 @@ sub list_lead {
 }
 
 sub lead_header {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my $locale   = $main::locale;
-
-  $main::auth->assert('config');
-
-  $form->{title} = $locale->text("$form->{title} Lead");
+  $::lxdebug->enter_sub;
+  $::auth->assert('config');
 
   # $locale->text('Add Lead')
   # $locale->text('Edit Lead')
+  $::form->{title} = $::locale->text("$::form->{title} Lead");
 
-  $form->{description} =~ s/\"/&quot;/g;
-
-  my $description =
-      qq|<input name=description size=50 value="$form->{lead}">|;
-
-  $form->header;
-
-  print qq|
-<body>
-
-<form method=post action=am.pl>
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=type value=lead>
-
-<table width=100%>
-  <tr>
-    <th class=listtop colspan=2>$form->{title}</th>
-  </tr>
-  <tr height="5"></tr>
-  <tr>
-    <th align=right>| . $locale->text('Description') . qq|</th>
-    <td>$description</td>
-  </tr>
-    <td colspan=2><hr size=3 noshade></td>
-  </tr>
-</table>
-|;
+  $::form->header;
+  print $::form->parse_html_template('am/lead_header');
 
-  $main::lxdebug->leave_sub();
+  $::lxdebug->leave_sub;
 }
 
 sub save_lead {
diff --git a/templates/webpages/am/lead_header.html b/templates/webpages/am/lead_header.html
new file mode 100644 (file)
index 0000000..2287eb6
--- /dev/null
@@ -0,0 +1,21 @@
+[%- USE HTML %]
+[%- USE T8 %]
+<body>
+
+<form method=post action=am.pl>
+
+<input type=hidden name=id value='[% id | html %]'>
+<input type=hidden name=type value=lead>
+
+<table width=100%>
+  <tr>
+    <th class=listtop colspan=2>[% title | html %]</th>
+  </tr>
+  <tr height="5"></tr>
+  <tr>
+    <th align=right>[% 'Description' | $T8 %]</th>
+    <td><input name=description size=50 value="[% lead | html %]"></td>
+  </tr>
+    <td colspan=2><hr size=3 noshade></td>
+  </tr>
+</table>