-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<div class="page-header"> | ||
<h2><?= t('Define action parameters') ?></h2> | ||
</div> | ||
|
||
<form method="post" action="<?= $this->url->href('ActionCreationController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> | ||
<?= $this->form->csrf() ?> | ||
|
||
<?= $this->form->hidden('event_name', $values) ?> | ||
<?= $this->form->hidden('action_name', $values) ?> | ||
|
||
<?= $this->form->label(t('Action'), 'action_name') ?> | ||
<?= $this->form->select('action_name', $available_actions, $values, array(), array('disabled')) ?> | ||
|
||
<?= $this->form->label(t('Event'), 'event_name') ?> | ||
<?= $this->form->select('event_name', $events, $values, array(), array('disabled')) ?> | ||
|
||
<?php foreach ($action_params as $param_name => $param_desc): ?> | ||
<?php if ($this->text->contains($param_name, 'column_id')): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $columns_list, $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'user_id')): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $users_list, $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'project_id')): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $projects_list, $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'color_id')): ?> | ||
<?= $this->form->colorSelect('params['.$param_name.']', $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'category_id')): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $categories_list, $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'link_id')): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $links_list, $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'check_box')): ?> | ||
<?= $this->form->label(t('Options'), $param_name) ?> | ||
<?= $this->form->checkbox('params['.$param_name.']', $param_desc, 1) ?> | ||
<?php elseif ($param_name === 'priority'): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $priorities_list, $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'duration')): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->number('params['.$param_name.']', $values) ?> | ||
<?php elseif ($this->text->contains($param_name, 'swimlane_id')): ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $swimlane_list, $values) ?> | ||
<?php elseif (is_array($param_desc)): ?> | ||
<?= $this->form->label(ucfirst($param_name), $param_name) ?> | ||
<?= $this->form->select('params['.$param_name.']', $param_desc, $values) ?> | ||
<?php else: ?> | ||
<?= $this->form->label($param_desc, $param_name) ?> | ||
<?= $this->form->text('params['.$param_name.']', $values) ?> | ||
<?php endif ?> | ||
<?php endforeach ?> | ||
|
||
<?= $this->modal->submitButtons() ?> | ||
</form> |
9 comments
on commit 408723f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the "Check_box" option work as an actual check box, if you use AutoSubtask Plugin, it is not needed, so I added code to check if that plugin is installed and override the template if not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its funny that i just noticed this now, its been so long since i used kanboard, and i must have always had AutoSubtask plugin installed when I tested things, that I took for granted the check_box option in the action param, and years later just realized I had to add it somewhere, as it was not a native option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its funny that i just noticed this now, its been so long since i used kanboard, and i must have always had AutoSubtask plugin installed when I tested things, that I took for granted the check_box option in the action param, and years later just realized I had to add it somewhere, as it was not a native option.
how can I make this a radio insteadof checkbox? I've looked at the file and not seen a 'radio' type in there. Related to #6 #7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
radios and check boxes are different.
a checkbox is true or false.
radios are a series of true or false, within an array of options.
here are some references:
this one is for a single radio:
https://github.com/kanboard/kanboard/blob/2841d81528af55301d9f7cd4cb5ab7657dde692f/app/Helper/FormHelper.php#L121
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
radios and check boxes are different.
a checkbox is true or false. radios are a series of true or false, within an array of options.
Its fine, too compplicated, I will stick to checkboxes so the user has better multiple options.... please check latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it's not, I didn't realize there was a single radio function in the helper already. I'll add it when I get a moment. Thanksgiving holiday is over tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay cool. Didn't realise there was a holiday going on. Not in the US. Hope you had a good one. You should know I have changed the branch name to master and also check the checkbox options I already done. Doubt any of them work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this should work in the action params template.
<?php elseif ($this->text->contains($param_name, 'radio')): ?>
<?= $this->form->label(t('Options'), $param_name) ?>
<?= $this->form->radio('params['.$param_name.']', $param_desc, 1) ?>
and then use
'radio_include_project' => t('Include the Project Name in the subject line?'),
instead of
'check_box_include_project' => t('Include the Project Name in the subject line?'),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this should work in the action params template.
<?php elseif ($this->text->contains($param_name, 'radio')): ?> <?= $this->form->label(t('Options'), $param_name) ?> <?= $this->form->radio('params['.$param_name.']', $param_desc, 1) ?>
and then use
'radio_include_project' => t('Include the Project Name in the subject line?'),
instead of'check_box_include_project' => t('Include the Project Name in the subject line?'),
cool but if you look at the latest code, the checkboxes work better as the options will be multiple. I originally thought radios would be right but when I went through the possible requirements by the end user, checkboxes with AND/OR seemed better. Let me know if you disagree as I dont think the code functions like this anyway
this right here is what needs to be done for TemplateTitle and Group_assign to function properly together. Albeit, a little more than just this line of code, but in both plugins need to check if the other is installed, and in both plugins conditionally determine which templates to use when overriding.