Source of file ThreeStepMyDeletionRequestsSideReport.php
Size: 1,784 Bytes - Last Modified: 2021-12-23T10:28:49+00:00
/var/www/docs.ssmods.com/process/src/code/ThreeStep/sidereports/ThreeStepMyDeletionRequestsSideReport.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 | <?php /** * Report showing my deletion requests * * @package cmsworkflow * @subpackage ThreeStep */ // @codeCoverageIgnoreStart class ThreeStepMyDeletionRequestsSideReport extends SS_Report { public function title() { return _t('ThreeStepMyDeletionRequestsSideReport.TITLE', "My deletion requests"); } public function group() { return _t('WorkflowRequest.WORKFLOW', 'Workflow'); } public function sourceRecords($params) { // Set stage, otherwise, we won't get any results $currentStage = Versioned::current_stage(); Versioned::reading_stage(Versioned::get_live_stage()); $res = WorkflowThreeStepRequest::get_by_author( 'WorkflowDeletionRequest', Member::currentUser(), array('AwaitingApproval', 'Approved') ); // Reset stage back to what it was Versioned::reading_stage($currentStage); // Add WFRequestedWhen column $doSet = new DataObjectSet(); if ($res) { foreach ($res as $result) { if ($wf = $result->openWorkflowRequest()) { $result->WFRequestedWhen = $wf->Created; $doSet->push($result); } } } return $doSet; } public function columns() { return array( "Title" => array( "link" => true, ), "WFRequestedWhen" => array( "formatting" => 'Requested on $value', 'casting' => 'SS_Datetime->Full' ), ); } public function canView() { return Object::has_extension('SiteTree', 'SiteTreeCMSThreeStepWorkflow'); } } // @codeCoverageIgnoreEnd ; |