Revision 08df38df
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
SL/Drafts.pm | ||
---|---|---|
108 | 108 |
sub remove { |
109 | 109 |
$main::lxdebug->enter_sub(); |
110 | 110 |
|
111 |
my ($self, $myconfig, $form, $draft_id) = @_;
|
|
111 |
my ($self, $myconfig, $form, @draft_ids) = @_;
|
|
112 | 112 |
|
113 |
return $main::lxdebug->leave_sub() unless ($draft_id);
|
|
113 |
return $main::lxdebug->leave_sub() unless (@draft_ids);
|
|
114 | 114 |
|
115 |
my ($dbh, $sth, $query, @values);
|
|
115 |
my ($dbh, $sth, $query); |
|
116 | 116 |
|
117 | 117 |
$dbh = $form->dbconnect($myconfig); |
118 | 118 |
|
119 |
$query = qq|DELETE FROM drafts WHERE id = ?|; |
|
120 |
do_query($form, $dbh, $query, $draft_id); |
|
119 |
$query = qq|DELETE FROM drafts WHERE id IN (| . |
|
120 |
join(", ", map({ "?" } @draft_ids)) . qq|)|; |
|
121 |
do_query($form, $dbh, $query, @draft_ids); |
|
121 | 122 |
|
122 | 123 |
$dbh->disconnect(); |
123 | 124 |
|
bin/mozilla/drafts.pl | ||
---|---|---|
83 | 83 |
my $draft_nextsub = $form->{draft_nextsub}; |
84 | 84 |
$draft_nextsub = "add" unless ($form->{draft_nextsub}); |
85 | 85 |
restore_form($form->{SAVED_FORM}, 1); |
86 |
delete($form->{SAVED_FORM}); |
|
86 | 87 |
delete($form->{action}); |
87 | 88 |
$form->{DONT_LOAD_DRAFT} = 1; |
88 | 89 |
|
... | ... | |
107 | 108 |
$lxdebug->leave_sub(); |
108 | 109 |
} |
109 | 110 |
|
111 |
sub delete_drafts { |
|
112 |
$lxdebug->enter_sub(); |
|
113 |
|
|
114 |
my @ids; |
|
115 |
foreach (keys(%{$form})) { |
|
116 |
push(@ids, $1) if (/^checked_(.*)/ && $form->{$_}); |
|
117 |
} |
|
118 |
Drafts->remove(\%myconfig, $form, @ids) if (@ids); |
|
119 |
restore_form($form->{SAVED_FORM}, 1); |
|
120 |
delete($form->{SAVED_FORM}); |
|
121 |
|
|
122 |
add(); |
|
123 |
|
|
124 |
$lxdebug->leave_sub(); |
|
125 |
} |
|
126 |
|
|
127 |
sub draft_action_dispatcher { |
|
128 |
$lxdebug->enter_sub(); |
|
129 |
|
|
130 |
if ($form->{draft_action} eq $locale->text("Skip")) { |
|
131 |
dont_load_draft(); |
|
132 |
} elsif ($form->{draft_action} eq $locale->text("Delete drafts")) { |
|
133 |
delete_drafts(); |
|
134 |
} |
|
135 |
|
|
136 |
$lxdebug->leave_sub(); |
|
137 |
} |
|
138 |
|
|
110 | 139 |
1; |
locale/de/all | ||
---|---|---|
351 | 351 |
'Delete' => 'L?schen', |
352 | 352 |
'Delete Account' => 'Konto l?schen', |
353 | 353 |
'Delete Dataset' => 'Datenbank l?schen', |
354 |
'Delete drafts' => 'Entw?rfe l?schen', |
|
354 | 355 |
'Delivered' => 'Geliefert', |
355 | 356 |
'Delivery Date' => 'Lieferdatum', |
356 | 357 |
'Department' => 'Abteilung', |
locale/de/ap | ||
---|---|---|
33 | 33 |
'Dec' => 'Dez', |
34 | 34 |
'December' => 'Dezember', |
35 | 35 |
'Delete' => 'L?schen', |
36 |
'Delete drafts' => 'Entw?rfe l?schen', |
|
36 | 37 |
'Department' => 'Abteilung', |
37 | 38 |
'Description' => 'Beschreibung', |
38 | 39 |
'Draft saved.' => 'Entwurf gespeichert.', |
... | ... | |
113 | 114 |
'Select from one of the projects below' => 'W?hlen Sie eines der untenstehenden Projekte', |
114 | 115 |
'Sep' => 'Sep', |
115 | 116 |
'September' => 'September', |
117 |
'Skip' => '?berspringen', |
|
116 | 118 |
'Source' => 'Beleg', |
117 | 119 |
'Subtotal' => 'Zwischensumme', |
118 | 120 |
'Tax' => 'Steuer', |
... | ... | |
162 | 164 |
'continue' => 'continue', |
163 | 165 |
'create_links' => 'create_links', |
164 | 166 |
'delete' => 'delete', |
167 |
'delete_drafts' => 'delete_drafts', |
|
165 | 168 |
'delivery_customer_selection' => 'delivery_customer_selection', |
166 | 169 |
'display_form' => 'display_form', |
167 | 170 |
'dont_load_draft' => 'dont_load_draft', |
171 |
'draft_action_dispatcher' => 'draft_action_dispatcher', |
|
168 | 172 |
'edit' => 'edit', |
169 | 173 |
'employee_selection_internal' => 'employee_selection_internal', |
170 | 174 |
'form_footer' => 'form_footer', |
... | ... | |
204 | 208 |
'kreditorenbuchung_erfassen' => 'add_accounts_payables_transaction', |
205 | 209 |
'weiter' => 'continue', |
206 | 210 |
'l?schen' => 'delete', |
211 |
'entw?rfe_l?schen' => 'delete_drafts', |
|
207 | 212 |
'kreditorenbuchung_bearbeiten' => 'edit_accounts_payables_transaction', |
208 | 213 |
'buchen' => 'post', |
209 | 214 |
'zahlung_buchen' => 'post_payment', |
locale/de/ar | ||
---|---|---|
37 | 37 |
'Dec' => 'Dez', |
38 | 38 |
'December' => 'Dezember', |
39 | 39 |
'Delete' => 'L?schen', |
40 |
'Delete drafts' => 'Entw?rfe l?schen', |
|
40 | 41 |
'Department' => 'Abteilung', |
41 | 42 |
'Description' => 'Beschreibung', |
42 | 43 |
'Draft saved.' => 'Entwurf gespeichert.', |
... | ... | |
121 | 122 |
'September' => 'September', |
122 | 123 |
'Ship via' => 'Transportmittel', |
123 | 124 |
'Shipping Point' => 'Versandort', |
125 |
'Skip' => '?berspringen', |
|
124 | 126 |
'Source' => 'Beleg', |
125 | 127 |
'Storno (one letter abbreviation)' => 'S', |
126 | 128 |
'Subtotal' => 'Zwischensumme', |
... | ... | |
170 | 172 |
'continue' => 'continue', |
171 | 173 |
'create_links' => 'create_links', |
172 | 174 |
'delete' => 'delete', |
175 |
'delete_drafts' => 'delete_drafts', |
|
173 | 176 |
'delivery_customer_selection' => 'delivery_customer_selection', |
174 | 177 |
'display' => 'display', |
175 | 178 |
'display_form' => 'display_form', |
176 | 179 |
'dont_load_draft' => 'dont_load_draft', |
180 |
'draft_action_dispatcher' => 'draft_action_dispatcher', |
|
177 | 181 |
'edit' => 'edit', |
178 | 182 |
'employee_selection_internal' => 'employee_selection_internal', |
179 | 183 |
'form_footer' => 'form_footer', |
... | ... | |
213 | 217 |
'debitorenbuchung' => 'ar_transaction', |
214 | 218 |
'weiter' => 'continue', |
215 | 219 |
'l?schen' => 'delete', |
220 |
'entw?rfe_l?schen' => 'delete_drafts', |
|
216 | 221 |
'buchen' => 'post', |
217 | 222 |
'zahlung_buchen' => 'post_payment', |
218 | 223 |
'rechnung' => 'sales_invoice', |
locale/de/drafts | ||
---|---|---|
4 | 4 |
'Customer Number' => 'Kundennummer', |
5 | 5 |
'DELETED' => 'Gel?scht', |
6 | 6 |
'DUNNING STARTED' => 'DUNNING STARTED', |
7 |
'Delete drafts' => 'Entw?rfe l?schen', |
|
7 | 8 |
'Draft saved.' => 'Entwurf gespeichert.', |
8 | 9 |
'ELSE' => 'Zusatz', |
9 | 10 |
'Enter longdescription' => 'Langtext eingeben', |
... | ... | |
31 | 32 |
'Select a part' => 'Artikel auswählen', |
32 | 33 |
'Select a project' => 'Projekt auswählen', |
33 | 34 |
'Select an employee' => 'Angestellten auswählen', |
35 |
'Skip' => '?berspringen', |
|
34 | 36 |
'Unit' => 'Einheit', |
35 | 37 |
'Value' => 'Wert', |
36 | 38 |
'Variable' => 'Variable', |
... | ... | |
52 | 54 |
'Q' => 'Q', |
53 | 55 |
'build_std_url' => 'build_std_url', |
54 | 56 |
'calculate_qty' => 'calculate_qty', |
57 |
'delete_drafts' => 'delete_drafts', |
|
55 | 58 |
'delivery_customer_selection' => 'delivery_customer_selection', |
56 | 59 |
'dont_load_draft' => 'dont_load_draft', |
60 |
'draft_action_dispatcher' => 'draft_action_dispatcher', |
|
57 | 61 |
'employee_selection_internal' => 'employee_selection_internal', |
58 | 62 |
'format_dates' => 'format_dates', |
59 | 63 |
'load_draft' => 'load_draft', |
... | ... | |
72 | 76 |
'set_longdescription' => 'set_longdescription', |
73 | 77 |
'show_history' => 'show_history', |
74 | 78 |
'vendor_selection' => 'vendor_selection', |
79 |
'entw?rfe_l?schen' => 'delete_drafts', |
|
75 | 80 |
'entwurf_speichern' => 'save_draft', |
76 | 81 |
'?berspringen' => 'skip', |
77 | 82 |
}; |
locale/de/ir | ||
---|---|---|
49 | 49 |
'Dec' => 'Dez', |
50 | 50 |
'December' => 'Dezember', |
51 | 51 |
'Delete' => 'L?schen', |
52 |
'Delete drafts' => 'Entw?rfe l?schen', |
|
52 | 53 |
'Delivery Date' => 'Lieferdatum', |
53 | 54 |
'Department' => 'Abteilung', |
54 | 55 |
'Description' => 'Beschreibung', |
... | ... | |
183 | 184 |
'Ship to' => 'Lieferadresse', |
184 | 185 |
'Shipping Address' => 'Lieferadresse', |
185 | 186 |
'Show details' => 'Details anzeigen', |
187 |
'Skip' => '?berspringen', |
|
186 | 188 |
'Source' => 'Beleg', |
187 | 189 |
'Steuersatz' => 'Steuersatz', |
188 | 190 |
'Storno' => 'Storno', |
... | ... | |
242 | 244 |
'continue' => 'continue', |
243 | 245 |
'customer_details' => 'customer_details', |
244 | 246 |
'delete' => 'delete', |
247 |
'delete_drafts' => 'delete_drafts', |
|
245 | 248 |
'delivery_customer_selection' => 'delivery_customer_selection', |
246 | 249 |
'display_form' => 'display_form', |
247 | 250 |
'display_row' => 'display_row', |
248 | 251 |
'dont_load_draft' => 'dont_load_draft', |
252 |
'draft_action_dispatcher' => 'draft_action_dispatcher', |
|
249 | 253 |
'e_mail' => 'e_mail', |
250 | 254 |
'edit' => 'edit', |
251 | 255 |
'employee_selection_internal' => 'employee_selection_internal', |
... | ... | |
304 | 308 |
'yes' => 'yes', |
305 | 309 |
'weiter' => 'continue', |
306 | 310 |
'l?schen' => 'delete', |
311 |
'entw?rfe_l?schen' => 'delete_drafts', |
|
307 | 312 |
'buchen' => 'post', |
308 | 313 |
'zahlung_buchen' => 'post_payment', |
309 | 314 |
'entwurf_speichern' => 'save_draft', |
locale/de/is | ||
---|---|---|
60 | 60 |
'Dec' => 'Dez', |
61 | 61 |
'December' => 'Dezember', |
62 | 62 |
'Delete' => 'L?schen', |
63 |
'Delete drafts' => 'Entw?rfe l?schen', |
|
63 | 64 |
'Delivery Date' => 'Lieferdatum', |
64 | 65 |
'Department' => 'Abteilung', |
65 | 66 |
'Description' => 'Beschreibung', |
... | ... | |
208 | 209 |
'Shipping Address' => 'Lieferadresse', |
209 | 210 |
'Shipping Point' => 'Versandort', |
210 | 211 |
'Show details' => 'Details anzeigen', |
212 |
'Skip' => '?berspringen', |
|
211 | 213 |
'Source' => 'Beleg', |
212 | 214 |
'Steuersatz' => 'Steuersatz', |
213 | 215 |
'Storno' => 'Storno', |
... | ... | |
267 | 269 |
'credit_note' => 'credit_note', |
268 | 270 |
'customer_details' => 'customer_details', |
269 | 271 |
'delete' => 'delete', |
272 |
'delete_drafts' => 'delete_drafts', |
|
270 | 273 |
'delivery_customer_selection' => 'delivery_customer_selection', |
271 | 274 |
'display_form' => 'display_form', |
272 | 275 |
'display_row' => 'display_row', |
273 | 276 |
'dont_load_draft' => 'dont_load_draft', |
277 |
'draft_action_dispatcher' => 'draft_action_dispatcher', |
|
274 | 278 |
'e_mail' => 'e_mail', |
275 | 279 |
'edit' => 'edit', |
276 | 280 |
'employee_selection_internal' => 'employee_selection_internal', |
... | ... | |
332 | 336 |
'weiter' => 'continue', |
333 | 337 |
'gutschrift' => 'credit_note', |
334 | 338 |
'l?schen' => 'delete', |
339 |
'entw?rfe_l?schen' => 'delete_drafts', |
|
335 | 340 |
'email' => 'e_mail', |
336 | 341 |
'auftrag' => 'order', |
337 | 342 |
'buchen' => 'post', |
templates/webpages/drafts/load_de.html | ||
---|---|---|
24 | 24 |
<td> |
25 | 25 |
<table> |
26 | 26 |
<tr> |
27 |
<th class="listheading"> </th> |
|
27 | 28 |
<th class="listheading">Datum</th> |
28 | 29 |
<th class="listheading">Beschreibung</th> |
29 | 30 |
<th class="listheading">Bearbeiter</th> |
... | ... | |
31 | 32 |
|
32 | 33 |
<TMPL_LOOP DRAFTS> |
33 | 34 |
<tr class="listrow<TMPL_IF __odd__>1<TMPL_ELSE>0</TMPL_IF>"> |
35 |
<td><input type="checkbox" name="checked_<TMPL_VAR id>" value="1"></td> |
|
34 | 36 |
<td><TMPL_VAR itime ESCAPE=HTML></td> |
35 | 37 |
<td><a href="<TMPL_VAR script ESCAPE=URL>?login=<TMPL_VAR login ESCAPE=URL>&password=<TMPL_VAR password ESCAPE=URL>&path=<TMPL_VAR path ESCAPE=URL>&action=load_draft&id=<TMPL_VAR id ESCAPE=URL>"><TMPL_VAR description ESCAPE=HTML></a></td> |
36 | 38 |
<td><TMPL_VAR employee_name ESCAPE=HTML></td> |
... | ... | |
42 | 44 |
|
43 | 45 |
<tr> |
44 | 46 |
<td> |
45 |
<input type="hidden" name="action" value="dont_load_draft"> |
|
46 |
<input type="submit" class="submit" name="dummy" value="?berspringen"> |
|
47 |
<input type="hidden" name="action" value="draft_action_dispatcher"> |
|
48 |
<input type="submit" class="submit" name="draft_action" value="?berspringen"> |
|
49 |
<input type="submit" class="submit" name="draft_action" value="Entw?rfe l?schen"> |
|
47 | 50 |
</td> |
48 | 51 |
</tr> |
49 | 52 |
</table> |
templates/webpages/drafts/load_master.html | ||
---|---|---|
24 | 24 |
<td> |
25 | 25 |
<table> |
26 | 26 |
<tr> |
27 |
<th class="listheading"> </th> |
|
27 | 28 |
<th class="listheading"><translate>Date</translate></th> |
28 | 29 |
<th class="listheading"><translate>Description</translate></th> |
29 | 30 |
<th class="listheading"><translate>Employee</translate></th> |
... | ... | |
31 | 32 |
|
32 | 33 |
<TMPL_LOOP DRAFTS> |
33 | 34 |
<tr class="listrow<TMPL_IF __odd__>1<TMPL_ELSE>0</TMPL_IF>"> |
35 |
<td><input type="checkbox" name="checked_<TMPL_VAR id>" value="1"></td> |
|
34 | 36 |
<td><TMPL_VAR itime ESCAPE=HTML></td> |
35 | 37 |
<td><a href="<TMPL_VAR script ESCAPE=URL>?login=<TMPL_VAR login ESCAPE=URL>&password=<TMPL_VAR password ESCAPE=URL>&path=<TMPL_VAR path ESCAPE=URL>&action=load_draft&id=<TMPL_VAR id ESCAPE=URL>"><TMPL_VAR description ESCAPE=HTML></a></td> |
36 | 38 |
<td><TMPL_VAR employee_name ESCAPE=HTML></td> |
... | ... | |
42 | 44 |
|
43 | 45 |
<tr> |
44 | 46 |
<td> |
45 |
<input type="hidden" name="action" value="dont_load_draft"> |
|
46 |
<input type="submit" class="submit" name="dummy" value="<translate>Skip</translate>"> |
|
47 |
<input type="hidden" name="action" value="draft_action_dispatcher"> |
|
48 |
<input type="submit" class="submit" name="draft_action" value="<translate>Skip</translate>"> |
|
49 |
<input type="submit" class="submit" name="draft_action" value="<translate>Delete drafts</translate>"> |
|
47 | 50 |
</td> |
48 | 51 |
</tr> |
49 | 52 |
</table> |
Auch abrufbar als: Unified diff
Möglichkeit zum Löschen von gespeicherten Entwürfen eingebaut.