コード例 #1
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_pdf_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    foreach ($PLUGIN_HOOKS['plugin_pdf'] as $type => $typepdf) {
        CommonGLPI::registerStandardTab($type, $typepdf);
    }
}
コード例 #2
0
ファイル: hook.php プロジェクト: pluginsGLPI/uninstall
function plugin_uninstall_postinit()
{
    global $UNINSTALL_TYPES;
    foreach ($UNINSTALL_TYPES as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginUninstallUninstall');
    }
}
コード例 #3
0
ファイル: hook.php プロジェクト: OscarLoayzaB/formcreator
function plugin_formcreator_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    foreach (PluginFormcreatorForm::getTypes(true) as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginFormcreatorForm');
    }
}
コード例 #4
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_appliances_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['plugin_uninstall_after']['appliances'] = array();
    $PLUGIN_HOOKS['item_purge']['appliances'] = array();
    foreach (PluginAppliancesAppliance::getTypes(true) as $type) {
        $PLUGIN_HOOKS['plugin_uninstall_after']['appliances'][$type] = array('PluginAppliancesAppliance_Item', 'cleanForItem');
        $PLUGIN_HOOKS['item_purge']['appliances'][$type] = array('PluginAppliancesAppliance_Item', 'cleanForItem');
        CommonGLPI::registerStandardTab($type, 'PluginAppliancesAppliance_Item');
    }
}
コード例 #5
0
ファイル: hook.php プロジェクト: OscarLoayzaB/relation
function plugin_relation_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['plugin_uninstall_after']['relation'] = array();
    $PLUGIN_HOOKS['item_purge']['relation'] = array();
    foreach (PluginRelationRelation::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['relation'][$type] = array('PluginRelationRelation', 'cleanForItem');
        CommonGLPI::registerStandardTab($type, 'PluginRelationRelation');
    }
    //$PLUGIN_HOOKS['add_css']['relation']=array('dd.css');
    //$PLUGIN_HOOKS['add_javascript']['relation']=array('jquery-1.9.0.min.js','jquery.dd.min.js');
}
コード例 #6
0
 static function postinit()
 {
     global $CFG_GLPI;
     foreach ($CFG_GLPI["networkport_types"] as $type) {
         CommonGLPI::registerStandardTab($type, __CLASS__);
     }
 }
コード例 #7
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_ocsinventoryng_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['pre_item_purge']['ocsinventoryng'] = array('Profile' => array('PluginOcsinventoryngProfile', 'purgeProfiles'));
    $PLUGIN_HOOKS['pre_item_add']['ocsinventoryng'] = array();
    $PLUGIN_HOOKS['item_update']['ocsinventoryng'] = array();
    $PLUGIN_HOOKS['pre_item_add']['ocsinventoryng'] = array('Computer_Item' => array('PluginOcsinventoryngOcslink', 'addComputer_Item'));
    $PLUGIN_HOOKS['item_update']['ocsinventoryng'] = array('Computer' => array('PluginOcsinventoryngOcslink', 'updateComputer'));
    $PLUGIN_HOOKS['pre_item_purge']['ocsinventoryng'] = array('Computer' => array('PluginOcsinventoryngOcslink', 'purgeComputer'), 'Computer_Item' => array('PluginOcsinventoryngOcslink', 'purgeComputer_Item'));
    foreach (PluginOcsinventoryngOcsServer::getTypes(true) as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginOcsinventoryngOcsServer');
    }
}
コード例 #8
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_typology_postinit()
{
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['item_purge']['typology'] = array();
    $PLUGIN_HOOKS['item_add']['typology'] = array();
    $PLUGIN_HOOKS['pre_item_purge']['typology'] = array('Profile' => array('PluginTypologyProfile', 'purgeProfiles'));
    foreach (PluginTypologyTypology::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['typology'][$type] = array('PluginTypologyTypology_Item', 'cleanItemTypology');
        $PLUGIN_HOOKS['item_add']['typology'][$type] = array('PluginTypologyTypology_Item', 'addItem');
        $PLUGIN_HOOKS['item_update']['typology'][$type] = array('PluginTypologyTypology_Item', 'updateItem');
        CommonGLPI::registerStandardTab($type, 'PluginTypologyTypology_Item');
    }
}
コード例 #9
0
ファイル: hook.php プロジェクト: pluginsGLPI/ocsinventoryng
function plugin_ocsinventoryng_postinit()
{
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['pre_item_add']['ocsinventoryng'] = array();
    $PLUGIN_HOOKS['item_update']['ocsinventoryng'] = array();
    $PLUGIN_HOOKS['pre_item_add']['ocsinventoryng'] = array('Computer_Item' => array('PluginOcsinventoryngOcslink', 'addComputer_Item'));
    $PLUGIN_HOOKS['pre_item_update']['ocsinventoryng'] = array('Infocom' => 'plugin_ocsinventoryng_pre_item_update');
    $PLUGIN_HOOKS['item_update']['ocsinventoryng'] = array('Computer' => array('PluginOcsinventoryngOcslink', 'updateComputer'), 'Infocom' => 'plugin_ocsinventoryng_item_update');
    $PLUGIN_HOOKS['pre_item_purge']['ocsinventoryng'] = array('Computer' => array('PluginOcsinventoryngOcslink', 'purgeComputer'), 'Computer_Item' => array('PluginOcsinventoryngOcslink', 'purgeComputer_Item'));
    $PLUGIN_HOOKS['item_purge']['ocsinventoryng'] = array('Printer' => array('PluginOcsinventoryngSnmpOcslink', 'purgePrinter'), 'NetworkEquipment' => array('PluginOcsinventoryngSnmpOcslink', 'purgeNetworkEquipment'), 'Computer' => array('PluginOcsinventoryngSnmpOcslink', 'purgeComputer'), 'Peripheral' => array('PluginOcsinventoryngSnmpOcslink', 'purgePeripheral'), 'Phone' => array('PluginOcsinventoryngSnmpOcslink', 'purgePhone'));
    if (Session::haveRight("plugin_ocsinventoryng", UPDATE) || Session::haveRight("plugin_ocsinventoryng_view", READ) || Session::haveRight("plugin_ocsinventoryng_sync", UPDATE)) {
        foreach (PluginOcsinventoryngOcsServer::getTypes(true) as $type) {
            CommonGLPI::registerStandardTab($type, 'PluginOcsinventoryngOcsServer');
        }
    }
}
コード例 #10
0
ファイル: plugin.class.php プロジェクト: pvasener/glpi
 /**
  * Define a new class managed by a plugin
  *
  * @param $itemtype        class name
  * @param $attrib    array of attributes, a hashtable with index in
  *                         (classname, typename, reservation_types)
  *
  * @return bool
  **/
 static function registerClass($itemtype, $attrib = array())
 {
     global $CFG_GLPI;
     $plug = isPluginItemType($itemtype);
     if (!$plug) {
         return false;
     }
     $plugin = strtolower($plug['plugin']);
     if (isset($attrib['doc_types'])) {
         $attrib['document_types'] = $attrib['doc_types'];
         unset($attrib['doc_types']);
     }
     if (isset($attrib['helpdesk_types'])) {
         $attrib['ticket_types'] = $attrib['helpdesk_types'];
         unset($attrib['helpdesk_types']);
     }
     if (isset($attrib['netport_types'])) {
         $attrib['networkport_types'] = $attrib['netport_types'];
         unset($attrib['netport_types']);
     }
     foreach (array('contract_types', 'directconnect_types', 'document_types', 'helpdesk_visible_types', 'infocom_types', 'linkgroup_tech_types', 'linkgroup_types', 'linkuser_tech_types', 'linkuser_types', 'location_types', 'networkport_instantiations', 'networkport_types', 'notificationtemplates_types', 'planning_types', 'reservation_types', 'rulecollections_types', 'systeminformations_types', 'ticket_types', 'unicity_types', 'link_types') as $att) {
         if (isset($attrib[$att]) && $attrib[$att]) {
             array_push($CFG_GLPI[$att], $itemtype);
             unset($attrib[$att]);
         }
     }
     if (isset($attrib['device_types']) && $attrib['device_types'] && method_exists($itemtype, 'getItem_DeviceType')) {
         if (class_exists($itemtype::getItem_DeviceType())) {
             array_push($CFG_GLPI['device_types'], $itemtype);
         }
         unset($attrib[$att]);
     }
     if (isset($attrib['addtabon'])) {
         if (!is_array($attrib['addtabon'])) {
             $attrib['addtabon'] = array($attrib['addtabon']);
         }
         foreach ($attrib['addtabon'] as $form) {
             CommonGLPI::registerStandardTab($form, $itemtype);
         }
     }
     //Manage entity forward from a source itemtype to this itemtype
     if (isset($attrib['forwardentityfrom'])) {
         CommonDBTM::addForwardEntity($attrib['forwardentityfrom'], $itemtype);
     }
     // Use it for plugin debug
     //       if (count($attrib)) {
     //          foreach ($attrib as $key => $val) {
     //             Toolbox::logInFile('debug',"Attribut $key used by $itemtype no more used for plugins\n");
     //          }
     //}
     return true;
 }
コード例 #11
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_domains_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['item_purge']['domains'] = array();
    foreach (PluginDomainsDomain::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['domains'][$type] = array('PluginDomainsDomain_Item', 'cleanForItem');
        CommonGLPI::registerStandardTab($type, 'PluginDomainsDomain_Item');
    }
}
コード例 #12
0
function plugin_financialreports_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    foreach (PluginFinancialreportsDisposalItem::getTypes(true) as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginFinancialreportsDisposalItem');
    }
}
コード例 #13
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_projet_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['item_purge']['projet'] = array();
    foreach (PluginProjetProjet::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['projet'][$type] = array('PluginProjetProjet', 'cleanItems');
        CommonGLPI::registerStandardTab($type, 'PluginProjetProjet_Item');
    }
    CommonGLPI::registerStandardTab("Central", 'PluginProjetTask');
}
コード例 #14
0
function plugin_manufacturersimports_postinit()
{
    foreach (PluginManufacturersimportsConfig::getTypes(true) as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginManufacturersimportsConfig');
    }
}
コード例 #15
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_immobilizationsheets_postinit()
{
    foreach (PluginImmobilizationsheetsItem::getTypes(true) as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginImmobilizationsheetsItem');
    }
}
コード例 #16
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_accounts_postinit()
{
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['item_purge']['accounts'] = array();
    foreach (PluginAccountsAccount::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['accounts'][$type] = array('PluginAccountsAccount_Item', 'cleanForItem');
        CommonGLPI::registerStandardTab($type, 'PluginAccountsAccount_Item');
    }
}
コード例 #17
0
ファイル: hook.php プロジェクト: satyan01/connections
function plugin_connections_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    foreach (PluginConnectionsConnection_Item::getClasses(true) as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginConnectionsConnection_Item');
    }
}
コード例 #18
0
function plugin_shellcommands_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    foreach (PluginShellcommandsShellcommand::getTypes(true) as $type) {
        CommonGLPI::registerStandardTab($type, 'PluginShellcommandsShellcommand_Item');
    }
}
コード例 #19
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_positions_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['item_purge']['positions'] = array();
    foreach (PluginPositionsPosition::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['positions'][$type] = array('PluginPositionsPosition', 'purgePositions');
        CommonGLPI::registerStandardTab($type, 'PluginPositionsPosition');
    }
}
コード例 #20
0
ファイル: hook.php プロジェクト: nsautier/positions
function plugin_positions_postinit()
{
    global $CFG_GLPI, $PLUGIN_HOOKS;
    $plugin = 'positions';
    foreach (array('add_css', 'add_javascript') as $type) {
        if (isset($PLUGIN_HOOKS[$type][$plugin])) {
            foreach ($PLUGIN_HOOKS[$type][$plugin] as $data) {
                if (!empty($PLUGIN_HOOKS[$type])) {
                    foreach ($PLUGIN_HOOKS[$type] as $key => $plugins_data) {
                        if (is_array($plugins_data) && $key != $plugin) {
                            foreach ($plugins_data as $key2 => $values) {
                                if ($values == $data) {
                                    unset($PLUGIN_HOOKS[$type][$key][$key2]);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $PLUGIN_HOOKS['item_purge']['positions'] = array();
    foreach (PluginPositionsPosition::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['positions'][$type] = array('PluginPositionsPosition', 'purgePositions');
        CommonGLPI::registerStandardTab($type, 'PluginPositionsPosition');
    }
}
コード例 #21
0
ファイル: hook.php プロジェクト: sx3052/racks
function plugin_racks_postinit()
{
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['item_purge']['racks'] = array();
    foreach (PluginRacksRack::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['racks'][$type] = array('PluginRacksRack_Item', 'cleanForItem');
        CommonGLPI::registerStandardTab($type, 'PluginRacksRack_Item');
    }
    foreach (PluginRacksItemSpecification::getModelClasses() as $model) {
        CommonGLPI::registerStandardTab($model, 'PluginRacksItemSpecification');
    }
}
コード例 #22
0
function plugin_databases_postinit()
{
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['item_purge']['databases'] = array();
    foreach (PluginDatabasesDatabase::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['databases'][$type] = array('PluginDatabasesDatabase_Item', 'cleanForItem');
        CommonGLPI::registerStandardTab($type, 'PluginDatabasesDatabase_Item');
    }
}
コード例 #23
0
ファイル: hook.php プロジェクト: geldarr/hack-space
function plugin_resources_postinit()
{
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['pre_item_update']['resources'] = array('User' => 'plugin_pre_item_update_resources');
    $PLUGIN_HOOKS['item_purge']['resources'] = array();
    foreach (PluginResourcesResource::getTypes(true) as $type) {
        $PLUGIN_HOOKS['item_purge']['resources'][$type] = array('PluginResourcesResource_Item', 'cleanForItem');
        CommonGLPI::registerStandardTab($type, 'PluginResourcesResource_Item');
    }
    CommonGLPI::registerStandardTab("Central", 'PluginResourcesTask');
}