YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Documents/resources/Detail.min.js

Summary

Maintainability
A
1 hr
Test Coverage
'use strict';

/*+***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *************************************************************************************/"use strict";Vtiger_Detail_Js("Documents_Detail_Js",{//It stores the CheckFileIntegrity response data
checkFileIntegrityResponseCache:{},/*
         * function to trigger CheckFileIntegrity action
         * @param: CheckFileIntegrity url.
         */checkFileIntegrity:function checkFileIntegrity(checkFileIntegrityUrl){Documents_Detail_Js.getFileIntegrityResponse(checkFileIntegrityUrl).done(function(data){Documents_Detail_Js.displayCheckFileIntegrityResponse(data);});},/**
         * function to get the CheckFileIntegrity response data
         * @returns {Promise}
         */getFileIntegrityResponse:function getFileIntegrityResponse(params){var aDeferred=jQuery.Deferred();//Check in the cache
return jQuery.isEmptyObject(Documents_Detail_Js.checkFileIntegrityResponseCache)?AppConnector.request(params).done(function(data){Documents_Detail_Js.checkFileIntegrityResponseCache=data,aDeferred.resolve(Documents_Detail_Js.checkFileIntegrityResponseCache);}):aDeferred.resolve(Documents_Detail_Js.checkFileIntegrityResponseCache),aDeferred.promise()},/*
         * function to display the CheckFileIntegrity message
         */displayCheckFileIntegrityResponse:function displayCheckFileIntegrityResponse(data){var result=data.result,success=result.success,message=result.message,params={};params=success?{text:message,type:"success"}:{text:message,type:"error"},Documents_Detail_Js.showNotify(params),window.location.href=result.url;},//This will show the messages of CheckFileIntegrity using pnotify
showNotify:function showNotify(customParams){var params={title:app.vtranslate("JS_CHECK_FILE_INTEGRITY"),text:customParams.text,type:customParams.type,delay:"2000"};app.showNotify(params);}},{});
//# sourceMappingURL=Detail.min.js.map