[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/layouts/vlayout/modules/Settings/MailConverter/resources/ -> List.js (source)

   1  /*+***********************************************************************************
   2   * The contents of this file are subject to the vtiger CRM Public License Version 1.0
   3   * ("License"); You may not use this file except in compliance with the License
   4   * The Original Code is:  vtiger CRM Open Source
   5   * The Initial Developer of the Original Code is vtiger.
   6   * Portions created by vtiger are Copyright (C) vtiger.
   7   * All Rights Reserved.
   8   *************************************************************************************/
   9  
  10  jQuery.Class('Settings_MailConverter_List_Js',{
  11      
  12      checkMailBoxMaxLimit : function(url) {
  13          AppConnector.request(url).then(
  14              function(response) {
  15                  if(typeof response.result != 'undefined'){
  16                      window.location.href = 'index.php?module='+app.getModuleName()+'&parent='+app.getParentModuleName()+'&view=Edit&mode=step1&create=new';
  17                  } else {
  18                      var params = {
  19                          title : app.vtranslate('JS_MESSAGE'),
  20                          text: response.error.message,
  21                          animation: 'show',
  22                          type: 'info'
  23                      };
  24                      Vtiger_Helper_Js.showPnotify(params);
  25                  }
  26              }
  27              )    
  28          
  29      },
  30      
  31      triggerScan : function(url) {
  32          var progressIndicatorElement = jQuery.progressIndicator({
  33              'position' : 'html',
  34              'blockInfo' : {
  35                  'enabled' : true
  36              }
  37          });
  38          AppConnector.request(url).then(
  39              function(response) {
  40                  if(typeof response.result != 'undefined'){
  41                      var params = {};
  42                      params.record = response.result.id;
  43                      Settings_MailConverter_List_Js.loadMailBox(params);
  44                  } else {
  45                      var params = {
  46                          title : app.vtranslate('JS_MESSAGE'),
  47                          text: response.error.message,
  48                          animation: 'show',
  49                          type: 'error'
  50                      };
  51                      Vtiger_Helper_Js.showPnotify(params);
  52                  }
  53                   progressIndicatorElement.progressIndicator({
  54                      'mode' : 'hide'
  55                  });
  56              }
  57          );    
  58      },
  59      
  60      
  61      triggerDelete : function(url) {
  62          
  63          Vtiger_Helper_Js.showConfirmationBox({'message':app.vtranslate('LBL_DELETE_CONFIRMATION')}).then(function(){
  64              var progressIndicatorElement = jQuery.progressIndicator({
  65                  'position' : 'html',
  66                  'blockInfo' : {
  67                      'enabled' : true
  68                  }
  69              });
  70              AppConnector.request(url).then(function(data){
  71                  progressIndicatorElement.progressIndicator({
  72                      'mode' : 'hide'
  73                  });
  74                  var deletedRecordId = data.result.id;
  75                  var deletedRecordContainerId = 'SCANNER_'+deletedRecordId;
  76                  jQuery('#'+deletedRecordContainerId).remove();
  77                  var params = {
  78                      title : app.vtranslate('JS_MESSAGE'),
  79                      text: app.vtranslate('JS_MAILBOX_DELETED_SUCCESSFULLY'),
  80                      animation: 'show',
  81                      type: 'success'
  82                  };
  83                  var url = window.location.href;
  84                  var url1 = url.split('&');
  85                  var path = url1[0]+"&"+url1[1]+"&"+url1[2];
  86                  window.location.assign(path);
  87                  Vtiger_Helper_Js.showPnotify(params);
  88              });
  89          });
  90      },    
  91          
  92      loadMailBox : function(data) {
  93          var progressIndicatorElement = jQuery.progressIndicator({
  94              'position' : 'html',
  95              'blockInfo' : {
  96                  'enabled' : true
  97              }
  98          });
  99          data.module = app.getModuleName();
 100          data.parent = app.getParentModuleName();
 101          data.view = "ListAjax";
 102          data.mode = 'getMailBoxContentView'
 103          AppConnector.request(data).then(
 104              function(html) {
 105                  var scannerContentdId = "SCANNER_"+data.record;
 106                  if(jQuery('#'+scannerContentdId).length > 0) {
 107                      jQuery('#'+scannerContentdId).html(html)
 108                  }else{
 109                      jQuery('#listViewContents').append('<br>'+html);
 110                  }
 111                  progressIndicatorElement.progressIndicator({
 112                      'mode' : 'hide'
 113                  });
 114                  var params = {
 115                      title : app.vtranslate('JS_MESSAGE'),
 116                      text: app.vtranslate('JS_MAILBOX_LOADED_SUCCESSFULLY'),
 117                      animation: 'show',
 118                      type: 'success'
 119                  };
 120                  Vtiger_Helper_Js.showPnotify(params);
 121                  if(typeof data.listViewUrl != 'undefined') {
 122                      var path = data.listViewUrl+'&record='+data.record;
 123                      window.location.assign(path);
 124                  }
 125              }
 126              );
 127      }
 128  },{
 129      registerEvents : function(){
 130          
 131      }
 132  })


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1