[Vtigercrm-commits] [vtiger-commits] r10758 - in /vtigercrm/branches/5.0.3: Smarty/templates/ActivityEditView.tpl Smarty/templates/Header.tpl include/js/en_us.lang.js include/js/general.js modules/Calendar/language/en_us.lang.php modules/Calendar/script.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 23 01:04:13 EDT 2007


Author: richie
Date: Sun Apr 22 23:03:58 2007
New Revision: 10758

Log:
fix for Calendar : start date & time is not validated properly while creating an event with the status as planned. Fixes #3462 --minnie

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/ActivityEditView.tpl
    vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl
    vtigercrm/branches/5.0.3/include/js/en_us.lang.js
    vtigercrm/branches/5.0.3/include/js/general.js
    vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php
    vtigercrm/branches/5.0.3/modules/Calendar/script.js

Modified: vtigercrm/branches/5.0.3/Smarty/templates/ActivityEditView.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/ActivityEditView.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/ActivityEditView.tpl Sun Apr 22 23:03:58 2007
@@ -898,9 +898,9 @@
         var fieldlabel = new Array('{$MOD.LBL_LIST_SUBJECT}','{$MOD.LBL_START_DATE}','{$MOD.LBL_TIME}','{$MOD.LBL_DUE_DATE}','{$MOD.LBL_STATUS}');
         var fielddatatype = new Array('V~M','D~M~time_start','T~O','D~M~OTH~GE~date_start~Start Date & Time','V~O');
 {else}
-	var fieldname = new Array('subject','date_start','due_date','taskpriority','sendnotification','parent_id','contact_id','reminder_time','recurringtype');
-        var fieldlabel = new Array('{$MOD.LBL_LIST_SUBJECT}','{$MOD.LBL_START_DATE}','{$MOD.LBL_DUE_DATE}','{$MOD.Priority}','{$MOD.LBL_SENDNOTIFICATION}','{$MOD.LBL_RELATEDTO}','{$MOD.LBL_CONTACT_NAME}','{$MOD.LBL_SENDREMINDER}','{$MOD.Recurrence}');
-        var fielddatatype = new Array('V~M','D~M','D~M~OTH~GE~date_start~Start Date','V~O','C~O','I~O','I~O','I~O','O~O');
+	var fieldname = new Array('subject','date_start','time_start','due_date','eventstatus','taskpriority','sendnotification','parent_id','contact_id','reminder_time','recurringtype');
+        var fieldlabel = new Array('{$MOD.LBL_LIST_SUBJECT}','{$MOD.LBL_START_DATE}','{$MOD.LBL_START_TIME}','{$MOD.LBL_DUE_DATE}','{$MOD.LBL_STATUS}','{$MOD.Priority}','{$MOD.LBL_SENDNOTIFICATION}','{$MOD.LBL_RELATEDTO}','{$MOD.LBL_CONTACT_NAME}','{$MOD.LBL_SENDREMINDER}','{$MOD.Recurrence}');
+        var fielddatatype = new Array('V~M','D~M','T~O','D~M~OTH~GE~date_start~Start Date','V~O','V~O','C~O','I~O','I~O','I~O','O~O');
 {/if}
 </script>
 <script>	

Modified: vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl Sun Apr 22 23:03:58 2007
@@ -386,11 +386,11 @@
                chktime.setYear(yyyy)
                chktime.setMonth(mm-1)
                chktime.setDate(dd)
-                if (!compareDates(chkdate,datelabel,currdate,"Current date & time for Activities with status as Planned","GE")) {
+                if (!compareDates(chkdate,datelabel,currdate,alert_arr.DATE_SHOULDNOT_PAST,"GE")) {
                         window.document.QcEditView[datefield].focus()
                         return false
                 }
-                else if(!compareDates(chktime,timelabel,currdate,"Current Time for Activities with status as Planned","GE"))
+                else if(!compareDates(chktime,timelabel,currdate,alert_arr.TIME_SHOULDNOT_PAST,"GE"))
                 {
                         window.document.QcEditView[timefield].focus()
                         return false

Modified: vtigercrm/branches/5.0.3/include/js/en_us.lang.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/en_us.lang.js (original)
+++ vtigercrm/branches/5.0.3/include/js/en_us.lang.js Sun Apr 22 23:03:58 2007
@@ -113,5 +113,13 @@
                                 VALID_SH_TAX:'Enter valid Taxes for shipping and handling ',
 				ROLE_DRAG_ERR_MSG:'You cannot move a Parent Node under a Child Node',
 				LBL_DEL:'del',
-				VALID_DATA :' Enter Valid Data ,Please try again... '
+				VALID_DATA :' Enter Valid Data ,Please try again... ',
+                                STDFILTER : 'Standard Filters',
+                                STARTDATE : 'Start Date',
+                                ENDDATE : 'End Date',
+                                START_DATE_TIME : 'Start Date & Time',
+                                START_TIME : 'Start Time',
+                                DATE_SHOULDNOT_PAST :'Current date & time for Activities with status as Planned',
+                                TIME_SHOULDNOT_PAST :'Current Time for Activities with status as Planned'
+
                        };

Modified: vtigercrm/branches/5.0.3/include/js/general.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/general.js (original)
+++ vtigercrm/branches/5.0.3/include/js/general.js Sun Apr 22 23:03:58 2007
@@ -921,19 +921,17 @@
 		
 	}
        //added to check Start Date & Time,if Activity Status is Planned.//start
-	
         for (var j=0; j<fieldname.length; j++)
 	{
-
 		if(getObj(fieldname[j]) != null)
 		{
-			if(fieldname[j] == "date_start")
+			if(fieldname[j] == "date_start" || fieldname[j] == "task_date_start" )
 			{
 				var datelabel = fieldlabel[j]
 					var datefield = fieldname[j]
 					var startdatevalue = getObj(datefield).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
 			}
-			if(fieldname[j] == "time_start")
+			if(fieldname[j] == "time_start" || fieldname[j] == "task_time_start")
 			{
 				var timelabel = fieldlabel[j]
 					var timefield = fieldname[j]
@@ -944,9 +942,6 @@
 				var statusvalue = getObj(fieldname[j]).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
 					var statuslabel = fieldlabel[j++]
 			}
-		}else
-		{
-			return true;
 		}
 	}
 	if(statusvalue == "Planned")
@@ -974,11 +969,11 @@
                chktime.setDate(dd)
                chktime.setHours(hourval)
                chktime.setMinutes(minval)
-                if (!compareDates(chkdate,datelabel,currdate,"Current date & time for Activities with status as Planned","GE")) {
+                if (!compareDates(chkdate,datelabel,currdate,alert_arr.DATE_SHOULDNOT_PAST,"GE")) {
                         getObj(datefield).focus()
                         return false
                 }
-                else if(!compareDates(chktime,timelabel,currdate,"Current Time for Activities with status as Planned","GE"))
+                else if(!compareDates(chktime,timelabel,currdate,alert_arr.TIME_SHOULDNOT_PAST,"GE"))
                 {
                         getObj(timefield).focus()
                         return false

Modified: vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Sun Apr 22 23:03:58 2007
@@ -170,6 +170,7 @@
 'LBL_START_TIME' => 'Start Time',
 'LBL_END_TIME' => 'End Time',
 'LBL_START_DATE'=>'Start Date',
+'LBL_START_TIME'=>'Time Start',
 'LBL_DUE_DATE'=>'Due Date',
 'LBL_START_DATE_TIME'=>'Start Date & Time',
 'LBL_END_DATE_TIME'=>'End Date & Time',

Modified: vtigercrm/branches/5.0.3/modules/Calendar/script.js
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/script.js (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/script.js Sun Apr 22 23:03:58 2007
@@ -554,6 +554,25 @@
                                 document.EditView.followup_time_end.value = followupendhour+':'+followupendmin;
                         }
                         // Added for Aydin Kurt-Elli requirement END -by Minnie -->
+
+                        //added to check Start Date & Time,if Activity Status is Planned.//start
+                        if(document.EditView.eventstatus.value == "Planned")
+                        {
+                                var currdate=new Date()
+                                var chkdate=new Date()
+                                chkdate.setYear(yyyy)
+                                chkdate.setMonth(mm-1)
+                                chkdate.setDate(dd)
+
+                                if(!compareDates(chkdate,alert_arr.START_DATE_TIME,currdate,alert_arr.DATE_SHOULDNOT_PAST,"GE"))
+                                {
+                                        getObj("date_start").focus();
+                                        return false;
+                                }
+                                else return true
+                        }
+                        //end
+
 		}	
 		else
 			return false;





More information about the vtigercrm-commits mailing list