/** * SSO logout. * * @param string $type * @access public * @return void */ public function logout($type = 'notify') { if ($type != 'return') { $code = $this->config->sso->code; $userIP = $this->server->remote_addr; $token = $this->get->token; $key = $this->config->sso->key; $auth = md5($code . $userIP . $token . $key); $callback = urlencode($common->getSysURL() . inlink('logout', "type=return")); $location = $this->config->sso->addr; if (strpos($location, '&') !== false) { $location = rtrim($location, '&') . "&token={$token}&auth={$auth}&userIP={$userIP}&callback={$callback}"; } else { $location = rtrim($location, '?') . "?token={$token}&auth={$auth}&userIP={$userIP}&callback={$callback}"; } $this->locate($location); } if ($this->get->status == 'success') { session_destroy(); setcookie('za', false); setcookie('zp', false); $this->locate($this->createLink('user', 'login')); } $this->locate($this->createLink('user', 'logout')); }
/** * Edit a refund. * * @param int $refundID * @access public * @return void */ public function edit($refundID) { $refund = $this->refund->getByID($refundID); $this->checkPriv($refund, 'edit'); if ($_POST) { $changes = $this->refund->update($refundID); if (dao::isError()) { $this->send(array('result' => 'fail', 'message' => dao::getError())); } $files = $this->loadModel('file')->saveUpload('refund', $refundID); if (!empty($changes) or $files) { $fileAction = ''; if ($files) { $fileAction = $this->lang->addFiles . join(',', $files); } $actionID = $this->loadModel('action')->create('refund', $refundID, 'Edited', $fileAction); if ($changes) { $this->action->logHistory($actionID, $changes); } } $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "refundID={$refundID}"))); } $this->view->currencyList = $this->loadModel('common', 'sys')->getCurrencyList(); $this->view->currencySign = $this->loadModel('common', 'sys')->getCurrencySign(); $this->view->categories = $this->refund->getCategoryPairs(); $this->view->refund = $refund; $this->view->users = $this->loadModel('user')->getPairs('noclosed,nodeleted'); $this->display(); }
/** * Edit a build. * * @param int $buildID * @access public * @return void */ public function edit($buildID) { if (!empty($_POST)) { $changes = $this->build->update($buildID); if (dao::isError()) { die(js::error(dao::getError())); } if ($changes) { $actionID = $this->loadModel('action')->create('build', $buildID, 'edited'); $this->action->logHistory($actionID, $changes); } die(js::locate(inlink('view', "buildID={$buildID}"), 'parent')); } $this->loadModel('story'); $this->loadModel('bug'); $this->loadModel('project'); /* Set menu. */ $build = $this->build->getById((int) $buildID); $this->project->setMenu($this->project->getPairs(), $build->project); /* Get stories and bugs. */ $orderBy = 'status_asc, stage_asc, id_desc'; $stories = $this->story->getProjectStories($build->project, $orderBy); $bugs = $this->bug->getProjectBugs($build->project); /* Assign. */ $this->view->title = $this->lang->build->edit; $this->view->position[] = $this->lang->build->edit; $this->view->products = $this->project->getProducts($build->project); $this->view->build = $build; $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $build->builder); $this->view->stories = $stories; $this->view->bugs = $bugs; $this->view->orderBy = $orderBy; $this->display(); }
/** * Request the api. * * @param string $moduleName * @param string $methodName * @param string $action * @access public * @return void */ public function request($moduleName, $methodName, $action) { $host = common::getSysURL() . $this->config->webRoot; $param = ''; if ($action == 'extendModel') { if (!isset($_POST['noparam'])) { foreach ($_POST as $key => $value) { $param .= ',' . $key . '=' . $value; } $param = ltrim($param, ','); } $url = rtrim($host, '/') . inlink('getModel', "moduleName={$moduleName}&methodName={$methodName}¶ms={$param}", 'json'); $url .= $this->config->requestType == "PATH_INFO" ? '?' : '&'; $url .= $this->config->sessionVar . '=' . session_id(); } else { if (!isset($_POST['noparam'])) { foreach ($_POST as $key => $value) { $param .= '&' . $key . '=' . $value; } $param = ltrim($param, '&'); } $url = rtrim($host, '/') . helper::createLink($moduleName, $methodName, $param, 'json'); $url .= $this->config->requestType == "PATH_INFO" ? '?' : '&'; $url .= $this->config->sessionVar . '=' . session_id(); } /* Unlock session. After new request, restart session. */ session_write_close(); $content = file_get_contents($url); session_start(); return array('url' => $url, 'content' => $content); }
/** * Upgrade license when upgrade to 4.0. * * @access public * @return void */ public function upgradeLicense() { if ($this->get->agree) { $this->locate(inlink('backup')); } $this->view->license = file_get_contents($this->app->getBasePath() . '/doc/LICENSE'); $this->display(); }
/** * Delete an address. * * @param int $id * @access public * @return void */ public function delete($id) { $this->dao->delete()->from(TABLE_ADDRESS)->where('id')->eq($id)->andWhere('account')->eq($this->app->user->account)->exec(); if (dao::isError()) { $this->send(array('result' => 'fail', 'message' => dao::getError())); } $this->send(array('result' => 'success', 'message' => $this->lang->deleteSuccess, 'locate' => inlink('browse'))); }
/** * Ignore the admin entry warning. * * @access public * return void **/ public function ignore() { $result = $this->loadModel('setting')->setItems('system.common.global', array('ignoreAdminEntry' => true)); if ($result) { $this->send(array('result' => 'success', 'locate' => inlink('index'))); } $this->send(array('result' => 'fail', 'message' => $this->lang->fail)); }
/** * Set lang. * * @param string $module * @param string $field * @access public * @return void */ public function lang($module, $field, $appName = '') { $clientLang = $this->app->getClientLang(); if (empty($appName)) { $appName = $this->app->getAppName(); } $this->app->loadLang($module, $appName); if ($module == 'user' and $field == 'roleList' and $appName == 'sys') { $this->lang->menuGroups->setting = 'user'; } if (!empty($_POST)) { if ($module == 'common' and $field == 'currencyList') { $setting = fixer::input('post')->join('currency', ',')->setDefault('currency', '')->get(); $this->setting->setItems('system.sys.setting', $setting); if (dao::isError()) { $this->send(array('result' => 'fail', 'message' => dao::getError())); } $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('lang', "module={$module}&field={$field}&appName={$appName}"))); } $lang = $_POST['lang']; $appendField = isset($this->config->setting->appendLang[$module][$field]) ? $this->config->setting->appendLang[$module][$field] : ''; $this->setting->deleteItems("lang={$lang}&app={$appName}&module={$module}§ion={$field}", $type = 'lang'); if ($appendField) { $this->setting->deleteItems("lang={$lang}&app={$appName}&module={$module}§ion={$appendField}", $type = 'lang'); } foreach ($_POST['keys'] as $index => $key) { $value = $_POST['values'][$index]; if (!$value or !$key) { continue; } $system = $_POST['systems'][$index]; $this->setting->setItem("{$lang}.{$appName}.{$module}.{$field}.{$key}.{$system}", $value, $type = 'lang'); /* Save additional item. */ if ($appendField) { $this->setting->setItem("{$lang}.{$appName}.{$module}.{$appendField}.{$key}.{$system}", $_POST[$appendField][$index], $type = 'lang'); } } if (dao::isError()) { $this->send(array('result' => 'fail', 'message' => dao::getError())); } $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('lang', "module={$module}&field={$field}&appName={$appName}"))); } $dbFields = $this->setting->getItems("lang={$clientLang},all&app={$appName}&module={$module}§ion={$field}", 'lang'); $systemField = array(); foreach ($dbFields as $dbField) { $systemField[$dbField->key] = $dbField->system; } $this->view->fieldList = $module == 'common' ? $this->lang->{$field} : $this->lang->{$module}->{$field}; $this->view->module = $module; $this->view->field = $field; $this->view->clientLang = $clientLang; $this->view->systemField = $systemField; $this->view->appName = $appName; $this->display(); }
/** * Confirm the version. * * @access public * @return void */ public function confirm() { $this->view->title = $this->lang->upgrade->confirm; $this->view->position[] = $this->lang->upgrade->common; $this->view->confirm = $this->upgrade->getConfirm($this->post->fromVersion); $this->view->fromVersion = $this->post->fromVersion; /* When sql is empty then skip it. */ if (empty($this->view->confirm)) { $this->locate(inlink('execute', "fromVersion={$this->post->fromVersion}")); } $this->display(); }
/** * Get schema of database. * * @param string $table * @access public * @return void */ public function db($table = '') { $this->view->title = $this->lang->dev->db; $this->view->position[] = html::a(inlink('api'), $this->lang->dev->common); $this->view->position[] = $this->lang->dev->db; $this->view->tables = $this->dev->getTables(); $this->view->tab = 'db'; $this->view->selectedTable = $table; $this->view->tab = 'db'; $this->view->fields = $table ? $this->dev->getFields($table) : array(); $this->display(); }
public function test() { $pubuConfig = $this->pubu->getConfig(); $this->view->position[] = html::a(inlink('index'), $this->lang->pubu->common); $this->view->position[] = '测试'; $ping = $this->pubu->sendNotification($pubuConfig->webhook, array('type' => 'ping', "data" => array("hello" => "zentao"))); $this->view->ping = $ping; if (is_string($ping)) { echo js::alert($ping); die(js::locate('back')); } $this->display(); }
/** * index page of project module. * * @param string $status * @access public * @return void */ public function index($status = 'involved', $recTotal = 0, $recPerPage = 10, $pageID = 1) { $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); if (empty($this->projects)) { $this->locate(inlink('create')); } $this->view->title = $this->lang->project->common; $this->view->status = $status; $this->view->projects = $this->project->getList($status, $pager); $this->view->users = $this->loadModel('user')->getPairs('noclosed'); $this->view->pager = $pager; $this->display(); }
/** * Build All index. * * @access public * @return void */ public function buildIndex($type = 'article', $lastID = '') { if (helper::isAjaxRequest()) { $result = $this->search->buildAllIndex($type, $lastID); if (dao::isError()) { $this->send(array('result' => 'fail', 'message' => dao::getError())); } if (isset($result['finished']) and $result['finished']) { $this->send(array('result' => 'finished', 'message' => $this->lang->search->buildSuccessfully)); } else { $this->send(array('result' => 'unfinished', 'message' => sprintf($this->lang->search->buildResult, $result['count']), 'next' => inlink('buildIndex', "type={$result['type']}&lastID={$result['lastID']}"))); } } $this->view->title = $this->lang->search->buildIndex; $this->display(); }
/** * Bind zentao. * * @access public * @return void */ public function bind() { if ($_POST) { $response = $this->admin->bindByAPI(); if ($response == 'success') { $this->loadModel('setting')->setItem('system.common.global.community', $this->post->account); echo js::alert($this->lang->admin->bind->success); die(js::locate(inlink('index'), 'parent')); } die($response); } $this->view->title = $this->lang->admin->bind->caption; $this->view->position[] = $this->lang->admin->bind->caption; $this->view->sn = $this->config->global->sn; $this->display(); }
/** * Buy score use money. * * @access public * @return void */ public function buyScore() { if ($this->app->user->account == 'guest') { $this->locate($this->createLink('user', 'login')); } if ($_POST) { if ($this->post->amount < $this->config->score->buyScore->minAmount) { $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->score->errorAmount, $this->config->score->buyScore->minAmount))); } $orderID = $this->score->saveOrder(); if (!$orderID) { $this->send(array('result' => 'fail', 'message' => dao::getError())); } $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('payOrder', "orderID={$orderID}"))); } $this->display(); }
public function save() { if (!empty($_POST)) { $this->config->ldap->host = $this->post->ldapHost; $this->config->ldap->version = $this->post->ldapVersion; $this->config->ldap->bindDN = $this->post->ldapBindDN; $this->config->ldap->bindPWD = $this->post->ldapPassword; $this->config->ldap->baseDN = $this->post->ldapBaseDN; $this->config->ldap->searchFilter = $this->post->ldapFilter; $this->config->ldap->uid = $this->post->ldapAttr; $this->config->ldap->mail = $this->post->ldapMail; // 此处我们把配置写入配置文件 $ldapConfig = "<?php \n" . "\$config->ldap = new stdclass();\n" . "\$config->ldap->host = '{$this->post->ldapHost}';\n" . "\$config->ldap->version = '{$this->post->ldapVersion}';\n" . "\$config->ldap->bindDN = '{$this->post->ldapBindDN}';\n" . "\$config->ldap->bindPWD = '{$this->post->ldapPassword}';\n" . "\$config->ldap->baseDN = '{$this->post->ldapBaseDN}';\n" . "\$config->ldap->searchFilter = '{$this->post->ldapFilter}';\n" . "\$config->ldap->uid = '{$this->post->ldapAttr}';\n" . "\$config->ldap->mail = '{$this->post->ldapMail}';\n" . "\$config->ldap->name = '{$this->post->ldapName}';\n"; $file = fopen("config.php", "w") or die("Unable to open file!"); fwrite($file, $ldapConfig); fclose($file); $this->locate(inlink('setting')); } }
/** * set site basic info. * * @access public * @return void */ public function setBasic() { $allowedTags = $this->app->user->admin == 'super' ? $this->config->allowedTags->admin : $this->config->allowedTags->front; if (!empty($_POST)) { $setting = fixer::input('post')->stripTags('meta', $allowedTags)->stripTags('tongji', $allowedTags)->join('modules', ',')->remove('allowedFiles')->setDefault('modules', '')->stripTags('pauseTip', $allowedTags)->remove('uid,lang,cn2tw,defaultLang,requestType')->get(); if (strpos($setting->modules, 'shop') !== false && strpos($setting->modules, 'user') === false) { $setting->modules = 'user,' . $setting->modules; } if ($setting->modules == 'initial') { unset($setting->modules); } $result = $this->loadModel('setting')->setItems('system.common.site', $setting); if (!$result) { $this->send(array('result' => 'fail', 'message' => $this->lang->fail)); } /* Set global settings. */ $globalSetting = new stdclass(); if ($this->post->lang) { $globalSetting->lang = join(',', $this->post->lang); $globalSetting->cn2tw = join('', $this->post->cn2tw); $globalSetting->defaultLang = $this->post->defaultLang; } if ($this->post->requestType) { $globalSetting->requestType = $this->post->requestType; } $result = $this->loadModel('setting')->setItems('system.common.site', $globalSetting, 'all'); if (!$result) { $this->send(array('result' => 'fail', 'message' => $this->lang->fail)); } /* Switch to desktop device if mobile template closed. */ if ($setting->mobileTemplate == 'close') { $this->session->set('device', 'desktop'); } $this->send(array('result' => 'success', 'message' => $this->lang->setSuccess, 'locate' => inlink('setbasic'))); } $this->view->title = $this->lang->site->common; $this->display(); }
/** * Edit a build. * * @param int $buildID * @access public * @return void */ public function edit($buildID) { if (!empty($_POST)) { $changes = $this->build->update($buildID); if (dao::isError()) { die(js::error(dao::getError())); } $files = $this->loadModel('file')->saveUpload('build', $buildID); if ($changes or $files) { $fileAction = ''; if (!empty($files)) { $fileAction = $this->lang->addFiles . join(',', $files) . "\n"; } $actionID = $this->loadModel('action')->create('build', $buildID, 'Edited', $fileAction); if (!empty($changes)) { $this->action->logHistory($actionID, $changes); } } die(js::locate(inlink('view', "buildID={$buildID}"), 'parent')); } $this->loadModel('project'); /* Set menu. */ $build = $this->build->getById((int) $buildID); $this->project->setMenu($this->project->getPairs(), $build->project); /* Get stories and bugs. */ $orderBy = 'status_asc, stage_asc, id_desc'; /* Assign. */ $project = $this->loadModel('project')->getById($build->project); $this->view->title = $project->name . $this->lang->colon . $this->lang->build->edit; $this->view->position[] = html::a($this->createLink('project', 'task', "projectID={$build->project}"), $project->name); $this->view->position[] = $this->lang->build->edit; $this->view->products = $this->project->getProducts($build->project); $this->view->build = $build; $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $build->builder); $this->view->orderBy = $orderBy; $this->display(); }
/** * Set upload configures. * * @access public * @return void */ public function setUpload() { if (!empty($_POST)) { $setting = fixer::input('post')->remove('allowedFiles')->setDefault('allowUpload', '0')->get(); $dangers = explode(',', $this->config->file->dangers); $allowedFiles = trim(strtolower($this->post->allowedFiles), ','); $allowedFiles = str_replace($dangers, '', $allowedFiles); $allowedFiles = seo::unify($allowedFiles, ','); $allowedFiles = ',' . $allowedFiles . ','; $fileConfig = array('allowed' => $allowedFiles); $this->loadModel('setting')->setItems('system.common.file', $fileConfig); $result = $this->loadModel('setting')->setItems('system.common.site', $setting); $cache = $this->loadModel('cache')->createConfigCache(); if (!$cache) { $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->error->noWritable, $this->app->getTmpRoot() . 'cache'))); } if ($result) { $this->send(array('result' => 'success', 'message' => $this->lang->setSuccess, 'locate' => inlink('setupload'))); } $this->send(array('result' => 'fail', 'message' => $this->lang->fail)); } $this->view->title = $this->lang->site->setBasic; $this->display(); }
public function edit($projectID) { // echo "edit"; if (!empty($_POST)) { $changes = $this->project->update($projectID); $this->project->updateProducts($projectID); if (dao::isError()) { die(js::error(dao::getError())); } if ($changes) { $actionID = $this->loadModel('action')->create('project', $projectID, 'edited'); $this->action->logHistory($actionID, $changes); } if (isonlybody()) { die(js::closeModal('parent.parent')); } die(js::locate(inlink('view', "projectID={$projectID}"), 'parent')); } /* Judge a private todo or not, If private, die. */ /* Set menu. */ $this->project->setMenu($this->projects, $projectID); $projects = array('' => '') + $this->projects; $project = $this->project->getById($projectID); $managers = $this->project->getDefaultManagers($projectID); if ($project->private and $this->app->user->account != $project->account) { die('private'); } /* Remove current project from the projects. */ unset($projects[$projectID]); $title = $this->lang->project->edit . $this->lang->colon . $project->name; $position[] = html::a($browseProjectLink, $project->name); $position[] = $this->lang->project->edit; $allProducts = $this->loadModel('product')->getPairs('noclosed|nocode'); $linkedProducts = $this->project->getProducts($project->id); $allProducts += $linkedProducts; $linkedProducts = join(',', array_keys($linkedProducts)); $this->view->title = $title; $this->view->position = $position; $this->view->projects = $projects; $this->view->project = $project; $this->view->poUsers = $this->loadModel('user')->getPairs('noclosed,nodeleted,pofirst', $project->PO); $this->view->pmUsers = $this->user->getPairs('noclosed,nodeleted,pmfirst', $project->PM); $this->view->qdUsers = $this->user->getPairs('noclosed,nodeleted,qdfirst', $project->QD); $this->view->rdUsers = $this->user->getPairs('noclosed,nodeleted,devfirst', $project->RD); $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; $this->display(); }
echo html::backButton($lang->install->pre, 'btn btn-primary'); ?> </div> <?php } else { ?> <div class='modal-header'><strong><?php echo $lang->install->saveConfig; ?> </strong></div> <div class='modal-body'> <div class='form-group'><?php echo html::textArea('config', $result->content, "rows='10' class='form-control small'"); ?> </div> <div class='alert alert-default'><?php printf($lang->install->save2File, $result->myPHP); ?> </div> </div> <div class='modal-footer'><?php echo html::a(inlink('step4'), $lang->install->next, "class='btn btn-primary'"); ?> </div> <?php } ?> </div> </div> <?php include './footer.html.php';
/** * Edit a todo. * * @param int $todoID * @access public * @return void */ public function edit($todoID) { if (!empty($_POST)) { $changes = $this->todo->update($todoID); if (dao::isError()) { die(js::error(dao::getError())); } if ($changes) { $actionID = $this->loadModel('action')->create('todo', $todoID, 'edited'); $this->action->logHistory($actionID, $changes); } if (isonlybody()) { die(js::closeModal('parent.parent')); } die(js::locate(inlink('view', "todoID={$todoID}"), 'parent')); } /* Judge a private todo or not, If private, die. */ $todo = $this->todo->getById($todoID); if ($todo->private and $this->app->user->account != $todo->account) { die('private'); } $todo->date = strftime("%Y-%m-%d", strtotime($todo->date)); $this->view->title = $this->lang->todo->common . $this->lang->colon . $this->lang->todo->edit; $this->view->position[] = $this->lang->todo->common; $this->view->position[] = $this->lang->todo->edit; $this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta); $this->view->todo = $todo; $this->display(); }
/** * Close a story. * * @param int $storyID * @access public * @return void */ public function close($storyID) { if (!empty($_POST)) { $changes = $this->story->close($storyID); if (dao::isError()) { die(js::error(dao::getError())); } $actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason)); $this->action->logHistory($actionID, $changes); $this->sendmail($storyID, $actionID); if (isonlybody()) { die(js::closeModal('parent.parent', 'this')); } die(js::locate(inlink('view', "storyID={$storyID}"), 'parent')); } /* Get story and product. */ $story = $this->story->getById($storyID); $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id')->fetch(); /* Set menu. */ $this->product->setMenu($this->product->getPairs(), $product->id); /* Set the closed reason options. */ if ($story->status == 'draft') { unset($this->lang->story->reasonList['cancel']); } $this->view->title = $this->lang->story->close . "STORY" . $this->lang->colon . $story->title; $this->view->position[] = html::a($this->createLink('product', 'browse', "product={$product->id}"), $product->name); $this->view->position[] = $this->lang->story->common; $this->view->position[] = $this->lang->story->close; $this->view->product = $product; $this->view->story = $story; $this->view->actions = $this->action->getList('story', $storyID); $this->view->users = $this->loadModel('user')->getPairs(); $this->display(); }
<?php /** * The html template file of select version method of upgrade module of ZenTaoPMS. * * @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com) * @license ZPLV12 (http://zpl.pub/page/zplv12.html) * @author Chunsheng Wang <*****@*****.**> * @package upgrade * @version $Id$ */ include '../../common/view/header.lite.html.php'; ?> <form method='post' action='<?php echo inlink('confirm'); ?> '> <div class='container'> <div class='modal-dialog'> <div class='modal-header'> <h3><?php echo $lang->upgrade->selectVersion; ?> </h3> </div> <div class='modal-body'> <div class='form-group'> <?php echo html::select('fromVersion', $lang->upgrade->fromVersions, $version, "class='form-control single-input'"); echo " <span class='text-danger help-inline'>{$lang->upgrade->versionNote}</span>"; ?>
/** * Link bugs. * * @param int $releaseID * @param string $browseType * @param int $param * @access public * @return void */ public function linkBug($releaseID = 0, $browseType = '', $param = 0) { if (!empty($_POST['bugs'])) { $this->release->linkBug($releaseID); die(js::locate(inlink('view', "releaseID={$releaseID}&type=bug"), 'parent')); } /* Set menu. */ $release = $this->release->getByID($releaseID); $build = $this->loadModel('build')->getByID($release->build); $this->commonAction($release->product); /* Build the search form. */ $this->loadModel('bug'); $queryID = $browseType == 'bysearch' ? (int) $param : 0; unset($this->config->bug->search['fields']['product']); $this->config->bug->search['actionURL'] = $this->createLink('release', 'view', "releaseID={$releaseID}&type=bug&link=true¶m=" . helper::safe64Encode('&browseType=bySearch&queryID=myQueryID')); $this->config->bug->search['queryID'] = $queryID; $this->config->bug->search['style'] = 'simple'; $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($release->product => $release->product)); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($release->product, $viewType = 'bug', $startModuleID = 0); $this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getProjectPairs($release->product); $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($release->product); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $this->loadModel('search')->setSearchParams($this->config->bug->search); if ($browseType == 'bySearch') { $allBugs = $this->bug->getBySearch($release->product, $queryID, 'id_desc'); } else { $allBugs = empty($build->project) ? array() : $this->bug->getReleaseBugs($build->id, $release->product); } $this->view->allBugs = $allBugs; $this->view->releaseBugs = empty($release->bugs) ? array() : $this->bug->getByList($release->bugs); $this->view->release = $release; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->browseType = $browseType; $this->view->param = $param; $this->display(); }
?> ><?php echo html::a(inlink('page', "mode=all"), $lang->stat->all); ?> </li> <?php foreach ($lang->stat->trafficModes as $code => $modeName) { ?> <?php $class = $mode == $code ? "class='active'" : ''; ?> <li <?php echo $class; ?> ><?php echo html::a(inlink('page', "mode={$code}"), $modeName); ?> </li> <?php } ?> <li> <form method='get'> <?php echo html::hidden('m', 'stat') . html::hidden('f', 'report'); ?> <?php echo html::hidden('mode', 'fixed'); ?> <?php echo html::hidden('orderBy', 'pv_desc');
} ?> <tr class='text-center'> <td colspan='5'> <?php if ($preCase) { echo html::a(inlink('runCase', "runID={$preCase['runID']}&caseID={$preCase['caseID']}&version={$preCase['version']}"), $lang->testtask->pre, '', "id='pre' class='btn'"); } if (empty($run->case->steps)) { echo html::submitButton($lang->testtask->pass, "onclick=\$('#result').val('pass')", 'btn-success'); echo html::submitButton($lang->testtask->fail, "onclick=\$('#result').val('fail')", 'btn-danger'); } else { echo html::submitButton(); } if ($nextCase) { echo html::a(inlink('runCase', "runID={$nextCase['runID']}&caseID={$nextCase['caseID']}&version={$nextCase['version']}"), $lang->testtask->next, '', "id='next' class='btn'"); } if (!$run->case->steps) { echo html::hidden('result', ''); } echo html::hidden('case', $run->case->id); echo html::hidden('version', $run->case->currentVersion); ?> </td> </tr> </table> </form> </div> <div class='main' id='resultsContainer'> </div> <script>
</li> <?php } else { ?> <li class='preious disabled'><a href='###'><i class='icon-arrow-left'></i> <?php print $lang->article->none; ?> </a></li> <?php } ?> <?php if ($next) { ?> <li class='next'><?php echo html::a(inlink('view', "id={$next->id}"), $next->title . ' <i class="icon-arrow-right"></i>', 'id="next"'); ?> </li> <?php } else { ?> <li class='next disabled'><a href='###'> <?php print $lang->article->none; ?> <i class='icon-arrow-right'></i></a></li> <?php } ?> </ul> </footer> </div>
echo "<div class='comment'>" . $action->comment . "</div>"; } ?> </li> <?php } ?> </ol> </div> </div> </div> <iframe name="actionframe" style="display: none"></iframe> <footer> <div class="foot_ctr"> <form id="form1" method='post' target="actionframe" style="height: 100%;" action='<?php echo inlink('commentStory', "storyId={$story->id}"); ?> '> <table style="height: 100%; width: 100%;"> <tr> <td><?php echo html::textarea('comment', '', "rows='3' style='width:100%'"); ?> </td> <td width="50"><input type="submit" id="submit" value="备注" /></td> <td width="50"><input type="button" value="评审" onclick="$.ui.loadContent('storycontent')" /></td> </tr> </table> </form> </div> </footer>
/** * Print actions of an order. * * @param string $order * @access public * @return string */ public function printActions($order, $btnLink = false) { if (RUN_MODE == 'admin' and $order->status == 'normal') { /* Send link. */ if ($order->payment == 'COD' and $order->deliveryStatus == 'not_send') { echo html::a(helper::createLink('order', 'delivery', "orderID={$order->id}"), $this->lang->order->delivery, "data-toggle='modal'"); } if ($order->payment != 'COD' and $order->payStatus == 'paid' and $order->deliveryStatus == 'not_send') { echo html::a(helper::createLink('order', 'delivery', "orderID={$order->id}"), $this->lang->order->delivery, "data-toggle='modal'"); } /* Pay link. */ if ($order->payment == 'COD' and $order->payStatus != 'paid' and $order->deliveryStatus == 'confirmed') { echo html::a(helper::createLink('order', 'pay', "orderID={$order->id}"), $this->lang->order->return, "data-toggle='modal'"); } /* Finish link. */ if ($order->payStatus == 'paid' and $order->deliveryStatus == 'confirmed' and $order->status != 'finished' and $order->status != 'canceled') { echo html::a('javascript:;', $this->lang->order->finish, "data-rel='" . helper::createLink('order', 'finish', "orderID={$order->id}") . "' class='finisher'"); } } if (RUN_MODE == 'front' and $order->status == 'normal') { if ($btnLink) { /* Pay link. */ if ($order->payment != 'COD' and $order->payStatus != 'paid') { echo html::a($this->createPayLink($order), $this->lang->order->pay, "target='_blank' class='btn-go2pay btn warning'"); } /* Track link. */ if ($order->deliveryStatus != 'not_send') { echo html::a(inlink('track', "orderID={$order->id}"), $this->lang->order->track, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' data-toggle='modal' class='btn btn-link'"); } /* Confirm link. */ if ($order->deliveryStatus == 'send') { echo html::a('javascript:;', $this->lang->order->confirmReceived, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' class='confirmDelivery btn primary'"); } /* Cancel link. */ if ($order->deliveryStatus == 'not_send' and $order->payStatus != 'paid' and $order->status == 'normal') { echo html::a('javascript:;', $this->lang->order->cancel, "data-rel='" . helper::createLink('order', 'cancel', "orderID={$order->id}") . "' class='cancelLink btn btn-link'"); } } else { /* Pay link. */ if ($order->payment != 'COD' and $order->payStatus != 'paid') { echo html::a($this->createPayLink($order), $this->lang->order->pay, "target='_blank' class='btn-go2pay'"); } /* Track link. */ if ($order->deliveryStatus != 'not_send') { echo html::a(inlink('track', "orderID={$order->id}"), $this->lang->order->track, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' data-toggle='modal'") . '<br>'; } /* Confirm link. */ if ($order->deliveryStatus == 'send') { echo html::a('javascript:;', $this->lang->order->confirmReceived, "data-rel='" . helper::createLink('order', 'confirmDelivery', "orderID={$order->id}") . "' class='confirmDelivery'"); } /* Cancel link. */ if ($order->deliveryStatus == 'not_send' and $order->payStatus != 'paid' and $order->status == 'normal') { echo html::a('javascript:;', $this->lang->order->cancel, "data-rel='" . helper::createLink('order', 'cancel', "orderID={$order->id}") . "' class='cancelLink'"); } } } }