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


PHP za函数代码示例

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


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


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