예제 #1
0
 static function is_pendingRecord($domain_name = null, $r = array())
 {
     $awnser = false;
     if (count($r) > 0) {
         $qFindResult = Queue::find('first', array('conditions' => 'commit_date IS NULL AND closed = 0 AND domain_name=' . Domain::quote($domain_name)));
         if (count($qFindResult->queue_item_records) > 0) {
             foreach ($qFindResult->queue_item_records as $key) {
                 if ($key->name === $r->name && $key->content === $r->content && $key->type === $r->type) {
                     return $awnser = true;
                 }
             }
         }
     }
     return $awnser;
 }
예제 #2
0
 function queue($id = FALSE)
 {
     $this->load->helper('notification');
     if ($_POST) {
         unset($_POST['send']);
         unset($_POST['_wysihtml5_mode']);
         $id = $_POST['id'];
         unset($_POST['id']);
         $ticket = Ticket::find_by_id($id);
         $attr = array('queue_id' => $_POST['queue_id']);
         $ticket->update_attributes($attr);
         if (!$ticket) {
             $this->session->set_flashdata('message', 'error:' . $this->lang->line('messages_assign_queue_error'));
         } else {
             $this->session->set_flashdata('message', 'success:' . $this->lang->line('messages_assign_queue_success'));
         }
         redirect('tickets/view/' . $id);
     } else {
         $this->view_data['queues'] = Queue::find('all', array('conditions' => array('inactive=?', '0')));
         $this->view_data['ticket'] = Ticket::find_by_id($id);
         $this->theme_view = 'modal';
         $this->view_data['title'] = $this->lang->line('application_queue');
         $this->view_data['form_action'] = 'tickets/queue';
         $this->content_view = 'tickets/_queue';
     }
 }
예제 #3
0
<?php

require_once 'base.php';
require_once $class_root . 'Queue.php';
print $display->header();
if (!preg_match('/^\\d+$/', $_GET['id'])) {
    print $display->error("You hacker!");
    print $display->footer();
    exit(1);
}
try {
    $q = Queue::find($_GET['id']);
    $qdomain = $q->queue_item_domains;
    $qrecord = $q->queue_item_records;
} catch (Exception $e) {
    print $e->getMessage();
    print $display->footer();
    exit(0);
}
?>


<script type="text/javascript">

function queueItem_delete(id, method) {
	new Ajax.Request('api/jsonrpc.php', {
			method: 'post',
			parameters: {"jsonrpc": "2.0", "method": method, "params": id , "id": 1},
			onSuccess: function(r) {
				var json = r.responseText.evalJSON();
                if(json.error) {
예제 #4
0
<?php

require_once 'base.php';
require_once $class_root . 'Queue.php';
print $display->header();
try {
    $qFindResult = Queue::find('all', array('conditions' => 'commit_date IS NULL AND archived = 0'));
} catch (Exception $e) {
    print $e->getMessage();
    print $display->footer();
    exit(0);
}
?>

<script type="text/javascript">

function queue_commit(id) { 
	new Ajax.Request('api/jsonrpc.php', {
                          method: 'post',
				parameters: {"jsonrpc": "2.0", "method": 'queue_commit', "params": id , "id": 1},
					onSuccess: function(r) {
						var json = r.responseText.evalJSON();
						if(json.error) {
							$('feedback').update(json.error.message + ' (' + json.error.code + ')').
							setStyle({color: 'red', display: 'block'});
						} else {
							$('tr_entry' + id).toggleClassName('queue_commited');
							$('action_entry' + id).update('Done');
							queue_counter();
							$('feedback').update('Request commited').setStyle({color: 'black', display: 'block'});
						}
예제 #5
0
 function ticket()
 {
     $this->view_data['breadcrumb'] = $this->lang->line('application_ticket');
     $this->view_data['breadcrumb_id'] = "ticket";
     $this->view_data['imap_loaded'] = false;
     if (extension_loaded('mysql')) {
         $this->view_data['imap_loaded'] = true;
     }
     if ($_POST) {
         unset($_POST['send']);
         if (!isset($_POST['ticket_config_active'])) {
             $_POST['ticket_config_active'] = "0";
         }
         if (!isset($_POST['ticket_config_delete'])) {
             $_POST['ticket_config_delete'] = "0";
         }
         if (!isset($_POST['ticket_config_ssl'])) {
             $_POST['ticket_config_ssl'] = "0";
         }
         if (!isset($_POST['ticket_config_imap'])) {
             $_POST['ticket_config_imap'] = "0";
         }
         $settings = Setting::first();
         $settings->update_attributes($_POST);
         if ($settings) {
             $this->session->set_flashdata('message', 'success:' . $this->lang->line('messages_save_settings_success'));
             redirect('settings/ticket');
         } else {
             $this->session->set_flashdata('message', 'error:' . $this->lang->line('messages_save_settings_error'));
             redirect('settings/ticket');
         }
     } else {
         $this->view_data['settings'] = Setting::first();
         $this->view_data['types'] = Type::find('all', array('conditions' => array('inactive = ?', '0')));
         $this->view_data['queues'] = Queue::find('all', array('conditions' => array('inactive = ?', '0')));
         $this->view_data['owners'] = User::find('all', array('conditions' => array('status = ?', 'active')));
         $this->view_data['form_action'] = 'settings/ticket';
         $this->content_view = 'settings/ticket';
     }
 }
예제 #6
0
            }});
}


</script>

<div id="feedback" style="display: none;"></div>

<br>


<?php 
#
#
#
$qFindResult = Queue::find('all', array('conditions' => 'commit_date IS NULL'));
print '<div class="header">' . Queue::count_all_pendingDomains() . ' pending domain changes</div><br>';
if (count($qFindResult) > 0) {
    print '<table><tr><th>Function</th><th>Name</th><th>Type</th><th>By</th></tr>';
    foreach ($qFindResult as $entry) {
        foreach ($entry->queue_item_domains as $item) {
            print '<tr class="domain"><td>' . $item->function . '</td><td>' . $item->name . '</td><td>' . $item->type . '</td><td>' . $item->user_id . '</td></tr>';
        }
    }
    print '</table><br><br>';
}
#
#
#
$result = ActiveRecord::query("SELECT COUNT(*) AS count FROM domains");
$dCount = (int) $result[0]['count'];
예제 #7
0
 public function queue_delete($p)
 {
     $q = Queue::find($p);
     return $q->destroy();
 }