• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP za函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中za函数的典型用法代码示例。如果您正苦于以下问题:PHP za函数的具体用法?PHP za怎么用?PHP za使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: addNoteTo

 /**
  * Add a note to an item
  *
  * @param unknown_type $toItem
  * @param unknown_type $note
  * @param unknown_type $title
  */
 public function addNoteTo($toItem, $note, $title = null, $username = null)
 {
     // get rid of multiple Re: bits in a title
     $title = preg_replace('|(Re: )+|i', 'Re: ', $title);
     $params = array('title' => $title, 'note' => $note, 'attachedtotype' => get_class($toItem), 'attachedtoid' => $toItem->id, 'userid' => $username == null ? za()->getUser()->getUsername() : $username);
     return $this->dbService->saveObject($params, 'Note');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:14,代码来源:NotificationService.php


示例2: preDispatch

 /**
  * Before allowing someone to do stuff, check to see
  * whether they have access to the file they've requested
  * 
  */
 public function preDispatch()
 {
     if (za()->getUser()->getRole() == User::ROLE_EXTERNAL) {
         // make sure the id is valid
         $id = $this->_getParam('id');
         $client = $this->clientService->getUserClient(za()->getUser());
         $project = $this->byId($this->_getParam('projectid'), 'Project');
         if ($client == null || $project == null) {
             $this->log->warn("User " . za()->getUser()->getUsername() . " tried viewing without valid client or project");
             $this->requireLogin();
             return;
         }
         if ($id) {
             // see whether the list of files for the current user's
             // company is valid
             /*$path = 'Clients/'.$client->title.'/Projects/'.$project->title;
             	            
             	            $okay = $this->fileService->isInDirectory($this->fileService->getFile($id), $path, true);
             
             	            if (!$okay) {
             	                $this->requireLogin();
             	            }*/
         }
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:30,代码来源:FileController.php


示例3: indexAction

 public function indexAction()
 {
     $user = za()->getUser();
     // If it's an external user, redirect to the external module
     if ($user->getDefaultModule() != '') {
         // redirect appropriately
         $this->redirect('index', null, null, $user->getDefaultModule());
         return;
     }
     $this->view->items = $this->notificationService->getWatchedItems($user, array('Project', 'Client'));
     $cats = array();
     $start = date('Y-m') . '-01 00:00:00';
     $end = date('Y-m-t') . ' 23:59:59';
     $order = 'endtime desc';
     $startDay = date('Y-m-d') . ' 00:00:00';
     $endDay = date('Y-m-d') . ' 23:59:59';
     //    	$this->view->taskInfo = $this->projectService->getTimesheetReport($user, null, null, -1, $start, $end, $cats, $order);
     //    	$this->view->dayTasks = $this->projectService->getDetailedTimesheet($user, null, null, null, -1, $startDay, $endDay);
     $this->view->latest = $this->projectService->getProjects(array('ismilestone=' => 0), 'updated desc', 1, 10);
     $task = new Task();
     $this->view->categories = $task->constraints['category']->getValues();
     $this->view->startDate = $start;
     $this->view->endDate = $end;
     $this->view->favourites = $this->dbService->getObjects('PanelFavourite', array('creator=' => za()->getUser()->username));
     $this->renderView('index/index.php');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:26,代码来源:IndexController.php


示例4: reindex

function reindex($items)
{
    $searchService = za()->getService('SearchService');
    foreach ($items as $item) {
        echo "Reindexing " . $item->title . "...   ";
        $searchService->index($item);
        echo "Done\r\n";
    }
}
开发者ID:nyeholt,项目名称:relapse,代码行数:9,代码来源:reindex_system.php


示例5: listforuserAction

 public function listforuserAction()
 {
     $user = $this->userService->getUserByField('username', $this->_getParam('username'));
     if ($user == null) {
         $user = za()->getUser();
     }
     $this->view->user = $user;
     $this->view->reports = $this->expenseService->getExpenseReports(array('expensereport.username=' => $user->username, 'expensereport.locked=' => '1', 'expensereport.paiddate<>' => 'null'));
     $this->renderView('expenses/list.php');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:10,代码来源:IndexController.php


示例6: testDelete

 public function testDelete()
 {
     $searchService = za()->getService('SearchService');
     $example = new Task();
     $example->id = 1;
     $example->title = 'Task for testing';
     $example->description = "Task description for testing";
     $searchService->delete($example);
     $results = $searchService->search("testing");
     $this->assertEqual(count($results), 0);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:11,代码来源:TestSearchService.php


示例7: createuserAction

 /**
  * Create a user for the given contact. 
  */
 public function createuserAction()
 {
     $contact = $this->byId();
     try {
         $this->clientService->createUserForContact($contact);
     } catch (InvalidModelException $ime) {
         $this->flash($ime->getMessages());
         za()->log(print_r($ime->getMessages(), true), Zend_Log::ERR);
     }
     $this->redirect('contact', 'edit', array('id' => $contact->id));
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:14,代码来源:ContactController.php


示例8: contactlistAction

 /**
  * Load the contacts for a given client id
  */
 public function contactlistAction()
 {
     $client = $this->clientService->getUserClient(za()->getUser());
     if (!$client) {
         echo "Failed loading contacts";
         return;
     }
     $this->view->client = $client;
     $this->view->contacts = $this->clientService->getContacts($client);
     $this->renderRawView('contact/ajax-list.php');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:14,代码来源:ContactController.php


示例9: viewAction

 /**
  * View a single client
  *
  */
 public function viewAction()
 {
     $this->view->client = $this->byId();
     $this->view->title = $this->view->client->title;
     $this->view->existingWatch = $this->notificationService->getWatch(za()->getUser(), $this->view->client);
     if ($this->_getParam('_ajax')) {
         $this->renderRawView('client/ajaxView.php');
     } else {
         $this->renderView('client/view.php');
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:15,代码来源:ClientController.php


示例10: execute

 public function execute()
 {
     $server = za()->getConfig('support_mail_server');
     $user = za()->getConfig('support_email_user');
     $pass = za()->getConfig('support_email_pass');
     if (!$server || !$user || !$pass) {
         // exit!
         throw new Exception("Configuration incorrect for checking issue emails");
     }
     $emails = $this->emailService->readEmailFrom($server, $user, $pass, true);
     $this->issueService->processIncomingEmails($emails);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:12,代码来源:CheckEmails.php


示例11: dispatchLoopStartup

 /**
  * Called before Zend_Controller_Front enters its dispatch loop.
  * During the dispatch loop.
  *
  * This callback allows for proxy or filter behavior.  The
  * $action must be returned for the Zend_Controller_Dispatcher_Token to enter the
  * dispatch loop.  To abort before the dispatch loop is
  * entered, return FALSE.
  *
  * @param  Zend_Controller_Dispatcher_Token|boolean $action
  * @return Zend_Controller_Dispatcher_Token|boolean
  */
 public function dispatchLoopStartup($action)
 {
     // Checks PHP_AUTH_USER and PHP_AUTH_PW and uses those values
     // to authenticate a user
     if (!za()->getUser()->getId() > 0 && isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
         // Get the auth service and authenticate the user
         $auth = za()->getService('AuthService');
         /* @var $auth AuthService */
         $user = $auth->authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
     }
     return $action;
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:24,代码来源:PhpAuthPlugin.php


示例12: renderView

 /**
  * Before rendering, we'll add some extra stuff into the view!
  *
  */
 protected function renderView($script)
 {
     if (za()->getUser()->hasRole(User::ROLE_USER)) {
         $this->view->actionList = new CompositeView('layouts/actions-list.php');
         // Let's get a bunch of the current user's oldest incomplete
         // tasks to put in the list.
         $projectService = za()->getService('ProjectService');
         /* @var $projectService ProjectService */
         $this->view->actionList->tasks = $projectService->getUserTasks(za()->getUser(), array('complete=' => 0));
     }
     parent::renderView($script);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:16,代码来源:BaseController.php


示例13: testListDirectory

 function testListDirectory()
 {
     $fileService = za()->getService('FileService');
     /* @var $fileService AlfrescoFileService */
     try {
         $file = $fileService->createFile('sample_file.txt', '/My');
         $fileService->setFile($file, __FILE__);
     } catch (FileExistsException $fee) {
         // don't do anything, we don't really care
     }
     $list = $fileService->listDirectory('/My');
     $this->assertEqual(3, count($list));
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:13,代码来源:TestAlfrescoFileService.php


示例14: preDispatch

 public function preDispatch()
 {
     $userClient = $this->clientService->getUserClient(za()->getUser());
     if ($userClient != null) {
         $id = $this->_getParam('id');
         // get the user's client
         if ($id != $userClient->id) {
             $this->_setParam('id', $userClient->id);
         }
     } else {
         $this->requireLogin();
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:13,代码来源:ClientController.php


示例15: editAction

 /**
  * Edit a user object.
  *
  */
 public function editAction()
 {
     $id = (int) $this->_getParam('id');
     $userToEdit = za()->getUser();
     // if the user's an admin, give them the list of contacts
     // to bind for this user
     if (za()->getUser()->isPower()) {
         // get all the contacts
         $this->view->contacts = $this->clientService->getContacts();
     }
     $this->view->model = $userToEdit;
     $this->renderView('user/edit.php');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:17,代码来源:UserController.php


示例16: execute

 public function execute()
 {
     $issues = $this->issueService->getIssues(array('status=' => 'Open'));
     // Get the project for each issue
     $group = $this->groupService->getGroupByField('title', za()->getConfig('issue_group'));
     if ($group) {
         $users = $this->groupService->getUsersInGroup($group);
         $msg = new TemplatedMessage('open-issues.php', array('issues' => $issues));
         $this->notificationService->notifyUser('Open Requests', $users, $msg);
     } else {
         za()->log()->warn("Could not find group for sending issues to");
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:13,代码来源:IssueNotification.php


示例17: track

 /**
  * Track an action
  *
  * @param unknown_type $actionname
  * @param unknown_type $actionid
  * @param unknown_type $user
  * @param unknown_type $url
  */
 public function track($actionname, $actionid, $user = null, $url = null, $data = null)
 {
     $params = array();
     if ($user == null) {
         $params['user'] = za()->getUser()->getUsername();
     }
     if ($url == null) {
         $params['url'] = current_url();
     }
     $params['actionname'] = $actionname;
     $params['actionid'] = $actionid;
     $params['entrydata'] = $data;
     $this->trackAction($params);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:22,代码来源:TrackerService.php


示例18: testGetExpenses

 function testGetExpenses()
 {
     $dbService = za()->getService('DbService');
     /* @var $dbService DbService */
     $dbService->delete('expense');
     $dbService->delete('client');
     $clientService = za()->getService('ClientService');
     /* @var $clientService ClientService */
     $expenseService = za()->getService('ExpenseService');
     /* @var $clientService ExpenseService */
     $params['title'] = 'Client';
     $client = $clientService->saveClient($params);
     $expense1 = array('description');
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:14,代码来源:TestExpenseService.php


示例19: testCreateClient

 public function testCreateClient()
 {
     $dbService = za()->getService('DbService');
     /* @var $dbService DbService */
     $dbService->delete('client');
     $clientService = za()->getService('ClientService');
     /* @var $clientService ClientService */
     $params['title'] = 'Client';
     $client = $clientService->saveClient($params);
     $project = $clientService->getClientSupportProject($client);
     $this->assertEqual('Client Support', $project->title);
     // Try again to force loading.
     $project = $clientService->getClientSupportProject($client);
     $this->assertEqual('Client Support', $project->title);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:15,代码来源:TestClientService.php


示例20: testImportGantt

 public function testImportGantt()
 {
     $projectService = za()->getService('ProjectService');
     /* @var $projectService ProjectService */
     $projectService->dbService->delete('project');
     $projectService->dbService->delete('task');
     $projectService->dbService->delete('usertaskassignment');
     $params['title'] = "My Project";
     $project = $projectService->saveProject($params);
     $projectService->importTasks($project, dirname(__FILE__) . '/POC.csv', 'ms');
     $exporter = $projectService->exportTasks($project, 'gp');
     print_r($exporter->getHeaderRow());
     while ($row = $exporter->getNextDataRow()) {
         print_r($row);
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:16,代码来源:TestProjectService.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP zamgerlog函数代码示例发布时间:2022-05-23
下一篇:
PHP z_taxonomy_image_url函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap