当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::delete方法代码示例

本文整理汇总了PHP中Notification::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::delete方法的具体用法?PHP Notification::delete怎么用?PHP Notification::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notification的用法示例。


在下文中一共展示了Notification::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plugin_typology_uninstall

function plugin_typology_uninstall()
{
    global $DB;
    // Plugin tables deletion
    $tables = array("glpi_plugin_typology_profiles", "glpi_plugin_typology_typologies", "glpi_plugin_typology_typologycriterias", "glpi_plugin_typology_typologycriteriadefinitions", "glpi_plugin_typology_typologies_items");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    // Plugin adding information on general table deletion
    $tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs");
    foreach ($tables_glpi as $table_glpi) {
        $DB->query("DELETE FROM `{$table_glpi}` WHERE `itemtype` = 'PluginTypologyTypology';");
    }
    //drop rules
    $Rule = new Rule();
    $a_rules = $Rule->find("`sub_type`='PluginTypologyRuleTypology'");
    foreach ($a_rules as $data) {
        $Rule->delete($data);
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginTypologyTypology', 'event' => 'AlertNotValidatedTypology', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    return true;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:26,代码来源:hook.php

示例2: plugin_consumables_uninstall

function plugin_consumables_uninstall()
{
    global $DB;
    include_once GLPI_ROOT . "/plugins/consumables/inc/profile.class.php";
    include_once GLPI_ROOT . "/plugins/consumables/inc/menu.class.php";
    $tables = array("glpi_plugin_consumables_profiles", "glpi_plugin_consumables_requests");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $options = array('itemtype' => 'PluginConsumablesRequest', 'event' => 'ConsumableRequest', 'FIELDS' => 'id');
    $notif = new Notification();
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginConsumablesRequest', 'event' => 'ConsumableResponse', 'FIELDS' => 'id');
    $notif = new Notification();
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginConsumablesRequest', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    // Delete rights associated with the plugin
    $profileRight = new ProfileRight();
    foreach (PluginConsumablesProfile::getAllRights() as $right) {
        $profileRight->deleteByCriteria(array('name' => $right['field']));
    }
    PluginConsumablesMenu::removeRightsFromSession();
    PluginConsumablesProfile::removeRightsFromSession();
    return true;
}
开发者ID:AircraftRu,项目名称:consumables,代码行数:39,代码来源:hook.php

示例3: plugin_ideabox_uninstall

function plugin_ideabox_uninstall()
{
    global $DB;
    $tables = array("glpi_plugin_ideabox_ideaboxs", "glpi_plugin_ideabox_ideaboxes", "glpi_plugin_ideabox_comments", "glpi_plugin_ideabox_profiles");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    //old tables
    $tables = array("glpi_plugin_ideabox", "glpi_plugin_ideabox_mailing");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginIdeaboxIdeabox', 'event' => 'new', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginIdeaboxIdeabox', 'event' => 'update', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginIdeaboxIdeabox', 'event' => 'delete', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginIdeaboxIdeabox', 'event' => 'newcomment', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginIdeaboxIdeabox', 'event' => 'updatecomment', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginIdeaboxIdeabox', 'event' => 'deletecomment', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginIdeaboxIdeabox', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    $tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs", "glpi_tickets");
    foreach ($tables_glpi as $table_glpi) {
        $DB->query("DELETE FROM `{$table_glpi}` WHERE `itemtype` = 'PluginIdeaboxIdeabox' OR `itemtype` = 'PluginIdeaboxComment';");
    }
    if (class_exists('PluginDatainjectionModel')) {
        PluginDatainjectionModel::clean(array('itemtype' => 'PluginIdeaboxIdeabox'));
    }
    return true;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:57,代码来源:hook.php

示例4: plugin_domains_uninstall

function plugin_domains_uninstall()
{
    global $DB;
    $tables = array("glpi_plugin_domains_domains", "glpi_plugin_domains_domains_items", "glpi_plugin_domains_domaintypes", "glpi_plugin_domains_profiles", "glpi_plugin_domains_configs", "glpi_plugin_domains_notificationstates");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    //old versions
    $tables = array("glpi_plugin_domain", "glpi_plugin_domain_device", "glpi_dropdown_plugin_domain_type", "glpi_plugin_domain_profiles", "glpi_plugin_domain_mailing");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginDomainsDomain', 'event' => 'ExpiredDomains', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginDomainsDomain', 'event' => 'DomainsWhichExpire', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginDomainsDomain', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    $tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs", "glpi_tickets", "glpi_contracts_items");
    foreach ($tables_glpi as $table_glpi) {
        $DB->query("DELETE FROM `{$table_glpi}` WHERE `itemtype` = 'PluginDomainsDomain';");
    }
    if (class_exists('PluginDatainjectionModel')) {
        PluginDatainjectionModel::clean(array('itemtype' => 'PluginDomainsDomain'));
    }
    return true;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:41,代码来源:hook.php

示例5: uninstallOrderItemNotification

 public static function uninstallOrderItemNotification()
 {
     global $DB;
     $notif = new Notification();
     $options = array('itemtype' => 'PluginOrderOrder_Item', 'event' => 'delivered', 'FIELDS' => 'id');
     foreach ($DB->request('glpi_notifications', $options) as $data) {
         $notif->delete($data);
     }
     $template = new NotificationTemplate();
     $translation = new NotificationTemplateTranslation();
     //templates
     $options = array('itemtype' => 'PluginOrderOrder_Item', 'FIELDS' => 'id');
     foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
         $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
         foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
             $translation->delete($data_template);
         }
         $template->delete($data);
     }
 }
开发者ID:equinoxefr,项目名称:order,代码行数:20,代码来源:order_item.class.php

示例6: plugin_ocsinventoryng_uninstall

function plugin_ocsinventoryng_uninstall()
{
    global $DB;
    $tables = array("glpi_plugin_ocsinventoryng_ocsservers", "glpi_plugin_ocsinventoryng_ocslinks", "glpi_plugin_ocsinventoryng_ocsadmininfoslinks", "glpi_plugin_ocsinventoryng_profiles", "glpi_plugin_ocsinventoryng_threads", "glpi_plugin_ocsinventoryng_servers", "glpi_plugin_ocsinventoryng_configs", "glpi_plugin_ocsinventoryng_notimportedcomputers", "glpi_plugin_ocsinventoryng_details", "glpi_plugin_ocsinventoryng_registrykeys", "glpi_plugin_ocsinventoryng_networkports", "glpi_plugin_ocsinventoryng_networkporttypes");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $tables_glpi = array("glpi_bookmarks", "glpi_displaypreferences", "glpi_documents_items", "glpi_logs", "glpi_tickets");
    foreach ($tables_glpi as $table_glpi) {
        $DB->query("DELETE\n                  FROM `" . $table_glpi . "`\n                  WHERE `itemtype` IN ('PluginMassocsimportNotimported',\n                                       'PluginMassocsimportDetail',\n                                       'PluginOcsinventoryngOcsServer',\n                                       'PluginOcsinventoryngNotimportedcomputer',\n                                       'PluginOcsinventoryngDetail')");
    }
    $query = "DELETE\n             FROM `glpi_alerts`\n             WHERE `itemtype` IN ('PluginMassocsimportNotimported',\n                                  'PluginOcsinventoryngNotimportedcomputer')";
    $DB->queryOrDie($query, $DB->error());
    // clean rules
    $rule = new RuleImportEntity();
    foreach ($DB->request("glpi_rules", array('sub_type' => 'RuleImportEntity', 'name' => 'RootOcs')) as $data) {
        $rule->delete($data);
    }
    $notification = new Notification();
    foreach (getAllDatasFromTable($notification->getTable(), "`itemtype` IN ('PluginMassocsimportNotimported',\n                                                 'PluginOcsinventoryngNotimportedcomputer')") as $data) {
        $notification->delete($data);
    }
    $template = new NotificationTemplate();
    foreach (getAllDatasFromTable($template->getTable(), "`itemtype` IN ('PluginMassocsimportNotimported',\n                                                 'PluginOcsinventoryngNotimportedcomputer')") as $data) {
        $template->delete($data);
    }
    $cron = new CronTask();
    if ($cron->getFromDBbyName('PluginMassocsimportThread', 'CleanOldThreads')) {
        // creation du cron - param = duree de conservation
        CronTask::Unregister('massocsimport');
    }
    if ($cron->getFromDBbyName('PluginOcsinventoryngThread', 'CleanOldThreads')) {
        // creation du cron - param = duree de conservation
        CronTask::Unregister('ocsinventoryng');
    }
    return true;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:37,代码来源:hook.php

示例7: if

		}else{
			$error_msg .= "Error updating Notification!\n";
			debug_message($notification->getLastError());
		}
	}
}else if($_REQUEST['mode'] == 'delete'){
	$title = "Delete Notification";

	if(!$notification->get($_REQUEST['id'])){
		$error_msg .= "Error retrieving notification information!\n";
		debug_message($notification->getLastError());
	}

	if($_POST['confirm']){
		if($_POST['confirm'] == "Yes"){
			if($notification->delete($_REQUEST['id'])){
				goBack();
			}else{
				$error_msg .= "Error deleting Notification!\n";
			}
		}else{
			goBack();
		}
	}
}else if($_REQUEST['mode'] == 'delete_address'){
	$title = "Delete Email Address";

	$na = new NotificationAddress();
	if($na->delete($_REQUEST['address_id'])){
		header("Location: ".getCurrentURL(null, false)."?mode=edit&id=".$_REQUEST['id']."\r\n");
		exit();
开发者ID:nanoprime,项目名称:sureinvoice,代码行数:31,代码来源:notification.php

示例8: plugin_certificates_uninstall

function plugin_certificates_uninstall() {
   global $DB;
   
   include_once (GLPI_ROOT."/plugins/certificates/inc/profile.class.php");
   include_once (GLPI_ROOT."/plugins/certificates/inc/menu.class.php");
   
   $tables = array("glpi_plugin_certificates_certificates",
               "glpi_plugin_certificates_certificates_items",
               "glpi_plugin_certificates_certificatetypes",
               "glpi_plugin_certificates_certificatestates",
               "glpi_plugin_certificates_configs",
               "glpi_plugin_certificates_notificationstates");

   foreach($tables as $table)
      $DB->query("DROP TABLE IF EXISTS `$table`;");
   
   //old versions	
   $tables = array("glpi_plugin_certificates",
               "glpi_plugin_certificates_profiles",
               "glpi_plugin_certificates_device",
               "glpi_dropdown_plugin_certificates_type",
               "glpi_dropdown_plugin_certificates_status",
               "glpi_plugin_certificates_config",
               "glpi_plugin_certificates_mailing",
               "glpi_plugin_certificates_default");

   foreach($tables as $table)
      $DB->query("DROP TABLE IF EXISTS `$table`;");
   
   $notif = new Notification();
   $options = array('itemtype' => 'PluginCertificatesCertificate',
                    'event'    => 'ExpiredCertificates',
                    'FIELDS'   => 'id');
   foreach ($DB->request('glpi_notifications', $options) as $data) {
      $notif->delete($data);
   }
   $options = array('itemtype' => 'PluginCertificatesCertificate',
                    'event'    => 'CertificatesWhichExpire',
                    'FIELDS'   => 'id');
   foreach ($DB->request('glpi_notifications', $options) as $data) {
      $notif->delete($data);
   }
   
   //templates
   $template = new NotificationTemplate();
   $translation = new NotificationTemplateTranslation();
   $options = array('itemtype' => 'PluginCertificatesCertificate',
                    'FIELDS'   => 'id');
   foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
      $options_template = array('notificationtemplates_id' => $data['id'],
                    'FIELDS'   => 'id');
   
         foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
         }
      $template->delete($data);
   }
   
   $tables_glpi = array("glpi_displaypreferences",
               "glpi_documents_items",
               "glpi_bookmarks",
               "glpi_logs",
               "glpi_tickets",
               "glpi_contracts_items",
               "glpi_notepads");

   foreach($tables_glpi as $table_glpi)
      $DB->query("DELETE FROM `$table_glpi` WHERE `itemtype` = 'PluginCertificatesCertificate';");
      
   //Delete rights associated with the plugin
   $profileRight = new ProfileRight();
   foreach (PluginCertificatesProfile::getAllRights() as $right) {
      $profileRight->deleteByCriteria(array('name' => $right['field']));
   }
   PluginCertificatesMenu::removeRightsFromSession();
   
   PluginCertificatesProfile::removeRightsFromSession();

   return true;
}
开发者ID:euqip,项目名称:glpi-smartcities,代码行数:80,代码来源:hook.php

示例9: plugin_badges_uninstall

function plugin_badges_uninstall()
{
    global $DB;
    include_once GLPI_ROOT . "/plugins/badges/inc/profile.class.php";
    include_once GLPI_ROOT . "/plugins/badges/inc/menu.class.php";
    $tables = array("glpi_plugin_badges_badges", "glpi_plugin_badges_badgetypes", "glpi_plugin_badges_configs", "glpi_plugin_badges_notificationstates", "glpi_plugin_badges_requests");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    //old versions
    $tables = array("glpi_plugin_badges", "glpi_dropdown_plugin_badges_type", "glpi_plugin_badges_users", "glpi_plugin_badges_profiles", "glpi_plugin_badges_config", "glpi_plugin_badges_mailing", "glpi_plugin_badges_default");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginBadgesBadge', 'event' => 'ExpiredBadges', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginBadgesBadge', 'event' => 'BadgesWhichExpire', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginBadgesBadge', 'event' => 'BadgesReturn', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginBadgesBadge', 'event' => 'AccessBadgeRequest', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginBadgesBadge', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    $tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs", "glpi_items_tickets", "glpi_notepads", "glpi_dropdowntranslations");
    foreach ($tables_glpi as $table_glpi) {
        $DB->query("DELETE FROM `{$table_glpi}` WHERE `itemtype` LIKE 'PluginBadges%';");
    }
    if (class_exists('PluginDatainjectionModel')) {
        PluginDatainjectionModel::clean(array('itemtype' => 'PluginBadgesBadge'));
    }
    CronTask::Unregister('PluginBadgesReturn');
    //Delete rights associated with the plugin
    $profileRight = new ProfileRight();
    foreach (PluginBadgesProfile::getAllRights() as $right) {
        $profileRight->deleteByCriteria(array('name' => $right['field']));
    }
    PluginBadgesMenu::removeRightsFromSession();
    PluginBadgesProfile::removeRightsFromSession();
    return true;
}
开发者ID:AssAB,项目名称:badges,代码行数:59,代码来源:hook.php

示例10: Database

<?php

if ($_POST) {
    include_once 'config/database.php';
    include_once 'class/notification.php';
    $database = new Database();
    $db = $database->getConnection();
    $notification = new Notification($db);
    $notification->id_notification = $_POST['object_id'];
    if ($notification->delete()) {
        echo "Usterka usunieta.";
    } else {
        echo "Nie mozna usunac";
    }
}
开发者ID:lukaszog,项目名称:bootstrap-php-pdo-oop-car-service,代码行数:15,代码来源:delete_notification.php

示例11: uninstall

 public static function uninstall()
 {
     global $DB;
     $notif = new Notification();
     foreach (array('ask', 'validation', 'cancel', 'undovalidation', 'duedate', 'delivered') as $event) {
         $options = array('itemtype' => 'PluginOrderOrder', 'event' => $event, 'FIELDS' => 'id');
         foreach ($DB->request('glpi_notifications', $options) as $data) {
             $notif->delete($data);
         }
     }
     //templates
     $template = new NotificationTemplate();
     $translation = new NotificationTemplateTranslation();
     $options = array('itemtype' => 'PluginOrderOrder', 'FIELDS' => 'id');
     foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
         $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
         foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
             $translation->delete($data_template);
         }
         $template->delete($data);
     }
 }
开发者ID:equinoxefr,项目名称:order,代码行数:22,代码来源:notificationtargetorder.class.php

示例12: plugin_projet_uninstall

function plugin_projet_uninstall()
{
    global $DB;
    $tables = array("glpi_plugin_projet_projets", "glpi_plugin_projet_projetstates", "glpi_plugin_projet_projets_items", "glpi_plugin_projet_projets_projets", "glpi_plugin_projet_tasks", "glpi_plugin_projet_tasks_items", "glpi_plugin_projet_taskstates", "glpi_plugin_projet_tasktypes", "glpi_plugin_projet_taskplannings", "glpi_plugin_projet_tasks_tasks", "glpi_plugin_projet_profiles", "glpi_plugin_projet_followups");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $oldtables = array("glpi_plugin_projet", "glpi_plugin_projet_items", "glpi_plugin_projet_tasks", "glpi_plugin_projet_tasks_items", "glpi_dropdown_plugin_projet_tasks_type", "glpi_plugin_projet_mailing", "glpi_dropdown_plugin_projet_status", "glpi_dropdown_plugin_projet_task_status", "glpi_plugin_project", "glpi_plugin_project_items", "glpi_plugin_project_tasks", "glpi_plugin_project_tasks_items", "glpi_dropdown_plugin_project_status", "glpi_dropdown_plugin_project_tasks_type", "glpi_dropdown_plugin_project_task_status", "glpi_plugin_project_mailing", "glpi_plugin_project_profiles", "glpi_plugin_project_users", "glpi_plugin_project_setup", "glpi_plugin_project_groups", "glpi_plugin_project_items", "glpi_plugin_project_enterprises", "glpi_plugin_project_contracts", "glpi_plugin_project_documents", "glpi_dropdown_project_tasks_type", "glpi_project", "glpi_project_tasks", "glpi_project_user", "glpi_project_items", "glpi_plugin_projet_projetitems", "glpi_plugin_projet_mailings", "glpi_plugin_projet_taskitems");
    foreach ($oldtables as $oldtable) {
        $DB->query("DROP TABLE IF EXISTS `{$oldtable}`;");
    }
    $rep_files_projet = GLPI_PLUGIN_DOC_DIR . "/projet";
    Toolbox::deleteDir($rep_files_projet);
    $in = "IN (" . implode(',', array("'PluginProjetProjet'", "'PluginProjetTask'")) . ")";
    $tables = array("glpi_displaypreferences", "glpi_documents_items", "glpi_contracts_items", "glpi_bookmarks", "glpi_logs", "glpi_tickets");
    foreach ($tables as $table) {
        $query = "DELETE FROM `{$table}` WHERE (`itemtype` " . $in . " ) ";
        $DB->query($query);
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginProjetProjet', 'event' => 'new', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginProjetProjet', 'event' => 'update', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginProjetProjet', 'event' => 'delete', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginProjetProjet', 'event' => 'newtask', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginProjetProjet', 'event' => 'updatetask', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginProjetProjet', 'event' => 'deletetask', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginProjetProjet', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    return true;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:57,代码来源:hook.php

示例13: plugin_accounts_uninstall

function plugin_accounts_uninstall()
{
    global $DB;
    $tables = array("glpi_plugin_accounts_accounts", "glpi_plugin_accounts_accounts_items", "glpi_plugin_accounts_accounttypes", "glpi_plugin_accounts_accountstates", "glpi_plugin_accounts_profiles", "glpi_plugin_accounts_configs", "glpi_plugin_accounts_hashs", "glpi_plugin_accounts_hashes", "glpi_plugin_accounts_aeskeys", "glpi_plugin_accounts_notificationstates");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    //old versions
    $tables = array("glpi_plugin_comptes", "glpi_plugin_compte_device", "glpi_dropdown_plugin_compte_type", "glpi_dropdown_plugin_compte_status", "glpi_plugin_compte_profiles", "glpi_plugin_compte_config", "glpi_plugin_compte_default", "glpi_plugin_compte_mailing", "glpi_plugin_compte", "glpi_plugin_compte_hash", "glpi_plugin_compte_aeskey");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginAccountsAccount', 'event' => 'new', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginAccountsAccount', 'event' => 'ExpiredAccounts', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginAccountsAccount', 'event' => 'AccountsWhichExpire', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginAccountsAccount', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    $tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs", "glpi_tickets");
    foreach ($tables_glpi as $table_glpi) {
        $DB->query("DELETE FROM `{$table_glpi}`\n               WHERE `itemtype` = 'PluginAccountsAccount'\n               OR `itemtype` = 'PluginAccountsHelpdesk'\n               OR `itemtype` = 'PluginAccountsGroup' ;");
    }
    if (class_exists('PluginDatainjectionModel')) {
        PluginDatainjectionModel::clean(array('itemtype' => 'PluginAccountsAccount'));
    }
    return true;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:45,代码来源:hook.php

示例14: plugin_additionalalerts_uninstall

function plugin_additionalalerts_uninstall()
{
    global $DB;
    $tables = array("glpi_plugin_additionalalerts_ocsalerts", "glpi_plugin_additionalalerts_infocomalerts", "glpi_plugin_additionalalerts_notificationstates", "glpi_plugin_additionalalerts_notificationtypes", "glpi_plugin_additionalalerts_profiles", "glpi_plugin_additionalalerts_configs");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    //old versions
    $tables = array("glpi_plugin_additionalalerts_reminderalerts", "glpi_plugin_alerting_config", "glpi_plugin_alerting_state", "glpi_plugin_alerting_profiles", "glpi_plugin_alerting_mailing", "glpi_plugin_alerting_type");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginAdditionalalertsOcsAlert', 'event' => 'ocs', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginAdditionalalertsOcsAlert', 'event' => 'newocs', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginAdditionalalertsInfocomAlert', 'event' => 'notinfocom', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginAdditionalalertsOcsAlert', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginAdditionalalertsInfocomAlert', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    return true;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:49,代码来源:hook.php

示例15: plugin_accounts_uninstall

function plugin_accounts_uninstall()
{
    global $DB;
    include_once GLPI_ROOT . "/plugins/accounts/inc/profile.class.php";
    include_once GLPI_ROOT . "/plugins/accounts/inc/menu.class.php";
    $tables = array("glpi_plugin_accounts_accounts", "glpi_plugin_accounts_accounts_items", "glpi_plugin_accounts_accounttypes", "glpi_plugin_accounts_accountstates", "glpi_plugin_accounts_configs", "glpi_plugin_accounts_hashs", "glpi_plugin_accounts_hashes", "glpi_plugin_accounts_aeskeys", "glpi_plugin_accounts_notificationstates");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    //old versions
    $tables = array("glpi_plugin_comptes", "glpi_plugin_compte_device", "glpi_dropdown_plugin_compte_type", "glpi_dropdown_plugin_compte_status", "glpi_plugin_compte_profiles", "glpi_plugin_compte_config", "glpi_plugin_compte_default", "glpi_plugin_compte_mailing", "glpi_plugin_compte", "glpi_plugin_compte_hash", "glpi_plugin_compte_aeskey", "glpi_plugin_accounts_profiles");
    foreach ($tables as $table) {
        $DB->query("DROP TABLE IF EXISTS `{$table}`;");
    }
    $notif = new Notification();
    $options = array('itemtype' => 'PluginAccountsAccount', 'event' => 'new', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginAccountsAccount', 'event' => 'ExpiredAccounts', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    $options = array('itemtype' => 'PluginAccountsAccount', 'event' => 'AccountsWhichExpire', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notifications', $options) as $data) {
        $notif->delete($data);
    }
    //templates
    $template = new NotificationTemplate();
    $translation = new NotificationTemplateTranslation();
    $options = array('itemtype' => 'PluginAccountsAccount', 'FIELDS' => 'id');
    foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
        $options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
        foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
            $translation->delete($data_template);
        }
        $template->delete($data);
    }
    $tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs", "glpi_items_tickets", "glpi_dropdowntranslations");
    foreach ($tables_glpi as $table_glpi) {
        $DB->query("DELETE FROM `{$table_glpi}`\n               WHERE `itemtype` = 'PluginAccountsAccount'\n               OR `itemtype` = 'PluginAccountsHelpdesk'\n               OR `itemtype` = 'PluginAccountsGroup'\n               OR `itemtype` = 'PluginAccountsAccountState'\n               OR `itemtype` = 'PluginAccountsAccountType' ;");
    }
    if (class_exists('PluginDatainjectionModel')) {
        PluginDatainjectionModel::clean(array('itemtype' => 'PluginAccountsAccount'));
    }
    //Delete rights associated with the plugin
    $profileRight = new ProfileRight();
    foreach (PluginAccountsProfile::getAllRights() as $right) {
        $profileRight->deleteByCriteria(array('name' => $right['field']));
    }
    PluginAccountsProfile::removeRightsFromSession();
    PluginAccountsMenu::removeRightsFromSession();
    return true;
}
开发者ID:puchadesc,项目名称:accounts,代码行数:54,代码来源:hook.php


注:本文中的Notification::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。