repo->getLastReviewInfo($file); $repoModule = isset($lastReview) && isset($lastReview->module) ? $lastReview->module : ''; /* Get product pairs. */ if($repo->product) { $products = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('`id`')->in($repo->product)->fetchPairs(); } else { $products = $this->loadModel('product')->getPairs('', 0, '', 'all'); } /* get product by cookie or last review in this file. */ $repoProduct = isset($_COOKIE['repoPairs'][$repoID]) ? $_COOKIE['repoPairs'][$repoID] : ''; $repoProduct = isset($lastReview) && isset($lastReview->product) ? $lastReview->product : $repoProduct; $repoProduct = isset($products[$repoProduct]) ? $repoProduct : key($products); $executions = $this->repo->getExecutionPairs($repoProduct); $modules = $this->loadModel('tree')->getOptionMenu($repoProduct, $viewType = 'bug', $startModuleID = 0); $users = $this->loadModel('user')->getPairs('devfirst|nodeleted|noclosed'); $products = array('' => '') + $products; $executions = array('' => '') + $executions; $cwd = getcwd(); $commiters = $this->user->getCommiters(); $blamePairs = array(); if($suffix and $suffix != 'binary' and strpos($this->config->repo->images, "|$suffix|") === false) { $blames = $this->scm->blame($entry, $info->revision); foreach($blames as $line => $blame) { if(!isset($blame['committer'])) { if(isset($blamePairs[$line - 1])) $blamePairs[$line] = $blamePairs[$line - 1]; continue; } $blamePairs[$line] = zget($commiters, $blame['committer'], $blame['committer']); } } chdir($cwd); $infoRevision = isset($info->revision) ? $info->revision : ''; $v1 = isset($oldRevision) ? str_replace('-', '*', $oldRevision) : 0; $v2 = str_replace('-', '*', $infoRevision); $reviews = $this->repo->getReview($repoID, $file, $v2); $bugUrl = $this->repo->createLink('addBug', "repoID=$repoID&file=$file&v1=$v1&v2=$v2"); $commentUrl = $this->repo->createLink('addComment'); $productSelect = html::select('product', $products, $repoProduct, 'class="product form-control chosen" onchange="changeProduct(this)"'); $branches = $this->loadModel('branch')->getPairs($repoProduct); $moduleSelect = html::select('module', $modules, $repoModule, 'class="form-control chosen"'); $executionSelect = html::select('execution', $executions, '', 'class="form-control chosen"'); $typeSelect = html::select('repoType', $lang->repo->typeList, '', 'class="form-control chosen"'); $userSelect = html::select('assignedTo', $users, '', 'class="form-control chosen assignedTo"'); $bugs = array(); foreach($reviews as $line => $lineReview) { $lineBugs = array(); foreach ($lineReview['bugs'] as $bugID => $bug) { $lineBug = array(); $lineBug['id'] = $bugID; $lineBug['line'] = $line; $lineBug['title'] = $bug->title; $lineBug['steps'] = $bug->steps; $lineBug['realname'] = $bug->realname; $lineBug['openedDate'] = substr($bug->openedDate, 5, 11); $lineBug['lines'] = $bug->lines; $lineBug['file'] = $bug->entry; if($bug->edit) $lineBug['edit'] = true; if(!empty($bug->delete)) $lineBug['delete'] = true; if(isset($lineReview['comments'])) { if(isset($lineReview['comments'][$bugID])) { $comments = $lineReview['comments'][$bugID]; $bugComments = array(); foreach ($comments as $commentID => $comment) { $bugComment = array( 'id' => $comment->id, 'edit' => $comment->edit, 'realname' => $comment->realname, 'user' => $comment->user, 'date' => substr($comment->date, 5, 11), 'comment' => $comment->comment, ); $bugComments[] = $bugComment; } $lineBug['comments'] = $bugComments; } } $lineBugs[] = $lineBug; } $bugs[$line] = $lineBugs; } $browser = helper::getBrowser(); js::set('browser', $browser['name']); js::set('bugs', $bugs); js::set('productError', $lang->repo->error->product); js::set('contentError', $lang->repo->error->commentText); js::set('titleError', $lang->repo->error->title); js::set('commentError', $lang->repo->error->comment); js::set('submit', $lang->repo->submit); js::set('cancel', $lang->repo->cancel); js::set('confirmDelete', $lang->repo->notice->deleteBug); js::set('confirmDeleteComment', $lang->repo->notice->deleteComment); js::set('repoID', $repoID); js::set('revision', $infoRevision); js::set('file', $file); js::set('blamePairs', $blamePairs); js::set('isonlybody', isonlybody()); ?>
app->tab == 'project' && $objectID):?>
repo->product?>
repo->execution?>
repo->module;?>
repo->title?>
repo->type?>
repo->assign?>
repo->lines?>
-
repo->detile?>
repo->submit, '', 'btn btn-wide btn-primary bugSubmit');?> cancel, "onclick='hiddenForm()'", 'btn btn-wide');?>
user->errorDeny, $lang->repo->common, $lang->repo->addBug);?>
Bug # Bug # repo->lines?>
 
repo->commited . ' ' . $lang->repo->comment;?>
repo->expand?>
repo->collapse?>