public function __construct() {
    $class       = get_called_class();
    $this->table = getTableForItemType($class);
    if (class_exists($class)) {
       $this->objecttype = PluginGenericobjectType::getInstance($class);
    }
    $this->dohistory = $this->canUseHistory();
 }
 public function __construct()
 {
     $class = get_called_class();
     $this->table = getTableForItemType($class);
     if (class_exists($class)) {
         $this->objecttype = PluginGenericobjectType::getInstance($class);
     }
     $this->dohistory = $this->canUseHistory();
     if (preg_match("/PluginGenericobject(.*)/", $class, $results)) {
         self::$rightname = 'plugin_genericobject_' . strtolower($results[1]) . 's';
     }
     if ($this->canUseNotepad()) {
         // For GLPI 0.85.x
         $this->usenotepadrights = true;
         // For GLPI 0.90.x
         $this->usenotepad = true;
     }
 }
Beispiel #3
0
function plugin_genericobject_MassiveActionsDisplay($options = array())
{
    $objecttype = PluginGenericobjectType::getInstance($options['itemtype']);
    switch ($options['action']) {
        case 'plugin_genericobject_transfer':
            if ($objecttype->isTransferable()) {
                Dropdown::show('Entity', array('name' => 'new_entity'));
                echo "&nbsp;<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . _sx('button', 'Post') . "\" >";
            }
            break;
    }
    return "";
}
Beispiel #4
0
function plugin_genericobject_MassiveActions($type)
{
    $types = PluginGenericobjectType::getTypes();
    if (isset($types[$type])) {
        $objecttype = PluginGenericobjectType::getInstance($type);
        if ($objecttype->isTransferable()) {
            return array('PluginGenericobjectObject' . MassiveAction::CLASS_ACTION_SEPARATOR . 'plugin_genericobject_transfer' => __("Transfer"));
        } else {
            return array();
        }
    } else {
        return array();
    }
}