[Vtigercrm-commits] [vtiger-commits] r10021 - in /vtigercrm/branches/5.0.3: Smarty/templates/Reports.tpl Smarty/templates/ReportsStep0.tpl modules/Reports/CheckReport.php modules/Reports/Report.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Jan 4 04:56:29 EST 2007
Author: richie
Date: Thu Jan 4 02:56:21 2007
New Revision: 10021
Log:
validation added for duplicate report/folder name
Added:
vtigercrm/branches/5.0.3/modules/Reports/CheckReport.php (with props)
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/Reports.tpl
vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep0.tpl
vtigercrm/branches/5.0.3/modules/Reports/Report.js
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 Thu Jan 4 02:56:21 2007
@@ -164,37 +164,58 @@
}
else
{
- fninvsh('orgLay');
- var foldername = getObj('folder_name').value;
- var folderdesc = getObj('folder_desc').value;
- getObj('folder_name').value = '';
- 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;
- }
- else
- {
- var folderid = getObj('folder_id').value;
- url ='&savemode=Edit&foldername='+foldername+'&folderdesc='+folderdesc+'&record='+folderid;
- }
- getObj('fldrsave_mode').value = 'save';
new Ajax.Request(
'index.php',
{queue: {position: 'end', scope: 'command'},
method: 'post',
- postBody: 'action=ReportsAjax&mode=ajax&file=SaveReportFolder&module=Reports'+url,
+ postBody: 'action=ReportsAjax&mode=ajax&file=CheckReport&module=Reports&check=folderCheck&folderName='+getObj('folder_name').value,
onComplete: function(response) {
- var item = response.responseText;
- getObj('customizedrep').innerHTML = item;
- }
- }
- );
- }
-}
+ if(response.responseText!=0)
+ {
+ alert("Folder name already exists, try again...");
+ return false;
+ }
+ else
+ {
+ fninvsh('orgLay');
+ var foldername = getObj('folder_name').value;
+ var folderdesc = getObj('folder_desc').value;
+ getObj('folder_name').value = '';
+ 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;
+ }
+ else
+ {
+ var folderid = getObj('folder_id').value;
+ url ='&savemode=Edit&foldername='+foldername+'&folderdesc='+folderdesc+'&record='+folderid;
+ }
+ getObj('fldrsave_mode').value = 'save';
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody: 'action=ReportsAjax&mode=ajax&file=SaveReportFolder&module=Reports'+url,
+ onComplete: function(response) {
+ var item = response.responseText;
+ getObj('customizedrep').innerHTML = item;
+ }
+ }
+
+ );
+ }
+ }
+ }
+ );
+
+ }
+}
+
+
function EditFolder(id,name,desc)
{
{/literal}
Modified: vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep0.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep0.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep0.tpl Thu Jan 4 02:56:21 2007
@@ -15,6 +15,7 @@
<title>vtiger CRM - Create Report</title>
<link href="{$THEME_PATH}style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="include/js/general.js"></script>
+ <script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="modules/Reports/Report.js"></script>
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
Modified: vtigercrm/branches/5.0.3/modules/Reports/Report.js
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/Report.js (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/Report.js Thu Jan 4 02:56:21 2007
@@ -464,12 +464,32 @@
alert("Missing Report Name");
}else
{
- hide('step1');
- show('step2');
- document.getElementById('back_rep').disabled = false;
- getObj('step1label').className = 'settingsTabList';
- getObj('step2label').className = 'settingsTabSelected';
- }
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody: 'action=ReportsAjax&mode=ajax&file=CheckReport&module=Reports&check=reportCheck&reportName='+document.NewRep.reportname.value,
+ onComplete: function(response) {
+ if(response.responseText!=0)
+ {
+ alert("Report name already exists, try again...");
+ return false;
+ }
+ else
+ {
+ hide('step1');
+ show('step2');
+ document.getElementById('back_rep').disabled = false;
+ getObj('step1label').className = 'settingsTabList';
+ getObj('step2label').className = 'settingsTabSelected';
+ }
+
+ }
+ }
+ );
+
+ }
+
}
else
{
More information about the vtigercrm-commits
mailing list