Skip to content

Instantly share code, notes, and snippets.

@dwheeler
Created March 13, 2012 18:04
Show Gist options
  • Save dwheeler/2030337 to your computer and use it in GitHub Desktop.
Save dwheeler/2030337 to your computer and use it in GitHub Desktop.
Alternative required dependency
<?php
$dependencies['Cases']['required_resolution'] = array(
'hooks' => array("edit"),
'trigger' => 'equal($status, "Closed")',
'triggerFields' => array('status'),
'onload' => true,
//Actions is a list of actions to fire when the trigger is true
'actions' => array(
array(
'name' => 'SetRequired',
//The parameters passed in will depend on the action type set in 'name'
'params' => array(
'target' => 'resolution',
'label' => 'resolution_label',
'value' => 'true',
),
),
),
'notActions' => array(
array(
'name' => 'SetRequired',
//The parameters passed in will depend on the action type set in 'name'
'params' => array(
'target' => 'resolution',
'label' => 'resolution_label',
'value' => 'false',
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment