public function editImage($userId) { if (!empty($_FILES)) { $this->loadModel('myImage')->uploadImg(); if (isonlybody()) { die(js::closeModal('parent')); } } $file = $this->loadModel('myImage')->getFile($userId); $this->view->file = $file; $this->display(); }
<?php /** * The mail file of order module of RanZhi. * * @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com) * @license ZPL (http://zpl.pub/page/zplv12.html) * @author Chu Jilu <*****@*****.**> * @package order * @version $Id: sendmail.html.php 867 2010-06-17 09:32:58Z yuren_@126.com $ * @link http://www.ranzhico.com */ $onlybody = isonlybody() ? true : false; if ($onlybody) { $_GET['onlybody'] = 'no'; } ?> <table width='98%' align='center'> <tr class='header'> <td> ORDER #<?php echo $order->id . "=>{$order->assignedTo} " . html::a(commonModel::getSysURL() . $this->createLink('crm.order', 'view', "orderID={$order->id}"), $order->title); ?> </td> </tr> <tr> <td> <fieldset> <legend><?php echo $lang->order->view; ?>
/** * Create a link to a module's method. * * This method also mapped in control class to call conveniently. * <code> * <?php * helper::createLink('hello', 'index', 'var1=value1&var2=value2'); * helper::createLink('hello', 'index', array('var1' => 'value1', 'var2' => 'value2'); * ?> * </code> * @param string $moduleName module name * @param string $methodName method name * @param string|array $vars the params passed to the method, can be array('key' => 'value') or key1=value1&key2=value2) or key1=value1&key2=value2 * @param string $viewType the view type * @param string $onlybody the view type * @static * @access public * @return string the link string. */ public static function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlybody = false) { global $app, $config; $link = $config->requestType == 'PATH_INFO' ? $config->webRoot : $_SERVER['PHP_SELF']; /* Set the view type and vars. */ if (empty($viewType)) { $viewType = $app->getViewType(); } if (!is_array($vars)) { parse_str($vars, $vars); } /* The PATH_INFO type. */ if ($config->requestType == 'PATH_INFO') { /* If the method equal the default method defined in the config file and the vars is empty, convert the link. */ if ($methodName == $config->default->method and empty($vars)) { /* If the module also equal the default module, change index-index to index.html. */ if ($moduleName == $config->default->module) { $link .= 'index.' . $viewType; } else { $link .= $moduleName . '/'; } } else { $link .= "{$moduleName}{$config->requestFix}{$methodName}"; if ($config->pathType == 'full') { foreach ($vars as $key => $value) { $link .= "{$config->requestFix}{$key}{$config->requestFix}{$value}"; } } else { foreach ($vars as $value) { $link .= "{$config->requestFix}{$value}"; } } $link .= '.' . $viewType; } } elseif ($config->requestType == 'GET') { $link .= "?{$config->moduleVar}={$moduleName}&{$config->methodVar}={$methodName}"; if ($viewType != 'html') { $link .= "&{$config->viewVar}=" . $viewType; } foreach ($vars as $key => $value) { $link .= "&{$key}={$value}"; } } /* if page has onlybody param then add this param in all link. the param hide header and footer. */ if ($onlybody or isonlybody()) { $onlybody = $config->requestType == 'PATH_INFO' ? "?onlybody=yes" : "&onlybody=yes"; $link .= $onlybody; } return $link; }
/** * create a button, when click, go to a link. * * @param string $label the link title * @param string $link the link url * @param string $target the target window * @param string $misc other params * @static * @access public * @return string */ public static function linkButton($label = '', $link = '', $target = 'self', $misc = '') { global $config; /* if page has onlybody param then add this param in all link. the param hide header and footer. */ if (strpos($link, 'onlybody=') === false and isonlybody()) { $onlybody = $config->requestType == 'PATH_INFO' ? "?onlybody=yes" : "&onlybody=yes"; $link .= $onlybody; } return " <input type='button' value='{$label}' {$misc} onclick='{$target}.location=\"{$link}\"' class='button-c' /> "; }
/** * Close a bug. * * @param int $bugID * @access public * @return void */ public function close($bugID) { if (!empty($_POST)) { $this->bug->close($bugID); if (dao::isError()) { die(js::error(dao::getError())); } $actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment); $this->sendmail($bugID, $actionID); if (isonlybody()) { die(js::closeModal('parent.parent')); } die(js::locate($this->createLink('bug', 'view', "bugID={$bugID}"), 'parent')); } $bug = $this->bug->getById($bugID); $productID = $bug->product; $this->bug->setMenu($this->products, $productID, $bug->branch); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->close; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID={$productID}"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->close; $this->view->bug = $bug; $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); }
/** * create a button, when click, go to a link. * * @param string $label the link title * @param string $link the link url * @param string $target the target window * @param string $misc other params * @param string $class css class * @static * @access public * @return string */ public static function linkButton($label = '', $link = '', $target = 'self', $misc = '', $class = '') { global $config, $lang; if (isonlybody() and $lang->goback == $label) { return false; } /* if page has onlybody param then add this param in all link. the param hide header and footer. */ if (strpos($link, 'onlybody=') === false and isonlybody()) { $onlybody = $config->requestType == 'PATH_INFO' ? "?onlybody=yes" : "&onlybody=yes"; $link .= $onlybody; } return " <button type='button' {$misc} onclick='{$target}.location=\"{$link}\"' class='btn {$class}'>{$label}</button>"; }
/** * Copy a group. * * @param int $groupID * @access public * @return void */ public function copy($groupID) { if (!empty($_POST)) { $this->group->copy($groupID); if (dao::isError()) { die(js::error(dao::getError())); } if (isonlybody()) { die(js::closeModal('parent.parent', 'this')); } die(js::locate($this->createLink('group', 'browse'), 'parent')); } $this->view->title = $this->lang->group->copy; $this->view->position[] = $this->lang->group->copy; $this->view->group = $this->group->getById($groupID); $this->display(); }
public function edit($sprintRecordID = 0, $onlybody = 'no') { if (!empty($_POST)) { $this->mySprintBoard->edit(); $sprintID = $this->loadModel('mySprintBoard')->getSprintIDBySprintRecordID($sprintRecordID); if (isonlybody()) { die(js::closeModal('parent.parent')); } die(js::locate(inlink('index', "sprintID={$sprintID}"), 'parent')); } $this->methodName = 'edit'; //这是我新增的,是为了显示编辑器的头 $sprintRecord = $this->mySprintBoard->getSprintRecordBySprintRecordID($sprintRecordID); $sprintName = $this->mySprintBoard->getSprintNameBySprintRecordID($sprintRecordID); $sprintID = $this->loadModel('mySprintBoard')->getSprintIDBySprintRecordID($sprintRecordID); //$sprintRecordID=$this->loadModel('mySprintBoard')->getSprintIDBySprintRecordID($sprintRecordID); $this->view->sprintName = $sprintName; $this->view->sprintRecord = $sprintRecord; $this->view->sprintID = $sprintID; $this->view->sprintRecordID = $sprintRecordID; //$this->view->sprintRecordID=$sprintRecord; $this->display(); }
/** * Close testtask. * * @param int $taskID * @access public * @return void */ public function close($taskID) { $actions = $this->loadModel('action')->getList('testtask', $taskID); if (!empty($_POST)) { $changes = $this->testtask->close($taskID); if (dao::isError()) { die(js::error(dao::getError())); } if ($this->post->comment != '' or !empty($changes)) { $actionID = $this->action->create('testtask', $taskID, 'Closed', $this->post->comment); $this->action->logHistory($actionID, $changes); } if (isonlybody()) { die(js::reload('parent.parent')); } die(js::locate($this->createLink('testtask', 'view', "taskID={$taskID}"), 'parent')); } /* Get task info. */ $testtask = $this->testtask->getById($taskID); $productID = $this->product->saveState($testtask->product, $this->products); /* Set menu. */ $this->testtask->setMenu($this->products, $productID); $this->view->testtask = $this->testtask->getById($taskID); $this->view->title = $testtask->name . $this->lang->colon . $this->lang->close; $this->view->position[] = $this->lang->testtask->common; $this->view->position[] = $this->lang->close; $this->view->actions = $actions; $this->display(); }
/** * add by yuzz * Print backLink and preLink and nextLink. * * @param string $backLink * @param object $preAndNext * @access public * @return void */ public static function printRPN3($backLink, $preAndNext = '', $planID = '', $linkTemplate = '') { global $lang, $app; if (isonlybody()) { return false; } echo html::a($backLink, '<i class="icon-goback icon-level-up icon-large icon-rotate-270"></i>', '', "class='btn' title={$lang->goback}"); if (isset($preAndNext->pre) and $preAndNext->pre) { $id = (isset($_SESSION['testcaseOnlyCondition']) and !$_SESSION['testcaseOnlyCondition'] and $app->getModuleName() == 'testcase' and isset($preAndNext->pre->case)) ? 'case' : 'id'; $title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : $preAndNext->pre->name; $title = '#' . $preAndNext->pre->{$id} . ' ' . $title; $link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->pre->{$id}) : inLink('bugview', "planID={$planID}&bugID={$preAndNext->pre->{$id}}"); echo html::a($link, '<i class="icon-pre icon-chevron-left"></i>', '', "id='pre' class='btn' title='{$title}'"); } if (isset($preAndNext->next) and $preAndNext->next) { $id = (isset($_SESSION['testcaseOnlyCondition']) and !$_SESSION['testcaseOnlyCondition'] and $app->getModuleName() == 'testcase' and isset($preAndNext->next->case)) ? 'case' : 'id'; $title = isset($preAndNext->next->title) ? $preAndNext->next->title : $preAndNext->next->name; $title = '#' . $preAndNext->next->{$id} . ' ' . $title; $link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->next->{$id}) : inLink('bugview', "planID={$planID}&bugID={$preAndNext->next->{$id}}"); echo html::a($link, '<i class="icon-pre icon-chevron-right"></i>', '', "id='next' class='btn' title='{$title}'"); } }
/** * Activate a task. * * @param int $taskID * @access public * @return void */ public function activate($taskID) { $this->commonAction($taskID); if (!empty($_POST)) { $this->loadModel('action'); $changes = $this->task->activate($taskID); if (dao::isError()) { die(js::error(dao::getError())); } if ($this->post->comment != '' or !empty($changes)) { $actionID = $this->action->create('task', $taskID, 'Activated', $this->post->comment); $this->action->logHistory($actionID, $changes); $this->sendmail($taskID, $actionID); } if (isonlybody()) { die(js::closeModal('parent.parent', 'this')); } die(js::locate($this->createLink('task', 'view', "taskID={$taskID}"), 'parent')); } if (!isset($this->view->members[$this->view->task->finishedBy])) { $this->view->members[$this->view->task->finishedBy] = $this->view->task->finishedBy; } $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->task->activate; $this->view->position[] = $this->lang->task->activate; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->display(); }
echo html::a(inlink('download', "repoID={$repoID}&path={$encodePath}&fromRevision={$revision}"), html::icon('download-alt') . $lang->repo->download, 'hiddenwin', "class='btn btn-sm btn-primary'"); } ?> <?php } ?> <div class='btn-group'> <?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(inlink('view', "repoID={$repoID}&path={$encodePath}&revision={$revision}&showBug={$showBug}&encoding={$key}", 'html', isonlybody()), $val); ?> </li> <?php } ?> </ul> </div> </div> </div> <?php if (strpos($config->repo->images, "|{$suffix}|") !== false) { ?> <div class='image'><img src='data:image/<?php echo $suffix; ?>
/** * Manage members of a group. * * @param int $groupID * @access public * @return void */ public function manageMember($groupID) { if (!empty($_POST)) { $this->group->updateUser($groupID); if (isonlybody()) { die(js::closeModal('parent.parent', 'this')); } die(js::locate($this->createLink('group', 'browse'), 'parent')); } $group = $this->group->getById($groupID); $groupUsers = $this->group->getUserPairs($groupID); $allUsers = $this->user->getPairs('nodeleted|noclosed|noempty|noletter'); $otherUsers = array_diff_assoc($allUsers, $groupUsers); $title = $this->lang->company->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->manageMember; $position[] = $group->name; $position[] = $this->lang->group->manageMember; $this->view->title = $title; $this->view->position = $position; $this->view->group = $group; $this->view->groupUsers = $groupUsers; $this->view->otherUsers = $otherUsers; $this->display(); }
public function sprintedit($projectID) { $this->loadModel('project'); $this->loadModel('action'); $this->loadModel('product'); $this->loadModel('user'); 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->pmUsers = $this->user->getUsersByProjectID($projectID); $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(); }
/** * 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 browse view file of product module of ZenTaoPMS. * * @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com) * @license LGPL (http://www.gnu.org/licenses/lgpl.html) * @author Chunsheng Wang <*****@*****.**> * @package product * @version $Id$ * @link http://www.zentao.net */ if (isonlybody()) { die(include './storylist.html.php'); } include '../../common/view/header.html.php'; include '../../common/view/treeview.html.php'; include '../../common/view/colorize.html.php'; ?> <script language='Javascript'> var browseType = '<?php echo $browseType; ?> '; </script> <div id='featurebar'> <div class='f-left'> <span id='bymoduleTab' onclick='browseByModule()'><?php echo html::a($this->inlink('browse', "productID={$productID}"), $lang->product->moduleStory); ?> </span>
/** addedbyheng * Finish a project. * * @param int $projectID * @access public * @return void */ public function finish($projectID) { $project = $this->project->getById($projectID); if ($project->status != 'done') { $this->project->finish($projectID); } if ($project->type == 'bug' or $project->type == 'task') { $confirmNote = 'confirm' . ucfirst($project->type); $confirmURL = $this->createLink($project->type, 'view', "id={$project->idvalue}"); $cancelURL = $this->server->HTTP_REFERER; die(js::confirm(sprintf($this->lang->project->{$confirmNote}, $project->idvalue), $confirmURL, $cancelURL, 'parent', 'parent')); } if (isonlybody()) { die(js::reload('parent.parent')); } die(js::reload('parent')); }
/** * Print backLink and preLink and nextLink. * * @param string $backLink * @param object $preAndNext * @access public * @return void */ public static function printRPN($backLink, $preAndNext = '', $linkTemplate = '') { global $lang, $app; if (isonlybody()) { return false; } echo html::a($backLink, $lang->goback, "class='btn btn-default' id='backButton'"); if (isset($preAndNext->pre) and $preAndNext->pre) { $id = 'id'; $title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : (isset($preAndNext->pre->name) ? $preAndNext->pre->name : ''); $title = '#' . $preAndNext->pre->{$id} . ' ' . $title; $link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->pre->{$id}) : inLink('view', "ID={$preAndNext->pre->{$id}}"); echo html::a($link, '<i class="icon-pre icon-chevron-left"></i>', "id='pre' class='btn' title='{$title}'"); } if (isset($preAndNext->next) and $preAndNext->next) { $id = 'id'; $title = isset($preAndNext->next->title) ? $preAndNext->next->title : (isset($preAndNext->next->name) ? $preAndNext->next->name : ''); $title = '#' . $preAndNext->next->{$id} . ' ' . $title; $link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->next->{$id}) : inLink('view', "ID={$preAndNext->next->{$id}}"); echo html::a($link, '<i class="icon-pre icon-chevron-right"></i>', "id='next' class='btn' title='{$title}'"); } }