[Vtigercrm-commits] [vtiger-commits] r10692 - in /vtigercrm/branches/5.0.3: Smarty/templates/ include/js/ include/utils/ modules/Accounts/ modules/Contacts/ modules/Emails/ modules/Leads/ modules/Users/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 16 02:37:45 EDT 2007


Author: richie
Date: Mon Apr 16 00:37:22 2007
New Revision: 10692

Log:
* Fixed the issue with module select in compose mail page when we click on any email link, Fixed #3577#3578

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/ComposeEmail.tpl
    vtigercrm/branches/5.0.3/Smarty/templates/DetailViewUI.tpl
    vtigercrm/branches/5.0.3/include/js/general.js
    vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
    vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php
    vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php
    vtigercrm/branches/5.0.3/modules/Emails/EditView.php
    vtigercrm/branches/5.0.3/modules/Leads/DetailView.php
    vtigercrm/branches/5.0.3/modules/Users/DetailView.php

Modified: vtigercrm/branches/5.0.3/Smarty/templates/ComposeEmail.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/ComposeEmail.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/ComposeEmail.tpl Mon Apr 16 00:37:22 2007
@@ -67,6 +67,11 @@
 	<td class="cellText" style="padding: 5px;" align="left" nowrap>
 		<select name="parent_type">
 			{foreach key=labelval item=selectval from=$elements.1.0}
+				{if $select_module eq $APP[$labelval]}
+					{assign var=selectval value="selected"}
+				{else}
+					{assign var=selectval value=""}
+				{/if}
 				<option value="{$labelval}" {$selectval}>{$APP[$labelval]}</option>
 			{/foreach}
 		</select>

Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailViewUI.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/DetailViewUI.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/DetailViewUI.tpl Mon Apr 16 00:37:22 2007
@@ -32,7 +32,9 @@
                                                        </div>
                                                   </td>
                                              {elseif $keyid eq '13' || $keyid eq '104'} <!--Email-->
-                                                  <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}" onmouseover="hndMouseOver({$keyid},'{$label|escape:'quotes'}');" onmouseout="fnhide('crmspanid');">&nbsp;<span id="dtlview_{$label}"><a href="mailto:{$keyval}" target="_blank">{$keyval}</a></span>
+                                                  <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}" onmouseover="hndMouseOver({$keyid},'{$label|escape:'quotes'}');" onmouseout="fnhide('crmspanid');">&nbsp;<span id="dtlview_{$label}">
+								<a href="javascript:InternalMailer({$ID},{$FIELD_ID},'{$MODULE}','record_id')">{$keyval}</a>
+							</span>
                                               		<div id="editarea_{$label}" style="display:none;">
                                               		  <input class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'" type="text" id="txtbox_{$label}" name="{$keyfldname}" maxlength='100' value="{$keyval|escape}"></input>
                                               		  <br><input name="button_{$label}" type="button" class="crmbutton small save" value="{$APP.LBL_SAVE_LABEL}" onclick="dtlViewAjaxSave('{$label|escape:'quotes'}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');fnhide('crmspanid');"/> {$APP.LBL_OR}

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 Mon Apr 16 00:37:22 2007
@@ -1588,11 +1588,11 @@
       window.onload = fnc;
   }
 }
-function InternalMailer(record_id,field_id,type) {
+function InternalMailer(record_id,field_id,par_module,type) {
         var url;
         switch(type) {
                 case 'record_id':
-                        url = 'index.php?module=Emails&action=EmailsAjax&internal_mailer=true&type='+type+'&record=&field_id='+field_id+'&rec_id='+record_id+'&file=EditView';//query string field_id added for listview-compose email issue
+                        url = 'index.php?module=Emails&action=EmailsAjax&internal_mailer=true&type='+type+'&record=&field_id='+field_id+'&rec_id='+record_id+'&file=EditView&par_module='+par_module;//query string field_id added for listview-compose email issue
                 break;
                 case 'email_addy':
                         url = 'index.php?module=Emails&action=EmailsAjax&internal_mailer=true&type='+type+'&record=&email_addy='+record_id+'&file=EditView';

Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Mon Apr 16 00:37:22 2007
@@ -1149,16 +1149,20 @@
 	}
 	elseif($uitype == 13 || $uitype == 104)
         {
-		if(useInternalMailer() == 1)
-		{
-			$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($module)." and uitype=13;";
+		//if(useInternalMailer() == 1)
+		//{
+			//check added for email link in user detailview
+			if($module == "Users")
+				$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($module)." and uitype=104;";
+			else
+				$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($module)." and uitype=13;";
 			$queryres = $adb->query($querystr);
 			//Change this index 0 - to get the vtiger_fieldid based on email1 or email2
 			$fieldid = $adb->query_result($queryres,0,'fieldid');
-			$value = '<a href="javascript:InternalMailer('.$entity_id.','.$fieldid.',\'record_id\')">'.$temp_val.'</a>';
-		}
-		else
-                	$value = '<a href="mailto:'.$field_val.'">'.$temp_val.'</a>';
+			$value = '<a href="javascript:InternalMailer('.$entity_id.','.$fieldid.',\''.$module.'\',\'record_id\')">'.$temp_val.'</a>';
+		//}
+		//else
+                //	$value = '<a href="mailto:'.$field_val.'">'.$temp_val.'</a>';
         }
 	elseif($uitype == 56)
 	{

Modified: vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php Mon Apr 16 00:37:22 2007
@@ -125,6 +125,12 @@
 	$related_array = getRelatedLists($currentModule,$focus);
 	$smarty->assign("RELATEDLISTS", $related_array);
 }
+//added for email link in detailv view
+$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($currentModule)." and uitype=13;";
+$queryres = $adb->query($querystr);
+$fieldid = $adb->query_result($queryres,0,'fieldid');
+$smarty->assign("FIELD_ID",$fieldid);
+
 $smarty->assign("SinglePane_View", $singlepane_view);
 
 $smarty->display("DetailView.tpl");

Modified: vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Mon Apr 16 00:37:22 2007
@@ -135,6 +135,11 @@
 	$related_array = getRelatedLists($currentModule,$focus);
 	$smarty->assign("RELATEDLISTS", $related_array);
 }
+//added for email link in detailv view
+$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($currentModule)." and uitype=13;";
+$queryres = $adb->query($querystr);
+$fieldid = $adb->query_result($queryres,0,'fieldid');
+$smarty->assign("FIELD_ID",$fieldid);
 
 $smarty->assign("SinglePane_View", $singlepane_view);
 

Modified: vtigercrm/branches/5.0.3/modules/Emails/EditView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/EditView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/EditView.php Mon Apr 16 00:37:22 2007
@@ -48,6 +48,13 @@
 	require_once("modules/Emails/mail.php");
 	echo parseEmailErrorString($_REQUEST['mail_error']);
 }
+//added to select the module in combobox of compose-popup
+if(isset($_REQUEST['par_module']) && $_REQUEST['par_module']!=''){
+	$smarty->assign('select_module',$_REQUEST['par_module']);
+}
+elseif(isset($_REQUEST['pmodule']) && $_REQUEST['pmodule']!='') {
+	$smarty->assign('select_module',$_REQUEST['pmodule']);	
+}
 
 if(isset($_REQUEST['record']) && $_REQUEST['record'] !='') 
 {
@@ -85,22 +92,27 @@
 	$smarty->assign('INT_MAILER',"true");
 	$rec_type = $_REQUEST["type"];
 	$rec_id = $_REQUEST["rec_id"];
+	
 	//added for getting list-ids to compose email popup from list view(Accounts,Contacts,Leads)
 	if(isset($_REQUEST['field_id']) && strlen($_REQUEST['field_id']) != 0) {
-             $id_list = $_REQUEST['rec_id'].'@'.$_REQUEST['field_id'].'|';
+	     if($_REQUEST['par_module'] == "Users")
+		$id_list = $_REQUEST['rec_id'].'@'.'-1|';
+	     else
+                $id_list = $_REQUEST['rec_id'].'@'.$_REQUEST['field_id'].'|';
              $smarty->assign("IDLISTS", $id_list);
         }
 	if($rec_type == "record_id") {
 		$rs = $adb->query("select setype from vtiger_crmentity where crmid='".$rec_id."'");
 		$type = $adb->query_result($rs,0,'setype');
-
-		if($type == "Leads") 
+		//check added for email link in user detail view
+		if($_REQUEST['par_module'] == "Users")
+			$q = "select email1,email2 from vtiger_users where id='".$rec_id."'";	
+		elseif($type == "Leads") 
 			$q = "select email as email1 from vtiger_leaddetails where leadid='".$rec_id."'";
 		elseif ($type == "Contacts")
 			$q = "select email as email1 from vtiger_contactdetails where contactid='".$rec_id."'";
 		elseif ($type == "Accounts")
 			$q = "select email1,email2 from vtiger_account where accountid='".$rec_id."'";
-
 		$email1 = $adb->query_result($adb->query($q),0,"email1");
 	} elseif ($rec_type == "email_addy") {
 		$email1 = $_REQUEST["email_addy"];

Modified: vtigercrm/branches/5.0.3/modules/Leads/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Leads/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Mon Apr 16 00:37:22 2007
@@ -135,6 +135,11 @@
 	$related_array = getRelatedLists($currentModule,$focus);
 	$smarty->assign("RELATEDLISTS", $related_array);
 }
+//added for email link in detailv view
+$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($currentModule)." and uitype=13;";
+$queryres = $adb->query($querystr);
+$fieldid = $adb->query_result($queryres,0,'fieldid');
+$smarty->assign("FIELD_ID",$fieldid);
 
 $smarty->assign("SinglePane_View", $singlepane_view);
 

Modified: vtigercrm/branches/5.0.3/modules/Users/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Users/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Users/DetailView.php Mon Apr 16 00:37:22 2007
@@ -108,7 +108,8 @@
 
 $oGetUserGroups = new GetUserGroups();
 $oGetUserGroups->getAllUserGroups($focus->id);
-
+if(useInternalMailer() == 1)
+        $smarty->assign("INT_MAILER","true");
 
 $smarty->assign("GROUP_COUNT",count($oGetUserGroups->user_groups));
 $smarty->assign("THEME", $theme);
@@ -195,6 +196,12 @@
 $smarty->assign("HOMEORDER",$focus->getHomeOrder($focus->id));
 $smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields));
 $smarty->assign("USERNAME",$focus->last_name.' '.$focus->first_name);
+//added for email link in detailv view
+$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($currentModule)." and uitype=104;";
+$queryres = $adb->query($querystr);
+$fieldid = $adb->query_result($queryres,0,'fieldid');
+$smarty->assign("FIELD_ID",$fieldid);
+
 //for check audittrail if it is enable or not
 $smarty->assign("AUDITTRAIL",$audit_trail);
 





More information about the vtigercrm-commits mailing list