* Code for task #114640, when the closing stage is set, then set the hidden field.

This commit is contained in:
hufangzhou
2024-04-03 15:25:32 +08:00
parent 00d3427532
commit 27016b80a3
4 changed files with 33 additions and 7 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
UPDATE `zt_workflowfield` SET `default` = 0 WHERE `field` = 'approva' AND `role` = 'approval' AND `default` = '';
UPDATE `zt_workflowfield` SET `default` = 'wait' WHERE `field` = 'reviewStatus' AND `role` = 'approval' AND `default` = '';
ALTER TABLE `zt_project` ADD COLUMN `enabled` enum('0','1') NOT NULL DEFAULT '1' AFTER `parallel`;
ALTER TABLE `zt_object` ADD COLUMN `enabled` enum('0','1') NOT NULL DEFAULT '1' AFTER `type`;
ALTER TABLE `zt_project` ADD COLUMN `enabled` enum('on','off') NOT NULL DEFAULT 'on' AFTER `parallel`;
ALTER TABLE `zt_object` ADD COLUMN `enabled` enum('0','1') NOT NULL DEFAULT '1' AFTER `type`;
+1 -1
View File
@@ -1477,7 +1477,7 @@ CREATE TABLE IF NOT EXISTS `zt_project` (
`fluidBoard` enum('0','1') NOT NULL DEFAULT '0',
`multiple` enum('0','1') NOT NULL DEFAULT '1',
`parallel` mediumint(9) NOT NULL DEFAULT '0',
`enabled` enum('0','1') NOT NULL DEFAULT '1',
`enabled` enum('on','off') NOT NULL DEFAULT 'on',
`colWidth` smallint(6) NOT NULL DEFAULT '264',
`minColWidth` smallint(6) NOT NULL DEFAULT '200',
`maxColWidth` smallint(6) NOT NULL DEFAULT '384',
+1 -1
View File
@@ -5,7 +5,7 @@ $app->loadLang('execution');
$app->loadLang('stage');
$config->programplan->form = new stdClass();
$config->programplan->form->create = array();
$config->programplan->form->create['enabled'] = array('label' => $lang->programplan->enabled, 'type' => 'string', 'control' => array('control' => 'switcher', 'checked' => true), 'required' => true, 'options' => $lang->programplan->enabledList);
$config->programplan->form->create['enabled'] = array('label' => $lang->programplan->enabled, 'type' => 'string', 'control' => array('control' => 'switcher', 'checked' => true), 'options' => $lang->programplan->enabledList);
$config->programplan->form->create['id'] = array('label' => '', 'type' => 'int', 'control' => 'text', 'required' => false, 'default' => 0);
$config->programplan->form->create['order'] = array('label' => '', 'type' => 'int', 'control' => 'text', 'required' => false, 'default' => 0);
$config->programplan->form->create['type'] = array('label' => $lang->execution->method, 'type' => 'string', 'control' => 'picker', 'required' => true, 'default' => 'stage', 'options' => $lang->execution->typeList);
+29 -3
View File
@@ -123,51 +123,77 @@ window.changeEnabled = function()
{
for(let item = 0; item < tdItems.length; item++)
{
if($(tdItems[item]).data('name') == 'enabled') continue;
if($(tdItems[item]).data('name') == 'attribute') continue;
if($(tdItems[item]).find('[data-zui-datepicker]').length)
{
$(tdItems[item]).find("input.hidden").last().remove();
$(tdItems[item]).find('[data-zui-datepicker]').zui('datePicker').render({disabled: false});
}
else if($(tdItems[item]).find('[data-zui-picker]').length)
{
$(tdItems[item]).find("input.hidden").last().remove();
$(tdItems[item]).find('[data-zui-picker]').zui('picker').render({disabled: false});
}
else if($(tdItems[item]).find('.radio-primary').length)
{
$(tdItems[item]).find("input.hidden").last().remove();
$(tdItems[item]).find('.radio-primary').parent().removeAttr('disabled');
}
else if($(tdItems[item]).find('input[type=text]').length)
{
$(tdItems[item]).find('input[type=text]').removeAttr('readonly');
}
else if($(tdItems[item]).data('name') == 'enabled')
{
$(tdItems[item]).find("input.hidden").last().remove();
}
}
}
else
{
let itemValue = '';
let itemName = '';
for(let item = 0; item < tdItems.length; item++)
{
if($(tdItems[item]).data('name') == 'enabled') continue;
if($(tdItems[item]).data('name') == 'attribute') continue;
if($(tdItems[item]).find('[data-zui-datepicker]').length)
{
itemValue = $(tdItems[item]).find('[data-zui-datepicker]').zui('datePicker').$.value;
itemName = $(tdItems[item]).find('input.pick-value').attr('name');
$(tdItems[item]).append("<input name='" + itemName + "' value='" + itemValue + "' class='hidden'/>");
$(tdItems[item]).find('[data-zui-datepicker]').zui('datePicker').render({disabled: true});
}
else if($(tdItems[item]).find('[data-zui-picker]').length)
{
itemValue = $(tdItems[item]).find('input').zui('picker').$.value;
itemName = $(tdItems[item]).find('input').attr('name');
$(tdItems[item]).append("<input name='" + itemName + "' value='" + itemValue + "' class='hidden'/>");
$(tdItems[item]).find('[data-zui-picker]').zui('picker').render({disabled: true});
}
else if($(tdItems[item]).find('.radio-primary').length)
{
itemValue = $(tdItems[item]).find('input[type=radio]:checked').val();
itemName = $(tdItems[item]).find('input[type=radio]:checked').attr('name');
$(tdItems[item]).append("<input name='" + itemName + "' value='" + itemValue + "' class='hidden'/>");
$(tdItems[item]).find('.radio-primary').parent().attr('disabled', 'disabled');
}
else if($(tdItems[item]).find('input[type=text]').length)
{
$(tdItems[item]).find('input[type=text]').attr('readonly', 'readonly');
}
else if($(tdItems[item]).data('name') == 'enabled')
{
itemName = $(tdItems[item]).find('input').attr('name');
$(tdItems[item]).append("<input name='" + itemName + "' value='off' class='hidden'/>")
}
}
}
}