• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts tagged delete

osTicket> Mass ‘Ban & Delete’

Oct26
2010
Written by Scott Rowley

Ok, people…careful with this one!

This is for if you would like to allow for mass ban & delete from the Tickets tab.
First you need to add a new button to the main page.

include/staff/tickets.inc.php

<input class="button" type="submit" name="banDelete" value="Ban & Delete"
onClick=' return confirm("Are you ABSOLUTLEY CERTAIN this was spam?");'>

Then we need to add the functionality. Its easier here to replace a larger chunk so…

scp/tickets.php
Replace

if(!$errors) {
$count=count($_POST['tids']);
if(isset($_POST['reopen'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && @$t->reopen()) $i++;
}
$msg="$i of $count selected tickets reopened";
}elseif(isset($_POST['close'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && @$t->close()) $i++;
}
$msg="$i of $count selected tickets closed";
}elseif(isset($_POST['overdue'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && !$t->isoverdue())
if($t->markOverdue()) $i++;
}
$msg="$i of $count selected tickets marked overdue";
}elseif(isset($_POST['delete'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && @$t->delete()) $i++;
}
$msg="$i of $count selected tickets deleted";
}
}
break;

With

if(!$errors) {
$count=count($_POST['tids']);
if(isset($_POST['reopen'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && @$t->reopen()) $i++;
}
$msg="$i of $count selected tickets reopened";
}elseif(isset($_POST['close'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && @$t->close()) $i++;
}
$msg="$i of $count selected tickets closed";
}elseif(isset($_POST['overdue'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && !$t->isoverdue())
if($t->markOverdue()) $i++;
}
$msg="$i of $count selected tickets marked overdue";
}elseif(isset($_POST['delete'])){
$i=0;
foreach($_POST['tids'] as $k=>$v) {
$t = new Ticket($v);
if($t && @$t->delete()) $i++;
}
$msg="$i of $count selected tickets deleted";
} // NOW MY CODE
elseif(isset($_POST['banDelete'])){
$i=0;
foreach($_POST['tids'] as $k=>$v)
{
$t = new Ticket($v);
if($t && @$t->delete())
{
if($beenBanned=$t->getEmail()){
if(Banlist::add($t->getEmail(),$thisuser->getName())){}
$msg .= "$beenBanned banned!<br />";}
$i++;
}
}
$msg .= "$i of $count selected tickets deleted <br />$i of $count emails banned.";
}}
break;

All of your effected tickets will now be deleted and the emails banned. You will also be alerted to the result so you can double check your email addresses and unban if necessary.

Posted in osTicket - Tagged ban, mass, mod, modification, osTicket, ticket

BASH> Set DELETE key in Putty/Poderosa/SecureCRT

Oct26
2010
Written by Scott Rowley

For Poderosa/Putty
– Create or edit the ~/.inputrc file with the following code:

"\e[3~": delete-char

For SecureCRT

Click Tools
Keymap Editor
Click the "DEL" button
Click Map Selected Key
enter in "\e[3~" (no quotes)
Hit OK
Save
Posted in BASH - Tagged key, poderosa, putty, securecrt, terminal

Emacs> Set delete key in emacs

Oct26
2010
Written by Scott Rowley

I really hate that the delete key backspaces. I’m sure there is a lot of pointless posturing on how this is the ‘old school’ way. Well… 1) I don’t care 2) I’m new school and I want a backspace key AND a delete key…
Add the following line to your ~/.emacs file:

(global-set-key (kbd "") 'delete-char)
Posted in Emacs - Tagged backspace, BASH, Emacs, key

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top