晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/akaindir/public_html/crm/resources/ |
Upload File : |
/*+***********************************************************************************
* 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.
*************************************************************************************/
jQuery.Class("Vtiger_Helper_Js",{
checkServerConfigResponseCache : '',
/*
* Function to get the instance of Mass edit of Email
*/
getEmailMassEditInstance : function(){
var className = 'Emails_MassEdit_Js';
var emailMassEditInstance = new window[className]();
return emailMassEditInstance
},
/*
* function to check server Configuration
* returns boolean true or false
*/
checkServerConfig : function(module){
var aDeferred = jQuery.Deferred();
var actionParams = {
"action": 'CheckServerInfo',
'module' : module
};
AppConnector.request(actionParams).then(
function(data) {
var state = false;
if(data.result){
state = true;
} else {
state = false;
}
aDeferred.resolve(state);
}
);
return aDeferred.promise();
},
/*
* Function to get Date Instance
* @params date---this is the field value
* @params dateFormat---user date format
* @return date object
*/
getDateInstance : function(dateTime,dateFormat, fieldType){
var dateTimeComponents = dateTime.split(" ");
var dateComponent = dateTimeComponents[0];
var timeComponent = dateTimeComponents[1];
var seconds = '00';
var splittedDate = dateComponent.split("-");
if (splittedDate.length > 3) {
var errorMsg = app.vtranslate("JS_INVALID_DATE");
throw errorMsg;
}
var splittedDateFormat = dateFormat.split("-");
var year = splittedDate[splittedDateFormat.indexOf("yyyy")];
var month = splittedDate[splittedDateFormat.indexOf("mm")];
var date = splittedDate[splittedDateFormat.indexOf("dd")];
var dateInstance = Date.parse(year+"-"+month+"-"+date);
if((dateInstance == null) || (year.length != 4) || (month.length > 2) || (date.length > 2)){
var errorMsg = app.vtranslate("JS_INVALID_DATE");
throw errorMsg;
}
if (fieldType == 'date' && typeof timeComponent != 'undefined') {
var errorMsg = app.vtranslate("JS_INVALID_DATE");
throw errorMsg;
}
//Before creating date object time is set to 00
//because as while calculating date object it depends system timezone
if(typeof timeComponent == "undefined"){
timeComponent = '00:00:00';
}
var timeSections = timeComponent.split(':');
if(typeof timeSections[2] != 'undefined'){
seconds = timeSections[2];
}
//Am/Pm component exits
if(typeof dateTimeComponents[2] != 'undefined') {
timeComponent += ' ' + dateTimeComponents[2];
if(dateTimeComponents[2].toLowerCase() == 'pm' && timeSections[0] != '12') {
timeSections[0] = parseInt(timeSections[0], 10) + 12;
}
if(dateTimeComponents[2].toLowerCase() == 'am' && timeSections[0] == '12') {
timeSections[0] = '00';
}
}
month = month-1;
var dateInstance = new Date(year,month,date,timeSections[0],timeSections[1],seconds);
return dateInstance;
},
requestToShowComposeEmailForm : function(selectedId,fieldname,fieldmodule){
var selectedFields = new Array();
selectedFields.push(fieldname);
var selectedIds = new Array();
selectedIds.push(selectedId);
var params = {
'module' : 'Emails',
'fieldModule' : fieldmodule,
'selectedFields[]' : selectedFields,
'selected_ids[]' : selectedIds,
'view' : 'ComposeEmail'
}
var emailsMassEditInstance = Vtiger_Helper_Js.getEmailMassEditInstance();
emailsMassEditInstance.showComposeEmailForm(params);
},
/*
* Function to get the compose email popup
*/
getInternalMailer : function(selectedId,fieldname,fieldmodule){
var module = 'Emails';
var cacheResponse = Vtiger_Helper_Js.checkServerConfigResponseCache;
var checkServerConfigPostOperations = function (data) {
if(data == true){
Vtiger_Helper_Js.requestToShowComposeEmailForm(selectedId,fieldname,fieldmodule);
} else {
alert(app.vtranslate('JS_EMAIL_SERVER_CONFIGURATION'));
}
}
if(cacheResponse === ''){
var checkServerConfig = Vtiger_Helper_Js.checkServerConfig(module);
checkServerConfig.then(function(data){
Vtiger_Helper_Js.checkServerConfigResponseCache = data;
checkServerConfigPostOperations(Vtiger_Helper_Js.checkServerConfigResponseCache);
});
} else {
checkServerConfigPostOperations(Vtiger_Helper_Js.checkServerConfigResponseCache);
}
},
/*
* Function to show the confirmation messagebox
*/
showConfirmationBox : function(data){
var aDeferred = jQuery.Deferred();
var bootBoxModal = bootbox.confirm(data['message'],app.vtranslate('LBL_NO'),app.vtranslate('LBL_YES'), function(result) {
if(result){
aDeferred.resolve();
} else{
aDeferred.reject();
}
});
bootBoxModal.on('hidden',function(e){
//In Case of multiple modal. like mass edit and quick create, if bootbox is shown and hidden , it will remove
// modal open
if(jQuery('#globalmodal').length > 0) {
// Mimic bootstrap modal action body state change
jQuery('body').addClass('modal-open');
}
})
return aDeferred.promise();
},
/*
* Function to show the custom dialogs
*/
showCustomDialogBox: function (data) {
//options are array of objects with label,button class and callback properties
bootbox.dialog(data['message'], data['options']);
},
/*
* Function to check Duplication of Account Name
* returns boolean true or false
*/
checkDuplicateName : function(details) {
var accountName = details.accountName;
var recordId = details.recordId;
var aDeferred = jQuery.Deferred();
var moduleName = details.moduleName;
if(typeof moduleName == "undefined"){
moduleName = app.getModuleName();
}
var params = {
'module' : moduleName,
'action' : "CheckDuplicate",
'accountname' : accountName,
'record' : recordId
}
AppConnector.request(params).then(
function(data) {
var response = data['result'];
var result = response['success'];
if(result == true) {
aDeferred.reject(response);
} else {
aDeferred.resolve(response);
}
},
function(error,err){
aDeferred.reject();
}
);
return aDeferred.promise();
},
showMessage : function(params){
if(typeof params.type == "undefined"){
params.type = 'info';
}
params.animation = "show";
params.title = app.vtranslate('JS_MESSAGE'),
Vtiger_Helper_Js.showPnotify(params);
},
/*
* Function to show pnotify message
*/
showPnotify : function(customParams) {
var userParams = customParams;
if(typeof customParams == 'string') {
var userParams = {};
userParams.text = customParams;
}
var params = {
sticker: false,
delay: '3000',
type: 'error',
pnotify_history: false
}
if(typeof userParams != 'undefined'){
var params = jQuery.extend(params,userParams);
}
return jQuery.pnotify(params);
},
/*
* Function to add clickoutside event on the element - By using outside events plugin
* @params element---On which element you want to apply the click outside event
* @params callbackFunction---This function will contain the actions triggered after clickoutside event
*/
addClickOutSideEvent : function(element, callbackFunction) {
element.one('clickoutside',callbackFunction);
},
/*
* Function to show horizontal top scroll bar
*/
showHorizontalTopScrollBar : function() {
var container = jQuery('.contentsDiv');
var topScroll = jQuery('.contents-topscroll',container);
var bottomScroll = jQuery('.contents-bottomscroll', container);
jQuery('.topscroll-div', container).css('width', jQuery('.bottomscroll-div', container).outerWidth());
jQuery('.bottomscroll-div', container).css('width', jQuery('.topscroll-div', container).outerWidth());
topScroll.scroll(function(){
bottomScroll.scrollLeft(topScroll.scrollLeft());
});
bottomScroll.scroll(function(){
topScroll.scrollLeft(bottomScroll.scrollLeft());
});
},
/*
* Function to confirmation modal for recurring events updation and deletion
*/
showConfirmationForRepeatEvents: function (customParams) {
var aDeferred = jQuery.Deferred();
var params = {
module: 'Calendar',
view: 'RecurringDeleteCheck'
}
jQuery.extend(params, customParams);
var postData = {};
AppConnector.request(params).then(function (data) {
var callBackFunction = function (modalContainer) {
modalContainer.on('click', '.onlyThisEvent', function () {
postData['recurringEditMode'] = 'current';
app.hideModalWindow();
aDeferred.resolve(postData);
});
modalContainer.on('click', '.futureEvents', function () {
postData['recurringEditMode'] = 'future';
app.hideModalWindow();
aDeferred.resolve(postData);
});
modalContainer.on('click', '.allEvents', function () {
postData['recurringEditMode'] = 'all';
app.hideModalWindow();
aDeferred.resolve(postData);
});
}
app.showModalWindow(data, function (data) {
if (typeof callBackFunction == 'function') {
callBackFunction(data);
}
})
});
return aDeferred.promise();
},
rand: function () {
return Math.floor((Math.random() * 1000) + 1);
},
mergeObjects: function (arrayOfObjs) {
var mergedObj = {};
jQuery.each(arrayOfObjs, function (i, kv) {
if (mergedObj.hasOwnProperty(kv.name)) {
mergedObj[kv.name] = jQuery.makeArray(mergedObj[kv.name]);
mergedObj[kv.name].push(kv.value);
}
else {
mergedObj[kv.name] = kv.value;
}
});
return mergedObj;
}
},{});