mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 12:00:46 +01:00
Compare commits
8 Commits
c86355ee5c
...
f6af582896
Author | SHA1 | Date | |
---|---|---|---|
|
f6af582896 | ||
|
c9559f651a | ||
|
8fa4d9a562 | ||
|
d4e2fb8e1f | ||
|
9b90415fb1 | ||
|
d0fa1534d9 | ||
|
61e568c2a5 | ||
|
b5aebbd5e8 |
@ -534,7 +534,7 @@ if (Auth::check()) {
|
||||
}
|
||||
|
||||
if (!empty($opt)) {
|
||||
$q = str_replace('|id_parent|', $id_record, $opt['main_query'][0]['query']);
|
||||
$q = str_replace('|id_parent|', ($id_record?:$id_parent), $opt['main_query'][0]['query']);
|
||||
$count = $dbo->fetchNum($q);
|
||||
}
|
||||
|
||||
|
@ -19,35 +19,29 @@
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$rs = $dbo->fetchArray('SELECT
|
||||
`co_contratti`.`id`,
|
||||
`co_contratti`.`nome`,
|
||||
`co_contratti`.`data_accettazione`,
|
||||
(SUM(`co_righe_contratti`.`qta`) - SUM(`in_interventi_tecnici`.`ore`)) AS ore_rimanenti,
|
||||
DATEDIFF(`data_conclusione`, NOW()) AS giorni_rimanenti,
|
||||
`data_conclusione`,
|
||||
`ore_preavviso_rinnovo`,
|
||||
`giorni_preavviso_rinnovo`,
|
||||
`an_anagrafiche`.`ragione_sociale` AS ragione_sociale
|
||||
FROM
|
||||
`co_contratti`
|
||||
INNER JOIN `an_anagrafiche` ON `an_anagrafiche`.`idanagrafica`=`co_contratti`.`idanagrafica`
|
||||
INNER JOIN `co_righe_contratti` ON (`co_righe_contratti`.`idcontratto`=`co_contratti`.`id` AND `co_righe_contratti`.`um`=\'ore\')
|
||||
INNER JOIN `co_staticontratti` ON `co_contratti`.`idstato`=`co_staticontratti`.`id`
|
||||
LEFT JOIN `co_staticontratti_lang` ON (`co_staticontratti`.`id` = `co_staticontratti_lang`.`id_record` AND `co_staticontratti_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).')
|
||||
LEFT JOIN `in_interventi` ON (`in_interventi`.`id_contratto` = `co_contratti`.`id` AND `in_interventi`.`idstatointervento` IN (SELECT `id` FROM `in_statiintervento` WHERE `in_statiintervento`.`is_completato` = 1))
|
||||
LEFT JOIN `in_interventi_tecnici` ON (`in_interventi_tecnici`.`idintervento` = `in_interventi`.`id`)
|
||||
WHERE
|
||||
`co_contratti`.`rinnovabile` = 1 AND
|
||||
YEAR(`data_conclusione`) > 1970 AND
|
||||
`co_contratti`.`id` NOT IN (SELECT `idcontratto_prev` FROM `co_contratti` contratti) AND
|
||||
`co_staticontratti_lang`.`title` NOT IN ("Concluso", "Rifiutato", "Bozza")
|
||||
GROUP BY
|
||||
`co_contratti`.`id`
|
||||
HAVING
|
||||
(`ore_rimanenti` <= `ore_preavviso_rinnovo` OR DATEDIFF(`data_conclusione`, NOW()) <= ABS(`giorni_preavviso_rinnovo`))
|
||||
ORDER BY
|
||||
`giorni_rimanenti` ASC, `ore_rimanenti` ASC');
|
||||
$rs = $dbo->fetchArray('
|
||||
SELECT
|
||||
`co_contratti`.`id`,
|
||||
((SELECT SUM(`co_righe_contratti`.`qta`) FROM `co_righe_contratti` WHERE `co_righe_contratti`.`um` = "ore" AND `co_righe_contratti`.`idcontratto` = `co_contratti`.`id`) - IFNULL((SELECT SUM(`in_interventi_tecnici`.`ore`) FROM `in_interventi_tecnici` INNER JOIN `in_interventi` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` WHERE `in_interventi`.`id_contratto` = `co_contratti`.`id` AND `in_interventi`.`idstatointervento` IN (SELECT `in_statiintervento`.`id` FROM `in_statiintervento` WHERE `in_statiintervento`.`is_completato` = 1)),0)) AS `ore_rimanenti`,
|
||||
`co_contratti`.`nome`,
|
||||
DATEDIFF(`data_conclusione`, NOW()) AS giorni_rimanenti,
|
||||
`co_contratti`.`data_accettazione`,
|
||||
`data_conclusione`,
|
||||
`ore_preavviso_rinnovo`,
|
||||
`giorni_preavviso_rinnovo`,
|
||||
(SELECT `ragione_sociale` FROM `an_anagrafiche` WHERE `idanagrafica` = `co_contratti`.`idanagrafica`) AS ragione_sociale
|
||||
FROM
|
||||
`co_contratti`
|
||||
INNER JOIN `co_staticontratti` ON `co_staticontratti`.`id` = `co_contratti`.`idstato`
|
||||
LEFT JOIN `co_staticontratti_lang` ON (`co_staticontratti`.`id` = `co_staticontratti_lang`.`id_record` AND `co_staticontratti_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).')
|
||||
WHERE
|
||||
`rinnovabile` = 1
|
||||
AND YEAR(`data_conclusione`) > 1970
|
||||
AND `co_contratti`.`id` NOT IN (SELECT `idcontratto_prev` FROM `co_contratti` contratti) AND `co_staticontratti_lang`.`title` NOT IN ("Concluso", "Rifiutato", "Bozza")
|
||||
HAVING
|
||||
(`ore_rimanenti` <= `ore_preavviso_rinnovo` OR DATEDIFF(`data_conclusione`, NOW()) <= ABS(`giorni_preavviso_rinnovo`))
|
||||
ORDER BY
|
||||
`giorni_rimanenti` ASC,`ore_rimanenti` ASC');
|
||||
|
||||
if (!empty($rs)) {
|
||||
echo '
|
||||
|
113
modules/ddt/src/API/v1/DDTS.php
Normal file
113
modules/ddt/src/API/v1/DDTS.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Modules\DDT\API\v1;
|
||||
|
||||
use API\Interfaces\CreateInterface;
|
||||
use API\Interfaces\RetrieveInterface;
|
||||
use API\Interfaces\UpdateInterface;
|
||||
use API\Resource;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\DDT\DDT;
|
||||
use Modules\DDT\Tipo;
|
||||
|
||||
class DDTS extends Resource implements RetrieveInterface, UpdateInterface, CreateInterface
|
||||
{
|
||||
public function retrieve($request)
|
||||
{
|
||||
$table = 'dt_ddt';
|
||||
|
||||
$select = [
|
||||
'dt_ddt.*',
|
||||
'dt_ddt.data',
|
||||
'dt_statiddt_lang.title AS stato',
|
||||
];
|
||||
|
||||
$joins[] = [
|
||||
'dt_statiddt',
|
||||
'dt_statiddt.id',
|
||||
'dt_ddt.idstatoddt',
|
||||
];
|
||||
|
||||
$joins[] = [
|
||||
'dt_statiddt_lang',
|
||||
'dt_statiddt_lang.id_record',
|
||||
'dt_statiddt.id',
|
||||
];
|
||||
|
||||
$where = [];
|
||||
$where[] = ['dt_statiddt_lang.id_lang', '=', \Models\Locale::getDefault()->id];
|
||||
|
||||
$whereraw = [];
|
||||
|
||||
$group = 'dt_ddt.id';
|
||||
|
||||
return [
|
||||
'table' => $table,
|
||||
'select' => $select,
|
||||
'joins' => $joins,
|
||||
'where' => $where,
|
||||
'whereraw' => $whereraw,
|
||||
'group' => $group,
|
||||
];
|
||||
}
|
||||
|
||||
public function create($request)
|
||||
{
|
||||
$data = $request['data'];
|
||||
|
||||
$anagrafica = Anagrafica::find($data['id_anagrafica']);
|
||||
$tipo = Tipo::find($data['id_tipo']);
|
||||
|
||||
$ddt = DDT::build($anagrafica, $tipo, $data['data'], $data['id_segment']);
|
||||
|
||||
$ddt->idstatoddt = $data['id_stato'];
|
||||
$ddt->idcausalet = $data['idcausale'];
|
||||
$ddt->idsede_partenza = $data['idsede_partenza'];
|
||||
$ddt->idsede_destinazione = $data['idsede_destinazione'];
|
||||
$ddt->save();
|
||||
|
||||
return [
|
||||
'id' => $ddt->id,
|
||||
'numero_esterno' => $ddt->numero_esterno,
|
||||
];
|
||||
}
|
||||
|
||||
public function update($request)
|
||||
{
|
||||
$data = $request['data'];
|
||||
|
||||
$ddt = DDT::find($data['id']);
|
||||
|
||||
$ddt->data = $data['data'];
|
||||
$ddt->idstatoddt = $data['id_stato'];
|
||||
$ddt->idcausalet = $data['idcausale'];
|
||||
$ddt->idanagrafica = $data['id_anagrafica'];
|
||||
$ddt->numero_esterno = $data['numero_esterno'];
|
||||
$ddt->idsede_partenza = $data['idsede_partenza'];
|
||||
$ddt->idsede_destinazione = $data['idsede_destinazione'];
|
||||
$ddt->save();
|
||||
}
|
||||
|
||||
public function delete($request)
|
||||
{
|
||||
$ddt = DDT::find($request['id']);
|
||||
$ddt->delete();
|
||||
}
|
||||
}
|
134
modules/ddt/src/API/v1/Righe.php
Normal file
134
modules/ddt/src/API/v1/Righe.php
Normal file
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Modules\DDT\API\v1;
|
||||
|
||||
use API\Interfaces\CreateInterface;
|
||||
use API\Interfaces\RetrieveInterface;
|
||||
use API\Resource;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\DDT\Components\Articolo;
|
||||
use Modules\DDT\Components\Descrizione;
|
||||
use Modules\DDT\Components\Riga;
|
||||
use Modules\DDT\DDT;
|
||||
|
||||
class Righe extends Resource implements RetrieveInterface, CreateInterface
|
||||
{
|
||||
public function retrieve($request)
|
||||
{
|
||||
$table = 'dt_righe_ddt';
|
||||
|
||||
$select = [
|
||||
'dt_righe_ddt.id',
|
||||
'dt_righe_ddt.idarticolo AS id_articolo',
|
||||
'dt_righe_ddt.idddt AS id_ddt',
|
||||
'dt_righe_ddt.descrizione',
|
||||
'dt_righe_ddt.qta',
|
||||
'dt_righe_ddt.created_at as data',
|
||||
];
|
||||
|
||||
$where = [['dt_righe_ddt.idddt', '=', $request['id_ddt']]];
|
||||
|
||||
return [
|
||||
'table' => $table,
|
||||
'select' => $select,
|
||||
'where' => $where,
|
||||
];
|
||||
}
|
||||
|
||||
public function create($request)
|
||||
{
|
||||
$data = $request['data'];
|
||||
$data['qta'] = ($data['qta']>0 ? $data['qta'] : 1);
|
||||
|
||||
$originale = ArticoloOriginale::find($data['id_articolo']);
|
||||
$ddt = DDT::find($data['id_ddt']);
|
||||
|
||||
if( !empty($data['is_descrizione']) ){
|
||||
$riga = Descrizione::build($ddt);
|
||||
$riga->descrizione = ($data['descrizione'] ? $data['descrizione'] : '-');
|
||||
$riga->qta = 0;
|
||||
}elseif(!empty($data['id_articolo']) && !empty($originale)){
|
||||
$riga = Articolo::build($ddt, $originale);
|
||||
|
||||
if( $originale->prezzo_vendita>0 ){
|
||||
$idiva = ($originale->idiva_vendita ? $originale->idiva_vendita : setting('Iva predefinita'));
|
||||
$riga->setPrezzoUnitario($originale->prezzo_vendita, $idiva);
|
||||
}else{
|
||||
$riga->prezzo_unitario = 0;
|
||||
}
|
||||
$riga->costo_unitario = $originale->prezzo_acquisto;
|
||||
$riga->qta = $data['qta'];
|
||||
$riga->descrizione = (!empty($data['descrizione']) ? $data['descrizione'] : $originale->descrizione);
|
||||
}else{
|
||||
$riga = Riga::build($ddt);
|
||||
$riga->qta = $data['qta'];
|
||||
$riga->descrizione = ($data['descrizione'] ? $data['descrizione'] : '-');
|
||||
$riga->costo_unitario = 0;
|
||||
$riga->setPrezzoUnitario(0, setting('Iva predefinita'));
|
||||
}
|
||||
|
||||
$riga->um = $data['um'] ?: null;
|
||||
$riga->save();
|
||||
}
|
||||
|
||||
public function update($request)
|
||||
{
|
||||
$data = $request['data'];
|
||||
$data['qta'] = ($data['qta']>0 ? $data['qta'] : 1);
|
||||
|
||||
$originale = ArticoloOriginale::find($data['id_articolo']);
|
||||
|
||||
$riga = Articolo::find($data['id_riga']) ?: Riga::find($data['id_riga']);
|
||||
$riga = $riga ?: Descrizione::find($data['id_riga']);
|
||||
|
||||
$riga->is_descrizione = 0;
|
||||
$riga->qta = $data['qta'];
|
||||
if( !empty($data['is_descrizione']) ){
|
||||
$riga->qta = 0;
|
||||
$riga->is_descrizione = 1;
|
||||
$riga->descrizione = ($data['descrizione'] ? $data['descrizione'] : '-');
|
||||
}elseif(!empty($data['id_articolo']) && !empty($originale)){
|
||||
$descrizione = (!empty($data['descrizione']) ? $data['descrizione'] : $originale->descrizione);
|
||||
$descrizione = ($descrizione ? $descrizione : '-');
|
||||
|
||||
$riga->descrizione = ($descrizione ? $descrizione : '-');
|
||||
$riga->costo_unitario = $originale->prezzo_acquisto;
|
||||
$riga->idarticolo = $originale->id;
|
||||
$idiva = ($originale->idiva_vendita ? $originale->idiva_vendita : setting('Iva predefinita'));
|
||||
$riga->setPrezzoUnitario($originale->prezzo_vendita, $idiva);
|
||||
}else{
|
||||
$riga->descrizione = ($data['descrizione'] ? $data['descrizione'] : '-');
|
||||
$riga->costo_unitario = 0;
|
||||
$riga->setPrezzoUnitario(0, setting('Iva predefinita'));
|
||||
}
|
||||
|
||||
$riga->um = $data['um'] ?: null;
|
||||
$riga->save();
|
||||
}
|
||||
|
||||
public function delete($request)
|
||||
{
|
||||
$riga = Articolo::find($request['id']) ?: Riga::find($request['id']);
|
||||
$riga = $riga ?: Descrizione::find($request['id']);
|
||||
$riga->delete();
|
||||
|
||||
ricalcola_costiagg_ddt($riga->idddt);
|
||||
}
|
||||
}
|
185
modules/interventi/plugins/mappa.php
Normal file
185
modules/interventi/plugins/mappa.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if(get('op')=='getmappa'){
|
||||
$nome = 'Ricarica mappa';
|
||||
}
|
||||
else{
|
||||
$nome = 'Visualizza mappa';
|
||||
}
|
||||
|
||||
echo "<center><a onclick=\"location.href='".$rootdir."/controller.php?id_module=".$id_module."&op=getmappa&r='+Math.random()+'#tab_".Plugins::get('Mostra su mappa')['id']."';\" id='button' class='btn btn-primary btn-lg btn-large'>".$nome."</a></center>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
if(get('op')=='getmappa'){
|
||||
$current_module = Modules::get($id_module);
|
||||
$total = Util\Query::readQuery($current_module);
|
||||
$module_query = Modules::replaceAdditionals($id_module, $total['query']);
|
||||
|
||||
$search_filters = array();
|
||||
|
||||
if( is_array( $_SESSION['module_'.$id_module] ) ){
|
||||
foreach( $_SESSION['module_'.$id_module] as $field_name => $field_value ){
|
||||
if( $field_value != '' && $field_name != 'selected' && $field_name != 'id_segment'){
|
||||
$field_name = str_replace( "search_", "", $field_name );
|
||||
$field_name = str_replace( "__", " ", $field_name );
|
||||
$field_name = str_replace( "-", " ", $field_name );
|
||||
array_push( $search_filters, "`".$field_name."` LIKE \"%".$field_value."%\"" );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( sizeof($search_filters) > 0 ){
|
||||
$module_query = str_replace( "2=2", "2=2 AND (".implode( " AND ", $search_filters ).") ", $module_query);
|
||||
}
|
||||
|
||||
$rs1 = $dbo->fetchArray( $module_query );
|
||||
|
||||
//marker svg
|
||||
if (!file_exists($docroot.'/assets/dist/img/leaflet/place-marker.svg')) {
|
||||
throw new Exception("File not found: " . $docroot.'/assets/dist/img/leaflet/place-marker.svg');
|
||||
}
|
||||
|
||||
$svgContent = file_get_contents($docroot.'/assets/dist/img/leaflet/place-marker.svg');
|
||||
if ($svgContent === false) {
|
||||
throw new Exception("Error reading file: " . $docroot.'/assets/dist/img/leaflet/place-marker.svg');
|
||||
}
|
||||
$stringa_descrizioni = "";
|
||||
$stringa_content = "";
|
||||
$color = "";
|
||||
$lat = "";
|
||||
$lng = "";
|
||||
for( $i=0; $i<sizeof($rs1); $i++ ){//elenco delle righe
|
||||
$val = html_entity_decode( $rs1[$i]['idanagrafica'] );
|
||||
$id_sede = $dbo->selectOne('in_interventi', '*', ['id' => $rs1[$i]['id']])['idsede_destinazione'];
|
||||
if($id_sede){
|
||||
$query = "SELECT *, nomesede AS ragione_sociale FROM an_sedi WHERE id='".$id_sede."'";
|
||||
$rs=$dbo->fetchArray($query);
|
||||
}else{
|
||||
$query="SELECT *, ragione_sociale FROM an_anagrafiche WHERE idanagrafica='".$val."'";
|
||||
$rs=$dbo->fetchArray($query);
|
||||
}
|
||||
|
||||
if($rs[0]['lat'] && $rs[0]['lng']){
|
||||
$color .= "'".$rs1[$i]['_bg_']."',";
|
||||
$lat .= "'".$rs[0]['lat']."',";
|
||||
$lng .= "'".$rs[0]['lng']."',";
|
||||
$stringa_descrizioni .= "'".str_replace("'", " ", $rs[0]['ragione_sociale'])."',";
|
||||
|
||||
$stringa_content .= "'";
|
||||
|
||||
$stringa_content .= str_replace("'", "", "<big><b>".$rs[0]['ragione_sociale']."</b></big><br>".$rs[0]['indirizzo'].", ".$rs[0]['cap'].", ".$rs[0]['citta']." (".$rs[0]['provincia'].")".($rs[0]['telefono']!=''? "<br><i class=\"fa fa-phone\"></i> ".$rs[0]['telefono'] : "").($rs[0]['email']!=''? "<br><i class=\"fa fa-envelope\"></i> ".$rs[0]['email'] : "")."<br>");
|
||||
|
||||
|
||||
$altri_interventi = $dbo->fetchArray('SELECT * FROM in_interventi WHERE idsede_destinazione='.prepare($id_sede).' AND idanagrafica='.prepare($val).' AND id IN ('.implode(',', array_column($rs1, 'id')).')');
|
||||
for($j=0;$j<sizeof($altri_interventi);$j++){
|
||||
$stringa_content .= str_replace("'", "", "<br> <a href=\"".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$altri_interventi[$j]['id']."\">Intervento numero: ".$altri_interventi[$j]['codice']." del ".date('d/m/Y', strtotime($altri_interventi[$j]['data_richiesta']))."</a>");
|
||||
}
|
||||
|
||||
$stringa_content .= "',";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "<div id='mappa'></div>";
|
||||
$stringa_descrizioni = substr($stringa_descrizioni,0,-1);
|
||||
$stringa_content = substr($stringa_content,0,-1);
|
||||
$lat = substr($lat,0,-1);
|
||||
$lng = substr($lng,0,-1);
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo $rootdir; ?>/modules/mappa/css/app.css">
|
||||
|
||||
<!-- Mappa -->
|
||||
<script>
|
||||
var ROOTDIR = '<?php echo $rootdir; ?>';
|
||||
|
||||
setTimeout(function(){
|
||||
caricaMap();
|
||||
}, 2000);
|
||||
|
||||
function caricaMap(){
|
||||
var lat = [<?php echo $lat; ?>];
|
||||
var lng = [<?php echo $lng; ?>];
|
||||
var color = [<?php echo $color; ?>];
|
||||
var descrizioni = [<?php echo $stringa_descrizioni; ?>];
|
||||
var content = [<?php echo $stringa_content; ?>];
|
||||
var svgContent = `<?php echo $svgContent;?>`;
|
||||
const lt = "41.706";
|
||||
const ln = "13.228";
|
||||
var container = L.DomUtil.get("mappa");
|
||||
|
||||
if(container._leaflet_id != null){
|
||||
map.eachLayer(function (layer) {
|
||||
if(layer instanceof L.Marker) {
|
||||
map.removeLayer(layer);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
map = L.map("mappa", {
|
||||
center: [lt, ln],
|
||||
zoom: 6,
|
||||
gestureHandling: true
|
||||
});
|
||||
|
||||
L.tileLayer("<?php echo setting('Tile server OpenStreetMap'); ?>", {
|
||||
maxZoom: 17,
|
||||
attribution: "© OpenStreetMap"
|
||||
}).addTo(map);
|
||||
|
||||
var markerArray = [];
|
||||
if( document.getElementById('mappa') ){
|
||||
for (let i = 0; i < lng.length; i++) {
|
||||
let svgIcon = L.divIcon({
|
||||
html: svgContent.replace('fill="#cccccc"','fill="' + color[i] + '"'),
|
||||
className: '',
|
||||
shadowUrl:globals.rootdir + "/assets/dist/img/leaflet/marker-shadow.png",
|
||||
iconSize: [45, 61],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
|
||||
markerArray.push(L.marker([ lat[i], lng[i]], {
|
||||
icon: svgIcon,
|
||||
}));
|
||||
|
||||
setTimeout(function() {
|
||||
L.marker([ lat[i], lng[i]], {
|
||||
icon: svgIcon,
|
||||
}).bindTooltip(descrizioni[i],
|
||||
{
|
||||
permanent: false,
|
||||
direction: 'right'
|
||||
}
|
||||
).bindPopup(content[i]
|
||||
).addTo(map);
|
||||
}, 200 * i);
|
||||
}
|
||||
var group = L.featureGroup(markerArray).addTo(map);
|
||||
map.fitBounds(group.getBounds());
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Modules\Interventi\API\v1;
|
||||
|
||||
use API\Interfaces\CreateInterface;
|
||||
use API\Interfaces\RetrieveInterface;
|
||||
use API\Resource;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\Interventi\Components\Articolo;
|
||||
use Modules\Interventi\Intervento;
|
||||
|
||||
class Articoli extends Resource implements RetrieveInterface, CreateInterface
|
||||
{
|
||||
public function retrieve($request)
|
||||
{
|
||||
$table = 'in_righe_interventi';
|
||||
|
||||
$select = [
|
||||
'in_righe_interventi.id',
|
||||
'in_righe_interventi.idarticolo AS id_articolo',
|
||||
'in_righe_interventi.idintervento AS id_intervento',
|
||||
'in_righe_interventi.qta',
|
||||
'in_righe_interventi.created_at as data',
|
||||
];
|
||||
|
||||
$where = [['in_righe_interventi.idarticolo', '!=', null], ['in_righe_interventi.idintervento', '=', $request['id_intervento']]];
|
||||
|
||||
return [
|
||||
'table' => $table,
|
||||
'select' => $select,
|
||||
'where' => $where,
|
||||
];
|
||||
}
|
||||
|
||||
public function create($request)
|
||||
{
|
||||
$data = $request['data'];
|
||||
|
||||
$originale = ArticoloOriginale::find($data['id_articolo']);
|
||||
$intervento = Intervento::find($data['id_intervento']);
|
||||
$articolo = Articolo::build($intervento, $originale);
|
||||
|
||||
$articolo->qta = $data['qta'];
|
||||
$articolo->um = $data['um'];
|
||||
|
||||
$articolo->prezzo_unitario = $originale->prezzo_vendita;
|
||||
$articolo->costo_unitario = $originale->prezzo_acquisto;
|
||||
|
||||
$articolo->save();
|
||||
}
|
||||
}
|
128
modules/interventi/src/API/v1/Righe.php
Normal file
128
modules/interventi/src/API/v1/Righe.php
Normal file
@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Modules\Interventi\API\v1;
|
||||
|
||||
use API\Interfaces\CreateInterface;
|
||||
use API\Interfaces\RetrieveInterface;
|
||||
use API\Resource;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\Interventi\Components\Articolo;
|
||||
use Modules\Interventi\Components\Riga;
|
||||
use Modules\Interventi\Components\Descrizione;
|
||||
use Modules\Interventi\Intervento;
|
||||
|
||||
class Righe extends Resource implements RetrieveInterface, CreateInterface
|
||||
{
|
||||
public function retrieve($request)
|
||||
{
|
||||
$table = 'in_righe_interventi';
|
||||
|
||||
$select = [
|
||||
'in_righe_interventi.id',
|
||||
'in_righe_interventi.idarticolo AS id_articolo',
|
||||
'in_righe_interventi.idintervento AS id_intervento',
|
||||
'in_righe_interventi.descrizione',
|
||||
'in_righe_interventi.qta',
|
||||
'in_righe_interventi.created_at as data',
|
||||
];
|
||||
|
||||
$where = [['in_righe_interventi.idintervento', '=', $request['id_intervento']]];
|
||||
|
||||
return [
|
||||
'table' => $table,
|
||||
'select' => $select,
|
||||
'where' => $where,
|
||||
];
|
||||
}
|
||||
|
||||
public function create($request)
|
||||
{
|
||||
$data = $request['data'];
|
||||
$data['qta'] = ($data['qta'] ? $data['qta'] : 1);
|
||||
|
||||
$intervento = Intervento::find($data['id_intervento']);
|
||||
$originale = ArticoloOriginale::find($data['id_articolo']);
|
||||
if ($data['is_articolo'] && !empty($originale)) {
|
||||
$riga = Articolo::build($intervento, $originale);
|
||||
|
||||
$riga->descrizione = (!empty($data['descrizione']) ? $data['descrizione'] : $originale->descrizione);
|
||||
$riga->qta = $data['qta'];
|
||||
$riga->um = $data['um'];
|
||||
$riga->costo_unitario = $originale->prezzo_acquisto;
|
||||
if( $originale->prezzo_vendita>0 ){
|
||||
$idiva = ($originale->idiva_vendita ? $originale->idiva_vendita : setting('Iva predefinita'));
|
||||
$riga->setPrezzoUnitario($originale->prezzo_vendita, $idiva);
|
||||
}else{
|
||||
$riga->prezzo_unitario = 0;
|
||||
}
|
||||
} elseif ($data['is_descrizione']) {
|
||||
$riga = Descrizione::build($intervento);
|
||||
|
||||
$riga->qta = 0;
|
||||
$riga->descrizione = ($data['descrizione'] ? $data['descrizione'] : '-');
|
||||
} else {
|
||||
$riga = Riga::build($intervento);
|
||||
|
||||
$riga->qta = $data['qta'];
|
||||
$riga->um = $data['um'];
|
||||
$riga->descrizione = ($data['descrizione'] ? $data['descrizione'] : '-');
|
||||
$riga->costo_unitario = 0;
|
||||
$riga->setPrezzoUnitario(0, setting('Iva predefinita'));
|
||||
}
|
||||
|
||||
$riga->save();
|
||||
}
|
||||
|
||||
public function delete($request)
|
||||
{
|
||||
$riga = Articolo::find($request['id']) ?: Riga::find($request['id']);
|
||||
$riga = $riga ?: Descrizione::find($request['id']);
|
||||
$riga->delete();
|
||||
}
|
||||
|
||||
public function update($request)
|
||||
{
|
||||
$data = $request['data'];
|
||||
$data['qta'] = ($data['qta'] ? $data['qta'] : 1);
|
||||
|
||||
$originale = ArticoloOriginale::find($data['id_articolo']);
|
||||
$riga = Articolo::find($data['id_riga']) ?: Riga::find($data['id_riga']);
|
||||
|
||||
$riga->qta = $data['qta'];
|
||||
if(!empty($data['id_articolo']) && !empty($originale)){
|
||||
$descrizione = (!empty($data['descrizione']) ? $data['descrizione'] : $originale->descrizione);
|
||||
$descrizione = ($descrizione ? $descrizione : '-');
|
||||
|
||||
$riga->descrizione = $descrizione;
|
||||
$riga->idarticolo = $originale->id;
|
||||
$riga->costo_unitario = $originale->prezzo_acquisto;
|
||||
$idiva = ($originale->idiva_vendita ? $originale->idiva_vendita : setting('Iva predefinita'));
|
||||
$riga->setPrezzoUnitario($originale->prezzo_vendita, $idiva);
|
||||
}else{
|
||||
$riga->descrizione = ($data['descrizione'] ? $data['descrizione'] : '-');
|
||||
$riga->costo_unitario = 0;
|
||||
$riga->setPrezzoUnitario(0, setting('Iva predefinita'));
|
||||
}
|
||||
|
||||
$riga->um = $data['um'] ?: null;
|
||||
$riga->save();
|
||||
}
|
||||
|
||||
}
|
@ -42,7 +42,7 @@ switch (get('op')) {
|
||||
// Filtri per data
|
||||
$add_query .= ' |date_period(`orario_inizio`,`data_richiesta`)|';
|
||||
|
||||
$query = 'SELECT *, `in_interventi`.`id` AS idintervento, `an_anagrafiche`.`lat` AS lat_anagrafica, `an_anagrafiche`.`lng` AS lng_anagrafica, `an_anagrafiche`.`indirizzo` AS indirizzo_anagrafica, `an_anagrafiche`.`cap` AS cap_anagrafica, `an_anagrafiche`.`citta` AS citta_anagrafica, `an_anagrafiche`.`provincia` AS provincia_anagrafica, `an_sedi`.`lat` AS lat_sede, `an_sedi`.`lng` AS lng_sede, `an_sedi`.`indirizzo` AS indirizzo_sede, `an_sedi`.`cap` AS cap_sede, `an_sedi`.`citta` AS citta_sede, `an_sedi`.`provincia` AS provincia_sede, `in_statiintervento_lang`.`title` AS stato FROM `in_interventi` INNER JOIN `an_anagrafiche` ON `in_interventi`.`idanagrafica`=`an_anagrafiche`.`idanagrafica` LEFT JOIN `an_sedi` ON `in_interventi`.`idsede_destinazione`=`an_sedi`.`id` INNER JOIN `in_statiintervento` ON `in_interventi`.`idstatointervento`=`in_statiintervento`.`id` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang`= '.prepare(Models\Locale::getDefault()->id).') LEFT JOIN `in_interventi_tecnici` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` '.$add_query;
|
||||
$query = 'SELECT *, `in_statiintervento`.`colore` AS `colore_stato`, `in_interventi`.`id` AS idintervento, `an_anagrafiche`.`lat` AS lat_anagrafica, `an_anagrafiche`.`lng` AS lng_anagrafica, `an_anagrafiche`.`indirizzo` AS indirizzo_anagrafica, `an_anagrafiche`.`cap` AS cap_anagrafica, `an_anagrafiche`.`citta` AS citta_anagrafica, `an_anagrafiche`.`provincia` AS provincia_anagrafica, `an_sedi`.`lat` AS lat_sede, `an_sedi`.`lng` AS lng_sede, `an_sedi`.`indirizzo` AS indirizzo_sede, `an_sedi`.`cap` AS cap_sede, `an_sedi`.`citta` AS citta_sede, `an_sedi`.`provincia` AS provincia_sede, `in_statiintervento_lang`.`title` AS stato FROM `in_interventi` INNER JOIN `an_anagrafiche` ON `in_interventi`.`idanagrafica`=`an_anagrafiche`.`idanagrafica` LEFT JOIN `an_sedi` ON `in_interventi`.`idsede_destinazione`=`an_sedi`.`id` INNER JOIN `in_statiintervento` ON `in_interventi`.`idstatointervento`=`in_statiintervento`.`id` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_statiintervento`.`id` AND `in_statiintervento_lang`.`id_lang`= '.prepare(Models\Locale::getDefault()->id).') LEFT JOIN `in_interventi_tecnici` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` '.$add_query;
|
||||
|
||||
$query = Query::replacePlaceholder($query);
|
||||
$query = Modules::replaceAdditionals(Module::where('name', 'Interventi')->first()->id, $query);
|
||||
@ -53,6 +53,7 @@ switch (get('op')) {
|
||||
|
||||
if (sizeof($records) > 0) {
|
||||
for ($i = 0; $i < sizeof($records); ++$i) {
|
||||
$colore = $records[$i]['colore_stato'];
|
||||
if (!empty($records[$i]['idsede_destinazione'])) {
|
||||
$lat = $records[$i]['lat_sede'];
|
||||
$lng = $records[$i]['lng_sede'];
|
||||
@ -114,7 +115,7 @@ switch (get('op')) {
|
||||
|
||||
$descrizione .= '<hr>';
|
||||
|
||||
$rs[] = ['descrizione' => $descrizione, 'lat' => $lat, 'lng' => $lng];
|
||||
$rs[] = ['descrizione' => $descrizione, 'colore' => $colore, 'lat' => $lat, 'lng' => $lng];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,14 +30,28 @@ include_once __DIR__.'/../../core.php';
|
||||
<div id="menu-filtri" class="open-menu">
|
||||
<div style='width:100%;height:50px;background-color:#4d4d4d;padding:8px;font-size:25px;color:white;' class='text-center'>
|
||||
<div class="pull-left"><i class='fa fa-forward clickable' id="menu-filtri-toggle"></i></div>
|
||||
<b>Filtri</b>
|
||||
<b><?php echo tr('Filtri');?></b>
|
||||
</div>
|
||||
|
||||
<div id="lista-filtri" style="padding:20px 40px;height:637px;overflow:auto;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="geocomplete">
|
||||
<input type="hidden" name="lat" id="lat" value="">
|
||||
<input type="hidden" name="lng" id="lng" value="">
|
||||
{[ "type": "text", "label": "<?php echo tr('Indirizzo');?>", "name": "gaddress", "value": "", "extra": "data-geo='formatted_address'", "icon-after":"<button type=\"button\" class=\"btn btn-info\" onclick=\"initGeocomplete();\"><i class=\"fa fa-search\"></i></button>", "icon-before":"<button type=\"button\" class=\"btn btn-info\" onclick=\"getLocation();\"><i class=\"fa fa-map-marker\"></i></button>" ]}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="geocomplete">
|
||||
<input type="hidden" name="lat" id="lat" value="">
|
||||
<input type="hidden" name="lng" id="lng" value="">
|
||||
{[ "type": "number", "label": "<?php echo tr('Nel raggio di');?>", "name": "range", "value": "", "decimals": 0, "icon-after":"m" ]}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label style='font-size:12pt;'>Geolocalizzazione attività per anagrafica</label>
|
||||
<label style='font-size:12pt;'><?php echo tr('Geolocalizzazione attività per anagrafica');?></label>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
@ -50,7 +64,7 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label style='font-size:12pt;'>Geolocalizzazione attività per stato</label>
|
||||
<label style='font-size:12pt;'><?php echo tr('Geolocalizzazione attività per stato');?></label>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
@ -76,6 +90,9 @@ foreach ($rs_stati as $stato) {
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var indirizzi = [];
|
||||
var coords = [];
|
||||
var circle = "";
|
||||
var ROOTDIR = '<?php echo $rootdir; ?>';
|
||||
|
||||
function caricaMappa() {
|
||||
@ -93,6 +110,91 @@ foreach ($rs_stati as $stato) {
|
||||
attribution: "© OpenStreetMap"
|
||||
}).addTo(map);
|
||||
}
|
||||
|
||||
function initGeocomplete() {
|
||||
$.ajax({
|
||||
url: "https://nominatim.openstreetmap.org/search.php?q=" + encodeURI(input("gaddress").get()) + "&format=jsonv2",
|
||||
type : "GET",
|
||||
dataType: "JSON",
|
||||
success: function(data){
|
||||
input("lat").set(data[0].lat);
|
||||
input("lng").set(data[0].lon);
|
||||
input("gaddress").set(data[0].display_name);
|
||||
|
||||
var latlng = L.latLng(data[0].lat, data[0].lon);
|
||||
map.setView(latlng, 16);
|
||||
|
||||
L.marker(latlng).addTo(map)
|
||||
.bindPopup("You are here").openPopup();
|
||||
|
||||
// Aggiungi cerchio per indicare l'accuratezza
|
||||
if (circle) {
|
||||
map.removeLayer(circle);
|
||||
}
|
||||
|
||||
circle = L.circle(latlng, {
|
||||
radius: $("#range").val().toEnglish()
|
||||
}).addTo(map);
|
||||
|
||||
reload_pointers();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Avvio ricerca indirizzo premendo Invio
|
||||
$("#gaddress, #range").on("keypress", function(e){
|
||||
if(e.which == 13){
|
||||
e.preventDefault();
|
||||
initGeocomplete();
|
||||
}
|
||||
});
|
||||
|
||||
// Funzione per ottenere e visualizzare la geolocalizzazione
|
||||
function getLocation() {
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(onLocationFound, onLocationError);
|
||||
} else {
|
||||
alert("Geolocation is not supported by this browser.");
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationFound(position) {
|
||||
var lat = position.coords.latitude;
|
||||
var lng = position.coords.longitude;
|
||||
|
||||
var latlng = L.latLng(lat, lng);
|
||||
map.setView(latlng, 16);
|
||||
|
||||
if (circle) {
|
||||
map.removeLayer(circle);
|
||||
}
|
||||
|
||||
L.marker(latlng).addTo(map)
|
||||
.bindPopup("You are here").openPopup();
|
||||
|
||||
// Aggiungi cerchio per indicare l'accuratezza
|
||||
circle = L.circle(latlng, {
|
||||
//radius: position.coords.accuracy
|
||||
radius: $("#range").val().toEnglish()
|
||||
}).addTo(map);
|
||||
|
||||
// Invia richiesta per ottenere l'indirizzo
|
||||
$.getJSON('https://nominatim.openstreetmap.org/reverse', {
|
||||
lat: lat,
|
||||
lon: lng,
|
||||
format: 'json'
|
||||
}, function(data) {
|
||||
input("lat").set(data.lat);
|
||||
input("lng").set(data.lon);
|
||||
input("gaddress").set(data.display_name);
|
||||
|
||||
reload_pointers();
|
||||
});
|
||||
}
|
||||
|
||||
function onLocationError(error) {
|
||||
alert("Error: " + error.message);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="<?php echo $rootdir; ?>/modules/mappa/js/app.js"></script>
|
@ -11,14 +11,6 @@ $(document).ready(function() {
|
||||
|
||||
let map;
|
||||
var markers = [];
|
||||
var icon = new L.Icon({
|
||||
iconUrl: globals.rootdir + "/assets/dist/img/marker-icon.png",
|
||||
shadowUrl:globals.rootdir + "/assets/dist/img/leaflet/marker-shadow.png",
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
|
||||
$('#menu-filtri-toggle').click(function() {
|
||||
|
||||
@ -41,9 +33,11 @@ $('#menu-filtri-toggle').click(function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function reload_pointers() {
|
||||
clearMarkers();
|
||||
var check = [];
|
||||
var svgContent = "";
|
||||
|
||||
$("input[type='checkbox']").each(function() {
|
||||
if($(this).is(':checked')){
|
||||
@ -53,16 +47,61 @@ function reload_pointers() {
|
||||
}
|
||||
});
|
||||
|
||||
$.get(ROOTDIR+'/modules/mappa/actions.php?op=get_markers&idanagrafica='+$('#idanagrafica').val()+'&check='+check, function(data){
|
||||
$.ajax({
|
||||
url: globals.rootdir + '/assets/dist/img/leaflet/place-marker.svg', // Percorso al file SVG
|
||||
dataType: 'text', // Imposta il tipo di dati attesi
|
||||
success: function(data) {
|
||||
svgContent = data; // Inserisci il contenuto SVG nella variabile
|
||||
},
|
||||
error: function() {
|
||||
alert('Failed to load SVG file.');
|
||||
}
|
||||
});
|
||||
|
||||
$.get(globals.rootdir + '/modules/mappa/actions.php?op=get_markers&idanagrafica='+$('#idanagrafica').val()+'&check='+check, function(data){
|
||||
var dettagli = JSON.parse(data);
|
||||
dettagli.forEach(function(dettaglio) {
|
||||
|
||||
if (dettaglio.lat && dettaglio.lng) {
|
||||
let svgIcon = L.divIcon({
|
||||
html: svgContent.replace('fill="#cccccc"','fill="' + dettaglio.colore + '"'),
|
||||
className: '',
|
||||
shadowUrl:globals.rootdir + "/assets/dist/img/leaflet/marker-shadow.png",
|
||||
iconSize: [45, 61],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
|
||||
L.marker([dettaglio.lat, dettaglio.lng], {
|
||||
icon: icon
|
||||
}).addTo(map);
|
||||
icon: svgIcon
|
||||
}).bindTooltip("",
|
||||
{
|
||||
permanent: false,
|
||||
direction: 'right'
|
||||
}
|
||||
).bindPopup(dettaglio.descrizione
|
||||
).addTo(map);
|
||||
}
|
||||
});
|
||||
|
||||
if (input("lat").get() && input("lng").get()) {
|
||||
const lat = parseFloat(input("lat").get());
|
||||
const lng = parseFloat(input("lng").get());
|
||||
|
||||
var icon = new L.Icon({
|
||||
iconUrl: globals.rootdir + "/assets/dist/img/marker-icon.png",
|
||||
shadowUrl:globals.rootdir + "/assets/dist/img/leaflet/marker-shadow.png",
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
|
||||
L.marker([lat, lng], {
|
||||
icon: icon
|
||||
}).addTo(map);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ echo '
|
||||
<div class="card-header with-border">
|
||||
<h3 class="card-title">'.tr('Dettagli aggiuntivi').'</h3>
|
||||
<div class="card-tools pull-right">
|
||||
<button type="button" class="btn btn-tool" data-widget="collapse">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse">
|
||||
<i class="fa fa-'.(empty($espandi_dettagli) ? 'plus' : 'minus').'"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -9,3 +9,14 @@ $has_name = database()->columnExists('zz_groups', 'name');
|
||||
if ($has_name && $has_nome) {
|
||||
$database->query('ALTER TABLE `zz_groups` DROP `name`');
|
||||
}
|
||||
|
||||
// File e cartelle deprecate
|
||||
$files = [
|
||||
'modules/interventi/src/API/v1/Articoli.php',
|
||||
];
|
||||
|
||||
foreach ($files as $key => $value) {
|
||||
$files[$key] = realpath(base_dir().'/'.$value);
|
||||
}
|
||||
|
||||
delete($files);
|
@ -136,4 +136,28 @@ INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`,
|
||||
INSERT INTO `zz_views_lang` (`id_lang`, `id_record`, `title`) VALUES
|
||||
(1, (SELECT `id` FROM `zz_views` WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name`='Giacenze sedi') AND `name` = 'Valore'), 'Valore');
|
||||
|
||||
DELETE FROM `zz_settings` WHERE `zz_settings`.`nome` = "Addebita marca da bollo al cliente"
|
||||
DELETE FROM `zz_settings` WHERE `zz_settings`.`nome` = "Addebita marca da bollo al cliente"
|
||||
|
||||
-- Aggiunta API per DDT
|
||||
INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES
|
||||
(NULL, 'v1', 'delete', 'righe_ddt', 'Modules\\DDT\\API\\v1\\Righe', '1'),
|
||||
(NULL, 'v1', 'update', 'righe_ddt', 'Modules\\DDT\\API\\v1\\Righe', '1'),
|
||||
(NULL, 'v1', 'create', 'righe_ddt', 'Modules\\DDT\\API\\v1\\Righe', '1'),
|
||||
(NULL, 'v1', 'retrieve', 'righe_ddt', 'Modules\\DDT\\API\\v1\\Righe', '1'),
|
||||
(NULL, 'v1', 'delete', 'ddt', 'Modules\\DDT\\API\\v1\\DDTS', '1'),
|
||||
(NULL, 'v1', 'update', 'ddt', 'Modules\\DDT\\API\\v1\\DDTS', '1'),
|
||||
(NULL, 'v1', 'create', 'ddt', 'Modules\\DDT\\API\\v1\\DDTS', '1'),
|
||||
(NULL, 'v1', 'retrieve', 'ddt', 'Modules\\DDT\\API\\v1\\DDTS', '1');
|
||||
|
||||
-- Modifica API righe interventi
|
||||
UPDATE `zz_api_resources` SET `resource` = 'righe_intervento', `class` = 'Modules\\Interventi\\API\\v1\\Righe' WHERE `zz_api_resources`.`resource` = 'articoli_intervento';
|
||||
UPDATE `zz_api_resources` SET `resource` = 'riga_intervento', `class` = 'Modules\\Interventi\\API\\v1\\Righe' WHERE `zz_api_resources`.`resource` = 'articolo_intervento';
|
||||
|
||||
INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES
|
||||
(NULL, 'v1', 'update', 'riga_intervento', 'Modules\\Interventi\\API\\v1\\Righe', '1'),
|
||||
(NULL, 'v1', 'delete', 'riga_intervento', 'Modules\\Interventi\\API\\v1\\Righe', '1');
|
||||
|
||||
-- Gestione mappa in plugin attività
|
||||
INSERT INTO `zz_plugins` (`id`, `name`, `idmodule_from`, `idmodule_to`, `position`, `script`, `enabled`, `default`, `order`, `compatibility`, `version`, `options2`, `options`, `directory`, `help`) VALUES (NULL, 'Mostra su mappa', (SELECT `id` FROM `zz_modules` WHERE `name`= 'Interventi'), (SELECT `id` FROM `zz_modules` WHERE `name`= 'Interventi'), 'tab_main', 'mappa.php', '1', '0', '0', '', '', NULL, NULL, '', '');
|
||||
|
||||
INSERT INTO `zz_plugins_lang` (`id`, `id_lang`, `id_record`, `title`) VALUES (NULL, '1', (SELECT `zz_plugins`.`id` FROM `zz_plugins` WHERE `zz_plugins`.`name`='Mostra su mappa'), 'Mostra su mappa');
|
Loading…
x
Reference in New Issue
Block a user