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:
parent
796de53c5a
commit
fe94eeb2ac
@ -536,7 +536,7 @@ function start_datatables() {
|
||||
var sum;
|
||||
var tempo;
|
||||
var tempo_attesa_ricerche = (globals.tempo_attesa_ricerche*1000);
|
||||
|
||||
|
||||
var table = $this.DataTable({
|
||||
language: {
|
||||
url: globals.js + '/i18n/datatables/' + globals.locale + '.min.json'
|
||||
@ -629,9 +629,9 @@ function start_datatables() {
|
||||
$('<br><input type="text" style="width:100%" class="form-control" placeholder="' + globals.translations.filter + '..."><i class="deleteicon fa fa-times fa-2x hide"></i>')
|
||||
.appendTo(column.header())
|
||||
.on('keyup', function (e) {
|
||||
|
||||
|
||||
clearInterval(tempo);
|
||||
|
||||
|
||||
if (e.which != 9) {
|
||||
if (!$(this).val()) {
|
||||
if ($(this).parent().data("slow") != undefined) $("#slow").remove();
|
||||
@ -648,13 +648,13 @@ function start_datatables() {
|
||||
|
||||
idx1 = 'module_' + $this.data('idmodule'); //+ "-" + $this.data('idplugin');
|
||||
idx2 = 'search_' + $(this).parent().attr('id').replace('th_', '');
|
||||
|
||||
|
||||
function start_search(search_value){
|
||||
session_set(idx1 + ',' + idx2, search_value, 0);
|
||||
column.search(search_value).draw();
|
||||
}
|
||||
|
||||
// Imposto delle sessioni per le ricerche del modulo e del campo specificatsi
|
||||
// Imposto delle sessioni per le ricerche del modulo e del campo specificatsi
|
||||
if(e.keyCode == 13 || $(this).val()==''){
|
||||
start_search($(this).val());
|
||||
}else{
|
||||
@ -662,7 +662,7 @@ function start_datatables() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Disabilito l'ordinamento alla pressione del tasto invio sull'<input>
|
||||
$("thead input, .search").on('keypress', function (e) {
|
||||
stopTableSorting(e);
|
||||
@ -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(';'));
|
||||
|
||||
@ -1055,7 +1061,7 @@ function start_inputmask(element) {
|
||||
if (min == 'undefined') {
|
||||
min = false;
|
||||
}
|
||||
|
||||
|
||||
var max = $this.attr('max-value');
|
||||
if (max == 'undefined') {
|
||||
max = false;
|
||||
@ -1151,10 +1157,10 @@ function session_set(session_array, value, clear, reload) {
|
||||
}
|
||||
|
||||
return $.get(globals.rootdir + "/ajax.php?op=session_set&session=" + session_array + "&value=" + value + "&clear=" + clear, function(data, status){
|
||||
|
||||
|
||||
if (reload==1)
|
||||
location.reload();
|
||||
|
||||
location.reload();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -1354,7 +1360,7 @@ function getCookie(cname) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Funzione per controllare se un file esiste
|
||||
* Funzione per controllare se un file esiste
|
||||
*/
|
||||
|
||||
function UrlExists(url)
|
||||
@ -1363,4 +1369,4 @@ function UrlExists(url)
|
||||
http.open('HEAD', url, false);
|
||||
http.send();
|
||||
return http.status!=404;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user