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


PHP eZCollaborationItem类代码示例

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


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

示例1: testApprovalFatalErrorWhenMoving

 /**
  * Test regression for issue #13952: Workflow cronjob gives fatal error if
  * node is moved to different location before approval.
  *
  * Test Outline
  * ------------
  * 1. Create a folder
  * 2. Approve folder
  * 3. Create child of folder
  * 4. Approve child
  * 5. Create a new version and re-publish the child
  * 6. Move child to root
  * 7. Approve child
  * 8. Run approval cronjob
  *
  * @result: Fatal error: Call to a member function attribute() on a non-object in
  *          /www/trunk/kernel/content/ezcontentoperationcollection.php on line 313
  * @expected: No fatal error
  * @link http://issues.ez.no/13952
  */
 public function testApprovalFatalErrorWhenMoving()
 {
     $anonymousObjectID = eZUser::fetchByName('anonymous')->attribute('contentobject_id');
     // STEP 1: Create a folder
     $folder = new ezpObject("folder", 2, $anonymousObjectID);
     $folder->name = "Parent folder (needs approval)";
     $folder->publish();
     // STEP 2: Approve folder
     $collaborationItem = eZCollaborationItem::fetch(1);
     $this->approveCollaborationItem($collaborationItem);
     $this->runWorkflow();
     // STEP 3: Create child of folder
     $child = new ezpObject("folder", $folder->mainNode->node_id, $anonymousObjectID);
     $child->name = "Child folder (needs approval)";
     $child->publish();
     // STEP 4: Approve child
     $collaborationItem = eZCollaborationItem::fetch(2);
     $this->approveCollaborationItem($collaborationItem);
     $this->runWorkflow();
     // STEP 5: Re-publish child
     $newVersion = $child->createNewVersion();
     ezpObject::publishContentObject($child->object, $newVersion);
     // STEP 6: Move child to root
     $child->mainNode->move(2);
     // STEP 7: Approve child again
     $collaborationItem = eZCollaborationItem::fetch(3);
     $this->approveCollaborationItem($collaborationItem);
     // STEP 8: Run approval cronjob
     $this->runWorkflow();
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:50,代码来源:ezapprovetype_regression.php

示例2: collaborationItem

 function collaborationItem()
 {
     if (isset($this->CollaborationID) and $this->CollaborationID) {
         return eZCollaborationItem::fetch($this->CollaborationID, $this->UserID);
     }
     return null;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:7,代码来源:ezcollaborationitemgrouplink.php

示例3: fetchItemCount

 function fetchItemCount($isRead, $isActive, $parentGroupID, $status)
 {
     $itemParameters = array('is_read' => $isRead, 'is_active' => $isActive, 'parent_group_id' => $parentGroupID);
     if ($status !== false) {
         $itemParameters['status'] = $status;
     }
     $count = eZCollaborationItem::fetchListCount($itemParameters);
     return array('result' => $count);
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:9,代码来源:ezcollaborationfunctioncollection.php

示例4: checkApproveCollaboration

 function checkApproveCollaboration( $process, $event )
 {
     $db = eZDb::instance();
     $taskResult = $db->arrayQuery( 'select workflow_process_id, collaboration_id from ezapprove_items where workflow_process_id = ' . $process->attribute( 'id' )  );
     $collaborationID = $taskResult[0]['collaboration_id'];
     $collaborationItem = eZCollaborationItem::fetch( $collaborationID );
     $contentObjectVersion = eZApproveCollaborationHandler::contentObjectVersion( $collaborationItem );
     $approvalStatus = eZApproveCollaborationHandler::checkApproval( $collaborationID );
     if ( $approvalStatus == eZApproveCollaborationHandler::STATUS_WAITING )
     {
         eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, 'approval still waiting' );
         return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
     }
     else if ( $approvalStatus == eZApproveCollaborationHandler::STATUS_ACCEPTED )
     {
         eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, 'approval was accepted' );
         $status = eZWorkflowType::STATUS_ACCEPTED;
     }
     else if ( $approvalStatus == eZApproveCollaborationHandler::STATUS_DENIED or
               $approvalStatus == eZApproveCollaborationHandler::STATUS_DEFERRED )
     {
         eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, 'approval was denied' );
         $contentObjectVersion->setAttribute( 'status', eZContentObjectVersion::STATUS_DRAFT );
         $status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     else
     {
         eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, "approval unknown status '$approvalStatus'" );
         $contentObjectVersion->setAttribute( 'status', eZContentObjectVersion::STATUS_REJECTED );
         $status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     $contentObjectVersion->sync();
     if ( $approvalStatus != eZApproveCollaborationHandler::STATUS_DEFERRED )
         $db->query( 'DELETE FROM ezapprove_items WHERE workflow_process_id = ' . $process->attribute( 'id' )  );
     return $status;
 }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:36,代码来源:ezapprovetype.php

示例5: fetchList

 static function fetchList($parameters = array())
 {
     return eZCollaborationItem::fetchListTool($parameters, false);
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:4,代码来源:ezcollaborationitem.php

示例6:

{
    $cli->output( "Removing all forgot password requests" );
    eZForgotPassword::cleanup();
}

if ( $clean['workflow'] )
{
    $cli->output( "Removing all workflow processes and operation mementos" );
    eZOperationMemento::cleanup();
    eZWorkflowProcess::cleanup();
}

if ( $clean['collaboration'] )
{
    $cli->output( "Removing all collaboration elements" );
    eZCollaborationItem::cleanup();
}

if ( $clean['collectedinformation'] )
{
    $cli->output( "Removing all collected information" );
    eZInformationCollection::cleanup();
}

if ( $clean['notification'] )
{
    $cli->output( "Removing all notifications events" );
    eZNotificationEvent::cleanup();
    eZNotificationCollection::cleanup();
    eZNotificationEventFilter::cleanup();
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:cleanup.php

示例7: eventContent

 function eventContent($event)
 {
     return eZCollaborationItem::fetch($event->attribute('data_int1'));
 }
开发者ID:legende91,项目名称:ez,代码行数:4,代码来源:ezcollaborationtype.php

示例8: array

/**
 * @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
 * @license http://ez.no/Resources/Software/Licenses/eZ-Business-Use-License-Agreement-eZ-BUL-Version-2.1 eZ Business Use License Agreement eZ BUL Version 2.1
 * @version 4.7.0
 * @package kernel
 */

$Module = $Params['Module'];
$ViewMode = $Params['ViewMode'];
$ItemID = $Params['ItemID'];

$Offset = $Params['Offset'];
if ( !is_numeric( $Offset ) )
    $Offset = 0;

$collabItem = eZCollaborationItem::fetch( $ItemID );
if ( $collabItem === null )
    return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );

$collabHandler = $collabItem->handler();
$collabItem->handleView( $ViewMode );
$template = $collabHandler->template( $ViewMode );
$collabTitle = $collabItem->title();

$viewParameters = array( 'offset' => $Offset );

$tpl = eZTemplate::factory();

$tpl->setVariable( 'view_parameters', $viewParameters );
$tpl->setVariable( 'collab_item', $collabItem );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:item.php

示例9: participantRoleString

 function participantRoleString()
 {
     if ($this->ParticipantRole < self::ROLE_CUSTOM) {
         return eZCollaborationItemParticipantLink::roleString($this->ParticipantRole);
     }
     $item = eZCollaborationItem::fetch($this->CollaborationID);
     return $item->attribute('type_identifier') . '_' . $item->handler()->participantRoleString($this->ParticipantRole);
 }
开发者ID:legende91,项目名称:ez,代码行数:8,代码来源:ezcollaborationitemparticipantlink.php

示例10: itemList

 function itemList($parameters = array())
 {
     return eZCollaborationItem::fetchList(array_merge(array('parent_group_id' => $this->ID), $parameters));
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:4,代码来源:ezcollaborationgroup.php

示例11: createApproval

 static function createApproval($contentObjectID, $contentObjectVersion, $authorID, $approverIDArray)
 {
     $collaborationItem = eZCollaborationItem::create('ezapprove', $authorID);
     $collaborationItem->setAttribute('data_int1', $contentObjectID);
     $collaborationItem->setAttribute('data_int2', $contentObjectVersion);
     $collaborationItem->setAttribute('data_int3', false);
     $collaborationItem->store();
     $collaborationID = $collaborationItem->attribute('id');
     $participantList = array(array('id' => array($authorID), 'role' => eZCollaborationItemParticipantLink::ROLE_AUTHOR), array('id' => $approverIDArray, 'role' => eZCollaborationItemParticipantLink::ROLE_APPROVER));
     foreach ($participantList as $participantItem) {
         foreach ($participantItem['id'] as $participantID) {
             $participantRole = $participantItem['role'];
             $link = eZCollaborationItemParticipantLink::create($collaborationID, $participantID, $participantRole, eZCollaborationItemParticipantLink::TYPE_USER);
             $link->store();
             $profile = eZCollaborationProfile::instance($participantID);
             $groupID = $profile->attribute('main_group');
             eZCollaborationItemGroupLink::addItem($groupID, $collaborationID, $participantID);
         }
     }
     // Create the notification
     $collaborationItem->createNotificationEvent();
     return $collaborationItem;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:23,代码来源:ezapprovecollaborationhandler.php

示例12: attribute

 function attribute($attr, $noFunction = false)
 {
     $retVal = false;
     switch ($attr) {
         case 'approve_status_name':
             $nameMap = $this->statusNameMap();
             $retVal = $nameMap[$this->attribute('approve_status')];
             break;
         case 'num_approvers':
             $retVal = count($this->approveUserList());
             break;
         case 'collaboration_item':
             #include_once( 'kernel/classes/ezcollaborationitem.php' );
             $retVal = eZCollaborationItem::fetch($this->attribute('collaborationitem_id'));
             break;
         case 'workflow_process':
             #include_once( 'kernel/classes/ezworkflowprocess.php' );
             $retVal = eZWorkflowProcess::fetch($this->attribute('workflowprocess_id'));
             break;
         case 'user_approve_status':
             $retVal = eZXApproveStatusUserLink::fetchByUserID(eZUser::currentUserID(), $this->attribute('id'), eZXApproveStatusUserLink::RoleApprover);
             break;
         case 'num_approve_required':
             $eventData = $this->attribute('approve2_event');
             if ($eventData) {
                 $retVal = $eventData->attribute('require_all_approve') ? $this->attribute('num_approvers') : 1;
             }
             break;
         case 'contentobject':
             $retVal = eZContentObject::fetch($this->attribute('contentobject_id'));
             break;
         default:
             $retVal = eZPersistentObject::attribute($attr);
             break;
     }
     return $retVal;
 }
开发者ID:brucem,项目名称:ezapprove2,代码行数:37,代码来源:ezxapprovestatus.php

示例13: checkApproveCollaboration

 function checkApproveCollaboration($process, $event, $collaborationID = 0)
 {
     $db = eZDb::instance();
     if ($collaborationID > 0) {
         $taskResult = $db->arrayQuery('select workflow_process_id, collaboration_id, target_node_ids from ezxapprovelocation_items where collaboration_id = ' . $collaborationID);
     } else {
         $taskResult = $db->arrayQuery('select workflow_process_id, collaboration_id, target_node_ids from ezxapprovelocation_items where workflow_process_id = ' . $process->attribute('id'));
     }
     $collaborationID = $taskResult[0]['collaboration_id'];
     $collaborationItem = eZCollaborationItem::fetch($collaborationID);
     $approvalStatus = approveLocationCollaborationHandler::checkApproval($collaborationID);
     $targetNodeIDs = json_decode($taskResult[0]['target_node_ids']);
     if ($approvalStatus == approveLocationCollaborationHandler::STATUS_WAITING) {
         eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, 'approval still waiting');
         return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
     } elseif ($approvalStatus == approveLocationCollaborationHandler::STATUS_ACCEPTED) {
         eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, 'approval was accepted');
         eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $targetNodeIDs, 'add new location(s)');
         return eZWorkflowType::STATUS_ACCEPTED;
     } elseif ($approvalStatus == approveLocationCollaborationHandler::STATUS_DENIED or $approvalStatus == approveLocationCollaborationHandler::STATUS_DEFERRED) {
         eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, 'approval was denied');
         $status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     } else {
         eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, "approval unknown status '{$approvalStatus}'");
         $status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
     if ($approvalStatus != approveLocationCollaborationHandler::STATUS_DEFERRED) {
         $db->query('DELETE FROM ezxapprovelocation_items WHERE workflow_process_id = ' . $process->attribute('id'));
     }
     return $status;
 }
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:31,代码来源:approvelocationtype.php


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