+ Add a function to judge the action is clickable.

This commit is contained in:
dingguodong
2023-06-14 18:14:00 +08:00
parent 223e2d9898
commit fdb863387a
+21
View File
@@ -673,4 +673,25 @@ class stakeholderModel extends model
->orderBy('id_desc')
->fetchAll();
}
/**
* Judge the action is clickable.
*
* @param object $object stakeholder
* @param string $action
* @access public
* @return bool
*/
public static function isClickable(object $object, string $action): bool
{
/* Judge the object whether can be changed. */
$canChange = common::canBeChanged('stakeholder', $object);
if(!$canChange) return false;
/* Special action can be set its own condition. */
if($action == 'notExists') return false;
/* The action is clickable by default. */
return true;
}
}