+ Add objectID param in doc module.

This commit is contained in:
zhujinyong
2021-03-23 17:43:04 +08:00
parent a5dada4578
commit 21a11d8d09
10 changed files with 90 additions and 81 deletions
+3 -12
View File
@@ -851,23 +851,15 @@ class doc extends control
*/
public function objectLibs($type, $objectID)
{
$from = $this->app->openApp;
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', false, true);
// setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->session->set('docList', $this->app->getURI(true));
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
if(empty($object)) $this->locate($this->createLink($type, 'create', '', '', '', $this->session->project));
$from = $this->app->openApp;
if($from == 'execution')
{
$this->execution->setMenu($objectID);
}
else
{
$this->loadModel($from)->setMenu($objectID);
}
$openApp = $this->app->openApp;
if($openApp != 'doc') $this->loadModel($openApp)->setMenu($objectID);
/* Set Custom. */
foreach(explode(',', $this->config->doc->customObjectLibs) as $libType) $customObjectLibs[$libType] = $this->lang->doc->customObjectLibs[$libType];
@@ -883,7 +875,6 @@ class doc extends control
$this->view->type = $type;
$this->view->object = $object;
$this->view->from = $from;
$this->view->libs = $this->doc->getLibsByObject($type, $objectID);
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
$this->display();
+8 -8
View File
@@ -12,10 +12,10 @@
?>
<?php $pageCSS .= $this->doc->appendNavCSS();?>
<?php include '../../common/view/header.html.php';?>
<?php if($this->from == 'execution'):;?>
<?php if($app->openApp == '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">
<div class="fade main-row <?php if($app->openApp == 'doc') echo 'split-row';?>" id="mainRow">
<?php if($this->from == 'doc'):?>
<?php include './side.html.php';?>
<?php endif;?>
@@ -27,7 +27,7 @@
<div class="panel block-files block-sm no-margin">
<div class="panel-heading">
<div class="panel-title font-normal">
<i class="icon icon-folder-open-o text-muted"></i> <?php echo $this->from == 'doc' ? $object->name : $object->name . $lang->doc->common;?>
<i class="icon icon-folder-open-o text-muted"></i> <?php echo $app->openApp == 'doc' ? $object->name : $object->name . $lang->doc->common;?>
<div class="btn-group pull-right">
<?php echo html::a('javascript:setBrowseType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title='{$lang->doc->browseTypeList['grid']}' class='btn btn-icon text-primary'");?>
<?php echo html::a('javascript:setBrowseType("bylist")', "<i class='icon icon-bars'></i>", '', "title='{$lang->doc->browseTypeList['list']}' class='btn btn-icon'");?>
@@ -37,19 +37,19 @@
<div class='panel-body'>
<div class="row row-grid files-grid" data-size="300">
<?php foreach($libs as $libID => $lib):?>
<?php if($libID == 'execution' and $from != 'doc') continue;?>
<?php if($libID == 'execution' and $app->openApp != '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 $libLink = inlink('browse', "libID=$libID&browseType=all&param=0&orderBy=id_desc");?>
<?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 if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$object->id");?>
<?php $icon = 'icon-folder text-yellow';?>
<?php if($libID == 'files') $icon = 'icon-paper-clip text-brown';?>
<div class="col">
<a class="file" href="<?php echo $libLink;?>" data-group=<?php echo $from;?>>
<a class="file" href="<?php echo $libLink;?>">
<i class="file-icon icon <?php echo $icon;?>"></i>
<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>
@@ -64,7 +64,7 @@
<?php endif;?>
<?php common::printLink('doc', 'editLib', "libID=$libID", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn btn-link iframe'")?>
<?php if(empty($lib->main)) common::printLink('doc', 'deleteLib', "libID=$libID", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?>
<?php common::printLink('tree', 'browse', "rootID=$libID&viewType=doc&currentModuleID=0&branch=0&from=$from", "<i class='icon icon-cog'></i>", '', "title='{$lang->doc->manageType}' class='btn btn-link'")?>
<?php common::printLink('tree', 'browse', "rootID=$libID&viewType=doc&currentModuleID=0&branch=0", "<i class='icon icon-cog'></i>", '', "title='{$lang->doc->manageType}' class='btn btn-link'")?>
<?php endif;?>
</div>
<?php endif;?>
+1 -1
View File
@@ -5,7 +5,7 @@
<thead>
<tr>
<th class='table-nest-title'>
<a class='table-nest-toggle table-nest-toggle-global' data-expand-text='<?php echo $lang->expand; ?>' data-collapse-text='<?php echo $lang->collapse; ?>'></a>
<a class='table-nest-toggle table-nest-toggle-global' data-expand-text='<?php echo $lang->expand; ?>' data-collapse-text='<?php echo $lang->collapse;?>'></a>
<?php echo $lang->program->name;?>
</th>
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->program->PM);?></th>
+55 -36
View File
@@ -20,6 +20,8 @@ class repo extends control
{
parent::__construct();
$this->scm = $this->app->loadClass('scm');
$disFuncs = str_replace(' ', '', ini_get('disable_functions'));
if(stripos(",$disFuncs,", ',exec,') !== false or stripos(",$disFuncs,", ',shell_exec,') !== false)
{
@@ -34,16 +36,15 @@ class repo extends control
/**
* Common actions.
*
* @param int $objectID projectID|executionID
* @param int $repoID
* @param int $objectID projectID|executionID
* @access public
* @return void
*/
public function commonAction($objectID, $repoID = 0)
public function commonAction($repoID = 0, $objectID = 0)
{
$openApp = $this->app->openApp;
$this->repos = $this->repo->getRepoPairs($openApp, $objectID);
$this->scm = $this->app->loadClass('scm');
if($openApp == 'project')
{
@@ -64,6 +65,7 @@ class repo extends control
/**
* List all repo.
*
* @param int $objectID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -71,10 +73,8 @@ class repo extends control
* @access public
* @return void
*/
public function maintain($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function maintain($objectID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$repoID = $this->session->repoID;
$this->commonAction($repoID);
$this->lang->switcherMenu = '';
if(common::hasPriv('repo', 'create')) $this->lang->TRActions = html::a(helper::createLink('repo', 'create'), "<i class='icon icon-plus'></i> " . $this->lang->repo->create, '', "class='btn btn-primary'");
@@ -90,11 +90,11 @@ class repo extends control
$this->view->position[] = $this->lang->repo->common;
$this->view->position[] = $this->lang->repo->browse;
$this->view->repoID = $repoID;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->repoList = empty($repoList) ? $repoList: $repoList[$pageID - 1];;
$this->view->products = $this->loadModel('product')->getPairs();
$this->view->orderBy = $orderBy;
$this->view->objectID = $objectID;
$this->view->pager = $pager;
$this->view->repoList = empty($repoList) ? $repoList: $repoList[$pageID - 1];;
$this->view->products = $this->loadModel('product')->getPairs();
$this->display();
}
@@ -106,7 +106,7 @@ class repo extends control
* @access public
* @return void
*/
public function create($objectID)
public function create($objectID = 0)
{
if($_POST)
{
@@ -114,11 +114,11 @@ class repo extends control
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$link = $this->repo->createLink('showSyncCommit', "repoID=$repoID", '', false, $this->projectID);
$link = $this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID", '', false);
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->commonAction($objectID);
$this->commonAction(0, $objectID);
$this->app->loadLang('action');
$this->repo->setMenu($this->repos, '', false);
@@ -136,11 +136,14 @@ class repo extends control
* Edit a repo.
*
* @param int $repoID
* @param int $objectID
* @access public
* @return void
*/
public function edit($repoID)
public function edit($repoID, $objectID = 0)
{
$this->commonAction($repoID, $objectID);
$repo = $this->repo->getRepoByID($repoID);
if($_POST)
{
@@ -161,9 +164,10 @@ class repo extends control
$repo->repoType = $repo->id . '-' . $repo->SCM;
$this->view->repo = $repo;
$this->view->repoID = $repoID;
$this->view->objectID = $objectID;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted');
$this->view->products = $this->projectID ? $this->loadModel('product')->getProductPairsByProject($this->projectID) : $this->loadModel('product')->getPairs();
$this->view->products = $objectID ? $this->loadModel('product')->getProductPairsByProject($objectID) : $this->loadModel('product')->getPairs();
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->edit;
$this->view->position[] = html::a(inlink('maintain'), $this->lang->repo->common);
@@ -176,15 +180,16 @@ class repo extends control
* Delete repo.
*
* @param int $repoID
* @param int $objectID
* @param string $confirm
* @access public
* @return void
*/
public function delete($repoID, $confirm = 'no')
public function delete($repoID, $objectID = 0, $confirm = 'no')
{
if($confirm == 'no')
{
die(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&confirm=yes")));
die(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&objectID=$objectID&confirm=yes")));
}
$relationID = $this->dao->select('id')->from(TABLE_RELATION)->where('extra')->eq($repoID)->fetch();
@@ -206,6 +211,7 @@ class repo extends control
* View repo file.
*
* @param int $repoID
* @param int $objectID
* @param string $entry
* @param string $revision
* @param string $showBug
@@ -213,8 +219,10 @@ class repo extends control
* @access public
* @return void
*/
public function view($repoID, $entry, $revision = 'HEAD', $showBug = 'false', $encoding = '')
public function view($repoID, $objectID = 0, $entry = '', $revision = 'HEAD', $showBug = 'false', $encoding = '')
{
$this->commonAction($repoID, $objectID);
if($this->get->repoPath) $entry = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
$this->repo->setBackSession('view', $withOtherModule = true);
@@ -282,6 +290,7 @@ class repo extends control
$this->view->showBug = $showBug;
$this->view->encoding = str_replace('-', '_', $encoding);
$this->view->repoID = $repoID;
$this->view->objectID = $objectID;
$this->view->repo = $repo;
$this->view->revision = $revision;
$this->view->revisionName = $revisionName;
@@ -306,18 +315,16 @@ class repo extends control
*
* @param int $repoID
* @param int $objectID
* @param string $path
* @param string $revision
* @param int $refresh
* @access public
* @return void
*/
public function browse($repoID = 0, $objectID = 0, $revision = 'HEAD', $refresh = 0)
public function browse($repoID = 0, $objectID = 0, $path = '', $revision = 'HEAD', $refresh = 0)
{
$this->commonAction($objectID);
$this->commonAction($repoID, $objectID);
/* Get path and refresh. */
$path = '';
if($this->get->repoPath) $path = $this->get->repoPath;
if(empty($refresh) and $this->cookie->repoRefresh) $refresh = $this->cookie->repoRefresh;
/* Set menu and session. */
@@ -343,7 +350,7 @@ class repo extends control
$oldRevision = isset($this->post->revision[1]) ? $this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ? $this->post->revision[0] : '';
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=" . $this->repo->encodePath($path) . "&oldrevision=$oldRevision&newRevision=$newRevision"));
$this->locate($this->repo->createLink('diff', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($path) . "&oldrevision=$oldRevision&newRevision=$newRevision"));
}
/* Cache infos. */
@@ -410,6 +417,7 @@ class repo extends control
$this->view->revision = $revision;
$this->view->infos = $infos;
$this->view->repoID = $repoID;
$this->view->objectID = $objectID;
$this->view->pager = $pager;
$this->view->path = urldecode($path);
$this->view->logType = $logType;
@@ -477,6 +485,7 @@ class repo extends control
* Show repo revision.
*
* @param int $repoID
* @param int $objectID
* @param int $revision
* @param string $root
* @param string $type
@@ -484,11 +493,8 @@ class repo extends control
* @access public
* @return void
*/
public function revision($repoID, $revision, $root = '', $type = 'dir')
public function revision($repoID, $objectID = 0, $revision, $root = '', $type = 'dir')
{
if($this->get->repoPath) $root = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
$this->repo->setBackSession();
if($repoID == 0) $repoID = $this->session->repoID;
$repo = $this->repo->getRepoByID($repoID);
@@ -560,6 +566,7 @@ class repo extends control
$this->view->type = $type;
$this->view->changes = $changes;
$this->view->repoID = $repoID;
$this->view->objectID = $objectID;
$this->view->revision = $log[0]->revision;
$this->view->parentDir = $parent;
$this->view->oldRevision = $oldRevision;
@@ -576,14 +583,17 @@ class repo extends control
* Blame repo file.
*
* @param int $repoID
* @param int $objectID
* @param string $entry
* @param string $revision
* @param string $encoding
* @access public
* @return void
*/
public function blame($repoID, $entry, $revision = 'HEAD', $encoding = '')
public function blame($repoID, $objectID = 0, $entry = '', $revision = 'HEAD', $encoding = '')
{
$this->commonAction($repoID, $objectID);
if($this->get->repoPath) $entry = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
if($repoID == 0) $repoID = $this->session->repoID;
@@ -606,6 +616,7 @@ class repo extends control
$this->view->title = $this->lang->repo->common;
$this->view->repoID = $repoID;
$this->view->objectID = $objectID;
$this->view->repo = $repo;
$this->view->revision = $revision;
$this->view->entry = $entry;
@@ -621,6 +632,7 @@ class repo extends control
* Show diff.
*
* @param int $repoID
* @param int $objectID
* @param string $entry
* @param string $oldRevision
* @param string $newRevision
@@ -629,11 +641,11 @@ class repo extends control
* @access public
* @return void
*/
public function diff($repoID, $entry = '', $oldRevision = '0', $newRevision = 'HEAD', $showBug = 'false', $encoding = '')
public function diff($repoID, $objectID = 0, $entry = '', $oldRevision = '0', $newRevision = 'HEAD', $showBug = 'false', $encoding = '')
{
$this->commonAction($repoID, $objectID);
if($this->get->repoPath) $entry = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
if($repoID == 0) $repoID = $this->session->repoID;
$file = $entry;
$repo = $this->repo->getRepoByID($repoID);
$entry = $this->repo->decodePath($entry);
@@ -655,7 +667,7 @@ class repo extends control
}
if($this->post->encoding) $encoding = $this->post->encoding;
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=" . $this->repo->encodePath($entry) . "&oldrevision=$oldRevision&newRevision=$newRevision&showBug=&encoding=$encoding"));
$this->locate($this->repo->createLink('diff', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($entry) . "&oldrevision=$oldRevision&newRevision=$newRevision&showBug=&encoding=$encoding"));
}
$this->scm->setEngine($repo);
@@ -708,6 +720,7 @@ class repo extends control
$this->view->suffix = $suffix;
$this->view->file = $file;
$this->view->repoID = $repoID;
$this->view->objectID = $objectID;
$this->view->repo = $repo;
$this->view->encoding = str_replace('-', '_', $encoding);
$this->view->arrange = $arrange;
@@ -782,12 +795,15 @@ class repo extends control
* Show sync comment.
*
* @param int $repoID
* @param int $objectID projectID|executionID
* @param string $branch
* @access public
* @return void
*/
public function showSyncCommit($repoID = 0, $branch = '')
public function showSyncCommit($repoID = 0, $objectID = 0, $branch = '')
{
$this->commonAction($repoID, $objectID);
$this->repo->setMenu($this->repos, $repoID);
if($repoID == 0) $repoID = $this->session->repoID;
if($branch) $branch = base64_decode($branch);
@@ -798,8 +814,9 @@ class repo extends control
$latestInDB = $this->repo->getLatestCommit($repoID);
$this->view->version = $latestInDB ? (int)$latestInDB->commit : 1;
$this->view->repoID = $repoID;
$this->view->objectID = $objectID;
$this->view->branch = $branch;
$this->view->browseLink = $this->repo->createLink('browse', "repoID=$repoID", '', false, $this->projectID);
$this->view->browseLink = $this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID", '', false);
$this->display();
}
@@ -813,6 +830,8 @@ class repo extends control
*/
public function ajaxSyncCommit($repoID = 0, $type = 'batch')
{
$this->commonAction($repoID);
set_time_limit(0);
$repo = $this->repo->getRepoByID($repoID);
if(empty($repo)) die();
+3 -4
View File
@@ -824,13 +824,12 @@ class repoModel extends model
* @param string $params
* @param string $viewType
* @param bool $onlybody
* @param int $projectID
* @access public
* @return string
*/
public function createLink($method, $params = '', $viewType = '', $onlybody = false, $projectID = 0)
public function createLink($method, $params = '', $viewType = '', $onlybody = false)
{
if($this->config->requestType == 'GET') return helper::createLink('repo', $method, $params, $viewType, $onlybody, $projectID);
if($this->config->requestType == 'GET') return helper::createLink('repo', $method, $params, $viewType, $onlybody);
$parsedParams = array();
parse_str($params, $parsedParams);
@@ -847,7 +846,7 @@ class repoModel extends model
}
$params = http_build_query($parsedParams);
$link = helper::createLink('repo', $method, $params, $viewType, $onlybody, $projectID);
$link = helper::createLink('repo', $method, $params, $viewType, $onlybody);
if(empty($pathParams)) return $link;
$link .= strpos($link, '?') === false ? '?' : '&';
+3 -3
View File
@@ -31,14 +31,14 @@ css::import($jsRoot . 'misc/highlight/styles/github.css');
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID"), $repo->name);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID"), $repo->name);
$paths= explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
echo " <span class='label label-info'>" . $revisionName . '</span>';
@@ -58,7 +58,7 @@ css::import($jsRoot . 'misc/highlight/styles/github.css');
<?php echo html::commonButton(zget($lang->repo->encodingList, $encoding, $lang->repo->encoding) . "<span class='caret'></span>", "id='encoding' data-toggle='dropdown'", 'btn dropdown-toggle')?>
<ul class='dropdown-menu' role='menu' aria-labelledby='encoding'>
<?php foreach($lang->repo->encodingList as $key => $val):?>
<li><?php echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=$encodePath&revision=$revision&encoding=$key"), $val)?></li>
<li><?php echo html::a($this->repo->createLink('blame', "repoID=$repoID&objectID=$objectID&entry=$encodePath&revision=$revision&encoding=$key"), $val)?></li>
<?php endforeach;?>
</ul>
</div>
+4 -4
View File
@@ -14,7 +14,7 @@
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID"), $repo->name);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID"), $repo->name);
if(!empty($path))
{
$paths = explode('/', $path);
@@ -22,7 +22,7 @@
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath) . "&revision=$revision"), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($postPath) . "&revision=$revision"), trim($pathName, '/'));
}
}
?>
@@ -31,7 +31,7 @@
</div>
<div class="btn-toolbar pull-right">
<span class='last-sync-time'><?php echo $lang->repo->notice->lastSyncTime . $cacheTime?></span>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($path) . "&revision=$revision&refresh=1"), "<i class='icon icon-refresh'></i> ". $lang->refresh, '', "class='btn btn-primary'");?>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($path) . "&revision=$revision&refresh=1"), "<i class='icon icon-refresh'></i> ". $lang->refresh, '', "class='btn btn-primary'");?>
</div>
</div>
<div id="mainContent" class="main-row fade">
@@ -57,7 +57,7 @@
<td>
<?php
$infoPath = trim($path . '/' . $info->name, '/');
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&entry=" . $this->repo->encodePath($infoPath));
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($infoPath));
echo html::a($link, $info->name, '', "title='{$info->name}'");
?>
</td>
+5 -5
View File
@@ -26,11 +26,11 @@
</tr>
</thead>
<tbody>
<?php foreach($repoList as $id => $repo):?>
<?php foreach($repoList as $repo):?>
<tr>
<td class='text-center'><?php echo $id; ?></td>
<td class='text-center'><?php echo $repo->id; ?></td>
<td class='text'><?php echo zget($lang->repo->scmList, $repo->SCM); ?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo html::a($this->createLink('repo', 'browse', "repoID={$repo->id}"), $repo->name);?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo html::a($this->createLink('repo', 'browse', "repoID={$repo->id}&objectID=$objectID"), $repo->name);?></td>
<td class='text'>
<?php
$productList = explode(',', str_replace(' ', '', $repo->product));
@@ -43,8 +43,8 @@
<td class='text' title='<?php echo $repo->path; ?>'><?php echo $repo->path; ?></td>
<td class='text-left c-actions'>
<?php
common::printIcon('repo', 'edit', "repoID=$id", '', 'list', 'edit');
if(common::hasPriv('repo', 'delete')) echo html::a($this->createLink('repo', 'delete', "repoID=$id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->repo->delete}' class='btn'");
common::printIcon('repo', 'edit', "repoID=$repo->id&objectID=$objectID", '', 'list', 'edit');
if(common::hasPriv('repo', 'delete')) echo html::a($this->createLink('repo', 'delete', "repoID=$repo->id&objectID=$objectID"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->repo->delete}' class='btn'");
?>
</td>
</tr>
+1 -1
View File
@@ -34,7 +34,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<div class='detail'>
<div class='detail-title'>
<?php echo $lang->repo->changes;?>
<div class='pull-right'><?php if(common::hasPriv('repo', 'diff')) echo html::a($this->repo->createLink('diff', "repoID=$repoID&entry=&fromRevision=$oldRevision&toRevision=$revision"), $lang->repo->diffAll);?></div>
<div class='pull-right'><?php if(common::hasPriv('repo', 'diff')) echo html::a($this->repo->createLink('diff', "repoID=$repoID&objectID=$objectID&entry=&fromRevision=$oldRevision&toRevision=$revision"), $lang->repo->diffAll);?></div>
</div>
<div class='detail-content'>
<table class='table no-margin'>
+7 -7
View File
@@ -25,14 +25,14 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID"), $repo->name);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID"), $repo->name);
$paths= explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
echo $version;
@@ -41,7 +41,7 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
</div>
</div>
<div class="btn-toolbar pull-right">
<?php echo html::a($this->repo->createLink('revision', "repoID=$repoID&revision=$revision"), $lang->repo->allChanges, '', "class='btn btn-primary'")?>
<?php echo html::a($this->repo->createLink('revision', "repoID=$repoID&objectID=$objectID&revision=$revision"), $lang->repo->allChanges, '', "class='btn btn-primary'")?>
</div>
</div>
<?php endif;?>
@@ -56,7 +56,7 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<div class='panel-actions'>
<?php if($suffix != 'binary' and strpos($config->repo->images, "|$suffix|") === false):?>
<?php
if(common::hasPriv('repo', 'blame')) echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=$encodePath&revision=$revision&encoding=$encoding"), html::icon('random') . $lang->repo->blame, '', "class='btn btn-sm btn-primary'");
if(common::hasPriv('repo', 'blame')) echo html::a($this->repo->createLink('blame', "repoID=$repoID&objectID=$objectID&entry=$encodePath&revision=$revision&encoding=$encoding"), html::icon('random') . $lang->repo->blame, '', "class='btn btn-sm btn-primary'");
if(common::hasPriv('repo', 'download')) echo html::a($this->repo->createLink('download', "repoID=$repoID&path=$encodePath&fromRevision=$revision"), html::icon('download-alt') . $lang->repo->download, 'hiddenwin', "class='btn btn-sm btn-primary'");
?>
<?php endif;?>
@@ -64,7 +64,7 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<?php echo html::commonButton(zget($lang->repo->encodingList, $encoding, $lang->repo->encoding) . "<span class='caret'></span>", "id='encoding' data-toggle='dropdown'", 'btn btn-sm btn-primary dropdown-toggle')?>
<ul class='dropdown-menu' role='menu' aria-labelledby='encoding'>
<?php foreach($lang->repo->encodingList as $key => $val):?>
<li><?php echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodePath&revision=$revision&showBug=$showBug&encoding=$key", 'html', isonlybody()), $val)?></li>
<li><?php echo html::a($this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=$encodePath&revision=$revision&showBug=$showBug&encoding=$key", 'html', isonlybody()), $val)?></li>
<?php endforeach;?>
</ul>
</div>
@@ -91,8 +91,8 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<?php if(!isonlybody()):?>
<div id="mainActions" class='main-actions'>
<nav class="container">
<?php if(!empty($preAndNext->pre)) echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodePath&revision={$preAndNext->pre}&showBug=$showBug", 'html', isonlybody()), "<i class='icon-pre icon-chevron-left'></i>", '', "id='prevPage' class='btn btn-info' title='{$preAndNext->pre}'")?>
<?php if(!empty($preAndNext->next)) echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodePath&revision={$preAndNext->next}&showBug=$showBug", 'html', isonlybody()), "<i class='icon-pre icon-chevron-right'></i>", '', "id='nextPage' class='btn btn-info' title='{$preAndNext->next}'")?>
<?php if(!empty($preAndNext->pre)) echo html::a($this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=$encodePath&revision={$preAndNext->pre}&showBug=$showBug", 'html', isonlybody()), "<i class='icon-pre icon-chevron-left'></i>", '', "id='prevPage' class='btn btn-info' title='{$preAndNext->pre}'")?>
<?php if(!empty($preAndNext->next)) echo html::a($this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=$encodePath&revision={$preAndNext->next}&showBug=$showBug", 'html', isonlybody()), "<i class='icon-pre icon-chevron-right'></i>", '', "id='nextPage' class='btn btn-info' title='{$preAndNext->next}'")?>
</nav>
</div>
<?php endif;?>