[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
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 11 12 function fetchAddSite(id) 13 { 14 $("status").style.display="inline"; 15 new Ajax.Request( 16 'index.php', 17 {queue: {position: 'end', scope: 'command'}, 18 method: 'post', 19 postBody:'module=Portal&action=PortalAjax&file=Popup&record='+id, 20 onComplete: function(response) { 21 $("status").style.display="none"; 22 $('editportal_cont').innerHTML = response.responseText; 23 } 24 } 25 ); 26 } 27 28 function fetchContents(mode) 29 { 30 $("status").style.display="inline"; 31 new Ajax.Request( 32 'index.php', 33 {queue: {position: 'end', scope: 'command'}, 34 method: 'post', 35 postBody:'action=PortalAjax&mode=ajax&module=Portal&file=ListView&datamode='+mode, 36 onComplete: function(response) { 37 $("status").style.display="none"; 38 $('portalcont').innerHTML = response.responseText; 39 } 40 } 41 ); 42 } 43 function DeleteSite(id) 44 { 45 if(confirm("Are you sure you want to delete ?")) 46 { 47 $("status").style.display="inline"; 48 new Ajax.Request( 49 'index.php', 50 {queue: {position: 'end', scope: 'command'}, 51 method: 'post', 52 postBody:'action=PortalAjax&mode=ajax&file=Delete&module=Portal&record='+id, 53 onComplete: function(response) { 54 $("status").style.display="none"; 55 $('portalcont').innerHTML = response.responseText; 56 } 57 } 58 ); 59 } 60 } 61 function SaveSite(id) 62 { 63 if ($('portalurl').value.replace(/^\s+/g, '').replace(/\s+$/g, '').length==0) { 64 alert('Site Url cannot be empty') 65 return false; 66 } 67 if ($('portalname').value.replace(/^\s+/g, '').replace(/\s+$/g, '').length==0) { 68 alert('Site Name cannot be empty') 69 return false; 70 } 71 Effect.Puff('orgLay'); 72 $("status").style.display="inline"; 73 var portalurl = document.getElementById('portalurl').value; 74 var portalurl = portalurl.replace(/&/g, "#$#$#"); 75 var portalname = document.getElementById('portalname').value; 76 new Ajax.Request( 77 'index.php', 78 {queue: {position: 'end', scope: 'command'}, 79 method: 'post', 80 postBody:'action=PortalAjax&mode=ajax&file=Save&module=Portal&portalname='+portalname+'&portalurl='+portalurl+'&record='+id, 81 onComplete: function(response) { 82 $("status").style.display="none"; 83 $('portalcont').innerHTML = response.responseText; 84 } 85 } 86 ); 87 } 88 function setSite(oUrllist) 89 { 90 var url = oUrllist.options[oUrllist.options.selectedIndex].value; 91 document.getElementById('locatesite').src = url; 92 } 93 94 var oRegex = new Object() ; 95 oRegex.UriProtocol = new RegExp('') ; 96 oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ; 97 98 oRegex.UrlOnChangeProtocol = new RegExp('') ; 99 oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ; 100 101 function OnUrlChange() 102 { 103 var sUrl; 104 var sProtocol; 105 106 sUrl=document.getElementById("portalurl").value ; 107 sProtocol=oRegex.UrlOnChangeProtocol.exec( sUrl ) ; 108 if ( sProtocol ) 109 { 110 sUrl = sUrl.substr( sProtocol[0].length ) ; 111 document.getElementById("portalurl").value = sUrl ; 112 } 113 114 115 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |