mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-24 07:17:55 +01:00
Conversione del plugin Referenti alla nuova struttura
This commit is contained in:
parent
84bd8a484c
commit
a1ad8d76e0
@ -586,6 +586,7 @@ function translateTemplate()
|
||||
global $id_module;
|
||||
global $id_record;
|
||||
global $id_plugin;
|
||||
global $id_parent;
|
||||
global $operations_log;
|
||||
|
||||
$template = ob_get_clean();
|
||||
@ -595,6 +596,7 @@ function translateTemplate()
|
||||
$template = str_replace('$id_module$', $id_module, $template);
|
||||
$template = str_replace('$id_plugin$', $id_plugin, $template);
|
||||
$template = str_replace('$id_record$', $id_record, $template);
|
||||
$template = str_replace('$id_parent$', $id_parent, $template);
|
||||
|
||||
// Completamento delle informazioni estese sulle azioni dell'utente
|
||||
if (Auth::check() && !empty($operations_log) && !empty($_SESSION['infos'])) {
|
||||
|
@ -14,7 +14,7 @@ $type = $_POST['type'];
|
||||
|
||||
if (!extension_loaded('zip')) {
|
||||
$_SESSION['errors'][] = tr('Estensione zip non supportata!').'<br>'.tr('Verifica e attivala sul tuo file _FILE_', [
|
||||
'_FILE_' => '<b>php.ini</b>'
|
||||
'_FILE_' => '<b>php.ini</b>',
|
||||
]);
|
||||
} elseif (!ends_with($filename, '.zip')) {
|
||||
$_SESSION['errors'][] = tr('Il file non è un archivio zip!');
|
||||
@ -30,7 +30,7 @@ if (!extension_loaded('zip')) {
|
||||
$zip->extractTo($tmp_dir);
|
||||
|
||||
// AGGIORNAMENTO
|
||||
if ($type == 'update') {
|
||||
if ('update' == $type) {
|
||||
// Salvo i file di configurazione e versione attuale
|
||||
$old_config = file_get_contents($docroot.'/config.inc.php');
|
||||
|
||||
@ -68,7 +68,7 @@ if (!extension_loaded('zip')) {
|
||||
}
|
||||
|
||||
// NUOVO MODULO
|
||||
elseif ($type == 'new') {
|
||||
elseif ('new' == $type) {
|
||||
// Se non c'è il file MODULE non é un modulo
|
||||
if (is_file($tmp_dir.'/MODULE')) {
|
||||
// Leggo le info dal file di configurazione del modulo
|
||||
@ -83,16 +83,6 @@ if (!extension_loaded('zip')) {
|
||||
// Scollego l'utente per eventuali aggiornamenti del db
|
||||
Auth::logout();
|
||||
|
||||
// Sposto il file di versione nella root per forzare l'aggiornamento del db
|
||||
file_put_contents($docroot.'/VERSION_'.$module_dir, $module_version);
|
||||
|
||||
// Sposto i file della cartella "lib/" nella root
|
||||
$lib_dir = $docroot.'/modules/'.$module_dir.'/lib/';
|
||||
if (is_dir($lib_dir)) {
|
||||
copyr($lib_dir, $docroot.'/lib');
|
||||
delete($lib_dir);
|
||||
}
|
||||
|
||||
// Sposto i file della cartella "files/" nella root
|
||||
$files_dir = $docroot.'/modules/'.$module_dir.'/files/';
|
||||
if (is_dir($files_dir)) {
|
||||
@ -102,11 +92,12 @@ if (!extension_loaded('zip')) {
|
||||
|
||||
// Inserimento delle voci del modulo nel db per ogni sezione [sezione]
|
||||
// Verifico che il modulo non esista già
|
||||
$query = 'SELECT name FROM zz_modules WHERE name='.prepare($module_name);
|
||||
$n = $dbo->fetchNum($query);
|
||||
$n = $dbo->fetchNum('SELECT name FROM zz_modules WHERE name='.prepare($module_name));
|
||||
|
||||
if ($n == 0) {
|
||||
$query = 'INSERT INTO zz_modules(`name`, `title`, `directory`, `options`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`) VALUES('.prepare($module_name).', '.prepare($module_name).', '.prepare($module_dir).', '.prepare($module_info['module_options']).', '.prepare($module_info['module_icon']).', '.prepare($module_version).', '.prepare($module_info['module_compatibility']).', "100", '.prepare($module_info['module_parent']).', 0, 1)';
|
||||
if (0 == $n) {
|
||||
$module_info['module_parent'] = $dbo->fetchNum('SELECT name FROM zz_modules WHERE id='.prepare($module_info['module_parent'])) ? prepare($module_info['module_parent']) : 'NULL';
|
||||
|
||||
$query = 'INSERT INTO zz_modules(`name`, `title`, `directory`, `options`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`) VALUES('.prepare($module_name).', '.prepare($module_name).', '.prepare($module_dir).', '.prepare($module_info['module_options']).', '.prepare($module_info['module_icon']).', '.prepare($module_version).', '.prepare($module_info['module_compatibility']).', "100", '.$module_info['module_parent'].', 0, 1)';
|
||||
$dbo->query($query);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (isset($id_record)) {
|
||||
$records = $dbo->fetchArray('SELECT *, (SELECT GROUP_CONCAT(an_tipianagrafiche.idtipoanagrafica) FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica=an_anagrafiche.idanagrafica) AS idtipianagrafica, (SELECT GROUP_CONCAT(idagente) FROM an_anagrafiche_agenti WHERE idanagrafica=an_anagrafiche.idanagrafica) AS idagenti, (SELECT GROUP_CONCAT(descrizione) FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica=an_anagrafiche.idanagrafica) AS tipianagrafica FROM an_anagrafiche GROUP BY idanagrafica HAVING idanagrafica='.prepare($id_record).' '.Modules::getAdditionalsQuery($id_module));
|
||||
|
||||
$records[0]['lat'] = floatval($records[0]['lat']);
|
||||
$records[0]['lng'] = floatval($records[0]['lng']);
|
||||
}
|
||||
|
||||
$id_azienda = $dbo->fetchArray("SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE descrizione='Azienda'")[0]['idtipoanagrafica'];
|
||||
|
@ -1,153 +0,0 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$id_record = filter('id_record');
|
||||
$operazione = filter('op');
|
||||
|
||||
switch ($operazione) {
|
||||
case 'addreferente':
|
||||
$nome = filter('nome');
|
||||
$mansione = filter('mansione');
|
||||
$telefono = filter('telefono');
|
||||
$email = filter('email');
|
||||
$idsede = filter('idsede');
|
||||
|
||||
if (isset($nome) && isset($idsede)) {
|
||||
$query = 'INSERT INTO `an_referenti` (`nome`, `mansione`, `telefono`, `email`, `idanagrafica`, `idsede`) VALUES ('.prepare($nome).', '.prepare($mansione).', '.prepare($telefono).', '.prepare($email).', '.prepare($id_record).', '.prepare($idsede).')';
|
||||
|
||||
$dbo->query($query);
|
||||
$_SESSION['infos'][] = tr('Aggiunto nuovo referente!');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'updatereferenti':
|
||||
foreach ($_POST['idreferente'] as $key => $value) {
|
||||
$query = 'UPDATE `an_referenti` SET `nome`='.prepare($_POST['nome'][$key]).', `mansione`='.prepare($_POST['mansione'][$key]).', `telefono`='.prepare($_POST['telefono'][$key]).', `email`='.prepare($_POST['email'][$key]).', `idsede`='.prepare($_POST['idsede'][$key]).' WHERE `id`='.prepare($value);
|
||||
|
||||
$dbo->query($query);
|
||||
}
|
||||
$_SESSION['infos'][] = tr('Salvataggio completato!');
|
||||
|
||||
break;
|
||||
|
||||
case 'deletereferente':
|
||||
$idreferente = filter('id');
|
||||
$dbo->query("DELETE FROM `an_referenti` WHERE `id`=".prepare($idreferente));
|
||||
$_SESSION['infos'][] = tr('Referente eliminato!');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (filter('add') != null) {
|
||||
echo '
|
||||
<form action="" method="post" role="form">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="addreferente">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Nominativo').'", "name": "nome", "required": 1 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Mansione').'", "name": "mansione", "required": 1 ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Telefono').'", "name": "telefono" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12">
|
||||
{[ "type": "select", "label": "'.tr('Sede').'", "name": "idsede", "values": "query=SELECT -1 AS id, \'Sede legale\' AS descrizione UNION SELECT id, CONCAT_WS(\' - \', nomesede, citta) AS descrizione FROM an_sedi WHERE idanagrafica='.$id_record.'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12 text-right">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> '.tr('Aggiungi').'</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="'.$rootdir.'/lib/init.js"></script>';
|
||||
} else {
|
||||
echo '
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">'.tr('Referenti').'</h3>
|
||||
<a class="btn btn-primary pull-right" data-toggle="modal" data-target="#bs-popup" data-title="Nuovo referente" data-href="'.$rootdir.'/modules/anagrafiche/plugins/referenti.php?add=1&id_record='.$id_record.'"><i class="fa fa-plus"></i> '.tr('Nuovo referente').'</a>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>'.tr('Qui hai la possibilità di gestire i referenti di questa anagrafica').'.</p>
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="updatereferenti">';
|
||||
|
||||
$query = 'SELECT * FROM an_referenti WHERE idanagrafica='.prepare($id_record).' ORDER BY id DESC';
|
||||
$results = $dbo->fetchArray($query);
|
||||
if (count($results) != 0) {
|
||||
echo '
|
||||
<table class="table table-condensed table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Nominativo').'</th>
|
||||
<th>'.tr('Mansione').'</th>
|
||||
<th>'.tr('Telefono').'</th>
|
||||
<th>'.tr('Indirizzo email').'</th>
|
||||
<th>'.tr('Sede').'</th>
|
||||
<th>'.tr('Opzioni').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
foreach ($results as $result) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="idreferente[]" value="'.$result['id'].'">
|
||||
{[ "type": "text", "placeholder": "'.tr('Nominativo').'", "name": "nome[]", "required": 1, "value": "'.$result['nome'].'" ]}
|
||||
</td>
|
||||
<td>
|
||||
{[ "type": "text", "placeholder": "'.tr('Mansione').'", "name": "mansione[]", "required": 1, "value": "'.$result['mansione'].'" ]}
|
||||
</td>
|
||||
<td>
|
||||
{[ "type": "text", "placeholder": "'.tr('Telefono').'", "name": "telefono[]", "value": "'.$result['telefono'].'" ]}
|
||||
</td>
|
||||
<td>
|
||||
{[ "type": "text", "placeholder": "'.tr('Indirizzo email').'", "name": "email[]", "value": "'.$result['email'].'" ]}
|
||||
</td>
|
||||
<td>
|
||||
{[ "type": "select", "placeholder": "'.tr('Sede').'", "name": "idsede[]", "values": "query=SELECT -1 AS id, \'Sede legale\' AS descrizione UNION SELECT id, CONCAT( CONCAT_WS( \' (\', CONCAT_WS(\', \', `nomesede`, `citta`), `indirizzo` ), \')\') AS descrizione FROM an_sedi WHERE idanagrafica='.$id_record.'", "value": "'.$result['idsede'].'" ]}
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-danger pull-right ask" data-op="deletereferente" data-id="'.$result['id'].'">
|
||||
<i class="fa fa-trash"></i> '.tr('Elimina').'
|
||||
</a>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="pull-right">
|
||||
<button type="submit" class="btn btn-success"><i class="fa fa-check"></i> '.tr('Salva modifiche').'</button>
|
||||
</div>
|
||||
<div class="clearfix"></div>';
|
||||
}
|
||||
echo '
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
38
plugins/referenti/actions.php
Normal file
38
plugins/referenti/actions.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$operazione = filter('op');
|
||||
|
||||
switch ($operazione) {
|
||||
case 'addreferente':
|
||||
$nome = filter('nome');
|
||||
$mansione = filter('mansione');
|
||||
$telefono = filter('telefono');
|
||||
$email = filter('email');
|
||||
$idsede = filter('idsede');
|
||||
|
||||
if (isset($nome) && isset($idsede)) {
|
||||
$query = 'INSERT INTO `an_referenti` (`nome`, `mansione`, `telefono`, `email`, `idanagrafica`, `idsede`) VALUES ('.prepare($nome).', '.prepare($mansione).', '.prepare($telefono).', '.prepare($email).', '.prepare($id_record).', '.prepare($idsede).')';
|
||||
|
||||
$dbo->query($query);
|
||||
$_SESSION['infos'][] = tr('Aggiunto nuovo referente!');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'updatereferente':
|
||||
$query = 'UPDATE `an_referenti` SET `nome`='.prepare($post['nome']).', `mansione`='.prepare($post['mansione']).', `telefono`='.prepare($post['telefono']).', `email`='.prepare($post['email']).', `idsede`='.prepare($post['idsede']).' WHERE `id`='.prepare($id_record);
|
||||
$dbo->query($query);
|
||||
|
||||
$_SESSION['infos'][] = tr('Salvataggio completato!');
|
||||
|
||||
break;
|
||||
|
||||
case 'deletereferente':
|
||||
$dbo->query("DELETE FROM `an_referenti` WHERE `id`=".prepare($id_record));
|
||||
|
||||
$_SESSION['infos'][] = tr('Referente eliminato!');
|
||||
|
||||
break;
|
||||
}
|
44
plugins/referenti/add.php
Normal file
44
plugins/referenti/add.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
echo '
|
||||
<form action="plugin_editor.php?id_plugin=$id_plugin$&id_module=$id_module$&id_parent=$id_parent$" method="post" role="form">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="addreferente">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Nominativo').'", "name": "nome", "required": 1 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Mansione').'", "name": "mansione", "required": 1 ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Telefono').'", "name": "telefono" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12">
|
||||
{[ "type": "select", "label": "'.tr('Sede').'", "name": "idsede", "values": "query=SELECT -1 AS id, \'Sede legale\' AS descrizione UNION SELECT id, CONCAT_WS(\' - \', nomesede, citta) AS descrizione FROM an_sedi WHERE idanagrafica='.$id_parent.'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12 text-right">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> '.tr('Aggiungi').'</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="'.$rootdir.'/lib/init.js"></script>';
|
49
plugins/referenti/edit.php
Normal file
49
plugins/referenti/edit.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
echo '
|
||||
<form action="plugin_editor.php?id_plugin=$id_plugin$&id_module=$id_module$&id_record=$id_record$&id_parent=$id_parent$" method="post" role="form" id="form_sedi">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="updatereferente">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Nominativo').'", "name": "nome", "required": 1, "value" : "$nome$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Mansione').'", "name": "mansione", "required": 1, "value" : "$mansione$" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Telefono').'", "name": "telefono", "value" : "$telefono$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "value" : "$email$" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12">
|
||||
{[ "type": "select", "label": "'.tr('Sede').'", "name": "idsede", "values": "query=SELECT -1 AS id, \'Sede legale\' AS descrizione UNION SELECT id, CONCAT_WS(\' - \', nomesede, citta) AS descrizione FROM an_sedi WHERE idanagrafica='.$id_parent.'", "value" : "$idsede$" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-danger ask" data-backto="record-edit" data-href="'.$rootdir.'/plugin_editor.php" data-op="deletereferente" data-id_record="'.$records[0]['id'].'" data-id_plugin="'.$id_plugin.'" data-id_module="'.$id_module.'" data-id_parent="'.$id_parent.'">
|
||||
<i class="fa fa-trash"></i> '.tr('Elimina').'
|
||||
</a>
|
||||
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fa fa-plus"></i> '.tr('Modifica').'</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
echo '
|
||||
<script src="'.$rootdir.'/lib/init.js"></script>';
|
5
plugins/referenti/init.php
Normal file
5
plugins/referenti/init.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$records = $dbo->fetchArray('SELECT * FROM an_referenti WHERE id='.prepare($id_record));
|
@ -48,15 +48,14 @@ switch ($operazione) {
|
||||
'lng' => $post['lng'],
|
||||
];
|
||||
|
||||
$dbo->update('an_sedi', $array, ['id' => $post['id']]);
|
||||
$dbo->update('an_sedi', $array, ['id' => $id_record]);
|
||||
|
||||
$_SESSION['infos'][] = tr('Salvataggio completato!');
|
||||
|
||||
break;
|
||||
|
||||
case 'deletesede':
|
||||
$idsede = filter('id');
|
||||
$dbo->query("DELETE FROM `an_sedi` WHERE `id`=".prepare($idsede));
|
||||
$dbo->query("DELETE FROM `an_sedi` WHERE `id`=".prepare($id_record));
|
||||
|
||||
$_SESSION['infos'][] = tr('Sede eliminata!');
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
echo '
|
||||
<form action="plugin_editor.php?id_plugin=$id_plugin$&id_module=$id_module$&id_parent='.$id_parent.'" method="post" role="form">
|
||||
<form action="plugin_editor.php?id_plugin=$id_plugin$&id_module=$id_module$&id_parent=$id_parent$" method="post" role="form">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="addsede">
|
||||
|
||||
|
@ -12,10 +12,9 @@ if (!empty($google)) {
|
||||
*/
|
||||
|
||||
echo '
|
||||
<form action="plugin_editor.php?id_plugin=$id_plugin$&id_module=$id_module$&id_parent='.$id_parent.'" method="post" role="form" id="form_sedi">
|
||||
<form action="plugin_editor.php?id_plugin=$id_plugin$&id_module=$id_module$&id_record=$id_record$&id_parent=$id_parent$" method="post" role="form" id="form_sedi">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="updatesede">
|
||||
<input type="hidden" name="id" value="'.$records[0]['id'].'">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12">
|
||||
@ -137,7 +136,7 @@ echo '
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-danger ask" data-backto="record-edit" data-href="'.$rootdir.'/plugin_editor.php" data-op="deletesede" data-id="'.$records[0]['id'].'" data-id_plugin="'.$id_plugin.'" data-id_module="'.$id_module.'" data-id_parent="'.$id_parent.'">
|
||||
<a class="btn btn-danger ask" data-backto="record-edit" data-href="'.$rootdir.'/plugin_editor.php" data-op="deletesede" data-id_record="'.$records[0]['id'].'" data-id_plugin="'.$id_plugin.'" data-id_module="'.$id_module.'" data-id_parent="'.$id_parent.'">
|
||||
<i class="fa fa-trash"></i> '.tr('Elimina').'
|
||||
</a>
|
||||
|
||||
|
@ -2,4 +2,9 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$records = $dbo->fetchArray('SELECT * FROM an_sedi WHERE an_sedi.id='.prepare($id_record).' ORDER BY an_sedi.id DESC');
|
||||
if (isset($id_record)) {
|
||||
$records = $dbo->fetchArray('SELECT * FROM an_sedi WHERE id='.prepare($id_record));
|
||||
|
||||
$records[0]['lat'] = floatval($records[0]['lat']);
|
||||
$records[0]['lng'] = floatval($records[0]['lng']);
|
||||
}
|
||||
|
@ -73,7 +73,27 @@ $files = [
|
||||
'lib/html-helpers.class.php',
|
||||
'lib/photo.class.php',
|
||||
'lib/widgets.class.php',
|
||||
'modules/anagrafiche/plugins/sedi.php',
|
||||
'modules/anagrafiche/plugins/referenti.php',
|
||||
'templates/pdfgen.php',
|
||||
'templates/interventi/intervento_body.html',
|
||||
'templates/interventi/intervento.html',
|
||||
'templates/interventi/pdfgen.interventiphp',
|
||||
'templates/ddt/ddt_body.html',
|
||||
'templates/ddt/ddt.html',
|
||||
'templates/ddt/pdfgen.ddt',
|
||||
'templates/ordini/ordini_body.html',
|
||||
'templates/ordini/ordini.html',
|
||||
'templates/ordini/pdfgen.ordini',
|
||||
'templates/fatture/fatture_body.html',
|
||||
'templates/fatture/fatture.html',
|
||||
'templates/fatture/pdfgen.fatture.php',
|
||||
'templates/contratti/contratti_body.html',
|
||||
'templates/contratti/contratti.html',
|
||||
'templates/contratti/pdfgen.contratti.php',
|
||||
'templates/preventivi/preventivi_body.html',
|
||||
'templates/preventivi/preventivi.html',
|
||||
'templates/preventivi/pdfgen.preventivi.php',
|
||||
'update/install_2.0.sql',
|
||||
'update/update_2.1.sql',
|
||||
'update/update_2.1.php',
|
||||
|
@ -716,9 +716,9 @@ ADD `directory` varchar(50) NOT NULL AFTER `script`, ADD `options` text AFTER `s
|
||||
UPDATE `zz_plugins` SET `name` = 'Serial' WHERE `name` = 'Lotti';
|
||||
UPDATE `zz_plugins` SET `title` = `name` WHERE `title` = '';
|
||||
|
||||
-- Nuova struttura per il plugin Sedi in Anagrafiche
|
||||
UPDATE `zz_plugins` SET `script` = '', `options` = ' { "main_query": [ { "type": "table", "fields": "Nome, Indirizzo, Citta, CAP, Provincia, Referente", "query": "SELECT an_sedi.id, nomesede AS Nome, indirizzo AS Indirizzo, citta AS Città, cap AS CAP, provincia AS Provincia, (an_referenti.id) AS Referente FROM an_sedi LEFT OUTER JOIN an_referenti ON idsede = an_sedi.id WHERE 1=1 AND an_sedi.idanagrafica=|idanagrafica| HAVING 2=2 ORDER BY an_sedi.id DESC"} ]}', `directory` = 'sedi', `version` = '2.3', `compatibility` = '2.*' WHERE `name` = 'Sedi';
|
||||
|
||||
-- Nuova struttura per i plugin Sedi e Referenti in Anagrafiche
|
||||
UPDATE `zz_plugins` SET `script` = '', `options` = ' { "main_query": [ { "type": "table", "fields": "Nome, Indirizzo, Citta, CAP, Provincia, Referente", "query": "SELECT an_sedi.id, nomesede AS Nome, indirizzo AS Indirizzo, citta AS Città, cap AS CAP, provincia AS Provincia, an_referenti.nome AS Referente FROM an_sedi LEFT OUTER JOIN an_referenti ON idsede = an_sedi.id WHERE 1=1 AND an_sedi.idanagrafica=|idanagrafica| HAVING 2=2 ORDER BY an_sedi.id DESC"} ]}', `directory` = 'sedi', `version` = '2.3', `compatibility` = '2.*' WHERE `name` = 'Sedi';
|
||||
UPDATE `zz_plugins` SET `script` = '', `options` = ' { "main_query": [ { "type": "table", "fields": "Nominativo, Mansione, Telefono, Indirizzo email, Sede", "query": "SELECT an_referenti.id, an_referenti.nome AS Nominativo, mansione AS Mansione, an_referenti.telefono AS Telefono, an_referenti.email AS \'Indirizzo email\', an_sedi.nomesede AS Sede FROM an_referenti LEFT OUTER JOIN an_sedi ON idsede = an_sedi.id WHERE 1=1 AND an_referenti.idanagrafica=|idanagrafica| HAVING 2=2 ORDER BY an_referenti.id DESC"} ]}', `directory` = 'referenti', `version` = '2.3', `compatibility` = '2.*' WHERE `name` = 'Referenti';
|
||||
|
||||
-- Cleanup della tabella zz_settings
|
||||
DELETE FROM `zz_settings` WHERE (`idimpostazione` = 33 AND `nome` = 'osmcloud_username') OR (`idimpostazione` = 34 AND `nome` = 'osmcloud_password') OR (`idimpostazione` = 3 AND `nome` = 'max_idintervento') OR (`idimpostazione` = 30 AND `nome` = 'Numero di mesi prima da cui iniziare a visualizzare gli interventi') OR (`idimpostazione` = 35 AND `nome` = 'osm_installed');
|
||||
|
Loading…
x
Reference in New Issue
Block a user