diff --git a/modules/checklists/ajax.php b/modules/checklists/ajax.php
index b3a3c71e8..ec3263c4d 100644
--- a/modules/checklists/ajax.php
+++ b/modules/checklists/ajax.php
@@ -18,6 +18,7 @@
*/
include_once __DIR__.'/../../core.php';
+
use Modules\Checklists\Check;
use Modules\Checklists\ChecklistItem;
@@ -65,6 +66,18 @@ switch(post('op')){
break;
+ case "save_note":
+ $note = post('note');
+ $id = post('id');
+
+ $record = Check::find($id);
+ $record->note = $note;
+ $record->save();
+
+ flash()->info(tr('Nota salvata correttamente!'));
+
+ break;
+
case "remove_checkbox":
$id = post('id');
diff --git a/modules/checklists/modutil.php b/modules/checklists/modutil.php
index 5d81f6c79..53d6229ff 100644
--- a/modules/checklists/modutil.php
+++ b/modules/checklists/modutil.php
@@ -39,7 +39,16 @@ function renderChecklist($check, $level = 1, $parent = 0) {
$result .= '
- '.$check->content.' ';
+ '.$check->content.'
+ | ';
+
+ $result .= '
+
+ {[ "type": "textarea", "name": "note_checklist", "id": "'.$check->id.'", "value": "'.$check->note.'" ]}
+ | ';
+
+ $result .= '
+ ';
if (intval($check->assignedUsers->pluck('id')->toArray())>0){
$result .= ' ';
@@ -59,10 +68,11 @@ function renderChecklist($check, $level = 1, $parent = 0) {
| ';
$result .= '
-
+ |
+
| ';
@@ -74,7 +84,7 @@ function renderChecklist($check, $level = 1, $parent = 0) {
if(sizeof($check->children)>0){
$result .= '
-
+ |
';
$children = $structure->checks()->where('id_parent', $check->id)->orderBy('order')->get();
@@ -91,13 +101,6 @@ function renderChecklist($check, $level = 1, $parent = 0) {
$result .= '
|
-
-
-
- |
-
';
return $result;
diff --git a/plugins/checks.php b/plugins/checks.php
index 62e6f372e..819734272 100644
--- a/plugins/checks.php
+++ b/plugins/checks.php
@@ -103,19 +103,13 @@ for(i=0; ifileurl('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"),
+ note: $(this).val(),
+ id: $(this).attr("id"),
+ }, function() {
+ alertPush();
});
});
diff --git a/update/2_4_45.sql b/update/2_4_45.sql
index dd60532ed..ec1852cdf 100644
--- a/update/2_4_45.sql
+++ b/update/2_4_45.sql
@@ -116,9 +116,6 @@ INSERT INTO `zz_prints` (`id_module`, `is_record`, `name`, `title`, `filename`,
INSERT INTO `zz_settings` (`nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES ( "Visualizza solo promemoria assegnati", '0', 'boolean', '1', 'Applicazione', '7', 'Se abilitata permetti ai tecnici la visualizzazione dei soli promemoria in cui risultano come assegnati');
--- Aggiunta stampa ddt in entrata
-INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Ddt di acquisto'), '1', 'Ddt di acquisto', 'Ddt in entrata', 'DDT num. {numero} del {data}', 'ddt', 'idddt', '{\"pricing\":true}', 'fa fa-print', '', '', '0', '1', '1', '1');
-
-- Fix query Fatture di acquisto
UPDATE `zz_modules` SET `options` = "
SELECT
diff --git a/update/2_4_46.sql b/update/2_4_46.sql
index 35ebc0b34..2be35c533 100644
--- a/update/2_4_46.sql
+++ b/update/2_4_46.sql
@@ -25,4 +25,7 @@ ORDER BY
DELETE FROM `zz_prints` WHERE `name` = 'Spesometro';
-- Aggiunta stampa ddt in entrata
-INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Ddt di acquisto'), '1', 'Ddt di acquisto', 'Ddt in entrata', 'DDT num. {numero} del {data}', 'ddt', 'idddt', '{\"pricing\":true}', 'fa fa-print', '', '', '0', '1', '1', '1');
\ No newline at end of file
+INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Ddt di acquisto'), '1', 'Ddt di acquisto', 'Ddt in entrata', 'DDT num. {numero} del {data}', 'ddt', 'idddt', '{\"pricing\":true}', 'fa fa-print', '', '', '0', '1', '1', '1');
+
+-- Aggiunte note checklist
+ALTER TABLE `zz_checks` ADD `note` TEXT NOT NULL AFTER `content`;
\ No newline at end of file