[Vtigercrm-commits] [vtiger-commits] r9836 - in /vtigercrm/branches/5.0.3: Smarty/templates/pendingActivities.tpl Smarty/templates/upcomingActivities.tpl modules/Calendar/Save.php modules/Calendar/language/en_us.lang.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Nov 14 09:11:17 EST 2006


Author: richie
Date: Tue Nov 14 07:11:09 2006
New Revision: 9836

Log:
language support added for invitees mail in calendar

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl
    vtigercrm/branches/5.0.3/Smarty/templates/upcomingActivities.tpl
    vtigercrm/branches/5.0.3/modules/Calendar/Save.php
    vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php

Modified: vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl Tue Nov 14 07:11:09 2006
@@ -9,19 +9,36 @@
   *
  ********************************************************************************/
 -->*}
-{if $ACTIVITIES.1.noofactivities > 0}
-{assign var=label value=$ACTIVITIES.1.Title.0}
+{if $ACTIVITIES.2.noofactivities > 0 || $ACTIVITIES.3.noofactivities > 0}
+<script>
+{literal}
+function changePendingView(view)
+{
+        if(view == "today")
+        {
+
+                document.getElementById('todaypending').style.display="block";
+                document.getElementById('allpending').style.display="none";
+        }
+        else
+        {
+                document.getElementById('todaypending').style.display="none";
+                document.getElementById('allpending').style.display="block";
+
+        }
+}
+{/literal}
+</script>
+
+<div id="todaypending" style="display:block;">
+{assign var=label value=$ACTIVITIES.2.Title.0}
 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="small">
         <tr>
 		<td><img src="{$IMAGE_PATH}pending_left.gif"></td>
                 <td width="100%" background="{$IMAGE_PATH}pendingEvents.gif" valign="bottom" style="background-repeat:repeat-x;">
-                        <b class="fontBold">{$APP.$label}&nbsp;{$APP.LBL_PENDING_EVENTS}&nbsp;({$ACTIVITIES.1.noofactivities})</b><br />
+                        <b class="fontBold">{$APP.$label}&nbsp;{$APP.LBL_PENDING_EVENTS}&nbsp;({$ACTIVITIES.2.noofactivities})</b><br />
                         <b>{$APP.LBL_SHOW}</b>
-                        {if $ACTIVITIES.1.Title.0 eq 'today'}
-	                        {$APP.LBL_TODAY}&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" onClick="getHomeActivities(1,'all');">{$APP.LBL_ALL}</a>
-                        {else}
-                                <a href="#" onClick="getHomeActivities(1,'today');">{$APP.LBL_TODAY}</a>&nbsp;&nbsp;|&nbsp;&nbsp;{$APP.LBL_ALL}
-                        {/if}
+	                        {$APP.LBL_TODAY}&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" onClick="changePendingView('all');">{$APP.LBL_ALL}</a>
 		</td>
 
                 <td><img src="{$IMAGE_PATH}pending_right.gif"></td>
@@ -33,7 +50,47 @@
                         	<tr>
                                 <td style="border-bottom:1px dotted #dddddd;" colspan=3 align="right" valign=top>&nbsp;</td>
                                 </tr>
-                                {foreach item=entries name=entryloop from=$ACTIVITIES.1.Entries}
+				{if $ACTIVITIES.2.noofactivities != 0}
+                                {foreach item=entries name=entryloop from=$ACTIVITIES.2.Entries}
+                                <tr>
+					<td  style="border-bottom:1px dotted #dddddd;"  align="right" width="20">{math equation="x+1" x=$smarty.foreach.entryloop.index}</td>
+                                        <td  style="border-bottom:1px dotted #dddddd;"  align="right" width="20">{$entries.IMAGE}</td>
+                                        <td  style="border-bottom:1px dotted #dddddd;" align="left" valign="middle" colspan="2" width="85%"><b class="style_Gray">{$entries.0}</b>{*<br />{$entries.ACCOUNT_NAME*}</td>
+                                </tr>
+                                {/foreach}
+				{else}
+				<tr>
+					<td  style="border-bottom:1px dotted #dddddd;" align="left" valign="middle" colspan="2" width="85%"><b>{$APP.LBL_NONE_SCHEDULED}</b></td>
+				</tr>
+				{/if}
+                        </table>
+			</div>
+                </td>
+	</tr>
+</table>
+<br>
+</div>
+<div id = "allpending" style="display:none">
+{assign var=label value=$ACTIVITIES.3.Title.0}
+<table width="100%" border="0" cellpadding="0" cellspacing="0" class="small">
+        <tr>
+		<td><img src="{$IMAGE_PATH}pending_left.gif"></td>
+                <td width="100%" background="{$IMAGE_PATH}pendingEvents.gif" valign="bottom" style="background-repeat:repeat-x;">
+                        <b class="fontBold">{$APP.$label}&nbsp;{$APP.LBL_PENDING_EVENTS}&nbsp;({$ACTIVITIES.3.noofactivities})</b><br />
+                        <b>{$APP.LBL_SHOW}</b>
+                                <a href="#" onClick="changePendingView('today')">{$APP.LBL_TODAY}</a>&nbsp;&nbsp;|&nbsp;&nbsp;{$APP.LBL_ALL}
+		</td>
+
+                <td><img src="{$IMAGE_PATH}pending_right.gif"></td>
+        </tr>
+        <tr>
+                <td colspan="3" bgcolor="#FEF7C1" style="border-left:2px solid #A6A4A5;border-right:2px solid #A6A4A5;border-bottom:2px solid #A6A4A5;">
+			<div id="pendingActivitiesEntry" style="overflow-y:auto;overflow-x:hidden;height:150px;width:100%">
+                	<table width="100%" border="0" cellpadding="5" cellspacing="0">
+                        	<tr>
+                                <td style="border-bottom:1px dotted #dddddd;" colspan=3 align="right" valign=top>&nbsp;</td>
+                                </tr>
+                                {foreach item=entries name=entryloop from=$ACTIVITIES.3.Entries}
                                 <tr>
 					<td  style="border-bottom:1px dotted #dddddd;"  align="right" width="20">{math equation="x+1" x=$smarty.foreach.entryloop.index}</td>
                                         <td  style="border-bottom:1px dotted #dddddd;"  align="right" width="20">{$entries.IMAGE}</td>
@@ -46,5 +103,7 @@
 	</tr>
 </table>
 <br>
+</div>
+
 {/if}
 

Modified: vtigercrm/branches/5.0.3/Smarty/templates/upcomingActivities.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/upcomingActivities.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/upcomingActivities.tpl Tue Nov 14 07:11:09 2006
@@ -9,7 +9,28 @@
   *
  ********************************************************************************/
 -->*}
-{if $ACTIVITIES.0.noofactivities > 0}
+{if $ACTIVITIES.0.noofactivities > 0 || $ACTIVITIES.1.noofactivities > 0}
+<script>
+{literal}
+function changeUpcomingView(view)
+{
+        if(view == "today")
+        {
+
+                document.getElementById('todayUpcoming').style.display="block";
+                document.getElementById('allUpcoming').style.display="none";
+        }
+        else
+        {
+                document.getElementById('todayUpcoming').style.display="none";
+                document.getElementById('allUpcoming').style.display="block";
+
+        }
+}
+{/literal}
+</script>
+
+<div id='todayUpcoming'>
 	{assign var=label value=$ACTIVITIES.0.Title.0}
 	<table width="100%" border="0" cellpadding="0" cellspacing="0">
         	<tr>
@@ -21,11 +42,7 @@
                         <td colspan="3" bgcolor="#FFFFCF" style="border-left:2px solid #A6A4A5;border-right:2px solid #A6A4A5;padding-left:10px;">
                 	        <b class="fontBold">{$APP.$label}&nbsp;{$APP.LBL_UPCOMING_EVENTS}&nbsp;({$ACTIVITIES.0.noofactivities})</b><br />
                                 <b>{$APP.LBL_SHOW}</b>
-				{if $ACTIVITIES.0.Title.0 eq 'today'}
-					{$APP.LBL_TODAY}&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" onClick="getHomeActivities(0,'all')">{$APP.LBL_ALL}</a>
-				{else}
-					<a href="#" onClick="getHomeActivities(0,'today')">{$APP.LBL_TODAY}</a>&nbsp;&nbsp;|&nbsp;&nbsp;{$APP.LBL_ALL}
-			        {/if}
+					{$APP.LBL_TODAY}&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" onClick="changeUpcomingView('all')">{$APP.LBL_ALL}</a>
 			</td>
 		</tr>
 		<tr>
@@ -35,7 +52,49 @@
 					<tr bgcolor="#FFFFCF">
 	                                        <td style="border-bottom:1px dotted #dddddd;" colspan=3 align="right" valign=top>&nbsp;</td>
                                         </tr>
+					{if $ACTIVITIES.0.noofactivities != 0}
                                         {foreach item=entries name=entryloop from=$ACTIVITIES.0.Entries}
+                                        <tr bgcolor="#FFFFCF">
+						<td style="border-bottom:1px dotted #dddddd;" align="right" width="20" valign=top>{math equation="x+1" x=$smarty.foreach.entryloop.index}</td>
+						<td style="border-bottom:1px dotted #dddddd;" align="right" width="20" valign=top>{$entries.IMAGE}</td>
+                                                <td style="border-bottom:1px dotted #dddddd;" align="left" valign="middle" colspan="2" width="85%"><b>{$entries.0}</b>{*<br />{$entries.ACCOUNT_NAME*}</td>
+                                        </tr>
+                                        {/foreach}
+					{else}
+					<tr>
+					<td style="border-bottom:1px dotted #dddddd;" align="left" valign="middle" colspan="2" width="85%"><b>{$APP.LBL_NONE_SCHEDULED}</b></td>
+					</tr>
+					{/if}
+				</table>
+				</div>
+			</td>
+		</tr>
+	</table>
+	<br>
+</div>
+<div id = "allUpcoming" style = "display:none">
+	{assign var=label value=$ACTIVITIES.1.Title.0}
+	<table width="100%" border="0" cellpadding="0" cellspacing="0">
+        	<tr>
+                	<td><img src="{$IMAGE_PATH}upcoming_left.gif" align="top"  /></td>
+                	<td width="100%" background="{$IMAGE_PATH}upcomingEvents.gif" style="background-repeat:repeat-x; "></td>
+			<td><img src="{$IMAGE_PATH}upcoming_right.gif" align="top"  /></td>
+		</tr>
+		<tr>
+                        <td colspan="3" bgcolor="#FFFFCF" style="border-left:2px solid #A6A4A5;border-right:2px solid #A6A4A5;padding-left:10px;">
+                	        <b class="fontBold">{$APP.$label}&nbsp;{$APP.LBL_UPCOMING_EVENTS}&nbsp;({$ACTIVITIES.1.noofactivities})</b><br />
+                                <b>{$APP.LBL_SHOW}</b>
+					<a href="#" onClick="changeUpcomingView('today')">{$APP.LBL_TODAY}</a>&nbsp;&nbsp;|&nbsp;&nbsp;{$APP.LBL_ALL}
+			</td>
+		</tr>
+		<tr>
+			<td colspan="3" bgcolor="#FFFFCF" style="border-left:2px solid #A6A4A5;border-right:2px solid #A6A4A5;border-bottom:2px solid #A6A4A5;">
+			<div id="upcomingActivitiesEntry" style="overflow-y:auto;overflow-x:hidden;height:150px;width:100%">
+				<table width="100%" border="0" cellpadding="5" cellspacing="0">
+					<tr bgcolor="#FFFFCF">
+	                                        <td style="border-bottom:1px dotted #dddddd;" colspan=3 align="right" valign=top>&nbsp;</td>
+                                        </tr>
+                                        {foreach item=entries name=entryloop from=$ACTIVITIES.1.Entries}
                                         <tr bgcolor="#FFFFCF">
 						<td style="border-bottom:1px dotted #dddddd;" align="right" width="20" valign=top>{math equation="x+1" x=$smarty.foreach.entryloop.index}</td>
 						<td style="border-bottom:1px dotted #dddddd;" align="right" width="20" valign=top>{$entries.IMAGE}</td>
@@ -48,5 +107,7 @@
 		</tr>
 	</table>
 	<br>
+</div>
+
 {/if}
 

Modified: vtigercrm/branches/5.0.3/modules/Calendar/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/Save.php Tue Nov 14 07:11:09 2006
@@ -146,11 +146,11 @@
 	$selected_users_string =  $_REQUEST['inviteesid'];
 	$invitees_array = explode(';',$selected_users_string);
 	$subject = $_REQUEST['activity_mode'].' : '.$_REQUEST['subject'];
-	$description = getActivityDetails($_REQUEST['description']);
 	foreach($invitees_array as $inviteeid)
 	{
 		if($inviteeid != '')
 		{
+			$description=getActivityDetails($_REQUEST['description'],$inviteeid);
 			$to_email = getUserEmailId('id',$inviteeid);
 			$mail_status  = send_mail('Calendar',$to_email,$current_user->user_name,'',$subject,$description);
 			$record = $focus->id;
@@ -199,24 +199,31 @@
  * @param   string   $description       - activity description
  * return   string   $list              - HTML in string format
  */
-function getActivityDetails($description)
-{
-	global $log;
+function getActivityDetails($description,$inviteeid='')
+{
+	global $log,$current_user;
+        global $adb,$mod_strings;
 	$log->debug("Entering getActivityDetails(".$description.") method ...");
-	global $adb;
 
 	$reply = (($_REQUEST['mode'] == 'edit')?'Replied':'Created');
+	if($inviteeid=='')
 	$name = getUserName($_REQUEST['assigned_user_id']);
+	else
+	$name = getUserName($inviteeid);
+
+	$current_username = getUserName($current_user->id);
 	$status = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus']));
-
-	$list = 'Dear '.$name.',';
-	$list .= '<br><br> There is an vtiger_activity('.$_REQUEST['activity_mode'].')'.$reply.'. The details are :';
-	$list .= '<br>Subject : '.$_REQUEST['subject'];
-	$list .= '<br>Status : '.$status;
-	$list .= '<br>Priority : '.$_REQUEST['taskpriority'];
-	$list .= '<br>Related to : '.$_REQUEST['parent_name'];
-	$list .= '<br>Contact : '.$_REQUEST['contact_name'];
-	$list .= '<br><br> Description : '.$description;
+	
+	$list = $mod_strings['LBL_DEAR'].' ' .$name.',';
+        $list .= '<br><br>'.$mod_strings['LBL_ACTIVITY_STRING'].' '.$reply.'. '.$mod_strings['LBL_DETAILS_STRING'].':';
+        $list .= '<br>'.$mod_strings["LBL_SUBJECT"].' '.$_REQUEST['subject'];
+        $list .= '<br>'.$mod_strings["LBL_STATUS"].': '.$status;
+        $list .= '<br>'.$mod_strings["Priority"].': '.$_REQUEST['taskpriority'];
+        $list .= '<br>'.$mod_strings["Related To"].' : '.$_REQUEST['parent_name'];
+        $list .= '<br>'.$mod_strings["LBL_CONTACT"].' '.$_REQUEST['contact_name'];
+        $list .= '<br>'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description;
+	$list .= '<br><br>'.$mod_strings["LBL_REGARDS_STRING"].' ,';
+	$list .= '<br>'.$current_username.'.';
 
 	$log->debug("Exiting getActivityDetails method ...");
 	return $list;

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 Tue Nov 14 07:11:09 2006
@@ -204,6 +204,7 @@
 'LBL_ASSINGEDTO'=>'Assigned To',
 'LBL_RELATEDTO'=>'Related To',
 'LBL_STATUS'=>'Status',
+'LBL_DEAR'=>'Dear',
 'LBL_PENDING'=>'Pending',
 'LBL_PUBLIC'=>'Mark Public',
 'LBL_MORE'=>'More',
@@ -264,6 +265,9 @@
 'LBL_EVENT_INFORMATION'=>'Event Information',
 
 'LBL_NAME'=>'Subject:',
+'LBL_ACTIVITY_STRING'=>'There is an activity',
+'LBL_DETAILS_STRING'=>'The details are',
+'LBL_REGARDS_STRING'=>'Thanks & Regards',
 'LBL_CONTACT_NAME'=>'Contact Name',
 'LBL_OPEN_ACTIVITIES'=>'Open Activities',
 'LBL_ACTIVITY'=>'Activity:',





More information about the vtigercrm-commits mailing list