* code for task #48560.

This commit is contained in:
王怡栋
2022-02-08 11:26:13 +08:00
parent 41f254686a
commit af13e0610b
12 changed files with 201 additions and 0 deletions
+3
View File
@@ -16,3 +16,6 @@ ALTER TABLE `zt_block` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `ac
ALTER TABLE `zt_block` DROP INDEX `account_module_type_order`, ADD UNIQUE `account_vision_module_type_order` (`account`, `vision`, `module`, `type`, `order`);
ALTER TABLE `zt_effort` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `id`;
ALTER TABLE `zt_story` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `id`;
ALTER TABLE `zt_workflow` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `status`;
ALTER TABLE `zt_workflowdatasource` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `buildin`;
@@ -21,6 +21,7 @@ if($config->edition != 'open')
$lang->navIcons['oa'] = "<i class='icon icon-oa'></i>";
$lang->mainNav->feedback = $lang->navIcons['feedback'] . '反馈|feedback|browse|';
$lang->mainNav->oa = $lang->navIcons['oa'] . '办公|attend|personal|';
$lang->mainNav->workflow = $lang->navIcons['workflow'] . '工作流|workflow|browseFlow|';
}
/* Menu order. */
@@ -35,6 +36,7 @@ if($config->edition != 'open')
{
$lang->mainNav->menuOrder[21] = 'oa';
$lang->mainNav->menuOrder[25] = 'feedback';
$lang->mainNav->menuOrder[60] = 'workflow';
$lang->dividerMenu = ',oa,admin,';
}
else
@@ -0,0 +1,28 @@
<?php
$class = $currentApp ? '' : "class='active'";
$method = 'browseFlow';
$featurabar = "<div id='featurebar'><ul class='nav'>";
$featurabar .= "<li $class>" . html::a(inlink($method, "status=&app=&orderBy=$orderBy"), $lang->workflow->all) . '</li>';
$flowApps = $this->workflow->getFlowApps();
foreach($flowApps as $appCode)
{
$appName = zget($apps, $appCode, '');
if($appCode == 'project') $appName = $lang->project->common;
if($appCode == 'scrum') continue;
if(!$appName) continue;
$class = $appCode == $currentApp ? "class='active'" : '';
$featurabar .= "<li $class>" . html::a(inlink($method, "status=&app=$appCode&orderBy=$orderBy"), $appName) . '</li>';
}
$featurabar .= "</ul></div>";
?>
<script>
$(function()
{
if($('#featurebar').length == 0) $('#main .container').prepend(<?php echo json_encode($featurabar);?>);
$('a[disabled=disabled]').addClass('disabled');
$('.deleter').attr('data-toggle', 'ajax');
});
</script>
@@ -0,0 +1,27 @@
<style>
.col-md-5 .main-table td.actions .btn{
display: inline-block;
width: 26px;
padding: 2px;
overflow: hidden;
line-height: 20px;
color: #16a8f8;
background: 0 0;
border-color: transparent;
}
</style>
<script>
$(function()
{
$('tr.data-url').removeAttr('data-url');
var html = $('.col-md-5 .main-table td.actions a.fields:first').html();
$('.col-md-5 .main-table td.actions a.fields').attr('title', html).addClass('btn').html("<i class='icon icon-fields'></i>");
var html = $('.col-md-5 .main-table td.actions a.edit:first').html();
$('.col-md-5 .main-table td.actions a.edit').attr('title', html).addClass('btn').html("<i class='icon icon-edit'></i>");
var html = $('.col-md-5 .main-table td.actions a.deleter:first').html();
$('.col-md-5 .main-table td.actions a.deleter').attr('title', html).addClass('btn').html("<i class='icon icon-trash'></i>");
$('.col-md-5 .main-table tr').removeAttr('data-url');
})
</script>
@@ -0,0 +1,31 @@
<?php if($source->type == 'flow'):?>
<?php
$select = html::select('navigator', $lang->workflow->navigators, '', "class='form-control'");
$navigator = <<<EOT
<tr>
<th class='w-80px'>{$lang->workflow->navigator}</th>
<td>{$select}</td>
<td class='w-40px'></td>
</tr>
EOT;
?>
<script>
$('#app').parents('tr').before(<?php echo json_encode($navigator);?>).hide();
$('div.required.required-wrapper').remove();
setRequiredFields();
$('#navigator').change(function()
{
if($(this).val() == 'primary')
{
$('#app').parents('tr').hide();
$('select#positionModule').load(createLink('workflow', 'ajaxGetApps'));
}
if($(this).val() == 'secondary')
{
$('#app').parents('tr').show();
$('select#positionModule').load(createLink('workflow', 'ajaxGetAppMenus', 'app=' + $('#app').val() + '&exclude=<?php echo $source->module;?>'));
}
});
</script>
<?php endif;?>
@@ -0,0 +1,3 @@
<script>
$('#submit').after('<input type="hidden" name="vision" id="vision" value="<?php echo $this->config->vision;?>">');
</script>
@@ -0,0 +1,40 @@
<?php if($flow->type == 'flow'):?>
<?php
$select = html::select('navigator', $lang->workflow->navigators, $flow->navigator, "class='form-control'");
$navigator = <<<EOT
<tr>
<th class='w-80px'>{$lang->workflow->navigator}</th>
<td>{$select}</td>
<td class='w-40px'></td>
</tr>
EOT;
?>
<script>
$('#app').parents('tr').before(<?php echo json_encode($navigator);?>);
$('div.required.required-wrapper').remove();
setRequiredFields();
$('#navigator').change(function()
{
var app = '<?php echo $flow->app;?>';
var position = '<?php echo $flow->positionModule;?>';
var link = createLink('workflow', 'ajaxGetApps', 'exclude=<?php echo $flow->module;?>');
if($(this).val() == 'primary') $('#app').parents('tr').hide();
if($(this).val() == 'secondary')
{
$('#app').parents('tr').show();
$('#app').load(link, function()
{
$(this).val(app).trigger('chosen:updated');
});
link = createLink('workflow', 'ajaxGetAppMenus', 'app=' + $('#app').val() + '&exclude=' + currentModule);
}
$('select#positionModule').load(link, function()
{
$(this).val(position);
});
});
$('#navigator').change();
</script>
<?php endif;?>
@@ -0,0 +1,3 @@
<script>
if(typeof(readonlyActions) == 'undefined') readonlyActions = '';
</script>
@@ -0,0 +1,52 @@
<?php if(isset($flow) and $flow->type == 'flow'):?>
<?php
$select = html::select('navigator', $lang->workflow->navigators, $flow->navigator, "class='form-control'");
$navigator = <<<EOT
<tr>
<th class='w-80px'>{$lang->workflow->navigator}</th>
<td>{$select}</td>
<td class='w-40px'></td>
</tr>
EOT;
?>
<?php
js::set('positionModule', $flow->positionModule);
js::set('position', $flow->position);
js::set('app', $flow->app);
?>
<script>
$('#app').parents('tr').before(<?php echo json_encode($navigator);?>).hide();
$('div.required.required-wrapper').remove();
var $inputGroup = $('#app').closest('.input-group');
$inputGroup.find('#name').remove();
$inputGroup.find('#code').remove();
$inputGroup.find('.input-group-addon').remove();
setRequiredFields();
$('#navigator').change(function()
{
if($(this).val() == 'primary')
{
$('#app').parents('tr').hide();
$('select#positionModule').load(createLink('workflow', 'ajaxGetApps'), function()
{
$('#positionModule').val(positionModule);
$('#position').val(position);
});
}
if($(this).val() == 'secondary')
{
$('#app').parents('tr').show();
$('select#positionModule').load(createLink('workflow', 'ajaxGetAppMenus', 'app=' + $('#app').val() + '&exclude=<?php echo $flow->module;?>'), function()
{
$('#app').val(app);
$('#positionModule').val(positionModule);
$('#position').val(position);
});
}
});
$('#navigator').change();
</script>
<?php endif;?>
@@ -0,0 +1 @@
<?php include dirname(dirname(dirname(dirname(__FILE__)))) . '/workflowfield/ext/view/setexport.flow.html.hook.php';?>
@@ -0,0 +1 @@
<?php include dirname(dirname(dirname(dirname(__FILE__)))) . '/workflowfield/ext/view/setexport.flow.html.hook.php';?>
@@ -0,0 +1,10 @@
<script>
if(typeof(fieldDefaultOptions) == 'undefined') fieldDefaultOptions = '';
$(function()
{
$('a.btn[href="#confirmReleaseModal"]').click(function()
{
saveFields(function(result){});
})
})
</script>