mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-01 16:36:45 +01:00
Aggiunto supporto per files custom interventi
This commit is contained in:
parent
3a483e975a
commit
1d1042d8fe
@ -1334,3 +1334,15 @@ function getCookie(cname) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Funzione per controllare se un file esiste
|
||||
*/
|
||||
|
||||
function UrlExists(url)
|
||||
{
|
||||
var http = new XMLHttpRequest();
|
||||
http.open('HEAD', url, false);
|
||||
http.send();
|
||||
return http.status!=404;
|
||||
}
|
@ -1,10 +1,25 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
include_once $docroot.'/modules/interventi/modutil.php';
|
||||
include_once $docroot.'/modules/articoli/modutil.php';
|
||||
include_once $docroot.'/modules/my_impianti/modutil.php';
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
if (file_exists($docroot.'/modules/interventi/custom/modutil.php')) {
|
||||
include_once $docroot.'/modules/interventi/custom/modutil.php';
|
||||
} else {
|
||||
include_once $docroot.'/modules/interventi/modutil.php';
|
||||
}
|
||||
if (file_exists($docroot.'/modules/articoli/custom/modutil.php')) {
|
||||
include_once $docroot.'/modules/articoli/custom/modutil.php';
|
||||
} else {
|
||||
include_once $docroot.'/modules/articoli/modutil.php';
|
||||
}
|
||||
if (file_exists($docroot.'/modules/my_impianti/custom/modutil.php')) {
|
||||
include_once $docroot.'/modules/my_impianti/custom/modutil.php';
|
||||
} else {
|
||||
include_once $docroot.'/modules/my_impianti/modutil.php';
|
||||
}
|
||||
|
||||
switch (post('op')) {
|
||||
case 'update':
|
||||
|
@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
|
||||
// Prezzo modificabile solo se l'utente loggato è un tecnico (+ può vedere i prezzi) o se è amministratore
|
||||
$rs = $dbo->fetchArray('SELECT nome FROM zz_groups WHERE id IN(SELECT idgruppo FROM zz_users WHERE id='.prepare($_SESSION['id_utente']).')');
|
||||
|
@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
$module_name = 'Interventi';
|
||||
|
||||
if (get('anteprima') !== null) {
|
||||
|
@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
|
||||
$idriga = filter('idriga');
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
|
||||
include_once __DIR__.'/modutil.php';
|
||||
|
||||
$idiva = get_var('Iva predefinita');
|
||||
|
@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
|
||||
$query = 'SELECT * FROM in_righe_interventi WHERE idintervento='.prepare($id_record).' '.Modules::getAdditionalsQuery('Magazzino').' ORDER BY id ASC';
|
||||
$rs2 = $dbo->fetchArray($query);
|
||||
|
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
if (file_exists($docroot.'/modules/interventi/custom/modutil.php')) {
|
||||
include_once $docroot.'/modules/interventi/custom/modutil.php';
|
||||
} else {
|
||||
|
@ -1,7 +1,16 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
include_once DOCROOT.'/modules/fatture/modutil.php';
|
||||
if (file_exists( __DIR__.'/../../../core.php')) {
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
}else {
|
||||
include_once __DIR__.'/../../core.php';
|
||||
}
|
||||
if (file_exists($docroot.'/modules/fatture/custom/modutil.php')) {
|
||||
include_once $docroot.'/modules/fatture/custom/modutil.php';
|
||||
} else {
|
||||
include_once $docroot.'/modules/fatture/modutil.php';
|
||||
}
|
||||
|
||||
|
||||
switch (post('op')) {
|
||||
case 'export-bulk':
|
||||
|
@ -158,7 +158,17 @@ $_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="tecnici">
|
||||
<script>$('#tecnici').load('<?php echo $rootdir; ?>/modules/interventi/ajax_tecnici.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>');</script>
|
||||
<?php
|
||||
if (file_exists($docroot.'/modules/interventi/custom/ajax_tecnici.php')) {
|
||||
?>
|
||||
<script>$('#tecnici').load('<?php echo $rootdir; ?>/modules/interventi/custom/ajax_tecnici.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>');</script>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<script>$('#tecnici').load('<?php echo $rootdir; ?>/modules/interventi/ajax_tecnici.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>');</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -173,7 +183,13 @@ $_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="articoli">
|
||||
<?php include $docroot.'/modules/interventi/ajax_articoli.php'; ?>
|
||||
<?php
|
||||
if (file_exists($docroot.'/modules/interventi/custom/ajax_articoli.php')) {
|
||||
include $docroot.'/modules/interventi/custom/ajax_articoli.php';
|
||||
}else{
|
||||
include $docroot.'/modules/interventi/ajax_articoli.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php if (!$records[0]['flag_completato']) {
|
||||
@ -192,7 +208,13 @@ $_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="righe">
|
||||
<?php include $docroot.'/modules/interventi/ajax_righe.php'; ?>
|
||||
<?php
|
||||
if (file_exists($docroot.'/modules/interventi/custom/ajax_righe.php')) {
|
||||
include $docroot.'/modules/interventi/custom/ajax_righe.php';
|
||||
}else{
|
||||
include $docroot.'/modules/interventi/ajax_righe.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php if (!$records[0]['flag_completato']) {
|
||||
@ -212,7 +234,17 @@ $_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="costi">
|
||||
<script>$('#costi').load('<?php echo $rootdir; ?>/modules/interventi/ajax_costi.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>');</script>
|
||||
<?php
|
||||
if (file_exists($docroot.'/modules/interventi/custom/ajax_costi.php')) {
|
||||
?>
|
||||
<script>$('#costi').load('<?php echo $rootdir; ?>/modules/interventi/custom/ajax_costi.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>');</script>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<script>$('#costi').load('<?php echo $rootdir; ?>/modules/interventi/ajax_costi.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>');</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -17,15 +17,35 @@ function calcola_ore(idriga, start, end) {
|
||||
Aggiunge una nuova riga per la sessione di lavoro in base al tecnico selezionato
|
||||
*/
|
||||
function add_tecnici(idintervento, idtecnico) {
|
||||
$('#tecnici').load(globals.rootdir + '/modules/interventi/ajax_tecnici.php?id_module=' + globals.id_module +'&id_record=' + idintervento + '&op=add_sessione&idtecnico=' + idtecnico);
|
||||
|
||||
$('#costi').load(globals.rootdir + '/modules/interventi/ajax_costi.php?id_module=' + globals.id_module +'&id_record=' + idintervento);
|
||||
|
||||
if (UrlExists(globals.rootdir + '/modules/interventi/custom/ajax_tecnici.php')){
|
||||
$('#tecnici').load(globals.rootdir + '/modules/interventi/custom/ajax_tecnici.php?id_module=' + globals.id_module +'&id_record=' + idintervento + '&op=add_sessione&idtecnico=' + idtecnico);
|
||||
}else{
|
||||
$('#tecnici').load(globals.rootdir + '/modules/interventi/ajax_tecnici.php?id_module=' + globals.id_module +'&id_record=' + idintervento + '&op=add_sessione&idtecnico=' + idtecnico);
|
||||
}
|
||||
|
||||
if (UrlExists(globals.rootdir + '/modules/interventi/custom/ajax_costi.php')){
|
||||
$('#costi').load(globals.rootdir + '/modules/interventi/custom/ajax_costi.php?id_module=' + globals.id_module +'&id_record=' + idintervento);
|
||||
}else{
|
||||
$('#costi').load(globals.rootdir + '/modules/interventi/ajax_costi.php?id_module=' + globals.id_module +'&id_record=' + idintervento);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function elimina_sessione(idriga, idintervento, idzona) {
|
||||
if (confirm('Eliminare sessione di lavoro?')) {
|
||||
$('#tecnici').load(globals.rootdir + '/modules/interventi/ajax_tecnici.php?id_module=' + globals.id_module +'&id_record=' + idintervento + '&op=del_sessione&id=' + idriga);
|
||||
|
||||
$('#costi').load(globals.rootdir + '/modules/interventi/ajax_costi.php?id_module=' + globals.id_module +'&id_record=' + idintervento);
|
||||
}
|
||||
|
||||
if (UrlExists(globals.rootdir + '/modules/interventi/custom/ajax_tecnici.php')){
|
||||
$('#tecnici').load(globals.rootdir + '/modules/interventi/custom/ajax_tecnici.php?id_module=' + globals.id_module +'&id_record=' + idintervento + '&op=del_sessione&id=' + idriga);
|
||||
}else{
|
||||
$('#tecnici').load(globals.rootdir + '/modules/interventi/ajax_tecnici.php?id_module=' + globals.id_module +'&id_record=' + idintervento + '&op=del_sessione&id=' + idriga);
|
||||
}
|
||||
|
||||
if (UrlExists(globals.rootdir + '/modules/interventi/custom/ajax_costi.php')){
|
||||
$('#costi').load(globals.rootdir + '/modules/interventi/custom/ajax_costi.php?id_module=' + globals.id_module +'&id_record=' + idintervento);
|
||||
}else{
|
||||
$('#costi').load(globals.rootdir + '/modules/interventi/ajax_costi.php?id_module=' + globals.id_module +'&id_record=' + idintervento);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user