Revision 03b22b34
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
bin/mozilla/drafts.pl | ||
---|---|---|
18 | 18 |
|
19 | 19 |
if (!$form->{draft_id} && !$form->{draft_description}) { |
20 | 20 |
restore_form($form->{SAVED_FORM}, 1) if ($form->{SAVED_FORM}); |
21 |
delete($form->{SAVED_FORM}); |
|
21 |
delete $form->{SAVED_FORM}; |
|
22 |
|
|
23 |
$form->{SAVED_FORM} = save_form(); |
|
22 | 24 |
$form->{remove_draft} = 1; |
23 |
$form->{SAVED_FORM} = save_form(); |
|
24 | 25 |
|
25 | 26 |
$form->header(); |
26 | 27 |
print($form->parse_html_template("drafts/save_new")); |
28 |
|
|
27 | 29 |
return $lxdebug->leave_sub(); |
28 | 30 |
} |
29 | 31 |
|
30 |
my ($draft_id, $draft_description) = |
|
31 |
($form->{draft_id}, $form->{draft_description}); |
|
32 |
my ($draft_id, $draft_description) = ($form->{draft_id}, $form->{draft_description}); |
|
32 | 33 |
|
33 | 34 |
restore_form($form->{SAVED_FORM}, 1); |
34 |
delete($form->{SAVED_FORM});
|
|
35 |
delete $form->{SAVED_FORM};
|
|
35 | 36 |
|
36 | 37 |
Drafts->save(\%myconfig, $form, $draft_id, $draft_description); |
37 | 38 |
|
... | ... | |
47 | 48 |
|
48 | 49 |
Drafts->remove(\%myconfig, $form, $form->{draft_id}) if ($form->{draft_id}); |
49 | 50 |
|
50 |
delete($form->{draft_id}); |
|
51 |
delete($form->{draft_description}); |
|
51 |
delete @{$form}{qw(draft_id draft_description)}; |
|
52 | 52 |
|
53 | 53 |
$lxdebug->leave_sub(); |
54 | 54 |
} |
... | ... | |
66 | 66 |
|
67 | 67 |
$draft_nextsub = "add" unless ($draft_nextsub); |
68 | 68 |
|
69 |
delete($form->{action});
|
|
69 |
delete $form->{action};
|
|
70 | 70 |
my $saved_form = save_form(); |
71 | 71 |
|
72 | 72 |
$form->header(); |
... | ... | |
83 | 83 |
sub dont_load_draft { |
84 | 84 |
$lxdebug->enter_sub(); |
85 | 85 |
|
86 |
my $draft_nextsub = $form->{draft_nextsub}; |
|
87 |
$draft_nextsub = "add" unless ($form->{draft_nextsub}); |
|
86 |
my $draft_nextsub = $form->{draft_nextsub} || "add";
|
|
87 |
|
|
88 | 88 |
restore_form($form->{SAVED_FORM}, 1); |
89 |
delete($form->{SAVED_FORM});
|
|
90 |
delete($form->{action}); |
|
89 |
delete $form->{SAVED_FORM};
|
|
90 |
|
|
91 | 91 |
$form->{DONT_LOAD_DRAFT} = 1; |
92 | 92 |
|
93 | 93 |
call_sub($draft_nextsub); |
... | ... | |
99 | 99 |
$lxdebug->enter_sub(); |
100 | 100 |
|
101 | 101 |
my ($old_form, $id, $description) = Drafts->load(\%myconfig, $form, $form->{id}); |
102 |
|
|
102 | 103 |
if ($old_form) { |
103 | 104 |
$old_form = YAML::Load($old_form); |
105 |
|
|
104 | 106 |
@{$form}{keys %{ $old_form } } = @{$old_form}{keys %{ $old_form } }; |
105 |
$form->{draft_id} = $id; |
|
106 |
$form->{draft_description} = $description; |
|
107 |
$form->{remove_draft} = 'checked'; |
|
107 |
|
|
108 |
$form->{draft_id} = $id; |
|
109 |
$form->{draft_description} = $description; |
|
110 |
$form->{remove_draft} = 'checked'; |
|
108 | 111 |
} |
109 | 112 |
|
110 | 113 |
update(); |
... | ... | |
116 | 119 |
$lxdebug->enter_sub(); |
117 | 120 |
|
118 | 121 |
my @ids; |
119 |
foreach (keys(%{$form})) {
|
|
120 |
push(@ids, $1) if (/^checked_(.*)/ && $form->{$_});
|
|
122 |
foreach (keys %{$form}) {
|
|
123 |
push @ids, $1 if (/^checked_(.*)/ && $form->{$_});
|
|
121 | 124 |
} |
122 | 125 |
Drafts->remove(\%myconfig, $form, @ids) if (@ids); |
126 |
|
|
123 | 127 |
restore_form($form->{SAVED_FORM}, 1); |
124 |
delete($form->{SAVED_FORM});
|
|
128 |
delete $form->{SAVED_FORM};
|
|
125 | 129 |
|
126 | 130 |
add(); |
127 | 131 |
|
... | ... | |
133 | 137 |
|
134 | 138 |
if ($form->{draft_action} eq $locale->text("Skip")) { |
135 | 139 |
dont_load_draft(); |
140 |
|
|
136 | 141 |
} elsif ($form->{draft_action} eq $locale->text("Delete drafts")) { |
137 | 142 |
delete_drafts(); |
138 | 143 |
} |
Auch abrufbar als: Unified diff
Kosmetik