I
I
Ivan Eremin2017-07-14 19:42:06
PHP
Ivan Eremin, 2017-07-14 19:42:06

Bitrix24.corpportal checklist modernization in the task, how?

On the page for adding/editing a task, add the "Description" field to the "Checklist". Thus, the item in the checklist should contain
two fields "What needs to be done" and "Description".
When creating a "subtask" from a checklist item, the content from the "Description" must fall into the content of the subtask.
For a couple of hours I've been looking at both the module and the /bitrix/components/bitrix/tasks.task component, but I don't see what I need.
bxapi.ru/?module_id=tasks&class=CTaskCheckListItem dug out the list of module methods here ...
/bitrix/components/bitrix/tasks.widget.checklist I also found this :) and there template.php, judging by the content, is still responsible for checklists ... but, the head has already begun to slowly think in the evening. I will be glad to help you to solve the problem.
Responsible for entering the checklist line for the widget the following code inside php
Code

spoiler
<script data-bx-id="checklist-is-item" type="text/html">

            <?ob_start();?>
            <div data-item-value="{{VALUE}}" class="js-id-checklist-is-item js-id-checklist-is-item-{{VALUE}} tasks-checklist-item mode-read {{APPEARANCE}} {{READONLY}} {{ITEM_SET_INVISIBLE}}">
               <div class="task-checklist-field generic">
                  <div class="task-checklist-field-inner">
                     <span class="js-id-checklist-is-i-drag-handle task-field-drg-btn"></span>
                     <input id="chl_item_{{VALUE}}" class="js-id-checklist-is-i-toggle task-checklist-field-checkbox" type="checkbox" {{CHECKED_ATTRIBUTE}} {{DISABLED_ATTRIBUTE}} />

                     <?//read mode?>
                     <label class="block-read task-checklist-field-label" for="chl_item_{{VALUE}}"><span class="js-id-checklist-is-i-number">{{NUMBER}}</span>. <span class="js-id-checklist-is-i-title {{STROKE_CSS}}">{{{DISPLAY}}}</span></label>
                     <span class="js-id-checklist-is-i-edit block-read task-field-title-edit tasks-btn-edit"></span>

                     <?//edit mode?>
                     <input class="js-id-checklist-is-i-new-title block-edit task-checklist-field-add" type="text" value="{{TITLE}}" placeholder="<?=Loc::getMessage('TASKS_TTDP_CHECKLIST_WHAT_TO_BE_DONE')?>" maxlength="255" />
                     <span class="js-id-checklist-is-i-apply block-edit tasks-btn-apply task-field-title-ok"></span>

                     <?//any mode?>
                     <span class="js-id-checklist-is-i-delete task-field-title-del tasks-btn-delete"></span>

                     <input type="hidden" class="js-id-checklist-is-i-title-field" name="<?=$inputPrefix?>[{{VALUE}}][TITLE]" value="{{TITLE}}" />
                  </div>
               </div>

               <div class="js-id-checklist-is-i-drag-handle task-field-divider separator">
                  <div class="js-id-checklist-is-i-delete task-field-divider-close"></div>
               </div>

               <div class="tasks-checklist-item-marker"></div>

               <input type="hidden" name="<?=$inputPrefix?>[{{VALUE}}][ID]" value="{{ID}}" />
               <input class="js-id-checklist-is-i-sort-fld" type="hidden" name="<?=$inputPrefix?>[{{VALUE}}][<?=$tData['FIELDS']['SORT']?>]" value="{{<?=$tData['FIELDS']['SORT']?>}}" />
               <input class="js-id-checklist-is-i-complete-fld" type="hidden" name="<?=$inputPrefix?>[{{VALUE}}][<?=$tData['FIELDS']['CHECKED']?>]" value="{{<?=$tData['FIELDS']['CHECKED']?>}}" />
            </div>
            <?$template = trim(ob_get_flush());?>

         </script>

and now it looks like you need to add one more line in it ....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2017-07-16
@divanus

How are you going to store it in the database? Look at the structure of the b_tasks_checklist_items table.
It is not intended to be expanded, and moreover - TITLE can only contain 255 characters, which significantly limits the scope of the field.
Maybe the guys do not quite understand the essence of the checklist? Because if you need to explain the action, then this is already a subtask, not a checklist.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question