當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。