Server IP : 184.154.167.98 / Your IP : 18.188.135.3 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/public_html/contratos/apps/survey_client/js/ |
Upload File : |
$(document).ready(function() { var $section = $('#survey_client'); $section.find('.survey_client_category').change(function() { var $button = $(this); $button.attr('disabled', true); OCP.AppConfig.setValue( 'survey_client', $(this).attr('name').substring(14), $(this).attr('checked') ? 'yes' : 'no', { success: function() { $button.attr('disabled', false); } } ); }); $section.find('#survey_client_monthly_report').change(function() { var $button = $(this); $button.attr('disabled', true); $.ajax({ url: OC.linkToOCS('apps/survey_client/api/v1/', 2) + 'monthly?format=json', type: $(this).attr('checked') ? 'POST' : 'DELETE', success: function() { $button.attr('disabled', false); } }); }); $section.find('button').click(function() { var $button = $(this); $button.attr('disabled', true); $.ajax({ url: OC.linkToOCS('apps/survey_client/api/v1/', 2) + 'report?format=json', type: 'POST', success: function(response) { $button.attr('disabled', false); $section.find('.last_report').text(JSON.stringify(response.ocs.data, undefined, 4)); $section.find('.last_sent').text(t('survey_client', 'Last report sent on: {on}', { on: moment().format('LL') })); $section.find('.last_report').closest('div').removeClass('empty'); }, error: function(xhr) { $button.attr('disabled', false); OC.Notification.showTemporary(t('survey_client', 'An error occurred while sending your report.')); var response = xhr.responseJSON; $section.find('.last_report').text(JSON.stringify(response.ocs.data, undefined, 4)); } }); }); $('#last_report h3').on('click', function(e) { if (!$(this).parent().hasClass('empty')) { $(this).parent().find('p').toggleClass('hidden'); $(this).find('.icon').toggleClass('icon-triangle-s'); } }); });