1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-02 08:56:48 +01:00

Bugfix esportazioni

This commit is contained in:
Thomas Zilio 2018-06-29 15:48:57 +02:00
parent 796de53c5a
commit fe94eeb2ac
4 changed files with 26 additions and 65 deletions

View File

@ -769,6 +769,10 @@ function start_datatables() {
if (type === 'row') {
var selected = $this.data('selected').split(';');
selected = selected.filter(function (value, index, self) {
return value != '' && self.indexOf(value) === index;
})
var data = table.rows(indexes).data();
data.each(function (item) {
@ -779,6 +783,8 @@ function start_datatables() {
selected.push(id);
} else {
var index = selected.indexOf("" + id);
console.log(selected);
console.log(id);
if (index > -1) {
delete selected[index];
}
@ -786,9 +792,9 @@ function start_datatables() {
}
});
selected = selected.filter(function (entry) {
return entry != '';
});
selected = selected.filter(function (value, index, self) {
return value != '' && self.indexOf(value) === index;
})
$this.data('selected', selected.join(';'));

View File

@ -25,13 +25,12 @@ switch (post('op')) {
$rapportino_nome = sanitizeFilename($numero.' '.$r['data'].' '.$r['ragione_sociale'].'.pdf');
$filename = slashes($dir.'tmp/'.$rapportino_nome);
$iddocumento = $r['id'];
$ptype = 'fatture';
$print = $dbo->fetchArray('SELECT id, previous FROM zz_prints WHERE directory = '.prepare($ptype).' ORDER BY main DESC LIMIT 1');
$id_print = $print[0]['id'];
Prints::render($id_print, $iddocumento, $filename);
Prints::render($id_print, $r['id'], $filename);
}
$dir = slashes($dir);

View File

@ -616,46 +616,5 @@ switch (post('op')) {
]);
}
break;
case 'sendemail':
$from_address = post('from_address');
$from_name = post('from_name');
$destinatario = post('destinatario');
$cc = get_var('Destinatario fisso in copia (campo CC)');
$oggetto = html_entity_decode(post('oggetto'));
$testo_email = post('body');
$allegato = post('allegato');
$mail = new Mail();
$mail->AddReplyTo($from_address, $from_name);
$mail->SetFrom($from_address, $from_name);
$mail->AddAddress($destinatario, '');
// se ho impostato la conferma di lettura
if (post('confermalettura') == 'on') {
$mail->ConfirmReadingTo = $from_address;
}
$mail->Subject = $oggetto;
$mail->AddCC($cc);
$mail->MsgHTML($testo_email);
if (!empty($allegato)) {
$mail->AddAttachment($allegato);
}
if (!$mail->send()) {
$_SESSION['errors'][] = tr("Errore durante l'invio dell'email").': '.$mail->ErrorInfo;
} else {
$dbo->query('UPDATE in_interventi SET data_invio=NOW() WHERE id='.prepare($id_record));
$_SESSION['infos'][] = tr('Email inviata!');
}
break;
}

View File

@ -25,22 +25,19 @@ switch (post('op')) {
if (!empty($records)) {
foreach ($records as $r) {
//$numero = !empty($r['numero_esterno']) ? $r['numero_esterno'] : $r['numero'];
$numero = $r['codice'];
$numero = str_replace(['/', '\\'], '-', $numero);
// Gestione della stampa
$rapportino_nome = sanitizeFilename($numero.' '.date('Y_m_d', strtotime($r['data_richiesta'])).' '.$r['ragione_sociale'].'.pdf');
$filename = slashes($dir.'tmp/'.$rapportino_nome);
$_GET['idintervento'] = $r['id']; // Fix temporaneo per la stampa
$idintervento = $r['id']; // Fix temporaneo per la stampa
//$ptype = ($r['descrizione'] == 'Fattura accompagnatoria di vendita') ? 'fatture_accompagnatorie' : 'fatture';
$ptype = 'interventi';
require DOCROOT.'/pdfgen.php';
$print = $dbo->fetchArray('SELECT id, previous FROM zz_prints WHERE directory = '.prepare($ptype).' ORDER BY main DESC LIMIT 1');
$id_print = $print[0]['id'];
Prints::render($id_print, $r['id'], $filename);
}
$dir = slashes($dir);