本文整理汇总了PHP中AuditEvent::logAuditEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP AuditEvent::logAuditEvent方法的具体用法?PHP AuditEvent::logAuditEvent怎么用?PHP AuditEvent::logAuditEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuditEvent
的用法示例。
在下文中一共展示了AuditEvent::logAuditEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDetails
public function actionDetails($id)
{
$contact = static::getModelAndCatchNotFoundAndDisplayError('Contact', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($contact);
if (!LeadsUtil::isStateALead($contact->state)) {
$urlParams = array('/contacts/' . $this->getId() . '/details', 'id' => $contact->id);
$this->redirect($urlParams);
} else {
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($contact), 'LeadsModule'), $contact);
$getData = GetUtil::getData();
$isKanbanBoardInRequest = ArrayUtil::getArrayValue($getData, 'kanbanBoard');
if ($isKanbanBoardInRequest == 0 || $isKanbanBoardInRequest == null || Yii::app()->userInterface->isMobile() === true) {
$breadCrumbView = StickySearchUtil::resolveBreadCrumbViewForDetailsControllerAction($this, 'LeadsSearchView', $contact);
$detailsAndRelationsView = $this->makeDetailsAndRelationsView($contact, 'LeadsModule', 'LeadDetailsAndRelationsView', Yii::app()->request->getRequestUri(), $breadCrumbView);
$view = new LeadsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $detailsAndRelationsView));
} else {
$kanbanItem = new KanbanItem();
$kanbanBoard = new TaskKanbanBoard($kanbanItem, 'type', $contact, get_class($contact));
$kanbanBoard->setIsActive();
$params['relationModel'] = $contact;
$params['relationModuleId'] = $this->getModule()->getId();
$params['redirectUrl'] = null;
$listView = new TasksForLeadKanbanView($this->getId(), 'tasks', 'Task', null, $params, null, array(), $kanbanBoard);
$view = new LeadsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $listView));
}
echo $view->render();
}
}
示例2: actionDetails
/**
* @param $id
* @param null $redirectUrl
*/
public function actionDetails($id, $redirectUrl = null)
{
$modelClassName = $this->getModule()->getPrimaryModelName();
$activity = static::getModelAndCatchNotFoundAndDisplayError($modelClassName, intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($activity);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($activity), get_class($this->getModule())), $activity);
$pageViewClassName = $this->getPageViewClassName();
$view = new $pageViewClassName(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $this->makeEditAndDetailsView($activity, 'Details')));
echo $view->render();
}
示例3: actionDetails
public function actionDetails($id)
{
$product = static::getModelAndCatchNotFoundAndDisplayError('Product', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($product);
$breadCrumbLinks = array(StringUtil::getChoppedStringContent(strval($product), 25));
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($product), 'ProductsModule'), $product);
$detailsView = new ProductEditAndDetailsView('Details', $this->getId(), $this->getModule()->getId(), $product);
$view = new ProductsPageView(ProductDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadCrumbLinks, 'ProductBreadCrumbView'));
echo $view->render();
}
示例4: actionDetails
public function actionDetails($id)
{
$account = static::getModelAndCatchNotFoundAndDisplayError('Account', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($account);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account), 'AccountsModule'), $account);
$breadCrumbView = StickySearchUtil::resolveBreadCrumbViewForDetailsControllerAction($this, 'AccountsSearchView', $account);
$detailsAndRelationsView = $this->makeDetailsAndRelationsView($account, 'AccountsModule', 'AccountDetailsAndRelationsView', Yii::app()->request->getRequestUri(), $breadCrumbView);
$view = new AccountsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $detailsAndRelationsView));
echo $view->render();
}
示例5: actionDetails
public function actionDetails($id)
{
$animal = static::getModelAndCatchNotFoundAndDisplayError('Animal', intval($id));
$breadCrumbView = StickySearchUtil::resolveBreadCrumbViewForDetailsControllerAction($this, 'AnimalsSearchView', $animal);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($animal);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($animal), 'AnimalsModule'), $animal);
$titleBarAndEditView = $this->makeEditAndDetailsView($animal, 'Details');
$view = new AnimalsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $titleBarAndEditView));
echo $view->render();
}
示例6: actionDetails
public function actionDetails($id)
{
$savedReport = static::getModelAndCatchNotFoundAndDisplayError('SavedReport', intval($id));
ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedReport->moduleClassName);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedReport);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($savedReport), 'ReportsModule'), $savedReport);
$breadCrumbLinks = array(strval($savedReport));
$breadCrumbView = new ReportBreadCrumbView($this->getId(), $this->getModule()->getId(), $breadCrumbLinks);
$detailsAndRelationsView = $this->makeReportDetailsAndRelationsView($savedReport, Yii::app()->request->getRequestUri(), $breadCrumbView);
$view = new ReportsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $detailsAndRelationsView));
echo $view->render();
}
示例7: actionDetails
public function actionDetails($id)
{
$conversation = static::getModelAndCatchNotFoundAndDisplayError('Conversation', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($conversation);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($conversation), 'ConversationsModule'), $conversation);
ConversationsUtil::markUserHasReadLatest($conversation, Yii::app()->user->userModel);
$detailsView = new ConversationDetailsView($this->getId(), $this->getModule()->getId(), $conversation);
$conversationsMashableInboxUrl = Yii::app()->createUrl('mashableInbox/default/list', array('modelClassName' => 'Conversation'));
$breadcrumbLinks = array(Zurmo::t('ConversationsModule', 'Conversations') => $conversationsMashableInboxUrl, StringUtil::getChoppedStringContent(strval($conversation), 25));
$view = new ConversationsPageView(ZurmoDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadcrumbLinks, 'ConversationBreadCrumbView'));
echo $view->render();
}
示例8: actionDetails
public function actionDetails($id)
{
$contact = static::getModelAndCatchNotFoundAndDisplayError('Contact', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($contact);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($contact), 'ContactsModule'), $contact);
if (KanbanUtil::isKanbanRequest() === false) {
$breadCrumbView = StickySearchUtil::resolveBreadCrumbViewForDetailsControllerAction($this, 'ContactsSearchView', $contact);
$detailsAndRelationsView = $this->makeDetailsAndRelationsView($contact, 'ContactsModule', 'ContactDetailsAndRelationsView', Yii::app()->request->getRequestUri(), $breadCrumbView);
$view = new ContactsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $detailsAndRelationsView));
} else {
$view = TasksUtil::resolveTaskKanbanViewForRelation($contact, $this->getModule()->getId(), $this, 'TasksForContactKanbanView', 'ContactsPageView');
}
echo $view->render();
}
示例9: actionDetails
public function actionDetails($id)
{
$savedWorkflow = static::getModelAndCatchNotFoundAndDisplayError('SavedWorkflow', intval($id));
ControllerSecurityUtil::resolveCanCurrentUserAccessModule($savedWorkflow->moduleClassName);
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($savedWorkflow);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($savedWorkflow), 'WorkflowsModule'), $savedWorkflow);
$breadCrumbLinks = array(strval($savedWorkflow));
$workflow = SavedWorkflowToWorkflowAdapter::makeWorkflowBySavedWorkflow($savedWorkflow);
$workflowToWizardFormAdapter = new WorkflowToWizardFormAdapter($workflow);
$form = $workflowToWizardFormAdapter->makeFormByType();
$detailsView = new WorkflowDetailsView($this->getId(), $this->getModule()->getId(), $form);
$view = new WorkflowsPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadCrumbLinks, 'WorkflowBreadCrumbView'));
echo $view->render();
}
示例10: actionDetails
public function actionDetails($id)
{
$contact = static::getModelAndCatchNotFoundAndDisplayError('Contact', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($contact);
if (!LeadsUtil::isStateALead($contact->state)) {
$urlParams = array('/contacts/' . $this->getId() . '/details', 'id' => $contact->id);
$this->redirect($urlParams);
} else {
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($contact), 'LeadsModule'), $contact);
$breadCrumbView = StickySearchUtil::resolveBreadCrumbViewForDetailsControllerAction($this, 'LeadsSearchView', $contact);
$detailsAndRelationsView = $this->makeDetailsAndRelationsView($contact, 'LeadsModule', 'LeadDetailsAndRelationsView', Yii::app()->request->getRequestUri(), $breadCrumbView);
$view = new LeadsPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $detailsAndRelationsView));
echo $view->render();
}
}
示例11: logAuditEventsListForCreatedAndModifed
protected function logAuditEventsListForCreatedAndModifed($newModel)
{
if ($newModel) {
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_CREATED, strval($this), $this);
} else {
AuditUtil::logAuditEventsListForChangedAttributeValues($this);
}
}
示例12: testGetTailDistinctEventsByEventName
public function testGetTailDistinctEventsByEventName()
{
Yii::app()->user->userModel = User::getByUsername('super');
$account1 = new Account();
$account1->name = 'Dooble1';
$this->assertTrue($account1->save());
$account2 = new Account();
$account2->name = 'Dooble2';
$this->assertTrue($account2->save());
$account3 = new Account();
$account3->name = 'Dooble3';
$account3->owner = User::getByUsername('jimmy');
$this->assertTrue($account3->save());
$auditEvents = AuditEvent::getTailDistinctEventsByEventName('Item Viewed', Yii::app()->user->userModel, 5);
$this->assertEquals(0, count($auditEvents));
//Now create some audit entries for the Item Viewed event.
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account1), 'AccountsModule'), $account1);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account2), 'AccountsModule'), $account2);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account1), 'AccountsModule'), $account1);
//Switch users to add an audit event.
Yii::app()->user->userModel = User::getByUsername('jimmy');
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account3), 'AccountsModule'), $account3);
Yii::app()->user->userModel = User::getByUsername('super');
$auditEvents = AuditEvent::getTailDistinctEventsByEventName('Item Viewed', Yii::app()->user->userModel, 5);
$this->assertEquals(2, count($auditEvents));
}
示例13: actionDetails
/**
* Details view for project
* @param int $id
*/
public function actionDetails($id)
{
$project = static::getModelAndCatchNotFoundAndDisplayError('Project', intval($id));
ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($project);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($project), 'ProjectsModule'), $project);
$view = TasksUtil::resolveTaskKanbanViewForRelation($project, $this->getModule()->getId(), $this, 'TasksForProjectKanbanView', 'ProjectsPageView');
echo $view->render();
}
示例14: logAuditEventsListForCreatedAndModifed
protected function logAuditEventsListForCreatedAndModifed($newModel)
{
if ($newModel) {
// When the first user is created there can be no
// current user. Log the first user as creating themselves.
if (Yii::app()->user->userModel == null || !Yii::app()->user->userModel->id > 0) {
Yii::app()->user->userModel = $this;
}
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_CREATED, strval($this), $this);
} else {
AuditUtil::logAuditEventsListForChangedAttributeValues($this);
}
}
示例15: testDeleteModelFromRecentlyViewed
public function testDeleteModelFromRecentlyViewed()
{
Yii::app()->user->userModel = User::getByUsername('super');
ZurmoConfigurationUtil::setForCurrentUserByModuleName('ZurmoModule', 'recentlyViewed', null);
$account1 = new Account();
$account1->name = 'Dooble1';
$this->assertTrue($account1->save());
$account2 = new Account();
$account2->name = 'Dooble2';
$this->assertTrue($account2->save());
$account3 = new Account();
$account3->name = 'Dooble3';
$account3->owner = User::getByUsername('jimmy');
$this->assertTrue($account3->save());
//Now create some audit entries for the Item Viewed event.
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account1), 'AccountsModule'), $account1);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account2), 'AccountsModule'), $account2);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($account1), 'AccountsModule'), $account3);
$content = AuditEventsRecentlyViewedUtil::getRecentlyViewedAjaxContentByUser(Yii::app()->user->userModel, 5);
$this->assertContains('Dooble1', $content);
$this->assertContains('Dooble2', $content);
$this->assertContains('Dooble3', $content);
AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_DELETED, strval($account1), $account1);
$content = AuditEventsRecentlyViewedUtil::getRecentlyViewedAjaxContentByUser(Yii::app()->user->userModel, 5);
$this->assertNotContains('Dooble1', $content);
$this->assertContains('Dooble2', $content);
$this->assertContains('Dooble3', $content);
}