示例#1
0
/**
 *
 * Actions for rules
 * @since 0.84
 * @param $params input data
 * @return an array of actions
 */
function plugin_fields_getRuleActions($params)
{
    $actions = array();
    switch ($params['rule_itemtype']) {
        case "PluginFusioninventoryTaskpostactionRule":
            $options = PluginFieldsContainer::getAddSearchOptions("Computer");
            foreach ($options as $num => $option) {
                $actions[$option['linkfield']]['name'] = $option['name'];
                $actions[$option['linkfield']]['type'] = $option['pfields_type'];
                if ($option['pfields_type'] == 'dropdown') {
                    $actions[$option['linkfield']]['table'] = $option['table'];
                }
            }
            break;
    }
    return $actions;
}