[Vtigercrm-commits] [vtiger-commits] r9573 - in /vtigercrm/branches/5.0.1/modules/Portal: Popup.php Portal.js Save.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Fri Oct 6 03:11:53 EDT 2006
Author: richie
Date: Fri Oct 6 01:11:48 2006
New Revision: 9573
Log:
* Modified to fix the http:// to add with the site given - ticket 2169
Modified:
vtigercrm/branches/5.0.1/modules/Portal/Popup.php
vtigercrm/branches/5.0.1/modules/Portal/Portal.js
vtigercrm/branches/5.0.1/modules/Portal/Save.php
Modified: vtigercrm/branches/5.0.1/modules/Portal/Popup.php
==============================================================================
--- vtigercrm/branches/5.0.1/modules/Portal/Popup.php (original)
+++ vtigercrm/branches/5.0.1/modules/Portal/Popup.php Fri Oct 6 01:11:48 2006
@@ -42,7 +42,7 @@
<tr>
<td align="right" width="40%" ><b>'.$mod_strings['LBL_BOOKMARK'].' ' .$mod_strings['LBL_URL'] .' </b></td>
- <td align="left" width="60%"><input name="portalurl" id="portalurl" class="txtBox" value="'.$portalurl.'" type="text"></td>
+ <td align="left" width="60%">http://<input name="portalurl" id="portalurl" class="txtBox" value="'.$portalurl.'" type="text" onkeyup="OnUrlChange();"></td>
</tr>
<tr>
<td align="right" width="40%"> <b>'.$mod_strings['LBL_BOOKMARK'].' ' .$mod_strings['LBL_NAME'] .' </b></td>
Modified: vtigercrm/branches/5.0.1/modules/Portal/Portal.js
==============================================================================
--- vtigercrm/branches/5.0.1/modules/Portal/Portal.js (original)
+++ vtigercrm/branches/5.0.1/modules/Portal/Portal.js Fri Oct 6 01:11:48 2006
@@ -90,3 +90,25 @@
document.getElementById('locatesite').src = url;
}
+var oRegex = new Object() ;
+oRegex.UriProtocol = new RegExp('') ;
+oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ;
+
+oRegex.UrlOnChangeProtocol = new RegExp('') ;
+oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ;
+
+function OnUrlChange()
+{
+ var sUrl;
+ var sProtocol;
+
+ sUrl=document.getElementById("portalurl").value ;
+ sProtocol=oRegex.UrlOnChangeProtocol.exec( sUrl ) ;
+ if ( sProtocol )
+ {
+ sUrl = sUrl.substr( sProtocol[0].length ) ;
+ document.getElementById("portalurl").value = sUrl ;
+ }
+
+
+}
Modified: vtigercrm/branches/5.0.1/modules/Portal/Save.php
==============================================================================
--- vtigercrm/branches/5.0.1/modules/Portal/Save.php (original)
+++ vtigercrm/branches/5.0.1/modules/Portal/Save.php Fri Oct 6 01:11:48 2006
@@ -13,10 +13,10 @@
if(isset($_REQUEST['record']) && $_REQUEST['record'] !='')
{
- $result=UpdatePortal($_REQUEST['portalname'],$_REQUEST['portalurl'],$_REQUEST['record']);
+ $result=UpdatePortal($_REQUEST['portalname'],"http://".$_REQUEST['portalurl'],$_REQUEST['record']);
}else
{
- $result=SavePortal($_REQUEST['portalname'],$_REQUEST['portalurl']);
+ $result=SavePortal($_REQUEST['portalname'],"http://".$_REQUEST['portalurl']);
}
header("Location: index.php?action=PortalAjax&module=Portal&file=ListView&mode=ajax&datamode=manage");
?>
More information about the vtigercrm-commits
mailing list