Exemplo n.º 1
0
             inserttask('1');
             // Using nameserver, insert a task which rebuilds the server config
             inserttask('4');
             if (isset($_POST['delete_userfiles']) && (int) $_POST['delete_userfiles'] == 1) {
                 inserttask('6', $result['loginname']);
             }
             // Using filesystem - quota, insert a task which cleans the filesystem - quota
             inserttask('10');
             /*
              * move old tickets to archive
              */
             $tickets = ticket::customerHasTickets($id);
             if ($tickets !== false && isset($tickets[0])) {
                 foreach ($tickets as $ticket) {
                     $now = time();
                     $mainticket = ticket::getInstanceOf($userinfo, (int) $ticket);
                     $mainticket->Set('lastchange', $now, true, true);
                     $mainticket->Set('lastreplier', '1', true, true);
                     $mainticket->Set('status', '3', true, true);
                     $mainticket->Update();
                     $mainticket->Archive();
                     $log->logAction(ADM_ACTION, LOG_NOTICE, "archived ticket '" . $mainticket->Get('subject') . "'");
                 }
             }
             redirectTo($filename, array('page' => $page, 's' => $s));
         } else {
             ask_yesno_withcheckbox('admin_customer_reallydelete', 'admin_customer_alsoremovefiles', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['loginname']);
         }
     }
 } elseif ($action == 'add') {
     if ($userinfo['customers_used'] < $userinfo['customers'] || $userinfo['customers'] == '-1') {
Exemplo n.º 2
0
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Cron
 *
 */
/**
 * ARCHIVING CLOSED TICKETS
 */
fwrite($debugHandler, 'Ticket-archiving run started...' . "\n");
$result_tickets_stmt = Database::query("\n\tSELECT `id`, `lastchange`, `subject` FROM `" . TABLE_PANEL_TICKETS . "`\n\tWHERE `status` = '3' AND `answerto` = '0';");
$archiving_count = 0;
while ($row_ticket = $result_tickets_stmt->fetch(PDO::FETCH_ASSOC)) {
    $lastchange = $row_ticket['lastchange'];
    $now = time();
    $days = (int) (($now - $lastchange) / 86400);
    if ($days >= Settings::Get('ticket.archiving_days')) {
        fwrite($debugHandler, 'archiving ticket "' . $row_ticket['subject'] . '" (ID #' . $row_ticket['id'] . ')' . "\n");
        $mainticket = ticket::getInstanceOf(null, (int) $row_ticket['id']);
        $mainticket->Set('lastchange', $now, true, true);
        $mainticket->Set('lastreplier', '1', true, true);
        $mainticket->Set('status', '3', true, true);
        $mainticket->Update();
        $mainticket->Archive();
        $archiving_count++;
    }
}
fwrite($debugHandler, 'Archived ' . $archiving_count . ' tickets' . "\n");
Database::query("\n\tUPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = UNIX_TIMESTAMP()\n\tWHERE `settinggroup` = 'system' AND `varname` = 'last_archive_run'");
Exemplo n.º 3
0
/*
 * END REDUNDANT CODE (CRONSCRIPT "HEADER")
 */
/*
 * ARCHIVING CLOSED TICKETS
 */
fwrite($debugHandler, 'Ticket-archiving run started...' . "\n");
$result_tickets = $db->query('SELECT `id`, `lastchange`, `subject` FROM `' . TABLE_PANEL_TICKETS . "` \n                              WHERE `status` = '3' AND `answerto` = '0';");
$archiving_count = 0;
while ($row_ticket = $db->fetch_array($result_tickets)) {
    $lastchange = $row_ticket['lastchange'];
    $now = time();
    $days = (int) (($now - $lastchange) / 86400);
    if ($days >= $settings['ticket']['archiving_days']) {
        fwrite($debugHandler, 'archiving ticket "' . $row_ticket['subject'] . '" (ID #' . $row_ticket['id'] . ')' . "\n");
        $mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int) $row_ticket['id']);
        $mainticket->Set('lastchange', $now, true, true);
        $mainticket->Set('lastreplier', '1', true, true);
        $mainticket->Set('status', '3', true, true);
        $mainticket->Update();
        $mainticket->Archive();
        ++$archiving_count;
    }
}
fwrite($debugHandler, 'Archived ' . $archiving_count . ' tickets' . "\n");
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\'   AND `varname`      = \'last_archive_run\' ');
/**
 * STARTING CRONSCRIPT FOOTER.
 */
include $pathtophpfiles . '/lib/cron_shutdown.php';
/*
Exemplo n.º 4
0
        while ($row2 = $db->fetch_array($andere)) {
            $subticket = ticket::getInstanceOf($userinfo, $db, $settings, (int) $row2['id']);
            $lastchange = date("d.m.Y H:i\\h", $subticket->Get('lastchange'));
            if ($subticket->Get('by') == '1') {
                $by = $lng['ticket']['staff'];
            } else {
                $by = $lng['ticket']['customer'];
            }
            $subject = htmlentities($subticket->Get('subject'));
            $message = htmlentities($subticket->Get('message'));
            eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";");
        }
        $priorities = makeoption($lng['ticket']['high'], '1', htmlentities($mainticket->Get('priority')), true, true);
        $priorities .= makeoption($lng['ticket']['normal'], '2', htmlentities($mainticket->Get('priority')), true, true);
        $priorities .= makeoption($lng['ticket']['low'], '3', htmlentities($mainticket->Get('priority')), true, true);
        $subject = htmlentities($mainticket->Get('subject'));
        $ticket_replies_count = $db->num_rows($andere) + 1;
        // don't forget the main-ticket!
        eval("echo \"" . getTemplate("tickets/tickets_view") . "\";");
    } elseif ($action == 'delete' && $id != 0) {
        if (isset($_POST['send']) && $_POST['send'] == 'send') {
            $mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int) $id);
            $log->logAction(ADM_ACTION, LOG_INFO, "deleted archived ticket '" . $mainticket->Get('subject') . "'");
            $mainticket->Delete();
            redirectTo($filename, array('page' => $page, 's' => $s));
        } else {
            $mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int) $id);
            ask_yesno('ticket_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
        }
    }
}
Exemplo n.º 5
0
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Cron
 *
 */
/**
 * ARCHIVING CLOSED TICKETS
 */
fwrite($debugHandler, 'Ticket-archiving run started...' . "\n");
$result_tickets = $db->query("SELECT `id`, `lastchange`, `subject` FROM `" . TABLE_PANEL_TICKETS . "` \n                              WHERE `status` = '3' AND `answerto` = '0';");
$archiving_count = 0;
while ($row_ticket = $db->fetch_array($result_tickets)) {
    $lastchange = $row_ticket['lastchange'];
    $now = time();
    $days = (int) (($now - $lastchange) / 86400);
    if ($days >= $settings['ticket']['archiving_days']) {
        fwrite($debugHandler, 'archiving ticket "' . $row_ticket['subject'] . '" (ID #' . $row_ticket['id'] . ')' . "\n");
        $mainticket = ticket::getInstanceOf(null, $db, $settings, (int) $row_ticket['id']);
        $mainticket->Set('lastchange', $now, true, true);
        $mainticket->Set('lastreplier', '1', true, true);
        $mainticket->Set('status', '3', true, true);
        $mainticket->Update();
        $mainticket->Archive();
        $archiving_count++;
    }
}
fwrite($debugHandler, 'Archived ' . $archiving_count . ' tickets' . "\n");
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\'   AND `varname`      = \'last_archive_run\' ');