/** * ############################################### * BEGIN STAFF CP > REPORTS FUNCTIONS * ############################################### */ function PrintReport(_reportID) { screen_width = screen.width; screen_height = screen.height; widthm = (screen_width - 1000) / 2; heightm = (screen_height - 800) / 2; window.open(_baseName + '/Reports/Report/PrintReport/' + _reportID, "printwindow", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1000,height=800,left=" + widthm + ",top=" + heightm); } /** * ############################################### * END STAFF CP > REPORTS FUNCTIONS * ############################################### */ /** * ############################################### * BEGIN STAFF CP > TROUBLESHOOTER FUNCTIONS * ############################################### */ function HandleTroubleshooterCategoryType() { // const TYPE_GLOBAL = 1; // const TYPE_PUBLIC = 2; // const TYPE_PRIVATE = 3; // const TYPE_INHERIT = 4; if ($("input[@name='categorytype']:checked").val() == '1') { $('#View_Categorytabs').tabs('enable', 2); $('#View_Categorytabs').tabs('enable', 3); } else if ($("input[@name='categorytype']:checked").val() == '2') { $('#View_Categorytabs').tabs('enable', 2); $('#View_Categorytabs').tabs('disable', 3); } else if ($("input[@name='categorytype']:checked").val() == '3') { $('#View_Categorytabs').tabs('disable', 2); $('#View_Categorytabs').tabs('enable', 3); } else if ($("input[@name='categorytype']:checked").val() == '4') { $('#View_Categorytabs').tabs('disable', 2); $('#View_Categorytabs').tabs('disable', 3); } } function AddTRFile() { $('#trattachmentcontainer').append('
 
'); }; /** * ############################################### * END STAFF CP > TROUBLESHOOTER FUNCTIONS * ############################################### */ /** * ############################################### * BEGIN STAFF CP > KNOWLEDGEBASE FUNCTIONS * ############################################### */ function ArticleHelpful(_kbArticleID) { $('#kbratingcontainer').load(_baseName + '/Knowledgebase/ViewKnowledgebase/Rate/' + _kbArticleID + '/1'); } function ArticleNotHelpful(_kbArticleID) { $('#kbratingcontainer').load(_baseName + '/Knowledgebase/ViewKnowledgebase/Rate/' + _kbArticleID + '/0'); } function InsertKnowledgebaseCategoryWindow(_selectedKnowledgebaseCategoryID) { UICreateWindow(_baseName + '/Knowledgebase/Category/Insert/' + _selectedKnowledgebaseCategoryID, 'insertkbcategory', swiftLanguage['insert'], swiftLanguage['loading'], 680, 650, true, this); } function EditKnowledgebaseCategoryWindow(_selectedKnowledgebaseCategoryID) { UICreateWindow(_baseName + '/Knowledgebase/Category/Edit/' + _selectedKnowledgebaseCategoryID, 'editkbcategory', swiftLanguage['edit'], swiftLanguage['loading'], 680, 650, true, this); } function HandleKBCategoryType() { // const TYPE_GLOBAL = 1; // const TYPE_PUBLIC = 2; // const TYPE_PRIVATE = 3; // const TYPE_INHERIT = 4; if ($("input[@name='categorytype']:checked").val() == '1') { $('#View_Categorytabs').tabs('enable', 2); $('#View_Categorytabs').tabs('enable', 3); } else if ($("input[@name='categorytype']:checked").val() == '2') { $('#View_Categorytabs').tabs('enable', 2); $('#View_Categorytabs').tabs('disable', 3); } else if ($("input[@name='categorytype']:checked").val() == '3') { $('#View_Categorytabs').tabs('disable', 2); $('#View_Categorytabs').tabs('enable', 3); } else if ($("input[@name='categorytype']:checked").val() == '4') { $('#View_Categorytabs').tabs('disable', 2); $('#View_Categorytabs').tabs('disable', 3); } } function AddKBFile() { $('#kbattachmentcontainer').append('
 
'); }; /** * ############################################### * END STAFF CP > KNOWLEDGEBASE FUNCTIONS * ############################################### */ /** * ############################################### * BEGIN STAFF CP > RATINGS FUNCTIONS * ############################################### */ function TriggerRating(_ratingURL, _ratingID, _typeID, _ratingValue, _isReadOnly) { $.post(_baseName + _ratingURL, { 'ratingid': _ratingID, 'ratingvalue': _ratingValue }, function(data) { }); if (_isReadOnly == true) { $('input[name=rating_' + _ratingID + '_' + _typeID + ']').rating('readOnly', true); } } /** * ############################################### * END STAFF CP > RATINGS FUNCTIONS * ############################################### */ /** * ############################################### * BEGIN STAFF CP > TICKETS FUNCTIONS * ############################################### */ function TicketTipBubble(_element, _ticketID) { if ($(_element).parent().attr('data-hasqtip')) { return; } $(_element).parent().qtip({ content: { text: function(event, api) { $.get(_baseName + '/Tickets/Manage/Preview/' + _ticketID, function(content) { api.set('content.text', content); }); return; } }, show: { ready: true }, position: { target: 'mouse', adjust: { mouse: false } }, style: { classes: 'qtip-blue' } }); } function ShowEscalationPathHistory() { $('.escalationpathhistory').slideToggle(); } function ToggleRecurrence(_recurrenceType) { $('#recurrencecontainer_none').hide(); $('#recurrencecontainer_daily').hide(); $('#recurrencecontainer_weekly').hide(); $('#recurrencecontainer_monthly').hide(); $('#recurrencecontainer_yearly').hide(); if (_recurrenceType != 'none') { $('#recurrencerangecontainer').show(); } else { $('#recurrencerangecontainer').hide(); } $('#recurrencecontainer_' + _recurrenceType).show(); } function ReloadTicketFilterMenu() { $('#ticketfiltermenu').remove(); $.get(_baseName + '/Tickets/Filter/GetMenu', function(_responseText) { $('body').append(_responseText); }); } function QuoteTicketPost(_ticketID, _ticketPostID) { $.ajax({ type: 'POST', url: _baseName + '/Tickets/Ticket/GetQuote/' + _ticketID + '/' + _ticketPostID, data: '', success: function(_data) { if ($('#View_Tickettabs').tabs('option', 'selected') != 2) { $('#View_Tickettabs').tabs('option', 'selected', 1); $('#replycontents').val($('#replycontents').val() + _data); } else { $('#forwardcontents').val($('#forwardcontents').val() + _data); } } }); } function HandleFilterTypeToggle() { if ($("input[@name='filtertype']:checked").val() == '1') { $('#selectrestrictstaffgroupid').attr('disabled', false); } else { $('#selectrestrictstaffgroupid').attr('disabled', true); } } function LinkTicketSearchForms() { bindFormSubmit('searchmenuform'); bindFormSubmit('searchtimenuform'); bindFormSubmit('searchcrmenuform'); } var _activeTicketTabPrefix = ''; function QuickInsertLoad(_tabPrefix) { _activeTicketTabPrefix = _tabPrefix; $('#qi' + _tabPrefix + '_macro, #qi' + _tabPrefix + '_knowledgebase').focus(function() { if ($(this).hasClass('swifttextautocompleteinput')) { $(this).val(''); $(this).removeClass('swifttextautocompleteinput').addClass('swifttextautocompleteinputactive'); } }); $('#qi' + _tabPrefix + '_macro').oldautocomplete(_baseName + '/Tickets/Macro/GetLookup/' + doRand(), { width: 300, matchContains: true, delay: 40, matchCase: true }).result(function(event, data, formatted) { $('#qi' + _tabPrefix + '_macro').val(''); TriggerMacro(data[1]); }); if (!$('#qi' + _tabPrefix + '_macromenucontainer').length) { $('body').append('