mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-24 07:17:55 +01:00
Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
65198af2d8
10
CHANGELOG.md
10
CHANGELOG.md
@ -4,7 +4,7 @@ Tutti i maggiori cambiamenti di questo progetto saranno documentati in questo fi
|
||||
|
||||
Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://keepachangelog.com/), e il progetto segue il [Semantic Versioning](http://semver.org/) per definire le versioni delle release.
|
||||
|
||||
- [2.4.41 (2023-02-24)](#2441-2023-02-24)
|
||||
- [2.4.41 (2023-02-27)](#2441-2023-02-27)
|
||||
- [2.4.40 (2023-02-17)](#2440-2023-02-17)
|
||||
- [2.4.39 (2023-01-13)](#2439-2023-01-13)
|
||||
- [2.4.38 (2022-12-07)](#2438-2022-12-07)
|
||||
@ -52,10 +52,11 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
||||
- [2.2 (2016-11-10)](#22-2016-11-10)
|
||||
- [2.1 (2015-04-02)](#21-2015-04-02)
|
||||
|
||||
## 2.4.41 (2023-02-24)
|
||||
## 2.4.41 (2023-02-27)
|
||||
### Aggiunto (Added)
|
||||
- Aggiunta la modifica automatica del piano dei conti per clienti e fornitori
|
||||
- Aggiunto l'inserimento di email multiple per notifica di interventi
|
||||
- Aggiunta la possibilità di aggiornare l'ordine dei sottolivelli e di modificare la descrizione delle righe nelle checklist
|
||||
### Modificato (Changed)
|
||||
- Aggiornata la versione di fullcalendar
|
||||
- Rimozione dei clienti eliminati dalla sincronizzazione dell'app
|
||||
@ -67,6 +68,11 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
||||
- Corretta la creazione di eventi su calendario con vista del Giorno
|
||||
- Corretta la vista giornaliera in dashboard da impostazioni
|
||||
- Correzione query vista scadenzario
|
||||
- Corretto l'editor nei moduli
|
||||
- Corretta l'eliminazione di prima nota in riapertura di documenti
|
||||
- Corretto l'inserimento di articoli in DDT e fatture di acquisto
|
||||
- Corretta la visualizzazione del widget in Stato dei servizi
|
||||
- Corretta la creazione evento con impostazione AllDay attiva
|
||||
## 2.4.40 (2023-02-17)
|
||||
### Aggiunto (Added)
|
||||
- Aggiunto box dettagli cliente in fase di creazione fattura
|
||||
|
@ -1103,9 +1103,9 @@ div.tip {
|
||||
}
|
||||
|
||||
/* Stile Fullcalendar per weekend */
|
||||
.fc-sat,
|
||||
.fc-sun {
|
||||
background-color: rgba(255, 99, 71, 0.6) !important;
|
||||
.fc-day-sat,
|
||||
.fc-day-sun {
|
||||
background-color: rgba(255,49,21,.3) !important;
|
||||
}
|
||||
|
||||
.login-box .img-responsive {
|
||||
|
203
bug.php
203
bug.php
@ -1,203 +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/>.
|
||||
*/
|
||||
|
||||
use Modules\Emails\Account;
|
||||
use Notifications\EmailNotification;
|
||||
|
||||
include_once __DIR__.'/core.php';
|
||||
|
||||
$account = Account::where('predefined', true)->first();
|
||||
$bug_email = 'info@openstamanager.com';
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
if (filter('op') == 'send') {
|
||||
// Preparazione email
|
||||
$mail = new EmailNotification();
|
||||
|
||||
// Destinatario
|
||||
$mail->AddAddress($bug_email);
|
||||
|
||||
// Oggetto
|
||||
$mail->Subject = 'Segnalazione bug OSM '.$version;
|
||||
|
||||
// Aggiunta dei file di log (facoltativo)
|
||||
if (!empty(post('log')) && file_exists(base_dir().'/logs/error.log')) {
|
||||
$mail->AddAttachment(base_dir().'/logs/error.log');
|
||||
}
|
||||
|
||||
// Aggiunta della copia del database (facoltativo)
|
||||
if (!empty(post('sql'))) {
|
||||
$backup_file = base_dir().'/Backup OSM '.date('Y-m-d').' '.date('H_i_s').'.sql';
|
||||
Backup::database($backup_file);
|
||||
|
||||
$mail->AddAttachment($backup_file);
|
||||
|
||||
flash()->info(tr('Backup del database eseguito ed allegato correttamente!'));
|
||||
}
|
||||
|
||||
// Aggiunta delle informazioni di base sull'installazione
|
||||
$infos = [
|
||||
'Utente' => $user['username'],
|
||||
'IP' => get_client_ip(),
|
||||
'Versione OSM' => $version.' ('.(!empty($revision) ? $revision : 'In sviluppo').')',
|
||||
'PHP' => phpversion(),
|
||||
];
|
||||
|
||||
// Aggiunta delle informazioni sul sistema (facoltativo)
|
||||
if (!empty(post('info'))) {
|
||||
$infos['Sistema'] = $_SERVER['HTTP_USER_AGENT'].' - '.getOS();
|
||||
}
|
||||
|
||||
// Completamento del body
|
||||
$body = post('body').'<hr>';
|
||||
foreach ($infos as $key => $value) {
|
||||
$body .= '<p>'.$key.': '.$value.'</p>';
|
||||
}
|
||||
|
||||
$mail->Body = $body;
|
||||
|
||||
$mail->AltBody = 'Questa email arriva dal modulo bug di segnalazione bug di OSM';
|
||||
|
||||
// Invio mail
|
||||
if (!$mail->send()) {
|
||||
flash()->error(tr("Errore durante l'invio della segnalazione").': '.$mail->ErrorInfo);
|
||||
} else {
|
||||
flash()->info(tr('Email inviata correttamente!'));
|
||||
}
|
||||
|
||||
// Rimozione del dump del database
|
||||
if (!empty(post('sql'))) {
|
||||
delete($backup_file);
|
||||
}
|
||||
|
||||
redirect(base_path().'/bug.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
$pageTitle = tr('Bug');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
|
||||
if (empty($account['from_address']) || empty($account['server'])) {
|
||||
echo '
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i>
|
||||
<b>'.tr('Attenzione!').'</b> '.tr('Per utilizzare correttamente il modulo di segnalazione bug devi configurare alcuni parametri riguardanti le impostazione delle email').'.
|
||||
|
||||
'.Modules::link('Account email', $account['id'], tr('Correggi account'), null, 'class="btn btn-warning pull-right"').'
|
||||
<div class="clearfix"></div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><i class="fa fa-bug"></i> '.tr('Segnalazione bug').'</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="op" value="send">
|
||||
|
||||
<table class="table table-bordered table-condensed table-striped table-hover">
|
||||
<tr>
|
||||
<th width="150" class="text-right">'.tr('Da').':</th>
|
||||
<td>'.$account['from_address'].'</td>
|
||||
</tr>
|
||||
|
||||
<!-- A -->
|
||||
<tr>
|
||||
<th class="text-right">'.tr('A').':</th>
|
||||
<td>'.$bug_email.'</td>
|
||||
</tr>
|
||||
|
||||
<!-- Versione -->
|
||||
<tr>
|
||||
<th class="text-right">'.tr('Versione OSM').':</th>
|
||||
<td>'.$version.' ('.(!empty($revision) ? $revision : tr('In sviluppo')).')</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{[ "type": "checkbox", "placeholder": "'.tr('Allega file di log').'", "name": "log", "value": "1" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "checkbox", "placeholder": "'.tr('Allega copia del database').'", "name": "sql" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "checkbox", "placeholder": "'.tr('Allega informazioni sul PC').'", "name": "info", "value": "1" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<br>
|
||||
|
||||
{[ "type": "ckeditor", "label": "'.tr('Descrizione del bug').'", "name": "body" ]}
|
||||
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="submit" class="btn btn-primary" id="send" disabled>
|
||||
<i class="fa fa-envelope"></i> '.tr('Invia segnalazione').'
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
init();
|
||||
|
||||
var html = "<p>'.tr('Se hai riscontrato un bug ricordati di specificare').':</p>" +
|
||||
"<ul>" +
|
||||
"<li>'.tr('Modulo esatto (o pagina relativa) in cui questi si è verificato').';</li>" +
|
||||
"<li>'.tr('Dopo quali specifiche operazioni hai notato il malfunzionamento').'.</li>" +
|
||||
"</ul>" +
|
||||
"<p>'.tr('Assicurati inoltre di controllare che il checkbox relativo ai file di log sia contrassegnato, oppure riporta qui l\'errore visualizzato').'.</p>" +
|
||||
"<p>'.tr('Ti ringraziamo per il tuo contributo').',<br>" +
|
||||
"'.tr('Lo staff di OSM').'</p>";
|
||||
|
||||
var firstFocus = true;
|
||||
let editor = input("body");
|
||||
editor.set(html);
|
||||
|
||||
editor.on("change", function() {
|
||||
setTimeout(function() {
|
||||
$("#send").prop("disabled", editor.get() === "");
|
||||
}, 10);
|
||||
});
|
||||
|
||||
editor.on("focus", function() {
|
||||
if (firstFocus) {
|
||||
editor.set("");
|
||||
firstFocus = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="'.App::getPaths()['js'].'/ckeditor/ckeditor.js'.'"></script>';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
78
modules/checklists/ajax.php
Normal file
78
modules/checklists/ajax.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.n.c.
|
||||
*
|
||||
* 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';
|
||||
use Modules\Checklists\Check;
|
||||
|
||||
switch(post('op')){
|
||||
|
||||
case "delete_check":
|
||||
$id = post('id');
|
||||
|
||||
$record = Check::find($id);
|
||||
$record->delete();
|
||||
|
||||
break;
|
||||
|
||||
case "update_position":
|
||||
|
||||
$order = explode(',', post('order', true));
|
||||
|
||||
foreach($order as $i => $id){
|
||||
$dbo->query("UPDATE zz_checks SET `order`=".prepare($i)." WHERE id=".prepare($id));
|
||||
echo "UPDATE zz_checks SET `order`=".prepare($i)." WHERE id=".prepare($id);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "save_checkbox":
|
||||
|
||||
$id = post('id');
|
||||
|
||||
$record = Check::find($id);
|
||||
$record->checked_by = $user->id;
|
||||
$record->checked_at = date('Y-m-d H:i:s');
|
||||
$record->save();
|
||||
|
||||
break;
|
||||
|
||||
case "remove_checkbox":
|
||||
|
||||
$id = post('id');
|
||||
|
||||
$record = Check::find($id);
|
||||
$record->checked_by = NULL;
|
||||
$record->checked_at = NULL;
|
||||
$record->save();
|
||||
|
||||
break;
|
||||
|
||||
case "edit_check":
|
||||
$id_record = post('id_record');
|
||||
|
||||
$record = Check::find($id_record);
|
||||
$record->content = post('content');
|
||||
$record->save();
|
||||
|
||||
flash()->info(tr('Informazioni salvate correttamente!'));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
53
modules/checklists/components/edit-check.php
Normal file
53
modules/checklists/components/edit-check.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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';
|
||||
use Modules\Checklists\Check;
|
||||
|
||||
$id_record = get("id_record");
|
||||
$record = Check::find($id_record);
|
||||
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "<?php echo tr('Descrizione'); ?>", "name": "content", "required": 1, "value": "<?=$record->content?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="button" class="btn btn-success" id="save-btn"><i class='fa fa-save'></i> <?php echo tr('Salva'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#save-btn').click(function() {
|
||||
$('#save-btn').attr('disabled', true);
|
||||
$('#save-btn').html('<i class="fa fa-spinner fa-spin"></i> <?php echo tr('Salvataggio in corso...'); ?>');
|
||||
|
||||
$.post('<?php echo $rootdir; ?>/modules/checklists/ajax.php', {
|
||||
op: "edit_check",
|
||||
id_record: "<?=$id_record?>",
|
||||
content: $('#content').val()
|
||||
}, function(){
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
</script>
|
104
modules/checklists/modutil.php
Executable file → Normal file
104
modules/checklists/modutil.php
Executable file → Normal file
@ -17,55 +17,89 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
function renderChecklist($check, $level = 0)
|
||||
{
|
||||
function renderChecklist($check, $level = 1, $parent = 0) {
|
||||
|
||||
global $structure;
|
||||
|
||||
$user = auth()->getUser();
|
||||
$enabled = $check->assignedUsers ? $check->assignedUsers->pluck('id')->search($user->id) !== false : true;
|
||||
|
||||
$result = '
|
||||
<li id="check_'.$check->id.'" class="check-item'.(!empty($check->checked_at) ? ' done' : '').'" '.(!$enabled ? 'style="opacity: 0.4"' : '').' data-id="'.$check->id.'">
|
||||
<input type="checkbox" value="'.(!empty($check->checked_at) ? '1' : '0').'" '.(!empty($check->checked_at) ? 'checked' : '').'>
|
||||
$margin = ($level*20);
|
||||
|
||||
<span class="text">'.$check->content.'</span>';
|
||||
$result = '
|
||||
<tr id="check_'.$check->id.'" data-id="'.$check->id.'" class="sortablerow sonof_'.$parent.'" >
|
||||
<td style="padding-top:0px;padding-bottom:0px;border-top:0px;">
|
||||
<table class="table" style="margin-bottom:0px;">
|
||||
<tr>';
|
||||
|
||||
$result .= '
|
||||
<td style="width:40px;text-align:center;border-top:0px;border-left:3px solid #eaeaea;">
|
||||
<input type="checkbox" class="checkbox" data-id="'.$check->id.'" value="'.(!empty($check->checked_at) ? '1' : '0').'" '.(!empty($check->checked_at) ? 'checked' : '').' '.(!$enabled ? 'disabled' : '').'>
|
||||
</td>';
|
||||
|
||||
$result .= '
|
||||
<td style="border-top:0px;">
|
||||
<span class="text">'.$check->content.' </span>';
|
||||
|
||||
if (intval($check->assignedUsers->pluck('id')->toArray())>0){
|
||||
$result .= '<span class="label label-default">'. implode(',', $check->assignedUsers->pluck('username')->toArray()).'</span>';
|
||||
$result .= ' <span class="label label-info pull-right" style="padding:6px 8px;" data-toggle="tooltip" title="Assegnato a '. implode(', ', $check->assignedUsers->pluck('username')->toArray()).'"><i class="fa fa-user"></i></span>';
|
||||
}else{
|
||||
$result .= '<span class="label label-danger">'. tr('Nessun utente assegnato').'</span>';
|
||||
$result .= ' <span class="label label-danger pull-right" style="padding:6px 8px;">'. tr('Nessun utente assegnato').'</span>';
|
||||
}
|
||||
|
||||
if (empty($check->user) || $check->user->id == $user->id) {
|
||||
if(!empty($check->checked_at)){
|
||||
$result .= '
|
||||
<span class="label label-default pull-right" style="margin-right:5px;padding:6px 8px;">'.(!empty($check->checked_at) ? tr('Verificato da _NAME_ il _DATE_', [
|
||||
'_NAME_' => $check->checkUser->username,
|
||||
'_DATE_' => timestampFormat($check->checked_at),
|
||||
]) : '').'
|
||||
</span>';
|
||||
}
|
||||
|
||||
$result .= '
|
||||
</td>';
|
||||
|
||||
$result .= '
|
||||
<td style="width:40px;text-align:center;border-top:0px;">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-warning btn-xs '.(!$enabled ? 'disabled' : '').'" onclick="edit_check(\''.$check->id.'\')"><i class="fa fa-edit"></i></button>
|
||||
<button class="btn btn-danger btn-xs '.(!$enabled ? 'disabled' : '').'" onclick="delete_check(\''.$check->id.'\')"><i class="fa fa-trash"></i></button>
|
||||
</div>
|
||||
</td>';
|
||||
|
||||
|
||||
|
||||
$result .= '
|
||||
</tr>';
|
||||
|
||||
if(sizeof($check->children)>0){
|
||||
$result .= '
|
||||
<div class="tools">
|
||||
<i class="fa fa-trash-o check-delete"></i>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($level == 0) {
|
||||
<tr>
|
||||
<td colspan="4" style="padding-left:'.$margin.'px;padding-right:0px;padding-top:0px;padding-bottom:0px;border-top:0px;">
|
||||
<table class="table" style="margin-bottom:0px;">
|
||||
<tbody class="sort" data-sonof="'.$check->id.'">';
|
||||
$children = $structure->checks()->where('id_parent', $check->id)->orderBy('order')->get();
|
||||
foreach ($children as $child) {
|
||||
$result .= renderChecklist($child, $level + 1, $check->id);
|
||||
}
|
||||
$result .= '
|
||||
<span class="handle pull-right">
|
||||
<i class="fa fa-ellipsis-v"></i>
|
||||
<i class="fa fa-ellipsis-v"></i>
|
||||
</span>';
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
$result .= '
|
||||
<span class="badge pull-right" style="margin-right:5px">'.(!empty($check->checked_at) ? tr('Verificato da _NAME_ il _DATE_', [
|
||||
'_NAME_' => $check->checkUser->username,
|
||||
'_DATE_' => timestampFormat($check->checked_at),
|
||||
]) : '').'</span>';
|
||||
</table>
|
||||
</td>
|
||||
|
||||
$result .= '
|
||||
<ul class="todo-list">';
|
||||
<td style="width:40px;text-align:center;border-top:0px;">
|
||||
<button class="btn btn-xs btn-default handle '.(!$enabled ? 'disabled' : '').'" title="Modifica ordine delle righe" draggable="true">
|
||||
<i class="fa fa-sort"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
$children = $check->children;
|
||||
foreach ($children as $child) {
|
||||
$result .= renderChecklist($child, $level + 1);
|
||||
}
|
||||
|
||||
$result .= '
|
||||
</ul>
|
||||
</li>';
|
||||
</tr>';
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -80,10 +114,10 @@ function renderChecklistHtml($check, $level = 0)
|
||||
$result = '
|
||||
<tr>
|
||||
<td class="text-center" style="width:30px;">
|
||||
'.(!empty($check->checked_at)?'<img src="'.ROOTDIR.'/templates/interventi/check.png" style="width:10px;">':'').'
|
||||
'.(!empty($check->checked_at)?'<img src="'.ROOTDIR.'/templates/interventi/custom/check.png" style="width:10px;">':'').'
|
||||
</td>
|
||||
<td style="padding-left:'.$width.'px;">
|
||||
<span class="text">'.$check->content.'</span>
|
||||
<span class="text"><b>'.$check->content.'</b>'.(!empty($check->value)?': '.$check->value:'').'</span>
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
|
@ -545,7 +545,7 @@ function salvaArticolo() {
|
||||
});
|
||||
}
|
||||
|
||||
$("form").bind("keypress", function(e) {
|
||||
$("#link_form").bind("keypress", function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
salvaArticolo();
|
||||
|
@ -41,7 +41,15 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Contenuto'); ?>", "name": "content", "required": 1, "value": "$content$" ]}
|
||||
<?php
|
||||
echo input([
|
||||
'type' => 'textarea',
|
||||
'label' => tr('Contenuto'),
|
||||
'name' => 'content',
|
||||
'required' => 1,
|
||||
'value' => $record['content'],
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -509,6 +509,9 @@ globals.dashboard = {
|
||||
/* locales: allLocales, */
|
||||
locale: globals.locale,
|
||||
slotEventOverlap: false,
|
||||
weekNumbers: true,
|
||||
weekText: "W",
|
||||
nowIndicator: true,
|
||||
schedulerLicenseKey: "GPL-My-Project-Is-Open-Source",
|
||||
hiddenDays: globals.dashboard.show_sunday ? [] : [0],
|
||||
headerToolbar: {
|
||||
@ -571,8 +574,7 @@ globals.dashboard = {
|
||||
let start = info.start;
|
||||
let end = info.end;
|
||||
|
||||
let intero_giorno = !start.hasTime && !end.hasTime;
|
||||
if (intero_giorno !== true || globals.dashboard.informazioni_aggiuntive==0) {
|
||||
if (!info.allDay) {
|
||||
let data = moment(start).format("YYYY-MM-DD");
|
||||
let data_fine = moment(end).format("YYYY-MM-DD");
|
||||
let orario_inizio = moment(start).format("HH:mm");
|
||||
|
@ -366,10 +366,10 @@ if ($dir == 'entrata') {
|
||||
if (!$block_edit) {
|
||||
// Lettura ordini (cliente o fornitore)
|
||||
$ordini_query = 'SELECT COUNT(*) AS tot FROM or_ordini WHERE idanagrafica='.prepare($record['idanagrafica']).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Accettato\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).') AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0)';
|
||||
$ordini = $dbo->fetchArray($ordini_query)[0]['tot'];
|
||||
$tot_ordini = $dbo->fetchArray($ordini_query)[0]['tot'];
|
||||
|
||||
$ddt_query = 'SELECT COUNT(*) AS tot FROM dt_ddt WHERE idstatoddt IN (SELECT id FROM dt_statiddt WHERE descrizione IN(\'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoddt=(SELECT id FROM or_tipiordine WHERE dir="'.($dir == 'entrata' ? 'uscita' : 'entrata').'") AND dt_ddt.id IN (SELECT idddt FROM dt_righe_ddt WHERE dt_righe_ddt.idddt = dt_ddt.id AND (qta - qta_evasa) > 0)';
|
||||
$ddt = $dbo->fetchArray($ddt_query)[0]['tot'];
|
||||
$tot_ddt = $dbo->fetchArray($ddt_query)[0]['tot'];
|
||||
|
||||
// Form di inserimento riga documento
|
||||
echo '
|
||||
@ -383,7 +383,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).'}, "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).', "idsede_partenza": '.intval($ddt->idsede_partenza).', "idsede_destinazione": '.intval($ddt->idsede_destinazione).', "idanagrafica": '.$ddt->idanagrafica.', "dir": "'.$dir.'", "idagente": '.$ddt->idagente.'}, "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4" style="margin-top: 25px">
|
||||
@ -414,13 +414,13 @@ if (!$block_edit) {
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="'.(!empty($ddt) ? '' : ' disabled').'" style="cursor:pointer" data-href="'.$structure->fileurl('add_ddt.php').'?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi Ddt').'">
|
||||
<a class="'.(!empty($tot_ddt) ? '' : ' disabled').'" style="cursor:pointer" data-href="'.$structure->fileurl('add_ddt.php').'?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi Ddt').'">
|
||||
<i class="fa fa-plus"></i> '.tr('Ddt').'
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="'.(!empty($ordini) ? '' : ' disabled').'" style="cursor:pointer" data-href="'.$structure->fileurl('add_ordine.php').'?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi Ordine').'">
|
||||
<a class="'.(!empty($tot_ordini) ? '' : ' disabled').'" style="cursor:pointer" data-href="'.$structure->fileurl('add_ordine.php').'?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi Ordine').'">
|
||||
<i class="fa fa-plus"></i> '.tr('Ordine').'
|
||||
</a>
|
||||
</li>
|
||||
@ -581,7 +581,7 @@ function salvaArticolo() {
|
||||
});
|
||||
}
|
||||
|
||||
$("form").bind("keypress", function(e) {
|
||||
$("#link_form").bind("keypress", function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
salvaArticolo();
|
||||
|
@ -964,8 +964,12 @@ switch (post('op')) {
|
||||
$id_conto = $originale->idconto_acquisto;
|
||||
}
|
||||
$articolo->idconto = $id_conto;
|
||||
|
||||
$id_iva = $originale->idiva_vendita ?: setting('Iva predefinita');
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
if ($fattura->anagrafica['idiva_vendite'] ? $id_iva = $fattura->anagrafica['idiva_vendite'] : $id_iva = $originale->idiva_vendita ?: setting('Iva predefinita'));
|
||||
} else {
|
||||
if ($fattura->anagrafica['idiva_acquisti'] ? $id_iva = $fattura->anagrafica['idiva_acquisti'] : $id_iva = $originale->idiva_acquisti ?: setting('Iva predefinita'));
|
||||
}
|
||||
$id_anagrafica = $fattura->idanagrafica;
|
||||
$prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
|
||||
|
||||
|
@ -817,7 +817,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).'}, "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).', "idsede_partenza": '.intval($fattura->idsede_partenza).', "idsede_destinazione": '.intval($fattura->idsede_destinazione).', "idanagrafica": '.$fattura->idanagrafica.', "dir": "'.$dir.'", "idagente": '.$fattura->idagente.'}, "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4" style="margin-top: 25px">
|
||||
@ -1188,7 +1188,7 @@ function salvaArticolo() {
|
||||
});
|
||||
}
|
||||
|
||||
$("form").bind("keypress", function(e) {
|
||||
$("#link_form").bind("keypress", function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
salvaArticolo();
|
||||
|
@ -833,7 +833,7 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
$("form").bind("keypress", function(e) {
|
||||
$("#link_form").bind("keypress", function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
salvaArticolo();
|
||||
|
@ -439,7 +439,7 @@ function salvaArticolo() {
|
||||
});
|
||||
}
|
||||
|
||||
$("form").bind("keypress", function(e) {
|
||||
$("#link_form").bind("keypress", function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
salvaArticolo();
|
||||
|
@ -461,7 +461,7 @@ function salvaArticolo() {
|
||||
});
|
||||
}
|
||||
|
||||
$("form").bind("keypress", function(e) {
|
||||
$("#link_form").bind("keypress", function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
salvaArticolo();
|
||||
|
@ -82,8 +82,16 @@ use Models\PrintTemplate;
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Opzioni'); ?>", "name": "options", "value": "$options$", "help": "<?php echo tr('Impostazioni personalizzabili della stampa, in formato JSON'); ?>" ]}
|
||||
</div>
|
||||
<?php
|
||||
echo input([
|
||||
'type' => 'textarea',
|
||||
'label' => tr('Opzioni'),
|
||||
'name' => 'options',
|
||||
'value' => $record['options'],
|
||||
'help' => tr('Impostazioni personalizzabili della stampa, in formato JSON'),
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
145
plugins/checks.php
Executable file → Normal file
145
plugins/checks.php
Executable file → Normal file
@ -57,15 +57,15 @@ if ($structure->permission == 'rw') {
|
||||
|
||||
$checks = $structure->mainChecks($id_record);
|
||||
|
||||
echo '
|
||||
<ul class="todo-list checklist">';
|
||||
|
||||
foreach ($checks as $check) {
|
||||
echo renderChecklist($check);
|
||||
}
|
||||
echo " <table class='table'>
|
||||
<tbody class='sort' data-sonof='0'>";
|
||||
foreach ($checks as $check) {
|
||||
echo renderChecklist($check);
|
||||
}
|
||||
echo " </tbody>
|
||||
</table>";
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
@ -73,62 +73,95 @@ echo '
|
||||
echo '
|
||||
<script>$(document).ready(init)</script>
|
||||
|
||||
<script type="module">
|
||||
import Checklist from "./modules/checklists/js/checklist.js";
|
||||
<script>
|
||||
|
||||
var checklists = checklists ? checklists : {};
|
||||
$(document).ready(function() {
|
||||
checklists["'.$checks_id.'"] = new Checklist({
|
||||
id_module: "'.$id_module.'",
|
||||
id_plugin: "'.$id_plugin.'",
|
||||
id_record: "'.$id_record.'",
|
||||
}, "'.$checks_id.'");
|
||||
$(document).ready(function(){
|
||||
$("[data-toggle=\'tooltip\']").tooltip();
|
||||
});
|
||||
|
||||
sortable(".checklist", {
|
||||
placeholder: "sort-highlight",
|
||||
handle: ".handle",
|
||||
forcePlaceholderSize: true,
|
||||
zIndex: 999999,
|
||||
})[0].addEventListener("sortupdate", function(e) {
|
||||
let order = $(".checklist > li[data-id]").toArray().map(a => $(a).data("id"))
|
||||
sortable("#tab_checks .sort", {
|
||||
axis: "y",
|
||||
handle: ".handle",
|
||||
cursor: "move",
|
||||
dropOnEmpty: true,
|
||||
scroll: true,
|
||||
});
|
||||
|
||||
$.post(globals.rootdir + "/actions.php", {
|
||||
id_module: globals.id_module,
|
||||
id_plugin: "'.$id_plugin.'",
|
||||
id_record: globals.id_record,
|
||||
op: "ordina-checks",
|
||||
sortable_table = sortable("#tab_checks .sort").length;
|
||||
|
||||
for(i=0; i<sortable_table; i++){
|
||||
sortable("#tab_checks .sort")[i].addEventListener("sortupdate", function(e) {
|
||||
|
||||
var sonof = $(this).data("sonof");
|
||||
|
||||
let order = $(this).find(".sonof_"+sonof+"[data-id]").toArray().map(a => $(a).data("id"))
|
||||
|
||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||
op: "update_position",
|
||||
order: order.join(","),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(".checklist").todoList({
|
||||
onCheck: function () {
|
||||
var id = $(this).parent().data("id");
|
||||
|
||||
checklists["'.$checks_id.'"].toggleCheck(id);
|
||||
},
|
||||
onUnCheck: function () {
|
||||
var id = $(this).parent().data("id");
|
||||
|
||||
checklists["'.$checks_id.'"].toggleCheck(id);
|
||||
}
|
||||
});
|
||||
|
||||
$(".check-delete").click(function(event){
|
||||
var li = $(this).closest("li");
|
||||
var id = li.data("id");
|
||||
|
||||
swal({
|
||||
title: "'.tr("Rimuovere l'elemento della checklist?").'",
|
||||
html: "'.tr('Tutti gli elementi figli saranno rimossi di conseguenza. Continuare?').'",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "'.tr('Procedi').'",
|
||||
type: "error",
|
||||
}).then(function (result) {
|
||||
checklists["'.$checks_id.'"].deleteCheck(id);
|
||||
});
|
||||
|
||||
event.stopPropagation();
|
||||
$("input[name^=\'value\']").keyup(function(){
|
||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||
op: "save_value",
|
||||
value: $(this).val(),
|
||||
id: $(this).attr("data-id"),
|
||||
});
|
||||
});
|
||||
|
||||
$("textarea[name=\'note_checklist\']").keyup(function(){
|
||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||
op: "save_note",
|
||||
value: $(this).val(),
|
||||
id: $(this).attr("data-id"),
|
||||
});
|
||||
});
|
||||
|
||||
$(".checkbox").click(function(){
|
||||
if($(this).is(":checked")){
|
||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||
op: "save_checkbox",
|
||||
id: $(this).attr("data-id"),
|
||||
});
|
||||
|
||||
parent = $(this).attr("data-id");
|
||||
$("tr.sonof_"+parent).find("input[type=checkbox]").each(function(){
|
||||
if(!$(this).is(":checked")){
|
||||
$(this).click();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||
op: "remove_checkbox",
|
||||
id: $(this).attr("data-id"),
|
||||
});
|
||||
|
||||
parent = $(this).attr("data-id");
|
||||
$("tr.sonof_"+parent).find("input[type=checkbox]").each(function(){
|
||||
if($(this).is(":checked")){
|
||||
$(this).click();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
function delete_check(id){
|
||||
if(confirm("Eliminare questa checklist?")){
|
||||
$.post("'.$checklist_module->fileurl('ajax.php').'", {
|
||||
op: "delete_check",
|
||||
id: id,
|
||||
}, function(){
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function edit_check(id){
|
||||
launch_modal("Modifica checklist", "'.$checklist_module->fileurl('components/edit-check.php').'?id_record="+id, 1);
|
||||
}
|
||||
|
||||
</script>';
|
||||
|
||||
?>
|
@ -214,7 +214,7 @@ class WidgetManager implements ManagerInterface
|
||||
|
||||
protected function group($options)
|
||||
{
|
||||
$query = 'SELECT id FROM zz_widgets WHERE id_module = '.prepare($options['id_module']).' AND (|position|) AND enabled = 1 ORDER BY `order` ASC';
|
||||
$query = 'SELECT id, id_module FROM zz_widgets WHERE id_module = '.prepare($options['id_module']).' AND (|position|) AND enabled = 1 ORDER BY `order` ASC';
|
||||
|
||||
// Mobile (tutti i widget a destra)
|
||||
if (isMobile()) {
|
||||
@ -257,9 +257,13 @@ class WidgetManager implements ManagerInterface
|
||||
|
||||
// Aggiungo ad uno ad uno tutti i widget
|
||||
foreach ($widgets as $widget) {
|
||||
if ($widgets[0]['id_module'] == $database->fetchOne('SELECT id FROM zz_modules WHERE title = "Stato dei servizi"')['id']) {
|
||||
$result .= '
|
||||
<li class="col-sm-6 col-md-4 col-lg-5 li-widget" id="widget_'.$widget['id'].'" style="height:100% !important;" data-id="'.$widget['id'].'">';
|
||||
} else {
|
||||
$result .= '
|
||||
<li class="col-sm-6 col-md-4 col-lg-'.intval(12 / $row_max).' li-widget" id="widget_'.$widget['id'].'" data-id="'.$widget['id'].'">';
|
||||
|
||||
}
|
||||
$info = array_merge($options, [
|
||||
'id' => $widget['id'],
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user