Пример #1
0
function plugin_init_connections()
{
    global $PLUGIN_HOOKS, $CFG_GLPI;
    $PLUGIN_HOOKS['csrf_compliant']['connections'] = true;
    $PLUGIN_HOOKS['assign_to_ticket']['connections'] = true;
    $plugin = new Plugin();
    if ($plugin->isActivated("connections")) {
        Plugin::registerClass('PluginConnectionsConnection', array('linkuser_types' => true, 'linkgroup_types' => true, 'document_types' => true, 'contract_types' => true, 'ticket_types' => true, 'helpdesk_visible_types' => true, 'notificationtemplates_types' => true));
        Plugin::registerClass('PluginConnectionsProfile', array('addtabon' => 'Profile'));
        Plugin::registerClass('PluginConnectionsConnection_Item', array('addtabon' => 'NetworkEquipment'));
        $PLUGIN_HOOKS['item_purge']['connections'] = array();
        foreach (PluginConnectionsConnection_Item::getClasses(true) as $type) {
            $PLUGIN_HOOKS['item_purge']['connections'][$type] = 'plugin_item_purge_connections';
        }
        $PLUGIN_HOOKS['pre_item_purge']['connections'] = array('Profile' => array('PluginConnectionsProfile', 'purgeProfiles'));
        if (Session::haveRight("plugin_connections_connection", READ)) {
            $PLUGIN_HOOKS["menu_toadd"]['connections'] = array('assets' => 'PluginConnectionsMenu');
        }
        $PLUGIN_HOOKS['add_css']['connections'] = "connections.css";
        $PLUGIN_HOOKS['migratetypes']['connections'] = 'plugin_datainjection_migratetypes_connections';
        $PLUGIN_HOOKS['plugin_datainjection_populate']['connections'] = 'plugin_datainjection_populate_connections';
    }
}
Пример #2
0
 public function cleanDBonPurge()
 {
     $temp = new PluginConnectionsConnection_Item();
     $temp->clean(array('plugin_connections_connections_id' => $this->fields['id']));
 }
Пример #3
0
function plugin_item_purge_connections($item)
{
    $temp = new PluginConnectionsConnection_Item();
    $temp->clean(array('itemtype' => get_class($item), 'items_id' => $item->getField('id')));
    return true;
}
Пример #4
0
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
--------------------------------------------------------------------------
// ----------------------------------------------------------------------
// Original Author of file: CAILLAUD Xavier, GRISARD Jean Marc
// Purpose of file: plugin connections v1.6.4 - GLPI 0.84
// ----------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$PluginConnectionsConnection = new PluginConnectionsConnection();
$PluginConnectionsConnection_Item = new PluginConnectionsConnection_Item();
if (isset($_POST["add"]) && !isset($_POST["additem"])) {
    $PluginConnectionsConnection->check(-1, UPDATE, $_POST);
    $newID = $PluginConnectionsConnection->add($_POST);
    Html::back();
} elseif (isset($_POST["delete"])) {
    $PluginConnectionsConnection->check($_POST['id'], UPDATE);
    $PluginConnectionsConnection->delete($_POST);
    Html::redirect(Toolbox::getItemTypeSearchURL('PluginConnectionsConnection'));
} elseif (isset($_POST["restore"])) {
    $PluginConnectionsConnection->check($_POST['id'], UPDATE);
    $PluginConnectionsConnection->restore($_POST);
    Html::redirect(Toolbox::getItemTypeSearchURL('PluginConnectionsConnection'));
} elseif (isset($_POST["purge"])) {
    $PluginConnectionsConnection->check($_POST['id'], UPDATE);
    $PluginConnectionsConnection->delete($_POST, 1);