当前位置: 首页>>代码示例>>PHP>>正文


PHP pager::init方法代码示例

本文整理汇总了PHP中pager::init方法的典型用法代码示例。如果您正苦于以下问题:PHP pager::init方法的具体用法?PHP pager::init怎么用?PHP pager::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pager的用法示例。


在下文中一共展示了pager::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: trash

 /**
  * Trash 
  * 
  * @param  string $type all|hidden 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function trash($type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     $this->session->set('docList', $uri);
     /* Get deleted objects. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $trashes = $this->action->getTrashes($type, $orderBy, $pager);
     /* Title and position. */
     $this->view->title = $this->lang->action->trash;
     $this->view->position[] = $this->lang->action->trash;
     $this->view->trashes = $trashes;
     $this->view->type = $type;
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->users = $this->loadModel('user')->getPairs('noletter');
     $this->display();
 }
开发者ID:iamazhi,项目名称:zentaopms,代码行数:40,代码来源:control.php

示例2: _get

 public function _get()
 {
     $total = oo::m()->count();
     $page = $this->req('page');
     pager::init($page, $total);
     $list = oo::m()->limit(pager::$start, pager::$num)->orderby('id desc')->getall();
     method_exists($this, 'after_get') && $this->after_get($list);
     $this->assign('pager', pager::get());
     $this->assign('list', $list);
     $this->display("{$this->form['tpl']}_list");
 }
开发者ID:justlikeheaven,项目名称:buxun,代码行数:11,代码来源:controller_form.php

示例3: index

 public function index()
 {
     $cid = $this->req('cid', 0, 'intval');
     $where = array();
     $cid && ($where = array('cateid' => $cid));
     $total = oo::m('product')->where($where)->count();
     $page = $this->req('page');
     pager::init($page, $total);
     $list = oo::m('product')->limit(pager::$start, pager::$num)->orderby('id desc')->where($where)->getall();
     $this->assign('list', $list);
     //推荐商家
     $seller = oo::m('seller')->limit(5)->getall();
     $this->assign('seller', $seller);
     $this->display('list');
 }
开发者ID:justlikeheaven,项目名称:buxun,代码行数:15,代码来源:list_c.php

示例4: defaultpwd

 public function defaultpwd($recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     if ($this->app->getViewType() == 'mhtml') {
         $recPerPage = 10;
     }
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $passwords = $this->kevinlogin->getPasswordList($pager);
     if (!empty($_POST)) {
         $this->kevinlogin->updateDefaultPwd();
         die(js::reload('parent'));
     }
     $this->view->title = $this->lang->kevinlogin->common . $this->lang->colon . $this->lang->kevinlogin->defaultpwd;
     $this->view->position[] = $this->lang->kevinlogin->defaultpwd;
     $this->view->pager = $pager;
     $this->view->passwords = $passwords;
     $this->view->controlType = 'defaultpwd';
     $this->display();
 }
开发者ID:xupnge1314,项目名称:project,代码行数:20,代码来源:control.php

示例5: browse

 /**
  * Browse bugs.
  * 
  * @param  int    $productID 
  * @param  string $browseType 
  * @param  int    $param 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function browse($productID = 0, $branch = '', $browseType = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Set browseType, productID, moduleID and queryID. */
     $browseType = strtolower($browseType);
     $productID = $this->product->saveState($productID, $this->products);
     if ($branch === '') {
         $branch = $this->session->branch;
     }
     $moduleID = $browseType == 'bymodule' ? (int) $param : 0;
     $queryID = $browseType == 'bysearch' ? (int) $param : 0;
     /* Set menu and save session. */
     $this->bug->setMenu($this->products, $productID, $branch);
     $this->session->set('bugList', $this->app->getURI(true));
     /* Process the order by field. */
     if (!$orderBy) {
         $orderBy = $this->cookie->qaBugOrder ? $this->cookie->qaBugOrder : 'id_desc';
     }
     setcookie('qaBugOrder', $orderBy, $this->config->cookieLife, $this->config->webRoot);
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     if ($this->app->getViewType() == 'mhtml') {
         $recPerPage = 10;
     }
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $projects = $this->loadModel('project')->getPairs();
     $projects[0] = '';
     /* Get bugs. */
     $bugs = array();
     if ($browseType == 'all') {
         $bugs = $this->bug->getAllBugs($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == "bymodule") {
         $childModuleIds = $this->tree->getAllChildId($moduleID);
         $bugs = $this->bug->getModuleBugs($productID, $branch, $childModuleIds, $projects, $sort, $pager);
     } elseif ($browseType == 'assigntome') {
         $bugs = $this->bug->getByAssigntome($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'openedbyme') {
         $bugs = $this->bug->getByOpenedbyme($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'resolvedbyme') {
         $bugs = $this->bug->getByResolvedbyme($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'assigntonull') {
         $bugs = $this->bug->getByAssigntonull($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'unconfirmed') {
         $bugs = $this->bug->getUnconfirmed($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'unresolved') {
         $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unresolved', $sort, $pager);
     } elseif ($browseType == 'unclosed') {
         $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unclosed', $sort, $pager);
     } elseif ($browseType == 'toclosed') {
         $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'toclosed', $sort, $pager);
     } elseif ($browseType == 'longlifebugs') {
         $bugs = $this->bug->getByLonglifebugs($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'postponedbugs') {
         $bugs = $this->bug->getByPostponedbugs($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'needconfirm') {
         $bugs = $this->bug->getByNeedconfirm($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'bysearch') {
         $bugs = $this->bug->getBySearch($productID, $queryID, $sort, $pager, $branch);
     }
     /* Process the sql, get the conditon partion, save it to session. */
     $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', $browseType == 'needconfirm' ? false : true);
     /* Process bug for check story changed. */
     $bugs = $this->loadModel('story')->checkNeedConfirm($bugs);
     /* Build the search form. */
     $this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID={$productID}&branch={$branch}&browseType=bySearch&queryID=myQueryID");
     $this->config->bug->search['queryID'] = $queryID;
     $this->config->bug->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->bug->allProduct);
     $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID);
     $this->config->bug->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0);
     $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID);
     $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, 0, $params = '');
     $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values'];
     if ($this->session->currentProductType == 'normal') {
         unset($this->config->bug->search['fields']['branch']);
         unset($this->config->bug->search['params']['branch']);
     } else {
         $this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
         $this->config->bug->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty');
     }
     $this->loadModel('search')->setSearchParams($this->config->bug->search);
     $users = $this->user->getPairs('noletter');
     /* Process the openedBuild and resolvedBuild fields. */
     $productIdList = array();
     foreach ($bugs as $bug) {
         $productIdList[$bug->id] = $bug->product;
     }
//.........这里部分代码省略.........
开发者ID:jsyinwenjun,项目名称:zentao,代码行数:101,代码来源:control.php

示例6: dynamic

 /**
  * My dynamic.
  * 
  * @param  string $type 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function dynamic($type = 'today', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     /* Set the pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* The header and position. */
     $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->dynamic;
     $this->view->position[] = $this->lang->my->dynamic;
     /* Assign. */
     $this->view->type = $type;
     $this->view->recTotal = $recTotal;
     $this->view->recPerPage = $recPerPage;
     $this->view->pageID = $pageID;
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->actions = $this->loadModel('action')->getDynamic($this->app->user->account, $type, $sort, $pager);
     $this->display();
 }
开发者ID:heeeello,项目名称:zentaopms,代码行数:43,代码来源:control.php

示例7: linkCase

 /**
  * Link cases to a test task.
  * 
  * @param  int    $taskID 
  * @access public
  * @return void
  */
 public function linkCase($taskID, $param = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     if (!empty($_POST)) {
         $this->testtask->linkCase($taskID);
         $this->locate(inlink('cases', "taskID={$taskID}"));
     }
     /* Save session. */
     $this->session->set('caseList', $this->app->getURI(true));
     /* Get task and product id. */
     $task = $this->testtask->getById($taskID);
     $productID = $this->product->saveState($task->product, $this->products);
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Build the search form. */
     $this->loadModel('testcase');
     $this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
     $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
     $this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID={$taskID}");
     $this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->testcase->search);
     /* Save session. */
     $this->testtask->setMenu($this->products, $productID);
     $this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->linkCase;
     $this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID={$productID}"), $this->products[$productID]);
     $this->view->position[] = $this->lang->testtask->linkCase;
     /* Get cases. */
     if ($this->session->testcaseQuery == false) {
         $this->session->set('testcaseQuery', ' 1 = 1');
     }
     $query = str_replace("`product` = 'all'", '1', $this->session->testcaseQuery);
     // If search all product, replace product = all to 1=1
     $linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
     if ($param == 'all') {
         $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->andWhere('id')->notIN($linkedCases)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
     }
     if ($param == 'bystory') {
         $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
         $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()->andWhere('story')->in($stories)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
     }
     if ($param == 'bybug') {
         $bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs');
         $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()->andWhere('fromBug')->in($bugs)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
     }
     $this->view->users = $this->loadModel('user')->getPairs('noletter');
     $this->view->cases = $cases;
     $this->view->taskID = $taskID;
     $this->view->pager = $pager;
     $this->display();
 }
开发者ID:huokedu,项目名称:zentao,代码行数:56,代码来源:control.php

示例8: dynamic

 /**
  * Company dynamic.
  * 
  * @param  string $browseType 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function dynamic($browseType = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     $this->company->setMenu();
     $this->app->loadLang('user');
     $this->app->loadLang('project');
     $this->loadModel('action');
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     /* Set the pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     /* Set the user and type. */
     $account = $browseType == 'account' ? $param : 'all';
     $product = $browseType == 'product' ? $param : 'all';
     $project = $browseType == 'project' ? $param : 'all';
     $period = ($browseType == 'account' or $browseType == 'product' or $browseType == 'project') ? 'all' : $browseType;
     $queryID = $browseType == 'bysearch' ? (int) $param : 0;
     /* Get products' list.*/
     $products = $this->loadModel('product')->getPairs('nocode');
     $products = array($this->lang->product->select) + $products;
     $this->view->products = $products;
     /* Get projects' list.*/
     $projects = $this->loadModel('project')->getPairs('nocode');
     $projects = array($this->lang->project->select) + $projects;
     $this->view->projects = $projects;
     /* Get users.*/
     $users = $this->loadModel('user')->getPairs('nodeleted|noclosed');
     $users[''] = $this->lang->user->select;
     $this->view->users = $users;
     /* The header and position. */
     $this->view->title = $this->lang->company->common . $this->lang->colon . $this->lang->company->dynamic;
     $this->view->position[] = $this->lang->company->dynamic;
     /* Get actions. */
     if ($browseType != 'bysearch') {
         $actions = $this->action->getDynamic($account, $period, $orderBy, $pager, $product, $project);
     } else {
         $actions = $this->action->getDynamicBySearch($products, $projects, $queryID, $orderBy, $pager);
     }
     /* Build search form. */
     $projects[0] = '';
     $products[0] = '';
     $users[''] = '';
     ksort($projects);
     ksort($products);
     $projects['all'] = $this->lang->project->allProject;
     $products['all'] = $this->lang->product->allProduct;
     $this->config->company->dynamic->search['actionURL'] = $this->createLink('company', 'dynamic', "browseType=bysearch&param=myQueryID");
     $this->config->company->dynamic->search['queryID'] = $queryID;
     $this->config->company->dynamic->search['params']['project']['values'] = $projects;
     $this->config->company->dynamic->search['params']['product']['values'] = $products;
     $this->config->company->dynamic->search['params']['actor']['values'] = $users;
     $this->loadModel('search')->setSearchParams($this->config->company->dynamic->search);
     /* Assign. */
     $this->view->browseType = $browseType;
     $this->view->account = $account;
     $this->view->product = $product;
     $this->view->project = $project;
     $this->view->queryID = $queryID;
     $this->view->actions = $actions;
     $this->display();
 }
开发者ID:iamazhi,项目名称:zentaopms,代码行数:84,代码来源:control.php

示例9: printProjectBlock

 /**
  * Print project block.
  * 
  * @access public
  * @return void
  */
 public function printProjectBlock()
 {
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init(0, $this->params->num, 1);
     $this->view->projectStats = $this->loadModel('project')->getProjectStats($status = 'undone', $productID = 0, $itemCounts = 30, $orderBy = 'code', $pager);
     $this->display();
 }
开发者ID:heeeello,项目名称:zentaopms,代码行数:13,代码来源:control.php

示例10: dynamic

 /**
  * Product dynamic.
  * 
  * @param  string $type 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function dynamic($productID = 0, $type = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     $this->product->setMenu($this->products, $productID);
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* Set the pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Set the user and type. */
     $account = $type == 'account' ? $param : 'all';
     $period = $type == 'account' ? 'all' : $type;
     /* The header and position. */
     $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->dynamic;
     $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $this->products[$productID]);
     $this->view->position[] = $this->lang->product->dynamic;
     /* Assign. */
     $this->view->productID = $productID;
     $this->view->type = $type;
     $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter');
     $this->view->account = $account;
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->param = $param;
     $this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, $productID);
     $this->display();
 }
开发者ID:nanata1115,项目名称:zentaopms,代码行数:49,代码来源:control.php

示例11: sqlreview

 /**
  * My sqls
  * @param  string $type
  * @param  int    $recTotal
  * @param  int    $recPerPage
  * @param  int    $pageID
  * @access public
  * @return void
  */
 public function sqlreview($type = 'assignedto', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $this->session->set('sqlList', $this->app->getURI(true));
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Assign. */
     $this->view->header->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story;
     $this->view->position[] = $this->lang->my->story;
     $this->view->sqls = $this->loadModel('sqlreview')->getUserSqls($this->app->user->account, $type, 'id_desc', $pager);
     $this->view->users = $this->user->getPairs('noletter');
     $this->view->type = $type;
     $this->view->pager = $pager;
     $this->display();
 }
开发者ID:shshenpengfei,项目名称:scrum_project_manage_system,代码行数:25,代码来源:control.php

示例12: browse

 public function browse($libID = 'default', $moduleID = 0, $browseType = 'bymodule', $param = 0, $orderBy = 'lastEditedDate_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Set browseType.*/
     $browseType = strtolower($browseType);
     $queryID = $browseType == 'bysearch' ? (int) $param : 0;
     if ($libID == 'default') {
         $libID = $this->info->getDefaultLibId();
     }
     //		if (!$libID){
     //			$browseType = 'all';
     //		}
     if ($libID === false) {
         //there is no default lib
         $libName = '';
     } else {
         $libName = $this->infolibs[$libID];
     }
     /* Set menu, save session. */
     $this->info->setMenu($this->infolibs, $libID, 'info');
     $this->session->set('infoList', $this->app->getURI(true));
     /* Process the order by field. */
     if (!$orderBy) {
         $orderBy = $this->cookie->infoOrder ? $this->cookie->infoOrder : 'lastEditedDate_desc';
     }
     setcookie('infoOrder', $orderBy, $this->config->cookieLife, $this->config->webRoot);
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Get infos. */
     $modules = 0;
     $infos = array();
     $tmpinfos = array();
     $infos = $this->dao->select('*')->from(TABLE_INFO)->Where('deleted')->eq(0)->andWhere('Stickie')->eq(2)->orderBy($orderBy)->fetchAll();
     if ($browseType == 'all') {
         $tmpinfos = $this->dao->select('*')->from(TABLE_INFO)->Where('deleted')->eq(0)->andWhere('Stickie')->ne(2)->orderBy('Stickie_desc,' . $orderBy)->page($pager)->fetchAll();
     } elseif ($browseType == "bymodule") {
         if ($moduleID) {
             $modules = $this->info->getAllChildId($moduleID);
         }
         $tmpinfos = $this->info->getInfos($libID, $modules, 'Stickie_desc,' . $orderBy, $pager);
     } elseif ($browseType == 'createdbyme') {
         if ($moduleID) {
             $modules = $this->info->getAllChildId($moduleID);
         }
         $infos = $this->dao->findBycreatedBy($this->app->user->account)->from(TABLE_INFO)->beginIF(is_numeric($libID))->andWhere('lib')->eq($libID)->fi()->beginIF($modules)->andWhere('module')->in($modules)->fi()->andWhere('deleted')->eq(0)->orderBy('Stickie_desc,' . $orderBy)->page($pager)->fetchAll();
     } elseif ($browseType == 'postponed') {
         if ($moduleID) {
             $modules = $this->info->getAllChildId($moduleID);
         }
         $infos = $this->dao->findBydeadline('<', date('Y-m-d'))->from(TABLE_INFO)->andWhere("(`deadline` <> '0000-00-00')")->beginIF(is_numeric($libID))->andWhere('lib')->eq($libID)->fi()->beginIF($modules)->andWhere('module')->in($modules)->fi()->andWhere('deleted')->eq(0)->orderBy('Stickie_desc,' . $orderBy)->page($pager)->fetchAll();
     } elseif ($browseType == 'mailtome') {
         if ($moduleID) {
             $modules = $this->info->getAllChildId($moduleID);
         }
         $infos = $this->dao->findBymailto('LIKE', '%%' . $this->app->user->account . '%%')->from(TABLE_INFO)->beginIF(is_numeric($libID))->andWhere('lib')->eq($libID)->fi()->beginIF($modules)->andWhere('module')->in($modules)->fi()->andWhere('deleted')->eq(0)->orderBy('Stickie_desc,' . $orderBy)->page($pager)->fetchAll();
     } elseif ($browseType == "bysearch") {
         if ($queryID) {
             $query = $this->loadModel('search')->getQuery($queryID);
             if ($query) {
                 $this->session->set('infoQuery', $query->sql);
                 $this->session->set('infoForm', $query->form);
             } else {
                 $this->session->set('infoQuery', ' 1 = 1');
             }
         } else {
             if ($this->session->infoQuery == false) {
                 $this->session->set('infoQuery', ' 1 = 1');
             }
         }
         $infoQuery = $this->session->infoQuery;
         $infos = array();
         //置空总置顶
         $tmpinfos = $this->dao->select('*')->from(TABLE_INFO)->where($infoQuery)->andWhere('deleted')->eq(0)->orderBy('Stickie_desc,' . $orderBy)->page($pager)->fetchAll();
     }
     $infos = array_merge($infos, $tmpinfos);
     /* Process the sql, get the conditon partion, save it to session. Thus the report page can use the same condition. */
     $sql = explode('WHERE', $this->dao->get());
     $sql = explode('ORDER', $sql[1]);
     $sql = explode('AND Stickie', $sql[0]);
     //print $sql[0].'<br />';
     $this->session->set('infoReportCondition', $sql[0]);
     /* Get custom fields. */
     $customFields = $this->cookie->infoFields != false ? $this->cookie->infoFields : $this->config->info->list->defaultFields;
     $customed = !($customFields == $this->config->info->list->defaultFields);
     /* If customed, get related name or titles. */
     if ($customed) {
         /* Get related objects id lists. */
         $relatedModuleIdList = array();
         $relatedLibIdList = array();
         foreach ($infos as $info) {
             $relatedModuleIdList[$info->module] = $info->module;
             $relatedLibIdList[$info->lib] = $info->lib;
             /* Get related objects title or names. */
             $relatedModules = $this->dao->select('id, name')->from(TABLE_INFOMODULE)->where('id')->in($relatedModuleIdList)->fetchPairs();
             $relatedLibs = $this->dao->select('id, name')->from(TABLE_INFOLIB)->where('id')->in($relatedLibIdList)->fetchPairs();
             /* fill some field with useful value. */
             if (isset($relatedModules[$info->module])) {
                 $info->module = $relatedModules[$info->module];
             }
             if (isset($relatedLibs[$info->lib])) {
//.........这里部分代码省略.........
开发者ID:huokedu,项目名称:zentao,代码行数:101,代码来源:control.php

示例13: printProjectBlock

 /**
  * Print project block.
  * 
  * @access public
  * @return void
  */
 public function printProjectBlock()
 {
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init(0, $this->params->num, 1);
     $this->view->projectStats = $this->loadModel('project')->getProjectStats($status = 'undone', $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'order_desc', $this->viewType != 'json' ? $pager : '');
     $this->view->listLink = $this->view->sso . $this->view->sign . 'referer=' . base64_encode($this->createLink('my', 'project'));
 }
开发者ID:universal-youth,项目名称:pm.universal-youth.com,代码行数:13,代码来源:control.php

示例14: sprinttask

 /**
  * My sprinttasks
  * 
  * @param  string $type 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function sprinttask($sprintID = 0, $type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $this->session->set('taskList', $this->app->getURI(true));
     $this->session->set('storyList', $this->app->getURI(true));
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     if ($this->app->getViewType() == 'mhtml') {
         $recPerPage = 10;
     }
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* Assign. */
     $this->view->sprintID = $sprintID;
     $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->task;
     $this->view->position[] = $this->lang->my->task;
     $this->view->tabID = 'task';
     $this->view->tasks = $this->loadModel('task')->getUserSprintTasks($this->app->user->account, $sprintID, $type, 0, $pager, $sort);
     $this->view->type = $type;
     $this->view->recTotal = $recTotal;
     $this->view->recPerPage = $recPerPage;
     $this->view->pageID = $pageID;
     $this->view->orderBy = $orderBy;
     $this->view->users = $this->loadModel('user')->getPairs('noletter');
     $this->view->pager = $pager;
     $this->display();
 }
开发者ID:XMGmen,项目名称:zentao,代码行数:38,代码来源:control.php

示例15: browse

 /**
  * Browse cases.
  * 
  * @param  int    $productID 
  * @param  string $browseType 
  * @param  int    $param 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function browse($productID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Set browseType, productID, moduleID and queryID. */
     $browseType = strtolower($browseType);
     $productID = $this->product->saveState($productID, $this->products);
     $moduleID = $browseType == 'bymodule' ? (int) $param : 0;
     $queryID = $browseType == 'bysearch' ? (int) $param : 0;
     /* Set menu, save session. */
     $this->testcase->setMenu($this->products, $productID);
     $this->session->set('caseList', $this->app->getURI(true));
     $this->session->set('productID', $productID);
     $this->session->set('moduleID', $moduleID);
     $this->session->set('browseType', $browseType);
     $this->session->set('orderBy', $orderBy);
     /* Load lang. */
     $this->app->loadLang('testtask');
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* By module or all cases. */
     if ($browseType == 'bymodule' or $browseType == 'all') {
         $childModuleIds = $this->tree->getAllChildId($moduleID);
         $this->view->cases = $this->testcase->getModuleCases($productID, $childModuleIds, $sort, $pager);
     } elseif ($browseType == 'needconfirm') {
         $this->view->cases = $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_CASE)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')->where("t2.status = 'active'")->andWhere('t1.deleted')->eq(0)->andWhere('t2.version > t1.storyVersion')->orderBy($sort)->page($pager)->fetchAll();
     } elseif ($browseType == 'bysearch') {
         if ($queryID) {
             $query = $this->loadModel('search')->getQuery($queryID);
             if ($query) {
                 $this->session->set('testcaseQuery', $query->sql);
                 $this->session->set('testcaseForm', $query->form);
             } else {
                 $this->session->set('testcaseQuery', ' 1 = 1');
             }
         } else {
             if ($this->session->testcaseQuery == false) {
                 $this->session->set('testcaseQuery', ' 1 = 1');
             }
         }
         $queryProductID = $productID;
         $allProduct = "`product` = 'all'";
         $caseQuery = '(' . $this->session->testcaseQuery;
         if (strpos($this->session->testcaseQuery, $allProduct) !== false) {
             $products = array_keys($this->loadModel('product')->getPrivProducts());
             $caseQuery = str_replace($allProduct, '1', $caseQuery);
             $caseQuery = $caseQuery . ' AND `product`' . helper::dbIN($products);
             $queryProductID = 'all';
         }
         $caseQuery .= ')';
         $this->view->cases = $this->dao->select('*')->from(TABLE_CASE)->where($caseQuery)->beginIF($queryProductID != 'all')->andWhere('product')->eq($productID)->fi()->andWhere('deleted')->eq(0)->orderBy($sort)->page($pager)->fetchAll();
     }
     /* save session .*/
     $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $browseType != 'bysearch' ? false : true);
     /* Build the search form. */
     $this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
     $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
     $this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID={$productID}&browseType=bySearch&queryID=myQueryID");
     $this->config->testcase->search['queryID'] = $queryID;
     $this->loadModel('search')->setSearchParams($this->config->testcase->search);
     /* Assign. */
     $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
     $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID={$productID}"), $this->products[$productID]);
     $this->view->position[] = $this->lang->testcase->common;
     $this->view->productID = $productID;
     $this->view->productName = $this->products[$productID];
     $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'));
     $this->view->moduleID = $moduleID;
     $this->view->pager = $pager;
     $this->view->users = $this->user->getPairs('noletter');
     $this->view->orderBy = $orderBy;
     $this->view->browseType = $browseType;
     $this->view->param = $param;
     $this->display();
 }
开发者ID:XMGmen,项目名称:zentao,代码行数:88,代码来源:control.php


注:本文中的pager::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。