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

View File

@ -97,9 +97,8 @@ switch (post('op')) {
$contenuto = \Util\Ini::write(file_get_contents(DOCROOT.'/files/my_impianti/'.$componente), $post);
$dbo->query('UPDATE mg_articoli SET contenuto='.prepare($contenuto).' WHERE id='.prepare($id_record));
}else{
} else {
$dbo->query('UPDATE mg_articoli SET contenuto = \'\' WHERE id='.prepare($id_record));
}
// Upload file

View 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'].'">

View File

@ -2,7 +2,7 @@
include_once __DIR__.'/../core.php';
if (count($notes)>0) {
if (count($notes) > 0) {
echo '
<div class="box box-info direct-chat direct-chat-info">
<div class="box-header with-border">

View File

@ -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;
}
}