[Vtigercrm-commits] [vtiger-commits] r10703 - in /vtigercrm/branches/5.0.3: Smarty/templates/Reports.tpl include/language/en_us.lang.php modules/Reports/CheckReport.php modules/Reports/SaveReportFolder.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 17 04:18:37 EDT 2007
Author: richie
Date: Tue Apr 17 02:18:25 2007
New Revision: 10703
Log:
* Fixed the issues in Folder name of Reports, Now we can give special characters and the length should be less than or equal to 20, Fixed #3385#3637
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/Reports.tpl
vtigercrm/branches/5.0.3/include/language/en_us.lang.php
vtigercrm/branches/5.0.3/modules/Reports/CheckReport.php
vtigercrm/branches/5.0.3/modules/Reports/SaveReportFolder.php
Modified: vtigercrm/branches/5.0.3/Smarty/templates/Reports.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/Reports.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/Reports.tpl Tue Apr 17 02:18:25 2007
@@ -166,6 +166,13 @@
return false;
{literal}
}
+ else if(getObj('folder_name').value.replace(/^\s+/g, '').replace(/\s+$/g, '').length > 20 )
+ {
+ {/literal}
+ alert('{$APP.FOLDER_NAME_ALLOW_20CHARS}');
+ return false;
+ {literal}
+ }
else
{
new Ajax.Request(
@@ -174,21 +181,22 @@
method: 'post',
postBody: 'action=ReportsAjax&mode=ajax&file=CheckReport&module=Reports&check=folderCheck&folderName='+getObj('folder_name').value,
onComplete: function(response) {
- if((response.responseText==1) && (mode == 'Edit'))
+ var mode = getObj('fldrsave_mode').value;
+ if((response.responseText ==1 || response.responseText != 0) && (mode == 'Edit' || mode =='save') &&response.responseText != 999)
{
{/literal}
alert("{$APP.FOLDER_NAME_ALREADY_EXISTS}");
return false;
{literal}
}
- else if((response.responseText !=0) && (mode == 'Edit'))
+ else if(response.responseText == 999) // 999 check for special chars
{
- {/literal};
- alert("{$APP.FOLDER_NAME_ALREADY_EXISTS}");
+ {/literal}
+ alert("{$APP.SPECIAL_CHARS_NOT_ALLOWED}");
return false;
{literal}
}
- else
+ else
{
fninvsh('orgLay');
var foldername = getObj('folder_name').value;
@@ -197,7 +205,6 @@
getObj('folder_desc').value = '';
foldername = foldername.replace(/&/gi,'*amp*')
folderdesc = folderdesc.replace(/&/gi,'*amp*')
- var mode = getObj('fldrsave_mode').value;
if(mode == 'save')
{
url ='&savemode=Save&foldername='+foldername+'&folderdesc='+folderdesc;
Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original)
+++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Tue Apr 17 02:18:25 2007
@@ -851,6 +851,8 @@
'LNK_READ_LICENSE'=>'Read License',
'ACTIVITIES' => 'Activities',
'MAP_NAME_EXISTS'=>'This map name already exists. \n Do you want to overwrite it?',
+'FOLDER_NAME_ALLOW_20CHARS'=> 'Folder name allowed 20 characters only',
+'SPECIAL_CHARS_NOT_ALLOWED' => 'Special characters not allowed. try again...',
);
$app_list_strings = array (
Modified: vtigercrm/branches/5.0.3/modules/Reports/CheckReport.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/CheckReport.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/CheckReport.php Tue Apr 17 02:18:25 2007
@@ -26,11 +26,16 @@
else if($_REQUEST['check']== 'folderCheck')
{
$folderName = $_REQUEST['folderName'];
- $folderName = iconv("UTF-8",$default_charset,$folderName);
- $sSQL="select * from vtiger_reportfolder where foldername='".$folderName."'";
-
- $sqlresult = $adb->query($sSQL);
- echo $adb->num_rows($sqlresult);
+ $folderName =str_replace(array("'",'"'),'',iconv("UTF-8",$default_charset,$folderName));
+ if($folderName == "" || !$folderName)
+ {
+ echo "999";
+ }else
+ {
+ $SQL="select * from vtiger_reportfolder where foldername='".$folderName."'";
+ $sqlresult = $adb->query($SQL);
+ echo trim($adb->num_rows($sqlresult));
+ }
}
?>
Modified: vtigercrm/branches/5.0.3/modules/Reports/SaveReportFolder.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/SaveReportFolder.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/SaveReportFolder.php Tue Apr 17 02:18:25 2007
@@ -24,6 +24,13 @@
$folderdesc = addslashes($_REQUEST["folderdesc"]);
$foldername = str_replace('*amp*','&',$foldername);
$folderdesc = str_replace('*amp*','&',$folderdesc);
+/*if($foldername =="")
+{
+ echo "Please Enter valid Name";
+// header("Location: index.php?action=ReportsAjax&file=ListView&mode=ajax&module=Reports");
+
+}
+else*/
if($mode=="Save")
{
if($rfid=="")
More information about the vtigercrm-commits
mailing list