* [task#127429] modify quoted question can not delete of thinkstepbase.
This commit is contained in:
@@ -21,10 +21,10 @@ class thinkStep extends wg
|
||||
$questionType = $addType ? $addType : ($item->options->questionType ?? '');
|
||||
if($addType === 'node' || !$addType && $item->type === 'node') return thinkNode(set::step($step), set::mode($action), set::isRun($isRun));
|
||||
if($addType === 'transition' || !$addType && $item->type === 'transition') return thinkTransition(set::step($step), set::mode($action), set::isRun($isRun));
|
||||
if($questionType === 'input') return thinkInput(set::step($step), set::questionType('input'), set::mode($action), set::isRun($isRun), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'radio') return thinkRadio(set::step($step), set::questionType('radio'), set::mode($action), set::isRun($isRun), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'checkbox') return thinkCheckbox(set::step($step), set::questionType('checkbox'), set::mode($action), set::isRun($isRun), set::quoteQuestions($quoteQuestions), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'tableInput') return thinkTableInput(set::step($step), set::questionType('tableInput'), set::mode($action), set::isRun($isRun), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'input') return thinkInput(set::step($step), set::questionType('input'), set::mode($action), set::isRun($isRun));
|
||||
if($questionType === 'radio') return thinkRadio(set::step($step), set::questionType('radio'), set::mode($action), set::isRun($isRun), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'checkbox') return thinkCheckbox(set::step($step), set::questionType('checkbox'), set::mode($action), set::isRun($isRun), set::quoteQuestions($quoteQuestions), set::quotedQuestions($quotedQuestions));
|
||||
if($questionType === 'tableInput') return thinkTableInput(set::step($step), set::questionType('tableInput'), set::mode($action), set::isRun($isRun));
|
||||
if($questionType === 'multicolumn') return thinkMulticolumn(set::step($step), set::questionType('multicolumn'), set::mode($action), set::isRun($isRun), set::quotedQuestions($quotedQuestions));
|
||||
return array();
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class thinkStep extends wg
|
||||
global $lang, $app;
|
||||
$app->loadLang('thinkstep');
|
||||
|
||||
list($item, $action, $addType, $isRun) = $this->prop(array('item', 'action', 'addType', 'isRun'));
|
||||
list($item, $action, $addType, $isRun, $quotedQuestions) = $this->prop(array('item', 'action', 'addType', 'isRun', 'quotedQuestions'));
|
||||
if(!$item && !$addType) return array();
|
||||
|
||||
$marketID = data('marketID');
|
||||
@@ -66,7 +66,7 @@ class thinkStep extends wg
|
||||
set::icon('edit'),
|
||||
set::url(createLink('thinkstep', 'edit', "marketID={$marketID}&stepID={$item->id}")),
|
||||
) : null,
|
||||
$canDelete ? (!$item->existNotNode ? btn
|
||||
$canDelete ? (!$item->existNotNode && empty($quotedQuestions) ? btn
|
||||
(
|
||||
setClass('btn ghost text-gray w-5 h-5 ml-1 ajax-submit'),
|
||||
set::icon('trash'),
|
||||
@@ -78,7 +78,7 @@ class thinkStep extends wg
|
||||
'class' => 'ghost w-5 h-5 text-gray opacity-50 ml-1',
|
||||
'icon' => 'trash',
|
||||
'data-toggle' => 'tooltip',
|
||||
'data-title' => $lang->thinkstep->cannotDeleteNode,
|
||||
'data-title' => $item->existNotNode ? $lang->thinkstep->cannotDeleteNode : $lang->thinkstep->cannotDeleteQuestion,
|
||||
'data-placement' => 'bottom-start',
|
||||
))
|
||||
)) : null
|
||||
|
||||
@@ -109,23 +109,26 @@ class thinkStepBase extends wg
|
||||
|
||||
if(!empty($step->options->fields)) $step->options->fields = is_string($step->options->fields) ? explode(', ', $step->options->fields) : array_values((array)$step->options->fields);
|
||||
|
||||
$isCheckBox = $step->type == 'question' && $step->options->questionType == 'checkbox';
|
||||
$quoteItem = $isCheckBox && !empty($step->options->setOption) && $step->options->setOption == 1;
|
||||
$isCheckBox = !empty($step) && $step->type == 'question' && $step->options->questionType == 'checkbox';
|
||||
$isQuoteItem = $isCheckBox && !empty($step->options->setOption) && $step->options->setOption == 1;
|
||||
$detailTip = array();
|
||||
$quotedItems = array();
|
||||
foreach($quotedQuestions as $item)
|
||||
if(!empty($quotedQuestions))
|
||||
{
|
||||
$quotedItems[] = a
|
||||
(
|
||||
setClass('block text-primary-500 leading-relaxed'),
|
||||
set::href(createLink('thinkstep', 'view', "marketID=0&&wizardID=$item->wizard&&stepID=$item->id")),
|
||||
setData('toggle', 'modal'),
|
||||
setData('size', 'lg'),
|
||||
$item->index . '. ' . $item->title
|
||||
);
|
||||
foreach($quotedQuestions as $item)
|
||||
{
|
||||
$quotedItems[] = a
|
||||
(
|
||||
setClass('block text-primary-500 leading-relaxed'),
|
||||
set::href(createLink('thinkstep', 'view', "marketID=0&&wizardID=$item->wizard&&stepID=$item->id")),
|
||||
setData('toggle', 'modal'),
|
||||
setData('size', 'lg'),
|
||||
$item->index . '. ' . $item->title
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if($quoteItem && !empty($quoteQuestions))
|
||||
if($isQuoteItem && !empty($quoteQuestions))
|
||||
{
|
||||
foreach($quoteQuestions as $item)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user