* Finish task #63892.
This commit is contained in:
@@ -32,3 +32,6 @@ UPDATE `zt_project` SET `closedDate`='' AND `closedBy`='' WHERE `status` != 'clo
|
||||
|
||||
INSERT IGNORE INTO `zt_workflowaction` (`module`, `action`, `method`, `name`, `type`, `batchMode`, `extensionType`, `open`, `position`, `layout`, `show`, `buildin`, `role`, `createdBy`, `createdDate`) VALUES
|
||||
('bug', 'batchactivate', 'batchoperate', '批量激活', 'batch', 'different', 'none', 'normal', 'browse', 'normal', 'direct', '1', 'buildin', '', '2022-08-09 15:52');
|
||||
|
||||
INSERT INTO `zt_grouppriv` (SELECT `group`,`module`,'reply' FROM `zt_grouppriv` WHERE `module` = 'feedback' AND `method` = 'comment');
|
||||
INSERT INTO `zt_grouppriv` (SELECT `group`,`module`,'ask' FROM `zt_grouppriv` WHERE `module` = 'feedback' AND `method` = 'comment');
|
||||
|
||||
@@ -389,27 +389,21 @@ class control extends baseControl
|
||||
* inForm=0|1 The fields displayed in a form or not. The default is 1.
|
||||
* inCell=0|1 The fields displayed in a div with class cell or not. The default is 0.
|
||||
* @param bool $print
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function printExtendFields($object, $type, $extras = '', $print = true)
|
||||
public function printExtendFields($object, $type, $extras = '', $print = true, $moduleName = '', $methodName = '')
|
||||
{
|
||||
if(!isset($this->config->bizVersion)) return false;
|
||||
|
||||
$moduleName = $this->app->getModuleName();
|
||||
$methodName = $this->app->getMethodName();
|
||||
$moduleName = $moduleName ? $moduleName : $this->app->getModuleName();
|
||||
$methodName = $methodName ? $methodName : $this->app->getMethodName();
|
||||
$fields = $this->loadModel('flow')->printFields($moduleName, $methodName, $object, $type, $extras);
|
||||
if(!$print) return $fields;
|
||||
|
||||
$picker = '';
|
||||
//$jsRoot = $this->config->webRoot . "js/";
|
||||
//$picker = file_get_contents($this->app->getBasePath() . 'app/sys/common/view/picker.html.php');
|
||||
//$picker = substr($picker, strpos($picker, '<style>'));
|
||||
|
||||
//js::import($jsRoot . 'picker/min.js');
|
||||
//css::import($jsRoot . 'picker/min.css');
|
||||
|
||||
echo $picker . $fields;
|
||||
echo $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -681,6 +681,7 @@ class upgradeModel extends model
|
||||
break;
|
||||
case 'biz7.3':
|
||||
$this->updateApproval();
|
||||
$this->addFlowActions('biz7.3');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -6880,4 +6881,41 @@ class upgradeModel extends model
|
||||
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add workflow actions.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function addFlowActions($version)
|
||||
{
|
||||
$this->loadModel('workflow');
|
||||
$this->loadModel('workflowaction');
|
||||
$upgradeLang = $this->lang->workflowaction->upgrade[$version];
|
||||
$upgradeConfig = $this->config->workflowaction->upgrade[$version];
|
||||
if(empty($upgradeLang) || empty($upgradeConfig)) return true;
|
||||
|
||||
$this->lang->workflowaction->upgrade = new stdclass();
|
||||
$this->config->workflowaction->upgrade = new stdclass();
|
||||
foreach($upgradeLang as $module => $labels)
|
||||
{
|
||||
$this->lang->workflowaction->upgrade->actions = $labels;
|
||||
foreach($upgradeConfig[$module] as $code => $config) $this->config->workflowaction->upgrade->$code = $config;
|
||||
|
||||
$flow = $this->workflow->getByModule($module);
|
||||
$this->workflow->createActions($flow, 'upgrade');
|
||||
|
||||
$this->dao->update(TABLE_WORKFLOWACTION)->set('extensionType')->eq('none')->set('role')->eq('buildin')->where('module')->eq($module)->andWhere('action')->in(array_keys($labels))->exec();
|
||||
foreach($labels as $method => $label)
|
||||
{
|
||||
$workflowAction = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)->where('module')->eq($module)->andWhere('action')->eq($method)->fetch();
|
||||
unset($workflowAction->id);
|
||||
$workflowAction->vision = $workflowAction->vision == 'lite' ? 'rnd' : 'lite';
|
||||
$this->dao->replace(TABLE_WORKFLOWACTION)->data($workflowAction)->exec();
|
||||
}
|
||||
}
|
||||
return !dao::isError();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user