cae9bfc5db27b7af457fa1086457929c14519825
[kivitendo-erp.git] / bin / mozilla / pe.pl
1 #=====================================================================
2 # LX-Office ERP
3 # Copyright (C) 2004
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
6 #
7 #=====================================================================
8 # SQL-Ledger Accounting
9 # Copyright (c) 1998-2002
10 #
11 #  Author: Dieter Simader
12 #   Email: dsimader@sql-ledger.org
13 #     Web: http://www.sql-ledger.org
14 #
15 #
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
20 #
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #======================================================================
29 #
30 # project administration
31 # partsgroup administration
32 #
33 #======================================================================
34
35 use SL::PE;
36
37 require "bin/mozilla/common.pl";
38
39 1;
40
41 # end of main
42
43 sub add {
44   $lxdebug->enter_sub();
45
46   $form->{title} = "Add";
47
48   # construct callback
49   $form->{callback} =
50     "$form->{script}?action=add&type=$form->{type}&login=$form->{login}&password=$form->{password}"
51     unless $form->{callback};
52
53   call_sub("form_$form->{type}_header");
54   call_sub("form_$form->{type}_footer");
55
56   $lxdebug->leave_sub();
57 }
58
59 sub edit {
60   $lxdebug->enter_sub();
61   # show history button
62   $form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|;
63   #/show hhistory button
64   $form->{title} = "Edit";
65
66   if ($form->{type} eq 'project') {
67     PE->get_project(\%myconfig, \%$form);
68   }
69   if ($form->{type} eq 'partsgroup') {
70     PE->get_partsgroup(\%myconfig, \%$form);
71   }
72   if ($form->{type} eq 'pricegroup') {
73     PE->get_pricegroup(\%myconfig, \%$form);
74   }
75   call_sub("form_$form->{type}_header");
76   call_sub("form_$form->{type}_footer");
77
78   $lxdebug->leave_sub();
79 }
80
81 sub search {
82   $lxdebug->enter_sub();
83
84   if ($form->{type} eq 'project') {
85     $report        = "project_report";
86     $sort          = 'projectnumber';
87     $form->{title} = $locale->text('Projects');
88
89     $number = qq|
90         <tr>
91           <th align=right width=1%>| . $locale->text('Number') . qq|</th>
92           <td>| . $cgi->textfield('-name' => 'projectnumber', '-size' => 20) . qq|</td>
93         </tr>
94         <tr>
95           <th align=right>| . $locale->text('Description') . qq|</th>
96           <td>| . $cgi->textfield('-name' => 'description', '-size' => 60) . qq|</td>
97         </tr>
98   <tr>
99     <th>&nbsp;</th>
100     <td>| .
101     $cgi->radio_group('-name' => 'active', '-default' => 'active',
102                       '-values' => ['active', 'inactive', 'both'],
103                       '-labels' => { 'active' => ' ' . $locale->text("Active"),
104                                      'inactive' => ' ' . $locale->text("Inactive"),
105                                      'both' => ' ' . $locale->text("Both") })
106     . qq|</td>
107   </tr>
108 |;
109
110   }
111   if ($form->{type} eq 'partsgroup') {
112     $report        = "partsgroup_report";
113     $sort          = 'partsgroup';
114     $form->{title} = $locale->text('Groups');
115
116     $number = qq|
117         <tr>
118           <th align=right width=1%>| . $locale->text('Group') . qq|</th>
119           <td><input name=partsgroup size=20></td>
120         </tr>
121 |;
122
123   }
124
125   # for pricesgroups
126   if ($form->{type} eq 'pricegroup') {
127     $report        = "pricegroup_report";
128     $sort          = 'pricegroup';
129     $form->{title} = $locale->text('Pricegroup');
130
131     $number = qq|
132         <tr>
133           <th align=right width=1%>| . $locale->text('Pricegroup') . qq|</th>
134           <td><input name=pricegroup size=20></td>
135         </tr>
136 |;
137
138   }
139
140   $form->header;
141
142   print qq|
143 <body>
144
145 <form method=post action=$form->{script}>
146
147 <input type=hidden name=sort value=$sort>
148 <input type=hidden name=type value=$form->{type}>
149
150 <table width=100%>
151   <tr>
152     <th class=listtop>$form->{title}</th>
153   </tr>
154   <tr height="5"></tr>
155   <tr>
156     <td>
157       <table width=100%>
158         $number
159         <tr>
160           <td></td>
161           <td><input name=status class=radio type=radio value=all checked>&nbsp;|
162     . $locale->text('All') . qq|
163           <input name=status class=radio type=radio value=orphaned>&nbsp;|
164     . $locale->text('Orphaned') . qq|</td>
165         </tr>
166       </table>
167     </td>
168   </tr>
169   <tr>
170     <td><hr size=3 noshade></td>
171   </tr>
172 </table>
173
174 <input type=hidden name=nextsub value=$report>
175
176 <input type=hidden name=login value=$form->{login}>
177 <input type=hidden name=password value=$form->{password}>
178
179 <br>
180 <input class=submit type=submit name=action value="|
181     . $locale->text('Continue') . qq|">
182 </form>
183
184 </body>
185 </html>
186 |;
187
188   $lxdebug->leave_sub();
189 }
190
191 sub project_report {
192   $lxdebug->enter_sub();
193
194   map { $form->{$_} = $form->unescape($form->{$_}) }
195     (projectnumber, description);
196   PE->projects(\%myconfig, \%$form);
197
198   $callback =
199     "$form->{script}?action=project_report&type=$form->{type}&login=$form->{login}&password=$form->{password}&status=$form->{status}&active=" .
200     E($form->{active});
201   $href = $callback;
202
203   if ($form->{status} eq 'all') {
204     $option = $locale->text('All');
205   }
206   if ($form->{status} eq 'orphaned') {
207     $option .= $locale->text('Orphaned');
208   }
209   if ($form->{projectnumber}) {
210     $href     .= "&projectnumber=" . $form->escape($form->{projectnumber});
211     $callback .= "&projectnumber=$form->{projectnumber}";
212     $option   .=
213       "\n<br>" . $locale->text('Project') . " : $form->{projectnumber}";
214   }
215   if ($form->{description}) {
216     $href     .= "&description=" . $form->escape($form->{description});
217     $callback .= "&description=$form->{description}";
218     $option   .=
219       "\n<br>" . $locale->text('Description') . " : $form->{description}";
220   }
221
222   @column_index = qw(projectnumber description);
223
224   push(@column_index, "active") if ("both" eq $form->{active});
225
226   $column_header{projectnumber} =
227       qq|<th><a class=listheading href=$href&sort=projectnumber>|
228     . $locale->text('Number')
229     . qq|</a></th>|;
230   $column_header{description} =
231       qq|<th><a class=listheading href=$href&sort=description>|
232     . $locale->text('Description')
233     . qq|</a></th>|;
234   $column_header{active} =
235       qq|<th class="listheading">| . $locale->text('Active') . qq|</th>|;
236
237   $form->{title} = $locale->text('Projects');
238
239   $form->header;
240
241   print qq|
242 <body>
243
244 <table width=100%>
245   <tr>
246     <th class=listtop>$form->{title}</th>
247   </tr>
248   <tr height="5"></tr>
249   <tr>
250     <td>$option</td>
251   </tr>
252   <tr>
253     <td>
254       <table width=100%>
255         <tr class=listheading>
256 |;
257
258   map { print "$column_header{$_}\n" } @column_index;
259
260   print qq|
261         </tr>
262 |;
263
264   # escape callback
265   $form->{callback} = $callback .= "&sort=$form->{sort}";
266
267   # escape callback for href
268   $callback = $form->escape($callback);
269
270   foreach $ref (@{ $form->{project_list} }) {
271
272     $i++;
273     $i %= 2;
274
275     print qq|
276         <tr valign=top class=listrow$i>
277 |;
278
279     $column_data{projectnumber} =
280       qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{projectnumber}</td>|;
281     $column_data{description} = qq|<td>$ref->{description}&nbsp;</td>|;
282     $column_data{active} =
283       qq|<td>| .
284       ($ref->{active} ? $locale->text("Yes") : $locale->text("No")) .
285       qq|</td>|;
286
287     map { print "$column_data{$_}\n" } @column_index;
288
289     print "
290         </tr>
291 ";
292   }
293
294   print qq|
295       </table>
296     </td>
297   </tr>
298   <tr>
299     <td><hr size=3 noshade></td>
300   </tr>
301 </table>
302
303 <br>
304 <form method=post action=$form->{script}>
305
306 <input name=callback type=hidden value="$form->{callback}">
307
308 <input type=hidden name=type value=$form->{type}>
309
310 <input type=hidden name=login value=$form->{login}>
311 <input type=hidden name=password value=$form->{password}>
312
313 <input class=submit type=submit name=action value="|
314     . $locale->text('Add') . qq|">
315
316   </form>
317
318 </body>
319 </html>
320 |;
321
322   $lxdebug->leave_sub();
323 }
324
325 sub form_project_header {
326   $lxdebug->enter_sub();
327
328   $form->{title} = $locale->text("$form->{title} Project");
329
330   # $locale->text('Add Project')
331   # $locale->text('Edit Project')
332
333   $form->{description} =~ s/\"/&quot;/g;
334
335   my $projectnumber =
336     $cgi->textfield('-name' => 'projectnumber', '-size' => 20,
337                     '-default' => $form->{projectnumber});
338
339   my $description;
340   if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
341     $description =
342       $cgi->textarea('-name' => 'description', '-rows' => $rows, '-cols' => 60,
343                      '-style' => 'width: 100%', '-wrap' => 'soft',
344                      '-default' => $form->{description});
345   } else {
346     $description =
347       $cgi->textfield('-name' => 'description', '-size' => 60,
348                       '-default' => $form->{description});
349   }
350
351   my $active;
352   if ($form->{id}) {
353     $active =
354       qq|
355   <tr>
356     <th>&nbsp;</th>
357     <td>| .
358       $cgi->radio_group('-name' => 'active',
359                         '-values' => [1, 0],
360                         '-default' => $form->{active} * 1,
361                         '-labels' => { 1 => $locale->text("Active"),
362                                        0 => $locale->text("Inactive") })
363       . qq|</td>
364   </tr>
365 |;
366   }
367
368   $form->header;
369
370   print qq|
371 <body>
372
373 <form method=post action=$form->{script}>
374
375 <input type=hidden name=id value=$form->{id}>
376 <input type=hidden name=type value=project>
377
378 <table width=100%>
379   <tr>
380     <th class=listtop>$form->{title}</th>
381   </tr>
382   <tr height="5"></tr>
383   <tr>
384     <td>
385       <table>
386         <tr>
387           <th align=right>| . $locale->text('Number') . qq|</th>
388           <td>$projectnumber</td>
389         </tr>
390         <tr>
391           <th align=right>| . $locale->text('Description') . qq|</th>
392           <td>$description</td>
393         </tr>
394       $active
395       </table>
396     </td>
397   </tr>
398   <tr>
399     <td colspan=2><hr size=3 noshade></td>
400   </tr>
401 </table>
402 |;
403
404   $lxdebug->leave_sub();
405 }
406
407 sub form_project_footer {
408   $lxdebug->enter_sub();
409
410   print qq|
411
412 <input name=callback type=hidden value="$form->{callback}">
413
414 <input type=hidden name=login value=$form->{login}>
415 <input type=hidden name=password value=$form->{password}>
416
417 <br><input type=submit class=submit name=action value="|
418     . $locale->text('Save') . qq|">
419 |;
420
421   if ($form->{id} && $form->{orphaned}) {
422     print qq|
423 <input type=submit class=submit name=action value="|
424       . $locale->text('Delete') . qq|">|;
425   }
426
427   if ($form->{id}) {
428     # button for saving history
429     print qq|
430       <input type=button onclick=set_history_window(|
431       . $form->{id}
432       . qq|); name=history id=history value=|
433       . $locale->text('history')
434       . qq|>|;
435     # /button for saving history
436   }
437
438   print qq|
439 </form>
440
441 </body>
442 </html>
443 |;
444
445   $lxdebug->leave_sub();
446 }
447
448 sub save {
449   $lxdebug->enter_sub();
450
451   if ($form->{type} eq 'project') {
452     $form->isblank("projectnumber", $locale->text('Project Number missing!'));
453     PE->save_project(\%myconfig, \%$form);
454     $form->redirect($locale->text('Project saved!'));
455   }
456   if ($form->{type} eq 'partsgroup') {
457     $form->isblank("partsgroup", $locale->text('Group missing!'));
458     PE->save_partsgroup(\%myconfig, \%$form);
459     $form->redirect($locale->text('Group saved!'));
460   }
461
462   # choice pricegroup and save
463   if ($form->{type} eq 'pricegroup') {
464     $form->isblank("pricegroup", $locale->text('Pricegroup missing!'));
465     PE->save_pricegroup(\%myconfig, \%$form);
466     $form->redirect($locale->text('Pricegroup saved!'));
467   }
468   # saving the history
469   if(!exists $form->{addition} && $form->{id} ne "") {
470     $form->{snumbers} = qq|projectnumber_| . $form->{projectnumber};
471         $form->{addition} = "SAVED";
472         $form->save_history($form->dbconnect(\%myconfig));
473   }
474   # /saving the history 
475
476   $lxdebug->leave_sub();
477 }
478
479 sub delete {
480   $lxdebug->enter_sub();
481
482   PE->delete_tuple(\%myconfig, \%$form);
483
484   if ($form->{type} eq 'project') {
485     $form->redirect($locale->text('Project deleted!'));
486   }
487   if ($form->{type} eq 'partsgroup') {
488     $form->redirect($locale->text('Group deleted!'));
489   }
490   if ($form->{type} eq 'pricegroup') {
491     $form->redirect($locale->text('Pricegroup deleted!'));
492   }
493   # saving the history
494   if(!exists $form->{addition}) {
495     $form->{snumbers} = qq|projectnumber_| . $form->{projectnumber};
496         $form->{addition} = "DELETED";
497         $form->save_history($form->dbconnect(\%myconfig));
498   }
499   # /saving the history
500   $lxdebug->leave_sub();
501 }
502
503 sub continue { call_sub($form->{"nextsub"}); }
504
505 sub partsgroup_report {
506   $lxdebug->enter_sub();
507
508   map { $form->{$_} = $form->unescape($form->{$_}) } (partsgroup);
509   PE->partsgroups(\%myconfig, \%$form);
510
511   $callback =
512     "$form->{script}?action=partsgroup_report&type=$form->{type}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
513
514   if ($form->{status} eq 'all') {
515     $option = $locale->text('All');
516   }
517   if ($form->{status} eq 'orphaned') {
518     $option .= $locale->text('Orphaned');
519   }
520   if ($form->{partsgroup}) {
521     $callback .= "&partsgroup=$form->{partsgroup}";
522     $option   .= "\n<br>" . $locale->text('Group') . " : $form->{partsgroup}";
523   }
524
525   @column_index = $form->sort_columns(qw(partsgroup));
526
527   $column_header{partsgroup} =
528     qq|<th class=listheading width=90%>| . $locale->text('Group') . qq|</th>|;
529
530   $form->{title} = $locale->text('Groups');
531
532   $form->header;
533
534   print qq|
535 <body>
536
537 <table width=100%>
538   <tr>
539     <th class=listtop>$form->{title}</th>
540   </tr>
541   <tr height="5"></tr>
542   <tr>
543     <td>$option</td>
544   </tr>
545   <tr>
546     <td>
547       <table width=100%>
548         <tr class=listheading>
549 |;
550
551   map { print "$column_header{$_}\n" } @column_index;
552
553   print qq|
554         </tr>
555 |;
556
557   # escape callback
558   $form->{callback} = $callback;
559
560   # escape callback for href
561   $callback = $form->escape($callback);
562
563   foreach $ref (@{ $form->{item_list} }) {
564
565     $i++;
566     $i %= 2;
567
568     print qq|
569         <tr valign=top class=listrow$i>
570 |;
571
572     $column_data{partsgroup} =
573       qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{partsgroup}</td>|;
574     map { print "$column_data{$_}\n" } @column_index;
575
576     print "
577         </tr>
578 ";
579   }
580
581   print qq|
582       </table>
583     </td>
584   </tr>
585   <tr>
586     <td><hr size=3 noshade></td>
587   </tr>
588 </table>
589
590 <br>
591 <form method=post action=$form->{script}>
592
593 <input name=callback type=hidden value="$form->{callback}">
594
595 <input type=hidden name=type value=$form->{type}>
596
597 <input type=hidden name=login value=$form->{login}>
598 <input type=hidden name=password value=$form->{password}>
599
600 <input class=submit type=submit name=action value="|
601     . $locale->text('Add') . qq|">
602
603   </form>
604
605 </body>
606 </html>
607 |;
608
609   $lxdebug->leave_sub();
610 }
611
612 sub form_partsgroup_header {
613   $lxdebug->enter_sub();
614
615   $form->{title} = $locale->text("$form->{title} Group");
616
617   # $locale->text('Add Group')
618   # $locale->text('Edit Group')
619
620   $form->{partsgroup} =~ s/\"/&quot;/g;
621
622   $form->header;
623
624   print qq|
625 <body>
626
627 <form method=post action=$form->{script}>
628
629 <input type=hidden name=id value=$form->{id}>
630 <input type=hidden name=type value=$form->{type}>
631
632 <table width=100%>
633   <tr>
634     <th class=listtop>$form->{title}</th>
635   </tr>
636   <tr height="5"></tr>
637   <tr>
638     <td>
639       <table width=100%>
640         <tr>
641           <th align=right>| . $locale->text('Group') . qq|</th>
642
643           <td><input name=partsgroup size=30 value="$form->{partsgroup}"></td>
644         </tr>
645       </table>
646     </td>
647   </tr>
648   <tr>
649     <td colspan=2><hr size=3 noshade></td>
650   </tr>
651 </table>
652 |;
653
654   $lxdebug->leave_sub();
655 }
656
657 sub form_partsgroup_footer {
658   $lxdebug->enter_sub();
659
660   print qq|
661
662 <input name=callback type=hidden value="$form->{callback}">
663
664 <input type=hidden name=login value=$form->{login}>
665 <input type=hidden name=password value=$form->{password}>
666
667 <br><input type=submit class=submit name=action value="|
668     . $locale->text('Save') . qq|">
669 |;
670
671   if ($form->{id} && $form->{orphaned}) {
672     print qq|
673 <input type=submit class=submit name=action value="|
674       . $locale->text('Delete') . qq|">|;
675   }
676
677 # button for saving history
678 print qq|
679         <input type=button onclick=set_history_window(|
680         . $form->{id} 
681         . qq|); name=history id=history value=|
682         . $locale->text('history') 
683         . qq|>|;
684 # /button for saving history
685   print qq|
686 </form>
687
688 </body>
689 </html>
690 |;
691
692   $lxdebug->leave_sub();
693 }
694
695 #################################
696 # get pricesgroups and build up html-code
697 #
698 sub pricegroup_report {
699   $lxdebug->enter_sub();
700
701   map { $form->{$_} = $form->unescape($form->{$_}) } (pricegroup);
702   PE->pricegroups(\%myconfig, \%$form);
703
704   $callback =
705     "$form->{script}?action=pricegroup_report&type=$form->{type}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
706
707   if ($form->{status} eq 'all') {
708     $option = $locale->text('All');
709   }
710   if ($form->{status} eq 'orphaned') {
711     $option .= $locale->text('Orphaned');
712   }
713   if ($form->{pricegroup}) {
714     $callback .= "&pricegroup=$form->{pricegroup}";
715     $option   .=
716       "\n<br>" . $locale->text('Pricegroup') . " : $form->{pricegroup}";
717   }
718
719   @column_index = $form->sort_columns(qw(pricegroup));
720
721   $column_header{pricegroup} =
722       qq|<th class=listheading width=90%>|
723     . $locale->text('Pricegroup')
724     . qq|</th>|;
725
726   $form->{title} = $locale->text('Pricegroup');
727
728   $form->header;
729
730   print qq|
731 <body>
732
733 <table width=100%>
734   <tr>
735     <th class=listtop>$form->{title}</th>
736   </tr>
737   <tr height="5"></tr>
738   <tr>
739     <td>$option</td>
740   </tr>
741   <tr>
742     <td>
743       <table width=100%>
744         <tr class=listheading>
745 |;
746
747   map { print "$column_header{$_}\n" } @column_index;
748
749   print qq|
750         </tr>
751 |;
752
753   # escape callback
754   $form->{callback} = $callback;
755
756   # escape callback for href
757   $callback = $form->escape($callback);
758
759   foreach $ref (@{ $form->{item_list} }) {
760
761     $i++;
762     $i %= 2;
763
764     print qq|
765         <tr valign=top class=listrow$i>
766 |;
767     $column_data{pricegroup} =
768       qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{pricegroup}</td>|;
769
770     map { print "$column_data{$_}\n" } @column_index;
771
772     print "
773         </tr>
774 ";
775   }
776
777   print qq|
778       </table>
779     </td>
780   </tr>
781   <tr>
782     <td><hr size=3 noshade></td>
783   </tr>
784 </table>
785
786 <br>
787 <form method=post action=$form->{script}>
788
789 <input name=callback type=hidden value="$form->{callback}">
790
791 <input type=hidden name=type value=$form->{type}>
792
793 <input type=hidden name=login value=$form->{login}>
794 <input type=hidden name=password value=$form->{password}>
795
796 <input class=submit type=submit name=action value="|
797     . $locale->text('Add') . qq|">
798
799   </form>
800
801 </body>
802 </html>
803 |;
804
805   $lxdebug->leave_sub();
806 }
807
808 #######################
809 #build up pricegroup_header
810 #
811 sub form_pricegroup_header {
812   $lxdebug->enter_sub();
813
814   # $locale->text('Add Pricegroup')
815   # $locale->text('Edit Pricegroup')
816
817   $form->{title} = $locale->text("$form->{title} Pricegroup");
818
819   $form->{pricegroup} =~ s/\"/&quot;/g;
820
821   $form->header;
822
823   print qq|
824 <body>
825
826 <form method=post action=$form->{script}>
827
828 <input type=hidden name=id value=$form->{id}>
829 <input type=hidden name=type value=$form->{type}>
830
831 <table width=100%>
832   <tr>
833     <th class=listtop>$form->{title}</th>
834   </tr>
835   <tr height="5"></tr>
836   <tr>
837     <td>
838       <table width=100%>
839         <tr>
840           <th align=right>| . $locale->text('Preisgruppe') . qq|</th>
841           <td><input name=pricegroup size=30 value="$form->{pricegroup}"></td>
842         </tr>
843       </table>
844     </td>
845   </tr>
846   <tr>
847     <td colspan=2><hr size=3 noshade></td>
848   </tr>
849 </table>
850 |;
851
852   $lxdebug->leave_sub();
853 }
854 ######################
855 #build up pricegroup_footer
856 #
857 sub form_pricegroup_footer {
858   $lxdebug->enter_sub();
859
860   print qq|
861
862 <input name=callback type=hidden value="$form->{callback}">
863
864 <input type=hidden name=login value=$form->{login}>
865 <input type=hidden name=password value=$form->{password}>
866
867 <br><input type=submit class=submit name=action value="|
868     . $locale->text('Save') . qq|">
869 |;
870
871   if ($form->{id} && $form->{orphaned}) {
872     print qq|
873 <input type=submit class=submit name=action value="|
874       . $locale->text('Delete') . qq|">|;
875   }
876
877 # button for saving history
878 print qq|
879         <input type=button onclick=set_history_window(|
880         . $form->{id} 
881         . qq|); name=history id=history value=|
882         . $locale->text('history') 
883         . qq|>|;
884 # /button for saving history
885   print qq|
886 </form>
887
888 </body>
889 </html>
890 |;
891
892   $lxdebug->leave_sub();
893 }