diff --git a/db/update20.0.beta2.sql b/db/update20.0.beta2.sql index 07f796042f..1571433a52 100644 --- a/db/update20.0.beta2.sql +++ b/db/update20.0.beta2.sql @@ -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`; diff --git a/db/zentao.sql b/db/zentao.sql index 6e6028c31a..cb19cfad95 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -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', diff --git a/module/programplan/config/form.php b/module/programplan/config/form.php index 3cd1d4717c..9ed9a26ca5 100644 --- a/module/programplan/config/form.php +++ b/module/programplan/config/form.php @@ -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); diff --git a/module/programplan/js/create.ui.js b/module/programplan/js/create.ui.js index 24d2bcdc92..47638012eb 100644 --- a/module/programplan/js/create.ui.js +++ b/module/programplan/js/create.ui.js @@ -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(""); + $(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(""); + $(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(""); + $(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("") + } } } - }