1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 11:30:55 +01:00

Possibile bugfix allegati email

This commit is contained in:
Thomas Zilio 2019-11-26 17:03:25 +01:00
parent adf3aa0b58
commit 609368aa33
4 changed files with 16 additions and 7 deletions
modules
src/Notifications

@ -99,7 +99,6 @@ switch (post('op')) {
$dbo->query('UPDATE mg_articoli SET contenuto='.prepare($contenuto).' WHERE id='.prepare($id_record));
} else {
$dbo->query('UPDATE mg_articoli SET contenuto = \'\' WHERE id='.prepare($id_record));
}
// Upload file

@ -28,7 +28,6 @@ if (!empty($additionals)) {
</button>
</div>';
if ($editable) {
echo '
<a class="btn btn-danger ask pull-right" data-backto="record-edit" data-op="delete_filter" data-id="'.$additional['id'].'">

@ -10,7 +10,7 @@ use Uploads;
class EmailNotification extends PHPMailer implements NotificationInterface
{
protected $mail;
protected $attachments = [];
protected $directory;
protected $infos = [];
@ -168,7 +168,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface
$this->SmtpClose();
// Pulizia file generati
delete(DOCROOT.'/files/notifications/');
delete($this->getTempDirectory());
// Segnalazione degli errori
if (!$result) {
@ -225,7 +225,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface
$print = Prints::get($print);
// Utilizzo di una cartella particolare per il salvataggio temporaneo degli allegati
$path = DOCROOT.'/files/notifications/'.rand(0, 999);
$path = $this->getTempDirectory();
$info = Prints::render($print['id'], $id_record, $path);
$name = $name ?: $info['name'];
@ -262,4 +262,15 @@ class EmailNotification extends PHPMailer implements NotificationInterface
}
}
}
protected function getTempDirectory()
{
if (!isset($this->directory)) {
$this->directory = DOCROOT.'/files/notifications/'.rand(0, 999);
directory($this->directory);
}
return $this->directory;
}
}