Page 1 of 1
Auto lock
Posted: Fri Jul 30, 2010 8:58 am
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!
Posted: Fri Jul 30, 2010 9:04 am
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.
Posted: Sat Jul 31, 2010 2:03 pm
by mvraven
Yes that is how to close a ticket. But what i want is that a ticket will be locked.....
Posted: Wed Aug 04, 2010 9:08 am
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>
Posted: Thu Aug 05, 2010 10:54 am
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.
Posted: Thu Aug 05, 2010 3:29 pm
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);