[Vtigercrm-commits] [vtiger-commits] r10647 - in /vtigercrm/branches/5.0.3: Smarty/templates/ modules/Calendar/ modules/Calendar/language/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Apr 11 11:26:27 EDT 2007


Author: saraj
Date: Wed Apr 11 09:26:15 2007
New Revision: 10647

Log:
fix for Calendar related issue. Fixes #3455 #3402 --minnie

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/ActivityEditView.tpl
    vtigercrm/branches/5.0.3/modules/Calendar/ActivityAjax.php
    vtigercrm/branches/5.0.3/modules/Calendar/EditView.php
    vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php
    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 Wed Apr 11 09:26:15 2007
@@ -24,9 +24,17 @@
 </script>
 
 {*<!-- Contents -->*}
-<table width="100%" cellpadding="2" cellspacing="0" border="0">
 <form name="EditView" method="POST" action="index.php">
 <input type="hidden" name="time_start" id="time_start">
+<input type="hidden" name="view" value="{$view}">
+<input type="hidden" name="hour" value="{$hour}">
+<input type="hidden" name="day" value="{$day}">
+<input type="hidden" name="month" value="{$month}">
+<input type="hidden" name="year" value="{$year}">
+<input type="hidden" name="viewOption" value="{$viewOption}">
+<input type="hidden" name="subtab" value="{$subtab}">
+<input type="hidden" name="maintab" value="{$maintab}">
+<table width="100%" cellpadding="2" cellspacing="0" border="0">
 <tr>
         <td>
                 <table cellpadding="0" cellspacing="5" border="0">

Modified: vtigercrm/branches/5.0.3/modules/Calendar/ActivityAjax.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/ActivityAjax.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/ActivityAjax.php Wed Apr 11 09:26:15 2007
@@ -176,19 +176,19 @@
 					$cal_log->debug("going to get calendar Event HourView");
 					if($calendar_arr['view'] == 'day')
 					{
-						echo getDayViewLayout($calendar_arr);
+						echo getDayViewLayout($calendar_arr)."####".getEventTodoInfo($calendar_arr,'listcnt');
 					}
 					elseif($calendar_arr['view'] == 'week')
 					{
-						echo getWeekViewLayout($calendar_arr);	
+						echo getWeekViewLayout($calendar_arr)."####".getEventTodoInfo($calendar_arr,'listcnt');	
 					}
 					elseif($calendar_arr['view'] == 'month')
 					{
-						echo getMonthViewLayout($calendar_arr);
+						echo getMonthViewLayout($calendar_arr)."####".getEventTodoInfo($calendar_arr,'listcnt');
 					}
 					elseif($calendar_arr['view'] == 'year')
 					{
-						echo getYearViewLayout($calendar_arr);
+						echo getYearViewLayout($calendar_arr)."####".getEventTodoInfo($calendar_arr,'listcnt');
 					}
 					else
 					{
@@ -200,7 +200,7 @@
 					$cal_log->debug("going to get calendar Event ListView");
 					//To get Events List
 					$activity_list = getEventList($calendar_arr, $start_date, $end_date);
-					echo constructEventListView($calendar_arr,$activity_list);
+					echo constructEventListView($calendar_arr,$activity_list)."####".getEventTodoInfo($calendar_arr,'listcnt');
 				}
 			}
 			elseif($subtab == 'todo')
@@ -208,7 +208,7 @@
 				$cal_log->debug("going to get calendar Todo ListView");
 				//To get Todos List
 				$todo_list = getTodoList($calendar_arr, $start_date, $end_date);
-				echo constructTodoListView($todo_list,$calendar_arr,$subtab);
+				echo constructTodoListView($todo_list,$calendar_arr,$subtab)."####".getEventTodoInfo($calendar_arr,'listcnt');
 			}
 		}
 		elseif($type == 'view')

Modified: vtigercrm/branches/5.0.3/modules/Calendar/EditView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/EditView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/EditView.php Wed Apr 11 09:26:15 2007
@@ -223,17 +223,35 @@
 $smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
 
 if (isset($_REQUEST['return_module']))
-$smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
+	$smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
 if (isset($_REQUEST['return_action']))
-$smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
+	$smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
 if (isset($_REQUEST['return_id']))
-$smarty->assign("RETURN_ID", $_REQUEST['return_id']);
+	$smarty->assign("RETURN_ID", $_REQUEST['return_id']);
 if (isset($_REQUEST['ticket_id']))
-$smarty->assign("TICKETID", $_REQUEST['ticket_id']);
+	$smarty->assign("TICKETID", $_REQUEST['ticket_id']);
 if (isset($_REQUEST['product_id']))
-$smarty->assign("PRODUCTID", $_REQUEST['product_id']);
+	$smarty->assign("PRODUCTID", $_REQUEST['product_id']);
 if (isset($_REQUEST['return_viewname']))
-$smarty->assign("RETURN_VIEWNAME", $_REQUEST['return_viewname']);
+	$smarty->assign("RETURN_VIEWNAME", $_REQUEST['return_viewname']);
+if(isset($_REQUEST['view']) && $_REQUEST['view']!='')
+	$smarty->assign("view",$_REQUEST['view']);
+if(isset($_REQUEST['hour']) && $_REQUEST['hour']!='')
+	$smarty->assign("hour",$_REQUEST['hour']);
+if(isset($_REQUEST['day']) && $_REQUEST['day']!='')
+	$smarty->assign("day",$_REQUEST['day']);
+if(isset($_REQUEST['month']) && $_REQUEST['month']!='')
+	$smarty->assign("month",$_REQUEST['month']);
+if(isset($_REQUEST['year']) && $_REQUEST['year']!='')
+	$smarty->assign("year",$_REQUEST['year']);
+if(isset($_REQUEST['viewOption']) && $_REQUEST['viewOption']!='')
+	$smarty->assign("viewOption",$_REQUEST['viewOption']);
+if(isset($_REQUEST['subtab']) && $_REQUEST['subtab']!='')
+	$smarty->assign("subtab",$_REQUEST['subtab']);
+if(isset($_REQUEST['maintab']) && $_REQUEST['maintab']!='')
+	$smarty->assign("maintab",$_REQUEST['maintab']);
+	
+	
 $smarty->assign("THEME", $theme);
 $smarty->assign("IMAGE_PATH", $image_path);
 $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);

Modified: vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php Wed Apr 11 09:26:15 2007
@@ -288,9 +288,9 @@
 			{
 				$headerdata .="<tr><td>&nbsp;</td>";
 			}
-			$headerdata .="<td align='center' width='53%'>";
+			$headerdata .="<td align='center' width='53%'><span id='total_activities'>";
 	$headerdata .= getEventTodoInfo($cal_arr,'listcnt'); 
-	$headerdata .= "	</td>
+	$headerdata .= "</span></td>
 				<td align='center' width='30%'><table border=0 cellspacing=0 cellpadding=2><tr><td class=small><b>".$mod_strings['LBL_VIEW']." : </b></td><td>";
 	$view_options = getEventViewOption($cal_arr,$viewBox);
 	$headerdata .=$view_options."</td></tr></form></table>
@@ -1260,7 +1260,9 @@
 			OR (vtiger_recurringevents.recurringdate BETWEEN '".$start_date."' AND '".$end_date."')) ";
 	if($info != '')
 	{
-		$com_q = " AND vtiger_crmentity.smownerid = ".$current_user->id."
+		$groupids = fetchUserGroupids($current_user->id);
+		$com_q = " AND (vtiger_crmentity.smownerid = ".$current_user->id."
+				OR vtiger_groups.groupid in (".$groupids."))
 			GROUP BY vtiger_activity.activityid";
 		$pending_query = $query." AND (vtiger_activity.eventstatus = 'Planned')".$com_q;
 		$total_q =  $query."".$com_q;
@@ -1686,7 +1688,7 @@
 			{
 				$list_view .="<tr><td>&nbsp;</td>";
 			}
-			$list_view .="<td align='center' width='60%'>&nbsp;</td>
+			$list_view .="<td align='center' width='60%'><span id='total_activities'>".getEventTodoInfo($cal,'listcnt')."</span>&nbsp;</td>
 				<td align='right' width='28%'>&nbsp;</td>
 			</tr>
 		</table>

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 Wed Apr 11 09:26:15 2007
@@ -176,8 +176,8 @@
 'LBL_TODO'=>'To Do',
 'LBL_TODOS'=>'To Dos',
 'LBL_EVENTS'=>'Events',
-'LBL_TOTALEVENTS'=>'Total Events :',
-'LBL_TOTALTODOS'=>'Total To Dos :',
+'LBL_TOTALEVENTS'=>'My Total Events :',
+'LBL_TOTALTODOS'=>'My Total To Dos :',
 'LBL_VIEW'=>'View',
 'LBL_LISTVIEW'=>'List View',
 'LBL_HRVIEW'=>'Hour View',

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 Wed Apr 11 09:26:15 2007
@@ -863,7 +863,8 @@
     document.change_owner.subtab.value = type;
     if(complete) complete.href="javascript:updateStatus("+id+",'"+heldstatus+"','"+view+"',"+hour+","+day+","+month+","+year+",'"+type+"')";
     if(pending) pending.href="javascript:updateStatus("+id+",'"+notheldstatus+"','"+view+"',"+hour+","+day+","+month+","+year+",'"+type+"')";
-    if(postpone) postpone.href="index.php?module=Calendar&action=EditView&record="+id+"&activity_mode="+activity_mode;
+
+    if(postpone) postpone.href="index.php?module=Calendar&action=EditView&record="+id+"&return_action=index&activity_mode="+activity_mode+"&view="+view+"&hour="+hour+"&day="+day+"&month="+month+"&year="+year+"&viewOption="+OptionData+"&subtab="+type+"&maintab=Calendar";
     if(isShared == "shared")
     {
 	if(actdelete) actdelete.href="javascript:alert('"+alert_arr.SHARED_EVENT_DEL_MSG+"')";	
@@ -968,9 +969,18 @@
                         	postBody: 'module=Users&action=massdelete&return_module=Calendar&return_action=ActivityAjax&idlist='+id+'&view='+view+'&hour='+hour+'&day='+day+'&month='+month+'&year='+year+'&type=activity_delete&viewOption='+OptionData+'&subtab=event&ajax=true',
                         	onComplete: function(response) {
 					if(OptionData == 'listview')
-                                        	$("listView").innerHTML=response.responseText;
+		                        {
+                                                result = response.responseText.split('####');
+                                                $("total_activities").innerHTML = result[1];
+                                                $("listView").innerHTML=result[0];
+                                        }
                                 	if(OptionData == 'hourview')
-                                        	$("hrView").innerHTML=response.responseText;
+					{
+
+                                                result = response.responseText.split('####');
+                                                $("total_activities").innerHTML = result[1];
+                                                $("hrView").innerHTML=result[0];
+                                        }
                         	}
                 	}
 		);
@@ -983,7 +993,9 @@
                                 method: 'post',
                                 postBody: 'module=Users&action=massdelete&return_module=Calendar&return_action=ActivityAjax&idlist='+id+'&view='+view+'&hour='+hour+'&day='+day+'&month='+month+'&year='+year+'&type=activity_delete&subtab=todo&ajax=true',
                                 onComplete: function(response) {
-                                        $("mnuTab2").innerHTML=response.responseText;
+					result = response.responseText.split('####');
+					$("total_activities").innerHTML = result[1];
+					$("mnuTab2").innerHTML=result[0];
                                 }
                         }
                 );





More information about the vtigercrm-commits mailing list