diff --git a/modules/checklists/actions.php b/modules/checklists/actions.php index d08937ed3..4e4247fe4 100755 --- a/modules/checklists/actions.php +++ b/modules/checklists/actions.php @@ -57,7 +57,8 @@ switch (post('op')) { case 'add_item': $content = post('content'); $parent_id = post('parent') ?: null; - $item = ChecklistItem::build($record, $content, $parent_id); + $is_titolo = post('is_titolo'); + $item = ChecklistItem::build($record, $content, $parent_id, $is_titolo); flash()->info(tr('Nuova riga della checklist creata!')); diff --git a/modules/checklists/ajax.php b/modules/checklists/ajax.php index ec3263c4d..e18156b84 100644 --- a/modules/checklists/ajax.php +++ b/modules/checklists/ajax.php @@ -100,6 +100,7 @@ switch(post('op')){ } $record->content = post('content'); + $record->is_titolo = post('is_titolo'); $record->save(); flash()->info(tr('Informazioni salvate correttamente!')); diff --git a/modules/checklists/components/add-check.php b/modules/checklists/components/add-check.php index 682a8da72..893e218f2 100755 --- a/modules/checklists/components/add-check.php +++ b/modules/checklists/components/add-check.php @@ -33,29 +33,41 @@ foreach ($checks as $check) { echo '
-
- {[ "type": "text", "label": "'.tr('Contenuto').'", "name": "content", "required": 1 ]} +
+ '.input([ + 'type' => 'ckeditor', + 'label' => tr('Contenuto'), + 'name' => 'content', + 'required' => 1, + 'value' => '' + ]).' +
+
+ +
+
+ {[ "type": "select", "label": "'.tr('Collega a').'", "name": "parent", "values": '.json_encode($list).' ]}
-
- {[ "type": "select", "label": "'.tr('Collega a').'", "name": "parent", "values": '.json_encode($list).' ]} +
+ {[ "type": "checkbox", "label": "'.tr('Utilizza come titolo').'", "name": "is_titolo" ]}
-
- {[ "type": "select", "label": "'.tr('Utente assegnato').'", "name": "assigned_users", "ajax-source": "utenti", "multiple": 1 ]} +
+ {[ "type": "select", "label": "'.tr('Gruppo assegnato').'", "name": "group_id", "values": "query=SELECT id, nome AS text FROM zz_groups" ]}
- {[ "type": "select", "label": "'.tr('Gruppo assegnato').'", "name": "group_id", "values": "query=SELECT id, nome AS text FROM zz_groups" ]} + {[ "type": "select", "label": "'.tr('Utente assegnato').'", "name": "assigned_users", "ajax-source": "utenti", "multiple": 1 ]}
-
@@ -128,7 +140,8 @@ function addCheck(btn) { }, "'.$manager_id.'"); checklist.addCheck({ - content: $form.find("#content").val(), + content: input("content").get(), + is_titolo: input("is_titolo").get(), parent: $form.find("#parent").val(), assigned_users: $form.find("#assigned_users").val(), group_id: $form.find("#group_id").val(), diff --git a/modules/checklists/components/edit-check.php b/modules/checklists/components/edit-check.php index 85fb70bbb..7dd9e3f12 100644 --- a/modules/checklists/components/edit-check.php +++ b/modules/checklists/components/edit-check.php @@ -34,17 +34,30 @@ if($main_check){
- {[ "type": "text", "label": "", "name": "content_edit", "required": 1, "value": "content?>" ]} + 'ckeditor', + 'label' => tr('Descrizione'), + 'name' => 'content_edit', + 'required' => 1, + 'value' => htmlentities($record->content) + ]); + ?>
-
- +
+ {[ "type": "checkbox", "label": "", "name": "is_titolo", "value": "is_titolo ?>" ]} +
+ +
+