Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b4a40a3c

Von Tamino Steinert vor 4 Monaten hinzugefügt

  • ID b4a40a3c36d9856ca5fd15a54122634feb90d3fa
  • Vorgänger 3ac8bdc7
  • Nachfolger 31d1d9af

EmailJournal: Verarbeitet-Status von Anhängen per Button ändern

Unterschiede anzeigen:

SL/Controller/EmailJournal.pm
return;
}
sub action_toggle_attachment_processed {
my ($self) = @_;
$::auth->assert('email_journal');
my $attachment = SL::DB::EmailJournalAttachment->new(
id => $::form->{attachment_id}
)->load();
$self->entry($attachment->email_journal);
if (!$self->can_view_all && ($self->entry->sender_id != SL::DB::Manager::Employee->current->id)) {
$::form->error(t8('You do not have permission to access this entry.'));
}
$attachment->processed(!$attachment->processed);
$attachment->save;
$self->js
->html('#processed_' . $attachment->id, $attachment->processed_as_bool_yn)
->flash('info',
$attachment->processed ?
t8('Attachment \'#1\' set to processed.', $attachment->name)
: t8('Attachment \'#1\' set to unprocessed.', $attachment->name)
)->render();
return;
}
#
# filters
#
js/kivi.EmailJournal.js
$.post("controller.pl", data, kivi.eval_json_result);
}
ns.toggle_attachment_processed = function(attachment_id) {
let data = $('#record_action_form').serializeArray();
data.push({ name: 'action', value: 'EmailJournal/toggle_attachment_processed' });
data.push({ name: 'attachment_id', value: attachment_id });
$.post("controller.pl", data, kivi.eval_json_result);
}
});
locale/de/all
'Attach PDF:' => 'PDF anhängen',
'Attached Filename' => 'Name des Dateianhangs',
'Attachment' => 'als Anhang',
'Attachment \'#1\' set to processed.' => 'Anhang \'#1\' auf verarbeitet gesetzt.',
'Attachment \'#1\' set to unprocessed.' => 'Anhang \'#1\' auf nicht verarbeitet gesetzt.',
'Attachment name' => 'Name des Anhangs',
'Attachments' => 'Dateianhänge',
'Attempt to call an undefined sub named \'%s\'' => 'Es wurde versucht, eine nicht definierte Unterfunktion namens \'%s\' aufzurufen.',
......
'To user login' => 'Zum Benutzerlogin',
'Today' => 'heute',
'Toggle marker' => 'Markierung umschalten',
'Toggle processed' => 'Verarbeitet-Status umschalten',
'Toggle selection' => 'Auswahl umkehren',
'Too many results (#1 from #2).' => 'Zu viele Artikel (#1 von #2)',
'Too much recursions in assembly tree (>100)' => 'Zu tiefe Verschachtelung (>100) des Erzeugnisbaum',
locale/en/all
'Attach PDF:' => '',
'Attached Filename' => '',
'Attachment' => '',
'Attachment \'#1\' set to processed.' => '',
'Attachment \'#1\' set to unprocessed.' => '',
'Attachment name' => '',
'Attachments' => '',
'Attempt to call an undefined sub named \'%s\'' => '',
......
'To user login' => '',
'Today' => '',
'Toggle marker' => '',
'Toggle processed' => '',
'Toggle selection' => '',
'Too many results (#1 from #2).' => '',
'Too much recursions in assembly tree (>100)' => '',
templates/design40_webpages/email_journal/show.html
<th>[% 'MIME type' | $T8 %]</th>
<th>[% 'Size' | $T8 %]</th>
<th>[% 'Processed' | $T8 %]</th>
<th>[% 'Action' | $T8 %]</th>
</tr>
</thead>
<tbody>
......
<td>[% L.link(SELF.url_for(action="download_attachment", id=attachment.id), attachment.name) %]</td>
<td>[% HTML.escape(attachment.mime_type) %]</td>
<td>[% HTML.escape(LxERP.format_amount(attachment.content.length, 0)) %]</td>
<td>[% HTML.escape(attachment.processed_as_bool_yn) %]</td>
<td id="[% "processed_" _ attachment.id %]">
[% HTML.escape(attachment.processed_as_bool_yn) %]
</td>
<td> [% L.button_tag(
"kivi.EmailJournal.toggle_attachment_processed(" _ attachment.id _ ")",
LxERP.t8("Toggle processed")
) %]
</td>
</tr>
[% END %]
</tbody>
templates/webpages/email_journal/show.html
<th>[% LxERP.t8("MIME type") %]</th>
<th>[% LxERP.t8("Size") %]</th>
<th>[% LxERP.t8("Processed") %]</th>
<th>[% 'Action' | $T8 %]</th>
</tr>
</thead>
......
<td>[% L.link(SELF.url_for(action="download_attachment", id=attachment.id), attachment.name) %]</td>
<td>[% HTML.escape(attachment.mime_type) %]</td>
<td>[% HTML.escape(LxERP.format_amount(attachment.content.length, 0)) %]</td>
<td>[% HTML.escape(attachment.processed_as_bool_yn) %]</td>
<td id="[% "processed_" _ attachment.id %]">
[% HTML.escape(attachment.processed_as_bool_yn) %]
</td>
<td> [% L.button_tag(
"kivi.EmailJournal.toggle_attachment_processed(" _ attachment.id _ ")",
LxERP.t8("Toggle processed")
) %]
</td>
</tr>
[% END %]
</tbody>

Auch abrufbar als: Unified diff