Merge branch 'tsj_fixbug' into 'master'
* Fix bug. See merge request easycorp/zentaopms!7304
This commit is contained in:
@@ -431,7 +431,7 @@ class api extends control
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->users = $this->user->getPairs('nocode|noclosed');
|
||||
$this->view->projects = $this->loadModel('project')->getPairsByModel();
|
||||
$this->view->projects = $this->loadModel('project')->getPairsByModel('scrum,waterfall,agileplus,waterfallplus');
|
||||
$this->view->products = $this->loadModel('product')->getPairs();
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
.no-content-button {text-align: center; padding-top: 20px;}
|
||||
.no-content-button a:nth-child(2) {margin-left: 20px;}
|
||||
|
||||
.cell .detail .detail-title {padding-left: 5px; list-style: none;}
|
||||
.apiList .detail .detail-title {padding-left: 5px; list-style: none;}
|
||||
.menu-actions {position: absolute; top: 7px; right: 45px; padding: 7px 8px;}
|
||||
.detail ul {position: relative;}
|
||||
.tail-info {position: absolute; right: 0; padding-left: 10px; padding-top: 1px;}
|
||||
@@ -46,7 +46,7 @@ span.dotted-line+a {display: block;}
|
||||
.is-sorting > li > .tree-group {opacity: 1; border-radius: 4px;}
|
||||
.is-sorting > li ul {display: none!important;}
|
||||
li.drag-shadow ul {display: none!important;}
|
||||
.cell {height: 100%;}
|
||||
.apiList {height: 100%;}
|
||||
|
||||
#queryBox #groupAndOr {min-width: 60px;}
|
||||
.tree li>.list-toggle {left: -4px;}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<?php include './content.html.php';?>
|
||||
<?php else:?>
|
||||
<?php if(empty($libs) || empty($apiList)):?>
|
||||
<div class="cell">
|
||||
<div class="cell apiList">
|
||||
<div class="detail">
|
||||
<li class="detail-title"><?php echo intval($libID) > 0 ? $lang->api->apiList : $lang->api->pageTitle;?></li>
|
||||
</div>
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
<span><?php echo html::radio('libType', $lang->api->libTypeList, $type, "onchange='toggleLibType(this.value)'")?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='productBox'>
|
||||
<tr id='productBox' class="<?php if($type != 'product') echo 'hidden';?>">
|
||||
<th><?php echo $lang->api->product;?></th>
|
||||
<td class='required'>
|
||||
<span><?php echo html::select('product', $products, $objectID, "class='form-control chosen'")?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='projectBox' class='hidden'>
|
||||
<tr id='projectBox' class="<?php if($type != 'project') echo 'hidden';?>">
|
||||
<th><?php echo $lang->api->project;?></th>
|
||||
<td class='required'>
|
||||
<span><?php echo html::select('project', $projects, $objectID, "class='form-control chosen'")?></span>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<span><?php echo html::radio('acl', $lang->api->aclList, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'", 'block')?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='<?php echo $lib->acl != 'open' ? '' : 'hidden';?>'>
|
||||
<tr id='whiteListBox' class='<?php echo $lib->acl == 'private' ? '' : 'hidden';?>'>
|
||||
<th><?php echo $lang->api->whiteList;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
|
||||
@@ -151,7 +151,7 @@ class doc extends control
|
||||
if($type == 'product') $objects = $this->product->getPairs();
|
||||
if($type == 'project')
|
||||
{
|
||||
$objects = $this->project->getPairsByProgram();
|
||||
$objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban');
|
||||
if($this->app->tab == 'doc')
|
||||
{
|
||||
$this->view->executionPairs = array(0 => '') + $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
|
||||
@@ -391,13 +391,13 @@ class doc extends control
|
||||
$objects = array();
|
||||
if($objectType == 'project')
|
||||
{
|
||||
$objects = $this->loadModel('project')->getPairs();
|
||||
$this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
|
||||
$objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban');
|
||||
$this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'sprint,stage', 'multiple,leaf,noprefix');
|
||||
}
|
||||
elseif($objectType == 'execution')
|
||||
{
|
||||
$execution = $this->loadModel('execution')->getById($objectID);
|
||||
$objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix");
|
||||
$objects = $this->execution->getPairs($execution->project, 'sprint,stage', "multiple,leaf,noprefix");
|
||||
}
|
||||
elseif($objectType == 'product')
|
||||
{
|
||||
@@ -552,7 +552,7 @@ class doc extends control
|
||||
$objects = array();
|
||||
if($objectType == 'project')
|
||||
{
|
||||
$objects = $this->loadModel('project')->getPairs();
|
||||
$objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban');
|
||||
}
|
||||
elseif($objectType == 'execution')
|
||||
{
|
||||
@@ -1494,7 +1494,7 @@ class doc extends control
|
||||
public function ajaxGetExecution($projectID)
|
||||
{
|
||||
$executions = $this->execution->getList($projectID);
|
||||
$executionPairs = array(0 => '') + $this->execution->getPairs($projectID, 'all', 'multiple,leaf,noprefix');
|
||||
$executionPairs = array(0 => '') + $this->execution->getPairs($projectID, 'sprint,stage', 'multiple,leaf,noprefix');
|
||||
|
||||
$project = $this->project->getById($projectID);
|
||||
$disabled = $project->multiple ? '' : 'disabled';
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
$lang->doclib = new stdclass();
|
||||
$lang->doclib->name = 'Name';
|
||||
$lang->doclib->control = 'Zugriffskontrolle';
|
||||
$lang->doclib->control = 'Zugang';
|
||||
$lang->doclib->group = 'Gruppe';
|
||||
$lang->doclib->user = 'Benutzer';
|
||||
$lang->doclib->files = 'Dateien';
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
$lang->doclib = new stdclass();
|
||||
$lang->doclib->name = 'Nom';
|
||||
$lang->doclib->control = "Contrôle d'Accès";
|
||||
$lang->doclib->control = 'Droit';
|
||||
$lang->doclib->group = 'Groupe';
|
||||
$lang->doclib->user = 'Utilisateur';
|
||||
$lang->doclib->files = 'Pièces Jointes';
|
||||
|
||||
@@ -986,8 +986,8 @@ class docModel extends model
|
||||
$this->config->doc->search['module'] = 'contributeDoc';
|
||||
$products = $this->product->getPairs();
|
||||
|
||||
$this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram() + array('all' => $this->lang->doc->allProjects);
|
||||
$this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
|
||||
$this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram('', 'all', false, 'order_asc', 'kanban') + array('all' => $this->lang->doc->allProjects);
|
||||
$this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
|
||||
$this->config->doc->search['params']['lib']['values'] = array('' => '') + $this->loadModel('doc')->getLibs('all', 'withObject') + array('all' => $this->lang->doclib->all);
|
||||
$this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct);
|
||||
|
||||
@@ -1008,7 +1008,7 @@ class docModel extends model
|
||||
|
||||
if($type == 'project')
|
||||
{
|
||||
$this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
|
||||
$this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1024,7 +1024,7 @@ class docModel extends model
|
||||
else
|
||||
{
|
||||
$products = $this->product->getPairs('nocode', $this->session->project);
|
||||
$this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
|
||||
$this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions);
|
||||
$this->config->doc->search['params']['lib']['values'] = array('' => '', $libID => ($libID ? $libs[$libID] : 0), 'all' => $this->lang->doclib->all);
|
||||
$this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct);
|
||||
}
|
||||
@@ -1587,6 +1587,7 @@ class docModel extends model
|
||||
->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id')
|
||||
->where("CONCAT(',', t2.users, ',')")->like("%,{$this->app->user->account},%")
|
||||
->andWhere('t1.vision')->eq($this->config->vision)
|
||||
->andWhere('t1.model')->ne('kanban')
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
|
||||
->fetchPairs();
|
||||
@@ -1596,6 +1597,7 @@ class docModel extends model
|
||||
->where('type')->eq('project')
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('model')->ne('kanban')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
|
||||
->orderBy('order_asc')
|
||||
->fetchAll('id');
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->keywords;?></th>
|
||||
<td colspan='3' class='<?php if(strpos($config->doc->edit->requiredFields, 'keywords') !== false) echo 'required'?>'><?php echo html::input('keywords', '', "id='modalKeywords' class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
|
||||
<td colspan='3' class='<?php if(strpos($config->doc->create->requiredFields, 'keywords') !== false) echo 'required'?>'><?php echo html::input('keywords', '', "id='modalKeywords' class='form-control' placeholder='{$lang->doc->keywordsTips}'");?></td>
|
||||
</tr>
|
||||
<tr id='fileBox'>
|
||||
<th><?php echo $lang->doc->files;?></th>
|
||||
|
||||
@@ -369,8 +369,7 @@ $(function()
|
||||
*/
|
||||
function lcatePage(libID, moduleID, type)
|
||||
{
|
||||
|
||||
linkParams = linkParams.replace('%s', '&libID=' + libID + '&moduleID=' + moduleID);
|
||||
linkParams = linkParams.replace('%s', 'libID=' + libID + '&moduleID=' + moduleID);
|
||||
var methodName = '';
|
||||
if(config.currentModule == 'api')
|
||||
{
|
||||
@@ -384,11 +383,10 @@ $(function()
|
||||
}
|
||||
else
|
||||
{
|
||||
methodName = objectType == 'custom' ? 'tableContents' : objectType + 'Space';
|
||||
linkParams = objectType == 'custom' ? 'type=custom&' + linkParams : linkParams;
|
||||
methodName = objectType == 'execution' || objectType == 'custom' ? 'tableContents' : objectType + 'Space';
|
||||
linkParams = objectType == 'execution' || objectType == 'custom' ? 'type=' + objectType + '&' + linkParams : linkParams;
|
||||
}
|
||||
|
||||
|
||||
location.href = createLink(config.currentModule, methodName, linkParams);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<?php js::set('docLang', $lang->doc);?>
|
||||
<?php js::set('libType', 'annex');?>
|
||||
<?php js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));?>
|
||||
<?php js::set('linkParams', "objectID=$objectID&%s");?>
|
||||
<?php js::set('type', $type);?>
|
||||
<?php js::set('tab', $this->app->tab);?>
|
||||
<?php js::set('searchLink', helper::createLink('doc', 'showFiles', "type=$type&objectID=$objectID&viewType=$viewType&orderBy=id_desc&recTotal=0&recPerPage=20&pageID=1&searchTitle=%s"));?>
|
||||
@@ -69,10 +70,14 @@
|
||||
<?php foreach($files as $file):?>
|
||||
<?php if(empty($file->pathname)) continue;?>
|
||||
<tr>
|
||||
<?php
|
||||
$imageSize = $this->file->getImageSize($file);
|
||||
$imageWidth = isset($imageSize[0]) ? $imageSize[0] : 0;
|
||||
?>
|
||||
<td><?php echo sprintf('%03d', $file->id);?></td>
|
||||
<td class='c-name' title='<?php echo str_replace('.' . $file->extension, '', $file->title);?>'>
|
||||
<?php if(in_array($file->extension, $config->file->imageExtensions)):?>
|
||||
<div style='display: inline-block'><img onload='setImageSize(this, 19)' src='<?php echo $file->webPath;?>'/></div>
|
||||
<div style='display: inline-block'><img onload='setImageSize(this, 19)' src='<?php echo $file->webPath;?>' data-extension="<?php echo $file->extension;?>" data-id="<?php echo $file->id;?>" data-width="<?php echo $imageWidth;?>"/></div>
|
||||
<?php else:?>
|
||||
<?php echo $fileIcon[$file->id];?>
|
||||
<?php endif;?>
|
||||
@@ -233,5 +238,33 @@ function downloadFile(fileID, extension, imageWidth)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the max with of image.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setImageSize(image, maxWidth, maxHeight)
|
||||
{
|
||||
var $image = $(image);
|
||||
if($image.parent().prop('tagName').toLowerCase() == 'a') return;
|
||||
|
||||
/* If not set maxWidth, set it auto. */
|
||||
if(!maxWidth)
|
||||
{
|
||||
bodyWidth = $('body').width();
|
||||
maxWidth = bodyWidth - 470; // The side bar's width is 336, and add some margins.
|
||||
}
|
||||
if(!maxHeight) maxHeight = $(top.window).height();
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
maxHeightStyle = $image.height() > 0 ? 'max-height:' + maxHeight + 'px' : '';
|
||||
if(!document.getElementsByClassName('xxc-embed').length && $image.width() > 0 && $image.width() > maxWidth) $image.attr('width', maxWidth);
|
||||
$image.wrap('<a href="javascript:;" style="display:inline-block;position:relative;overflow:hidden;' + maxHeightStyle + '" onclick="return downloadFile(' + $image.attr('data-id') + ",'" + $image.attr('data-extension') + "', " + $image.attr('data-width') + ')"></a>');
|
||||
if($image.height() > 0 && $image.height() > maxHeight) $image.closest('a').append("<a href='###' class='showMoreImage' onclick='showMoreImage(this)'>" + lang.expand + " <i class='icon-angle-down'></i></a>");
|
||||
}, 50);
|
||||
}
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('treeData', $libTree);?>
|
||||
<?php js::set('linkParams', "objectID=$objectID%s&browseType=&orderBy=$orderBy");?>
|
||||
<?php js::set('linkParams', "objectID=$objectID&%s&browseType=&orderBy=$orderBy");?>
|
||||
<?php js::set('docLang', $lang->doc);?>
|
||||
<?php js::set('libType', $libType);?>
|
||||
<?php js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));?>
|
||||
|
||||
@@ -1638,7 +1638,7 @@ class executionModel extends model
|
||||
->beginIF(strpos($mode, 'multiple') !== false)->andWhere('multiple')->eq('1')->fi()
|
||||
->beginIF($type == 'all')->andWhere('type')->in('stage,sprint,kanban')->fi()
|
||||
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
|
||||
->beginIF($type != 'all')->andWhere('type')->eq($type)->fi()
|
||||
->beginIF($type != 'all')->andWhere('type')->in($type)->fi()
|
||||
->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi()
|
||||
->beginIF(!$this->app->user->admin and strpos($mode, 'all') === false)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->orderBy($orderBy)
|
||||
|
||||
@@ -1837,6 +1837,13 @@ class treeModel extends model
|
||||
$repeatName = $this->checkUnique($self, array("id{$self->id}" => $module->name), array("id{$self->id}" => $module->branch));
|
||||
if($repeatName) helper::end(js::alert(sprintf($this->lang->tree->repeatName, $repeatName)));
|
||||
|
||||
if((empty($module->root) or empty($module->name)) and in_array($self->type, array('doc', 'api')))
|
||||
{
|
||||
$this->app->loadLang('doc');
|
||||
if(empty($module->root)) helper::end(js::alert(sprintf($this->lang->error->notempty, $this->lang->doc->lib)));
|
||||
if(empty($module->name)) helper::end(js::alert(sprintf($this->lang->error->notempty, $this->lang->doc->catalogName)));
|
||||
}
|
||||
|
||||
$modules = $self->type == 'story' ? $this->getOptionMenu($self->root, 'story', 0, 'all') : '';
|
||||
|
||||
$parent = $this->getById($this->post->parent);
|
||||
|
||||
@@ -23,7 +23,12 @@ if(isset($pageCSS)) css::internal($pageCSS);
|
||||
<strong>
|
||||
<?php
|
||||
$lblEditTree = $lang->tree->edit;
|
||||
if($type == 'doc' or $type == 'api') $lblEditTree = $lang->tree->editDir;
|
||||
$required = '';
|
||||
if($type == 'doc' or $type == 'api')
|
||||
{
|
||||
$lblEditTree = $lang->tree->editDir;
|
||||
$required = 'root,name';
|
||||
}
|
||||
if($type == 'line') $lblEditTree = $lang->tree->manageLine;
|
||||
echo $lblEditTree;
|
||||
?>
|
||||
@@ -52,7 +57,7 @@ if(isset($pageCSS)) css::internal($pageCSS);
|
||||
<?php if($type == 'doc'):?>
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->doc->lib;?></th>
|
||||
<td><?php echo html::select('root', $libs, $module->root, "class='form-control chosen'");?></td>
|
||||
<td class="<?php if(strpos($required, 'root') !== false) echo 'required';?>"><?php echo html::select('root', $libs, $module->root, "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($module->type != 'line'):?>
|
||||
@@ -74,7 +79,7 @@ if(isset($pageCSS)) css::internal($pageCSS);
|
||||
echo $lblTreeName;
|
||||
?>
|
||||
</th>
|
||||
<td><?php echo html::input('name', $module->name, "class='form-control'");?></td>
|
||||
<td class="<?php if(strpos($required, 'name') !== false) echo 'required';?>"><?php echo html::input('name', $module->name, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<?php if($type == 'bug'):?>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user