Auto lock

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
mvraven
Posts: 32
Joined: Mon Nov 30, 2009 3:34 pm

Auto lock

Post by mvraven »

Script URL:
Version of script:2.2
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:lock, auto lock

Write your message below:

Is it possible that tickets what are older as 3 months are automatic locked?
This so that the ticket can be seen but cannot reply anymore.

Thnx!
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post by lupolo »

You can close a ticket after x - day's in the configuration screen, and also you have to enable the don't reply wenn a ticket is closed.
mvraven
Posts: 32
Joined: Mon Nov 30, 2009 3:34 pm

Post by mvraven »

Yes that is how to close a ticket. But what i want is that a ticket will be locked.....
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

1. BACKUP your files and database

2. This should help you lock all closed tickets that aren't locked already: save this code as "lock_all.php" (or some other name), upload to the admin folder, login to hesk and open lock_all.php in the browser (you will need to be logged in as Admin or staff with appropriate permission).

Code: Select all

<?php
define('IN_SCRIPT',1);
define('HESK_PATH','../');

/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/database.inc.php');

hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();

/* Check permissions for this feature */
hesk_checkPermission('can_view_tickets');
hesk_checkPermission('can_reply_tickets');
hesk_checkPermission('can_edit_tickets');

$revision = sprintf($hesklang['thist5'],hesk_date(),$_SESSION['name'].' ('.$_SESSION['user'].')');

$sql = 'UPDATE `'.$hesk_settings['db_pfix'].'tickets` SET `locked`=\'1\', `history`=CONCAT(`history`,\''.hesk_dbEscape($revision).'\') WHERE `status` = \'3\' AND `locked` = \'0\'';
hesk_dbQuery($sql);
?>
<p>OLD tickets locked, <a href="admin_main.php">click to continue</a></p>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
mvraven
Posts: 32
Joined: Mon Nov 30, 2009 3:34 pm

Post by mvraven »

Thnx Klemen. Nice.

But this will lock all open tickets. Also the one who are 1 day old. What i would like is that HESK auto lock all tickets that are older than 90 day's.

Is that possible?

Thnx for now.
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post by lupolo »

You have to do than somethink like this i think don't know the date table name (and also don't have a open check in it)


$sql = 'UPDATE `'.$hesk_settings['db_pfix'].'tickets` SET `locked`=\'1\', `history`=CONCAT(`history`,\''.hesk_dbEscape($revision).'\') WHERE `status` = \'3\' AND `locked` = \'0\'' AND 'date' < DATE_SUB(NOW(), INTERVAL 90 DAY);
hesk_dbQuery($sql);
Post Reply