Source of file ProcessStopStage.php
Size: 2,189 Bytes - Last Modified: 2022-02-21T10:00:36+00:00
/var/www/docs.ssmods.com/process/src/code/models/ProcessStopStage.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 | <?php /* **/ class ProcessStopStage extends Stage implements PermissionProvider { public static $has_one = array( 'Parent'=>'Process' ); public static $has_many = array( 'ProcessStages'=>'ProcessStage' ); public static $searchable_fields = array( 'Title', 'Parent.Title', ); public static $summary_fields = array( 'Title'=>'Title', 'PiecesOfInfo'=>'Pieces of Info (num)', 'Parent.Title'=>'Process Title' ); public static $default_sort = 'Order'; public function getCMSFields(){ $fields = parent::getCMSFields(); $fields->removeByName('Order'); $fields->removeByName('ProcessInfo'); $fields->removeByName('ProcessStages'); $processParent = Process::get(); if ($processParent) { $fields->insertAfter( new DropdownField( 'ParentID', 'Belongs to this Process', $processParent->map('ID', 'Title') ), 'Title'); } $fields->addFieldToTab('Root.Main', $processSteps = new CompositeField( new GridField( 'ProcessInfo', 'Information for this stage', $this->ProcessInfo(), GridFieldConfig_RelationEditor::create()) )); $fields->insertBefore(new LiteralField('StageTitle', '<h3 class="process-info-header"> <span class="step-label"> <span class="flyout">1.1</span><span class="arrow"></span> <span class="title">Stop stage details</span> </span> </h3>'),'Title'); $fields->insertBefore(new LiteralField('StageTitle', '<h3 class="process-info-header"> <span class="step-label"> <span class="flyout">1.2</span><span class="arrow"></span> <span class="title">Final information</span> </span> </h3>'),'ProcessInfo'); return $fields; } public function providePermissions() { return array( 'PROCESS_FLOW_VIEW' => array( 'name' => 'View process map admin', 'category' => 'Process Maps', ), 'PROCESS_FLOW_EDIT' => array( 'name' => 'Edit process flows', 'category' => 'Process Maps', ), 'PROCESS_FLOW_DELETE' => array( 'name' => 'Delete from process flows', 'category' => 'Process Maps', ), 'PROCESS_FLOW_CREATE' => array( 'name' => 'Create process maps', 'category' => 'Process Maps' ) ); } } |