* Fix code for doc.

This commit is contained in:
Yagami
2021-03-08 11:37:02 +08:00
parent e349884b8f
commit 0b5dcdba6c
24 changed files with 317 additions and 316 deletions
+7 -7
View File
@@ -32,22 +32,22 @@
</div>
<div class="panel-body">
<div class="row row-grid files-grid" data-size="300">
<?php if($type == 'product') $icon = 'icon-product text-secondary';?>
<?php if($type == 'project') $icon = 'icon-project text-green';?>
<?php if($type != 'product' and $type != 'project') $icon = 'icon-folder text-yellow';?>
<?php if($type == 'product') $icon = 'icon-product text-secondary';?>
<?php if($type == 'execution') $icon = 'icon-execution text-green';?>
<?php if($type != 'product' and $type != 'execution') $icon = 'icon-folder text-yellow';?>
<?php foreach($libs as $lib):?>
<?php $link = ($type == 'product' or $type == 'project') ? $this->createLink('doc', 'objectLibs', "type=$type&objectID=$lib->id") : $this->createLink('doc', 'browse', "libID=$lib->id");?>
<?php $link = ($type == 'product' or $type == 'execution') ? $this->createLink('doc', 'objectLibs', "type=$type&objectID=$lib->id") : $this->createLink('doc', 'browse', "libID=$lib->id");?>
<div class="col">
<a class="file" href="<?php echo $link;?>">
<i class="file-icon icon <?php echo $icon;?>"></i>
<div class="file-name"><?php echo ($type != 'product' && $type != 'project' && strpos($lib->collector, $this->app->user->account) !== false ? "<i class='icon icon-star text-yellow'></i> " : '') . $lib->name;?></div>
<?php if($type == 'product' or $type == 'project'):?>
<div class="file-name"><?php echo ($type != 'product' && $type != 'execution' && strpos($lib->collector, $this->app->user->account) !== false ? "<i class='icon icon-star text-yellow'></i> " : '') . $lib->name;?></div>
<?php if($type == 'product' or $type == 'execution'):?>
<div class="text-primary file-info"><?php echo count($subLibs[$lib->id]) . $lang->doc->item;?></div>
<?php else:?>
<div class="text-primary file-info"><?php echo $itemCounts[$lib->id] . $lang->doc->item;?></div>
<?php endif;?>
</a>
<?php if($type != 'product' and $type != 'project'):?>
<?php if($type != 'product' and $type != 'execution'):?>
<div class="actions">
<?php $star = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?>
<?php $collectTitle = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
+5 -5
View File
@@ -14,10 +14,10 @@
<table class="table table-borderless table-hover table-files table-fixed no-margin">
<thead>
<tr>
<?php if($type != 'product' and $type != 'project') $name = $lang->doclib->nameList[$type];?>
<?php if($type != 'product' and $type != 'execution') $name = $lang->doclib->nameList[$type];?>
<th class="c-name"><?php echo $lang->doc->libName;?></th>
<th class="c-num"><?php echo $lang->doc->num;?></th>
<?php if($type == 'product' or $type == 'project'):?>
<?php if($type == 'product' or $type == 'execution'):?>
<th class="c-user"><?php echo $lang->doc->addedBy;?></th>
<th class="c-datetime"><?php echo $lang->doc->addedDate;?></th>
<?php else:?>
@@ -27,17 +27,17 @@
</thead>
<tbody>
<?php foreach($libs as $lib):?>
<?php $link = ($type == 'product' or $type == 'project') ? $this->createLink('doc', 'objectLibs', "type=$type&objectID=$lib->id") : $this->createLink('doc', 'browse', "libID=$lib->id");?>
<?php $link = ($type == 'product' or $type == 'execution') ? $this->createLink('doc', 'objectLibs', "type=$type&objectID=$lib->id") : $this->createLink('doc', 'browse', "libID=$lib->id");?>
<tr>
<td class="c-name"><?php echo html::a($link, $lib->name);?></td>
<td class="c-num">
<?php if($type != 'product' and $type != 'project'):?>
<?php if($type != 'product' and $type != 'execution'):?>
<?php echo $itemCounts[$lib->id] . $lang->doc->item;?>
<?php else:?>
<?php echo count($subLibs[$lib->id]) . $lang->doc->item;?>
<?php endif;?>
</td>
<?php if($type == 'product' or $type == 'project'):?>
<?php if($type == 'product' or $type == 'execution'):?>
<td class="c-user"><?php if($lib->createdBy) echo zget($users, $lib->createdBy);?></td>
<td class="c-datetime"><?php if($lib->createdDate != '00-00-00 00:00:00') echo formatTime($lib->createdDate, 'Y-m-d');?></td>
<?php else:?>
+2 -2
View File
@@ -122,8 +122,8 @@
<?php if(!empty($attachLibs) and $browseType != 'bysearch'):?>
<?php foreach($attachLibs as $libType => $attachLib):?>
<tr>
<?php if($libType == 'project'):?>
<td class="c-name"><?php echo html::a(inlink('allLibs', "type=project&product={$currentLib->product}"), "<i class='icon icon-folder text-yellow'></i> &nbsp;" . $attachLib->name);?></td>
<?php if($libType == 'execution'):?>
<td class="c-name"><?php echo html::a(inlink('allLibs', "type=execution&product={$currentLib->product}"), "<i class='icon icon-folder text-yellow'></i> &nbsp;" . $attachLib->name);?></td>
<?php elseif($libType == 'files'):?>
<td class="c-name"><?php echo html::a(inlink('showFiles', "type=$type&objectID={$currentLib->$type}&from=$from"), "<i class='icon icon-folder text-yellow'></i> &nbsp;" . $attachLib->name);?></td>
<?php endif;?>
+2 -2
View File
@@ -87,9 +87,9 @@
<div class="col">
<?php
$browseLink = '';
if($libType == 'project')
if($libType == 'execution')
{
$browseLink = inlink('allLibs', "type=project&product={$currentLib->product}");
$browseLink = inlink('allLibs', "type=execution&product={$currentLib->product}");
}
elseif($libType == 'files')
{
+3 -3
View File
@@ -29,9 +29,9 @@
<th><?php echo $lang->doc->product?></th>
<td><?php echo html::select('product', $products, $type == 'product' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
</tr>
<tr class='project hidden'>
<th><?php echo $lang->doc->project?></th>
<td><?php echo html::select('project', $projects, $type == 'project' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
<tr class='execution hidden'>
<th><?php echo $lang->doc->execution?></th>
<td><?php echo html::select('execution', $executions, $type == 'execution' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
</tr>
<tr>
<th><?php echo $lang->doclib->name?></th>
+4 -4
View File
@@ -28,10 +28,10 @@
<td><?php echo $product->name?></td>
</tr>
<?php endif;?>
<?php if(!empty($lib->project)):?>
<?php if(!empty($lib->execution)):?>
<tr>
<th class='w-130px'><?php echo $lang->doc->project?></th>
<td><?php echo $project->name?></td>
<th class='w-130px'><?php echo $lang->doc->execution?></th>
<td><?php echo $execution->name?></td>
</tr>
<?php endif;?>
<tr>
@@ -43,7 +43,7 @@
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<?php if($lib->type == 'product' or $lib->type == 'project'):?>
<?php if($lib->type == 'product' or $lib->type == 'execution'):?>
<td>
<?php echo html::radio('acl', $lang->doclib->aclListA, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'")?>
<span class='text-info' id='noticeAcl'><?php echo $lang->doc->noticeAcl['lib'][$lib->type][$lib->acl];?></span>
+10 -10
View File
@@ -126,26 +126,26 @@
<div class="col-sm-7">
<div class="panel block-files block-sm" style="height: 290px;">
<div class="panel-heading">
<div class="panel-title"><?php echo $lang->project->undone . (common::checkNotCN() ? "{$lang->executionCommon}s" : "$lang->executionCommon");?></div>
<div class="panel-title"><?php echo $lang->execution->undone . (common::checkNotCN() ? "{$lang->executionCommon}s" : "$lang->executionCommon");?></div>
<nav class="panel-actions nav nav-default">
<li><?php echo html::a($this->createLink('doc', 'allLibs', 'type=project'), '<i class="icon icon-more icon-sm"></i>', '', "title='{$lang->more}'");?></li>
<li><?php echo html::a($this->createLink('doc', 'allLibs', 'type=execution'), '<i class="icon icon-more icon-sm"></i>', '', "title='{$lang->more}'");?></li>
</nav>
</div>
<div class="panel-body has-table">
<table class="table table-borderless table-fixed-head table-hover">
<thead>
<tr>
<th class="c-name"><?php echo $lang->project->name;?></th>
<th class="c-date"><?php echo $lang->project->begin;?></th>
<th class="c-date"><?php echo $lang->project->end;?></th>
<th class="c-name"><?php echo $lang->execution->name;?></th>
<th class="c-date"><?php echo $lang->execution->begin;?></th>
<th class="c-date"><?php echo $lang->execution->end;?></th>
</tr>
</thead>
<tbody>
<?php foreach($doingProjects as $project):?>
<tr data-url="<?php echo $this->createLink('doc', 'objectLibs', "type=project&objectID={$project->id}")?>">
<td class="c-name"><i class="icon icon-folder text-yellow"></i> <?php echo $project->name;?></td>
<td class="c-datetime"><?php echo formatTime($project->begin);?></td>
<td class="c-datetime"><?php echo formatTime($project->end);?></td>
<?php foreach($doingProjects as $execution):?>
<tr data-url="<?php echo $this->createLink('doc', 'objectLibs', "type=execution&objectID={$execution->id}")?>">
<td class="c-name"><i class="icon icon-folder text-yellow"></i> <?php echo $execution->name;?></td>
<td class="c-datetime"><?php echo formatTime($execution->begin);?></td>
<td class="c-datetime"><?php echo formatTime($execution->end);?></td>
</tr>
<?php endforeach;?>
</tbody>
+5 -5
View File
@@ -12,7 +12,7 @@
?>
<?php $pageCSS .= $this->doc->appendNavCSS();?>
<?php include '../../common/view/header.html.php';?>
<?php if($this->from == 'project'):;?>
<?php if($this->from == 'execution'):;?>
<style>.panel-body{min-height: 180px}</style>
<?php endif;?>
<div class="fade main-row <?php if($this->from == 'doc') echo 'split-row';?>" id="mainRow">
@@ -37,12 +37,12 @@
<div class='panel-body'>
<div class="row row-grid files-grid" data-size="300">
<?php foreach($libs as $libID => $lib):?>
<?php if($libID == 'project' and $from != 'doc') continue;?>
<?php if($libID == 'execution' and $from != 'doc') continue;?>
<?php if(strpos($config->doc->custom->objectLibs, 'files') === false && $libID == 'files') continue;?>
<?php if(strpos($config->doc->custom->objectLibs, 'customFiles') === false && isset($lib->main) && !$lib->main) continue;?>
<?php $libLink = inlink('browse', "libID=$libID&browseType=all&param=0&orderBy=id_desc&from=$from");?>
<?php if($libID == 'project') $libLink = inlink('allLibs', "type=project&product=$object->id");?>
<?php if($libID == 'execution') $libLink = inlink('allLibs', "type=execution&product=$object->id");?>
<?php if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$object->id&from=$from");?>
<?php $icon = 'icon-folder text-yellow';?>
@@ -51,10 +51,10 @@
<div class="col">
<a class="file" href="<?php echo $libLink;?>" data-group=<?php echo $from;?>>
<i class="file-icon icon <?php echo $icon;?>"></i>
<div class="file-name"><?php echo ($libID != 'project' && $libID != 'files' && strpos($lib->collector, $this->app->user->account) !== false ? "<i class='icon icon-star text-yellow'></i> " : '') . $lib->name;?></div>
<div class="file-name"><?php echo ($libID != 'execution' && $libID != 'files' && strpos($lib->collector, $this->app->user->account) !== false ? "<i class='icon icon-star text-yellow'></i> " : '') . $lib->name;?></div>
<div class="text-primary file-info"><?php echo $lib->allCount . $lang->doc->item;?></div>
</a>
<?php if($libID != 'project' and $libID != 'files'):?>
<?php if($libID != 'execution' and $libID != 'files'):?>
<?php $star = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?>
<?php $collectTitle = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<div class="actions">
+4 -4
View File
@@ -21,18 +21,18 @@
</thead>
<tbody>
<?php foreach($libs as $libID => $lib):?>
<?php if($libID == 'project' and $from != 'doc') continue;?>
<?php if($libID == 'execution' and $from != 'doc') continue;?>
<?php if(strpos($config->doc->custom->objectLibs, 'files') === false && $libID == 'files') continue;?>
<?php if(strpos($config->doc->custom->objectLibs, 'customFiles') === false && isset($lib->main) && !$lib->main) continue;?>
<?php $libLink = inlink('browse', "libID=$libID&browseType=all&param=0&orderBy=id_desc&from=$from");?>
<?php if($libID == 'project') $libLink = inlink('allLibs', "type=project&product=$object->id");?>
<?php if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$object->id&from=$from");?>
<?php if($libID == 'execution') $libLink = inlink('allLibs', "type=execution&product=$object->id");?>
<?php if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$object->id&from=$from");?>
<tr>
<td class="c-name"><?php echo html::a($libLink, $lib->name);?></td>
<td class="c-num"><?php echo $lib->allCount . $lang->doc->item;?></td>
<td class="c-actions">
<?php if($canBeChanged and $libID != 'project' and $libID != 'files'):?>
<?php if($canBeChanged and $libID != 'execution' and $libID != 'files'):?>
<?php $star = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?>
<?php $collectTitle = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<?php if(common::hasPriv('doc', 'collect')):?>
+2 -2
View File
@@ -72,7 +72,7 @@
<td class="text-center"><?php echo sprintf('%03d', $file->id);?></td>
<td class="c-url">
<?php
if($type == 'project' && in_array($file->objectType, array('task', 'build')))
if($type == 'execution' && in_array($file->objectType, array('task', 'build')))
{
$objectLink = $this->createLink($file->objectType, 'view', "objectID=$file->objectID", '', '', $file->PRJ);
}
@@ -149,7 +149,7 @@
?>
</a>
<?php
if($type == 'project' && in_array($file->objectType, array('task', 'build')))
if($type == 'execution' && in_array($file->objectType, array('task', 'build')))
{
$objectLink = $this->createLink($file->objectType, 'view', "objectID=$file->objectID", '', '', $file->PRJ);
}
+9 -9
View File
@@ -4,8 +4,8 @@ foreach($lang->doclib->tabList as $libType => $typeName) $sideLibs[$libType] = $
$allModules = $this->loadModel('tree')->getDocStructure();
$sideSubLibs = array();
$sideSubLibs['product'] = $this->doc->getSubLibGroups('product', array_keys($sideLibs['product']));
$sideSubLibs['project'] = $this->doc->getSubLibGroups('project', array_keys($sideLibs['project']));
$sideSubLibs['product'] = $this->doc->getSubLibGroups('product', array_keys($sideLibs['product']));
$sideSubLibs['execution'] = $this->doc->getSubLibGroups('execution', array_keys($sideLibs['execution']));
if($this->methodName != 'browse')
{
$browseType = '';
@@ -32,7 +32,7 @@ $sideWidth = common::checkNotCN() ? '270' : '238';
<?php if(empty($sideLibs[$tabValue])):?>
<li>
<?php
if($lang->navGroup->doc == 'doc' and $tabValue == 'project')
if($lang->navGroup->doc == 'doc' and $tabValue == 'execution')
{
echo $lang->noData;
}
@@ -71,10 +71,10 @@ $sideWidth = common::checkNotCN() ? '270' : '238';
<ul>
<?php foreach($sideSubLibs[$tabValue][$tabMenuID] as $subLibID => $subLibName):?>
<?php
if($subLibID == 'project')
if($subLibID == 'execution')
{
$subLibLink = inlink('allLibs', "type=project&product=$tabMenuID");
$activeClass = ($this->methodName == 'alllibs' && $type == 'project' && $$tabValue == $tabMenuID) ? "class='active'" : '';
$subLibLink = inlink('allLibs', "type=execution&product=$tabMenuID");
$activeClass = ($this->methodName == 'alllibs' && $type == 'execution' && $$tabValue == $tabMenuID) ? "class='active'" : '';
$icon = 'icon-stack';
}
elseif($subLibID == 'files')
@@ -173,7 +173,7 @@ $sideWidth = common::checkNotCN() ? '270' : '238';
<?php
if(common::hasPriv('doc', 'sort'))
{
echo html::a('###', "<i class='icon-sort'></i> {$lang->doc->orderLib}", '', "id='orderLib' class='text-secondary small " . (($type != 'product' and $type !='project') ? '' : 'hidden') . "' style='padding-left:5px;'");
echo html::a('###', "<i class='icon-sort'></i> {$lang->doc->orderLib}", '', "id='orderLib' class='text-secondary small " . (($type != 'product' and $type !='execution') ? '' : 'hidden') . "' style='padding-left:5px;'");
echo html::a('javascript:saveOrder()', "<i class='icon-checked'></i> {$lang->save}", '', "id='saveOrder' class='text-secondary small hidden' style='padding-left:10px;'");
}
?>
@@ -217,13 +217,13 @@ $(function()
$tabs.find('.tab-content .tab-pane#' + type).addClass('active');
}
$.cookie('docSideType', '');
$('#mainRow .side-col .side-footer #orderLib').toggleClass('hidden', (type == 'product' || type == 'project'));
$('#mainRow .side-col .side-footer #orderLib').toggleClass('hidden', (type == 'product' || type == 'execution'));
}
$('#mainRow .side-col .tabs .nav-tabs li a').click(function()
{
var href = $(this).attr('href');
var canOrder = !(href.indexOf('product') > 0 || href.indexOf('project') > 0);
var canOrder = !(href.indexOf('product') > 0 || href.indexOf('execution') > 0);
if(!canOrder)
{
$(this).closest('.side-col').find('.side-footer #orderLib').addClass('hidden');
+3 -3
View File
@@ -187,10 +187,10 @@ js::set('docID', $doc->id);
<td><?php echo $doc->productName;?></td>
</tr>
<?php endif;?>
<?php if($doc->projectName):?>
<?php if($doc->executionName):?>
<tr>
<th class='w-80px'><?php echo $lang->doc->project;?></th>
<td><?php echo $doc->projectName;?></td>
<th class='w-80px'><?php echo $lang->doc->execution;?></th>
<td><?php echo $doc->executionName;?></td>
</tr>
<?php endif;?>
<tr>