本文整理匯總了PHP中Ticket_User::cleanDBonItemDelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ticket_User::cleanDBonItemDelete方法的具體用法?PHP Ticket_User::cleanDBonItemDelete怎麽用?PHP Ticket_User::cleanDBonItemDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Ticket_User
的用法示例。
在下文中一共展示了Ticket_User::cleanDBonItemDelete方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cleanDBonPurge
function cleanDBonPurge()
{
global $DB;
$query = "SELECT `id`\n FROM `glpi_tickettasks`\n WHERE `tickets_id` = '" . $this->fields['id'] . "'";
$result = $DB->query($query);
if ($DB->numrows($result) > 0) {
while ($data = $DB->fetch_array($result)) {
$querydel = "DELETE\n FROM `glpi_ticketplannings`\n WHERE `tickettasks_id` = '" . $data['id'] . "'";
$DB->query($querydel);
}
}
$query1 = "DELETE\n FROM `glpi_tickettasks`\n WHERE `tickets_id` = '" . $this->fields['id'] . "'";
$DB->query($query1);
$query1 = "DELETE\n FROM `glpi_ticketvalidations`\n WHERE `tickets_id` = '" . $this->fields['id'] . "'";
$DB->query($query1);
$query1 = "DELETE\n FROM `glpi_ticketfollowups`\n WHERE `tickets_id` = '" . $this->fields['id'] . "'";
$DB->query($query1);
$query1 = "DELETE\n FROM `glpi_ticketsatisfactions`\n WHERE `tickets_id` = '" . $this->fields['id'] . "'";
$DB->query($query1);
$query1 = "DELETE\n FROM `glpi_tickets_tickets`\n WHERE `tickets_id_1` = '" . $this->fields['id'] . "'\n OR `tickets_id_2` = '" . $this->fields['id'] . "'";
$DB->query($query1);
$query1 = "DELETE\n FROM `glpi_slalevels_tickets`\n WHERE `tickets_id` = '" . $this->fields['id'] . "'";
$DB->query($query1);
$tu = new Ticket_User();
$tu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
$gt = new Group_Ticket();
$gt->cleanDBonItemDelete($this->getType(), $this->fields['id']);
}
示例2: cleanDBonPurge
function cleanDBonPurge()
{
global $DB;
$query = "DELETE\n FROM `glpi_profiles_users`\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
if ($this->fields['id'] > 0) {
// Security
$query = "DELETE\n FROM `glpi_displaypreferences`\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
$query = "DELETE\n FROM `glpi_bookmarks_users`\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
}
// Delete own reminders
$query = "DELETE\n FROM `glpi_reminders`\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
// Delete private bookmark
$query = "DELETE\n FROM `glpi_bookmarks`\n WHERE `users_id` = '" . $this->fields['id'] . "'\n AND `is_private` = '1'";
$DB->query($query);
// Set no user to public bookmark
$query = "UPDATE `glpi_bookmarks`\n SET `users_id` = '0'\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
// Set no user to consumables
$query = "UPDATE `glpi_consumables`\n SET `items_id` = '0'\n WHERE `items_id` = '" . $this->fields['id'] . "'\n AND `itemtype` = 'User'";
$DB->query($query);
$gu = new Group_User();
$gu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
$tu = new Ticket_User();
$tu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
$pu = new Problem_User();
$pu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
$kiu = new KnowbaseItem_User();
$kiu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
$ru = new Reminder_User();
$ru->cleanDBonItemDelete($this->getType(), $this->fields['id']);
$ue = new UserEmail();
$ue->deleteByCriteria(array('users_id' => $this->fields['id']));
// Ticket rules use various _users_id_*
Rule::cleanForItemAction($this, '_users_id%');
Rule::cleanForItemCriteria($this, '_users_id%');
}
示例3: cleanDBonPurge
function cleanDBonPurge()
{
global $DB;
$query = "DELETE\n FROM `glpi_profiles_users`\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
if ($this->fields['id'] > 0) {
// Security
$query = "DELETE\n FROM `glpi_displaypreferences`\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
$query = "DELETE\n FROM `glpi_bookmarks_users`\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
}
// Delete private reminder
$query = "DELETE\n FROM `glpi_reminders`\n WHERE `users_id` = '" . $this->fields['id'] . "'\n AND `is_private` = '1'";
$DB->query($query);
// Set no user to public reminder
$query = "UPDATE `glpi_reminders`\n SET `users_id` = '0'\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
// Delete private bookmark
$query = "DELETE\n FROM `glpi_bookmarks`\n WHERE `users_id` = '" . $this->fields['id'] . "'\n AND `is_private` = '1'";
$DB->query($query);
// Set no user to public bookmark
$query = "UPDATE `glpi_bookmarks`\n SET `users_id` = '0'\n WHERE `users_id` = '" . $this->fields['id'] . "'";
$DB->query($query);
$gu = new Group_User();
$gu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
$tu = new Ticket_User();
$tu->cleanDBonItemDelete($this->getType(), $this->fields['id']);
}