Skip to content
Snippets Groups Projects
ticket-view.inc.php 50.8 KiB
Newer Older
  • Learn to ignore specific revisions
  • $(function() {
        $(document).on('click', 'a.change-user', function(e) {
            e.preventDefault();
            var tid = <?php echo $ticket->getOwnerId(); ?>;
            var cid = <?php echo $ticket->getOwnerId(); ?>;
            var url = 'ajax.php/'+$(this).attr('href').substr(1);
            $.userLookup(url, function(user) {
                if(cid!=user.id
                        && $('.dialog#confirm-action #changeuser-confirm').length) {
    
                    $('#newuser').html(user.name +' &lt;'+user.email+'&gt;');
    
                    $('.dialog#confirm-action #action').val('changeuser');
                    $('#confirm-form').append('<input type=hidden name=user_id value='+user.id+' />');
                    $('#overlay').show();
                    $('.dialog#confirm-action .confirm-action').hide();
                    $('.dialog#confirm-action p#changeuser-confirm')
                    .show()
                    .parent('div').show().trigger('click');
                }
            });
        });
    
    <?php
        // Set the lock if one exists
    
    !function() {
      var setLock = setInterval(function() {
        if (typeof(window.autoLock) === 'undefined')
          return;
        clearInterval(setLock);
    
        autoLock.setLock({
    
          id:<?php echo $mylock->getId(); ?>,
    
          time: <?php echo $cfg->getLockTime() * 60; ?>}, 'acquire');
    
    
    <?php
    // Hover support for all inline images
    $urls = array();
    foreach (AttachmentFile::objects()->filter(array(
    
        'attachments__thread_entry__thread__id' => $ticket->getThreadId(),
        'attachments__inline' => true,
    
    )) as $file) {
        $urls[strtolower($file->getKey())] = array(
            'download_url' => $file->getDownloadUrl(),
            'filename' => $file->name,
        );
    } ?>
    
    $('#ticket_thread').data('imageUrls', <?php echo JsonDataEncoder::encode($urls); ?>);
    
    </script>