Eine Funktion zum "sicheren" Aufrufen von Unterfunktionen eingebaut, damit &{ $form...
[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}&path=$form->{path}&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=path value=$form->{path}>
177 <input type=hidden name=login value=$form->{login}>
178 <input type=hidden name=password value=$form->{password}>
179
180 <br>
181 <input class=submit type=submit name=action value="|
182     . $locale->text('Continue') . qq|">
183 </form>
184
185 </body>
186 </html>
187 |;
188
189   $lxdebug->leave_sub();
190 }
191
192 sub project_report {
193   $lxdebug->enter_sub();
194
195   map { $form->{$_} = $form->unescape($form->{$_}) }
196     (projectnumber, description);
197   PE->projects(\%myconfig, \%$form);
198
199   $callback =
200     "$form->{script}?action=project_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}&active=" .
201     E($form->{active});
202   $href = $callback;
203
204   if ($form->{status} eq 'all') {
205     $option = $locale->text('All');
206   }
207   if ($form->{status} eq 'orphaned') {
208     $option .= $locale->text('Orphaned');
209   }
210   if ($form->{projectnumber}) {
211     $href     .= "&projectnumber=" . $form->escape($form->{projectnumber});
212     $callback .= "&projectnumber=$form->{projectnumber}";
213     $option   .=
214       "\n<br>" . $locale->text('Project') . " : $form->{projectnumber}";
215   }
216   if ($form->{description}) {
217     $href     .= "&description=" . $form->escape($form->{description});
218     $callback .= "&description=$form->{description}";
219     $option   .=
220       "\n<br>" . $locale->text('Description') . " : $form->{description}";
221   }
222
223   @column_index = qw(projectnumber description);
224
225   push(@column_index, "active") if ("both" eq $form->{active});
226
227   $column_header{projectnumber} =
228       qq|<th><a class=listheading href=$href&sort=projectnumber>|
229     . $locale->text('Number')
230     . qq|</a></th>|;
231   $column_header{description} =
232       qq|<th><a class=listheading href=$href&sort=description>|
233     . $locale->text('Description')
234     . qq|</a></th>|;
235   $column_header{active} =
236       qq|<th class="listheading">| . $locale->text('Active') . qq|</th>|;
237
238   $form->{title} = $locale->text('Projects');
239
240   $form->header;
241
242   print qq|
243 <body>
244
245 <table width=100%>
246   <tr>
247     <th class=listtop>$form->{title}</th>
248   </tr>
249   <tr height="5"></tr>
250   <tr>
251     <td>$option</td>
252   </tr>
253   <tr>
254     <td>
255       <table width=100%>
256         <tr class=listheading>
257 |;
258
259   map { print "$column_header{$_}\n" } @column_index;
260
261   print qq|
262         </tr>
263 |;
264
265   # escape callback
266   $form->{callback} = $callback .= "&sort=$form->{sort}";
267
268   # escape callback for href
269   $callback = $form->escape($callback);
270
271   foreach $ref (@{ $form->{project_list} }) {
272
273     $i++;
274     $i %= 2;
275
276     print qq|
277         <tr valign=top class=listrow$i>
278 |;
279
280     $column_data{projectnumber} =
281       qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{projectnumber}</td>|;
282     $column_data{description} = qq|<td>$ref->{description}&nbsp;</td>|;
283     $column_data{active} =
284       qq|<td>| .
285       ($ref->{active} ? $locale->text("Yes") : $locale->text("No")) .
286       qq|</td>|;
287
288     map { print "$column_data{$_}\n" } @column_index;
289
290     print "
291         </tr>
292 ";
293   }
294
295   print qq|
296       </table>
297     </td>
298   </tr>
299   <tr>
300     <td><hr size=3 noshade></td>
301   </tr>
302 </table>
303
304 <br>
305 <form method=post action=$form->{script}>
306
307 <input name=callback type=hidden value="$form->{callback}">
308
309 <input type=hidden name=type value=$form->{type}>
310
311 <input type=hidden name=path value=$form->{path}>
312 <input type=hidden name=login value=$form->{login}>
313 <input type=hidden name=password value=$form->{password}>
314
315 <input class=submit type=submit name=action value="|
316     . $locale->text('Add') . qq|">
317
318   </form>
319
320 </body>
321 </html>
322 |;
323
324   $lxdebug->leave_sub();
325 }
326
327 sub form_project_header {
328   $lxdebug->enter_sub();
329
330   $form->{title} = $locale->text("$form->{title} Project");
331
332   # $locale->text('Add Project')
333   # $locale->text('Edit Project')
334
335   $form->{description} =~ s/\"/&quot;/g;
336
337   my $projectnumber =
338     $cgi->textfield('-name' => 'projectnumber', '-size' => 20,
339                     '-default' => $form->{projectnumber});
340
341   my $description;
342   if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
343     $description =
344       $cgi->textarea('-name' => 'description', '-rows' => $rows, '-cols' => 60,
345                      '-style' => 'width: 100%', '-wrap' => 'soft',
346                      '-default' => $form->{description});
347   } else {
348     $description =
349       $cgi->textfield('-name' => 'description', '-size' => 60,
350                       '-default' => $form->{description});
351   }
352
353   my $active;
354   if ($form->{id}) {
355     $active =
356       qq|
357   <tr>
358     <th>&nbsp;</th>
359     <td>| .
360       $cgi->radio_group('-name' => 'active',
361                         '-values' => [1, 0],
362                         '-default' => $form->{active} * 1,
363                         '-labels' => { 1 => $locale->text("Active"),
364                                        0 => $locale->text("Inactive") })
365       . qq|</td>
366   </tr>
367 |;
368   }
369
370   $form->header;
371
372   print qq|
373 <body>
374
375 <form method=post action=$form->{script}>
376
377 <input type=hidden name=id value=$form->{id}>
378 <input type=hidden name=type value=project>
379
380 <table width=100%>
381   <tr>
382     <th class=listtop>$form->{title}</th>
383   </tr>
384   <tr height="5"></tr>
385   <tr>
386     <td>
387       <table>
388         <tr>
389           <th align=right>| . $locale->text('Number') . qq|</th>
390           <td>$projectnumber</td>
391         </tr>
392         <tr>
393           <th align=right>| . $locale->text('Description') . qq|</th>
394           <td>$description</td>
395         </tr>
396       $active
397       </table>
398     </td>
399   </tr>
400   <tr>
401     <td colspan=2><hr size=3 noshade></td>
402   </tr>
403 </table>
404 |;
405
406   $lxdebug->leave_sub();
407 }
408
409 sub form_project_footer {
410   $lxdebug->enter_sub();
411
412   print qq|
413
414 <input name=callback type=hidden value="$form->{callback}">
415
416 <input type=hidden name=path value=$form->{path}>
417 <input type=hidden name=login value=$form->{login}>
418 <input type=hidden name=password value=$form->{password}>
419
420 <br><input type=submit class=submit name=action value="|
421     . $locale->text('Save') . qq|">
422 |;
423
424   if ($form->{id} && $form->{orphaned}) {
425     print qq|
426 <input type=submit class=submit name=action value="|
427       . $locale->text('Delete') . qq|">|;
428   }
429
430 # button for saving history
431 print qq|
432         <input type=button onclick=set_history_window(|
433         . $form->{id} 
434         . qq|); name=history id=history value=|
435         . $locale->text('history') 
436         . qq|>|;
437 # /button for saving history
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->{addition} = "SAVED";
471         $form->save_history($form->dbconnect(\%myconfig));
472   }
473   # /saving the history 
474
475   $lxdebug->leave_sub();
476 }
477
478 sub delete {
479   $lxdebug->enter_sub();
480
481   PE->delete_tuple(\%myconfig, \%$form);
482
483   if ($form->{type} eq 'project') {
484     $form->redirect($locale->text('Project deleted!'));
485   }
486   if ($form->{type} eq 'partsgroup') {
487     $form->redirect($locale->text('Group deleted!'));
488   }
489   if ($form->{type} eq 'pricegroup') {
490     $form->redirect($locale->text('Pricegroup deleted!'));
491   }
492   # saving the history
493   if(!exists $form->{addition}) {
494         $form->{addition} = "DELETED";
495         $form->save_history($form->dbconnect(\%myconfig));
496   }
497   # /saving the history
498   $lxdebug->leave_sub();
499 }
500
501 sub continue { call_sub($form->{"nextsub"}); }
502
503 sub partsgroup_report {
504   $lxdebug->enter_sub();
505
506   map { $form->{$_} = $form->unescape($form->{$_}) } (partsgroup);
507   PE->partsgroups(\%myconfig, \%$form);
508
509   $callback =
510     "$form->{script}?action=partsgroup_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
511
512   if ($form->{status} eq 'all') {
513     $option = $locale->text('All');
514   }
515   if ($form->{status} eq 'orphaned') {
516     $option .= $locale->text('Orphaned');
517   }
518   if ($form->{partsgroup}) {
519     $callback .= "&partsgroup=$form->{partsgroup}";
520     $option   .= "\n<br>" . $locale->text('Group') . " : $form->{partsgroup}";
521   }
522
523   @column_index = $form->sort_columns(qw(partsgroup));
524
525   $column_header{partsgroup} =
526     qq|<th class=listheading width=90%>| . $locale->text('Group') . qq|</th>|;
527
528   $form->{title} = $locale->text('Groups');
529
530   $form->header;
531
532   print qq|
533 <body>
534
535 <table width=100%>
536   <tr>
537     <th class=listtop>$form->{title}</th>
538   </tr>
539   <tr height="5"></tr>
540   <tr>
541     <td>$option</td>
542   </tr>
543   <tr>
544     <td>
545       <table width=100%>
546         <tr class=listheading>
547 |;
548
549   map { print "$column_header{$_}\n" } @column_index;
550
551   print qq|
552         </tr>
553 |;
554
555   # escape callback
556   $form->{callback} = $callback;
557
558   # escape callback for href
559   $callback = $form->escape($callback);
560
561   foreach $ref (@{ $form->{item_list} }) {
562
563     $i++;
564     $i %= 2;
565
566     print qq|
567         <tr valign=top class=listrow$i>
568 |;
569
570     $column_data{partsgroup} =
571       qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{partsgroup}</td>|;
572     map { print "$column_data{$_}\n" } @column_index;
573
574     print "
575         </tr>
576 ";
577   }
578
579   print qq|
580       </table>
581     </td>
582   </tr>
583   <tr>
584     <td><hr size=3 noshade></td>
585   </tr>
586 </table>
587
588 <br>
589 <form method=post action=$form->{script}>
590
591 <input name=callback type=hidden value="$form->{callback}">
592
593 <input type=hidden name=type value=$form->{type}>
594
595 <input type=hidden name=path value=$form->{path}>
596 <input type=hidden name=login value=$form->{login}>
597 <input type=hidden name=password value=$form->{password}>
598
599 <input class=submit type=submit name=action value="|
600     . $locale->text('Add') . qq|">
601
602   </form>
603
604 </body>
605 </html>
606 |;
607
608   $lxdebug->leave_sub();
609 }
610
611 sub form_partsgroup_header {
612   $lxdebug->enter_sub();
613
614   $form->{title} = $locale->text("$form->{title} Group");
615
616   # $locale->text('Add Group')
617   # $locale->text('Edit Group')
618
619   $form->{partsgroup} =~ s/\"/&quot;/g;
620
621   $form->header;
622
623   print qq|
624 <body>
625
626 <form method=post action=$form->{script}>
627
628 <input type=hidden name=id value=$form->{id}>
629 <input type=hidden name=type value=$form->{type}>
630
631 <table width=100%>
632   <tr>
633     <th class=listtop>$form->{title}</th>
634   </tr>
635   <tr height="5"></tr>
636   <tr>
637     <td>
638       <table width=100%>
639         <tr>
640           <th align=right>| . $locale->text('Group') . qq|</th>
641
642           <td><input name=partsgroup size=30 value="$form->{partsgroup}"></td>
643         </tr>
644       </table>
645     </td>
646   </tr>
647   <tr>
648     <td colspan=2><hr size=3 noshade></td>
649   </tr>
650 </table>
651 |;
652
653   $lxdebug->leave_sub();
654 }
655
656 sub form_partsgroup_footer {
657   $lxdebug->enter_sub();
658
659   print qq|
660
661 <input name=callback type=hidden value="$form->{callback}">
662
663 <input type=hidden name=path value=$form->{path}>
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}&path=$form->{path}&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}&path=$form->{path}&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=path value=$form->{path}>
794 <input type=hidden name=login value=$form->{login}>
795 <input type=hidden name=password value=$form->{password}>
796
797 <input class=submit type=submit name=action value="|
798     . $locale->text('Add') . qq|">
799
800   </form>
801
802 </body>
803 </html>
804 |;
805
806   $lxdebug->leave_sub();
807 }
808
809 #######################
810 #build up pricegroup_header
811 #
812 sub form_pricegroup_header {
813   $lxdebug->enter_sub();
814
815   # $locale->text('Add Pricegroup')
816   # $locale->text('Edit Pricegroup')
817
818   $form->{title} = $locale->text("$form->{title} Pricegroup");
819
820   $form->{pricegroup} =~ s/\"/&quot;/g;
821
822   $form->header;
823
824   print qq|
825 <body>
826
827 <form method=post action=$form->{script}>
828
829 <input type=hidden name=id value=$form->{id}>
830 <input type=hidden name=type value=$form->{type}>
831
832 <table width=100%>
833   <tr>
834     <th class=listtop>$form->{title}</th>
835   </tr>
836   <tr height="5"></tr>
837   <tr>
838     <td>
839       <table width=100%>
840         <tr>
841           <th align=right>| . $locale->text('Preisgruppe') . qq|</th>
842           <td><input name=pricegroup size=30 value="$form->{pricegroup}"></td>
843         </tr>
844       </table>
845     </td>
846   </tr>
847   <tr>
848     <td colspan=2><hr size=3 noshade></td>
849   </tr>
850 </table>
851 |;
852
853   $lxdebug->leave_sub();
854 }
855 ######################
856 #build up pricegroup_footer
857 #
858 sub form_pricegroup_footer {
859   $lxdebug->enter_sub();
860
861   print qq|
862
863 <input name=callback type=hidden value="$form->{callback}">
864
865 <input type=hidden name=path value=$form->{path}>
866 <input type=hidden name=login value=$form->{login}>
867 <input type=hidden name=password value=$form->{password}>
868
869 <br><input type=submit class=submit name=action value="|
870     . $locale->text('Save') . qq|">
871 |;
872
873   if ($form->{id} && $form->{orphaned}) {
874     print qq|
875 <input type=submit class=submit name=action value="|
876       . $locale->text('Delete') . qq|">|;
877   }
878
879 # button for saving history
880 print qq|
881         <input type=button onclick=set_history_window(|
882         . $form->{id} 
883         . qq|); name=history id=history value=|
884         . $locale->text('history') 
885         . qq|>|;
886 # /button for saving history
887   print qq|
888 </form>
889
890 </body>
891 </html>
892 |;
893
894   $lxdebug->leave_sub();
895 }