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

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sat Jan 13 07:56:22 EST 2007


Author: richie
Date: Sat Jan 13 05:56:11 2007
New Revision: 10055

Log:
Email validation in detail view and related list

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl
    vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl
    vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl
    vtigercrm/branches/5.0.3/include/js/general.js
    vtigercrm/branches/5.0.3/modules/Contacts/CallRelatedList.php
    vtigercrm/branches/5.0.3/modules/Emails/mailSelect.php
    vtigercrm/branches/5.0.3/modules/Leads/CallRelatedList.php
    vtigercrm/branches/5.0.3/modules/Leads/DetailView.php

Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Sat Jan 13 05:56:11 2007
@@ -27,7 +27,6 @@
 <div id="convertleaddiv" style="display:block;position:absolute;left:225px;top:150px;"></div>
 <script>
 {literal}
-
 var gVTModule = '{$smarty.request.module}';
 function callConvertLeadDiv(id)
 {
@@ -177,7 +176,7 @@
 						{/if}
 						{if $MODULE eq 'Leads' || $MODULE eq 'Contacts'}
 								{if $SENDMAILBUTTON eq 'permitted'}
-								<input title="{$APP.LBL_SENDMAIL_BUTTON_TITLE}" accessKey="{$APP.LBL_SENDMAIL_BUTTON_KEY}" class="crmbutton small edit" onclick="fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID});" type="button" name="SendMail" value="{$APP.LBL_SENDMAIL_BUTTON_LABEL}">&nbsp;
+								<input title="{$APP.LBL_SENDMAIL_BUTTON_TITLE}" accessKey="{$APP.LBL_SENDMAIL_BUTTON_KEY}" class="crmbutton small edit" onclick="if(checkEmailid('{$MODULE}','{$EMAIL}','{$YAHOO}')){ldelim}fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID}){rdelim}else{ldelim}return false{rdelim};" type="button" name="SendMail" value="{$APP.LBL_SENDMAIL_BUTTON_LABEL}">&nbsp;
 								{/if}
 						{/if}
 						{if $MODULE eq 'Quotes' || $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Invoice'}

Modified: vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/RelatedListContents.tpl Sat Jan 13 05:56:11 2007
@@ -18,7 +18,7 @@
 	{assign var = return_modname value='CallRelatedList'}
 {/if}
 {if $BASE_ACCOUNT neq ''}
-        {assign var="search_string" value="&search_field=accountid&query=true&searchtype=BasicSearch&search_text=$BASE_ACCOUNT"}
+        {assign var="search_string" value="&search_field=accountid&query=true&searchtype=BasicSearch&search_text=$BASE_ACCOUNT&check_rel=potential_rel"}
 {/if}
 {foreach key=header item=detail from=$RELATEDLISTS}
 

Modified: vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/SelectEmail.tpl Sat Jan 13 05:56:11 2007
@@ -10,7 +10,6 @@
  ********************************************************************************/
 -->*}
 <!-- BEGIN: main -->
-{if $EMAIL_ID neq '' || $YAHOO_ID neq ''}
 <div id="roleLay" style="z-index:12;display:block;width:400px;" class="layerPopup">
 <table border=0 cellspacing=0 cellpadding=5 width=100% class=layerHeadingULine>
 <tr>
@@ -39,9 +38,9 @@
 			{foreach name=emailids key=fieldid item=elements from=$MAILINFO}
 			<tr>
 				{if $smarty.foreach.emailids.iteration eq 1}	
-					<td align="center"><input  type="checkbox" value="{$fieldid}" name="email" onClick="checkEmailid('{$ENTITY_NAME}','{$EMAIL_ID}',0,'{$elements.0}')"/></td>
+					<td align="center"><input  type="checkbox" value="{$fieldid}" name="email" /></td>
 			{else}
-					<td align="center"><input type="checkbox" value="{$fieldid}" name="email" onClick="checkEmailid('{$ENTITY_NAME}','{$YAHOO_ID}',1,'{$elements.0}')" /></td>
+					<td align="center"><input type="checkbox" value="{$fieldid}" name="email"  /></td>
 				{/if}
 				{if $ONE_RECORD eq 'true'}	
 					<td align="left"><b>{$elements.0} </b><br>{$MAILDATA[$smarty.foreach.emailids.iteration]}</td>
@@ -67,6 +66,3 @@
 </tr>
 </table>
 </div>
-{else} 
-	<font color='red'>"{$ENTITY_NAME}" doesn't have an emailid</font>
-{/if}

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 Sat Jan 13 05:56:11 2007
@@ -1790,10 +1790,10 @@
                 rel_parent_module = frmName.parent_type.value;
 		record_id = frmName.parent_id.value;
                 module = rel_parent_module.split("&");	
-		if(record_id != '' && module == "Leads")
+		if(record_id != '' && module[0] == "Leads")
 		{
 			alert("You can't select related contacts from Lead ");
-			document.formName.selectcnt.disabled="true";
+			formName.selectcnt.disabled="true";
 		}
 		else
 		{
@@ -1804,7 +1804,7 @@
 			if(record_id != '')
 				window.open("index.php?module=Contacts&action=Popup&html=Popup_picker&popuptype=specific&form=EditView"+search_string+"&relmod_id="+record_id+"&parent_module="+module[0],"test","width=640,height=602,resizable=0,scrollbars=0");
 			else
-				window.open("index.php?module=Contacts&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=640,height=602,resizable=0,scrollbars=0");
+				window.open("index.php?module=Contacts&action=Popup&html=Popup_picker&popuptype=specific&form=EditView"+search_string,"test","width=640,height=602,resizable=0,scrollbars=0");
 
 
 		}
@@ -1826,10 +1826,11 @@
 			task_module = task_parent_module.split("&");
 			popuptype="&popuptype=toDospecific";
 		}
-		if(task_recordid != '' && task_module == "Leads" )
+		if(task_recordid != '' && task_module[0] == "Leads" )
 		{
 			alert("You can't select related contacts from Lead ");
-			document.frmName.selectcnt.disabled="true";
+			frmName.contact_name.value = '';
+ 	                frmName.selectcnt.disabled="true"
 		}
 		else
 		{
@@ -1874,23 +1875,13 @@
 		window.open("index.php?module=SalesOrder&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=640,height=602,resizable=0,scrollbars=0");
 }
 
-/**check whether emailid is available for a specific contact or not.
-contactname->name of the contact
-mailaddress->emailaddress
-index->checkbox index
-type->whether its a yahooid or emailid*/
-
-function checkEmailid(contactname,mailaddress,index,type)
-{
-        mail = document.SendMail.elements;
-        mailid = mail[index].checked;
-        if(mailid == true)
-        {
-                if(mailaddress == '')
-                {
-                        alert("'"+contactname+"'"+" doesn't have "+type);
-                        mail[index].checked=false;
-                }
-        }
-
-}
+function checkEmailid(parent_module,emailid,yahooid)
+ {
+       var check = true;
+       if(emailid == '' && yahooid == '')
+       {
+               alert("This "+parent_module+" doesn't have any mail ids");
+               check=false;
+       }
+       return check;
+ }

Modified: vtigercrm/branches/5.0.3/modules/Contacts/CallRelatedList.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/CallRelatedList.php (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/CallRelatedList.php Sat Jan 13 05:56:11 2007
@@ -64,9 +64,11 @@
         $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email);
 $category = getparenttab();
 $smarty->assign("CATEGORY",$category);
-
 $smarty->assign("ID",$focus->id);
 $smarty->assign("NAME",$focus->name);
+$smarty->assign("EMAIL",$focus->column_fields['email']);
+$smarty->assign("YAHOO",$focus->column_fields['yahooid']);
+
 $related_array = getRelatedLists($currentModule,$focus);
 $smarty->assign("RELATEDLISTS", $related_array);
 $smarty->assign("MODULE",$currentmodule);

Modified: vtigercrm/branches/5.0.3/modules/Emails/mailSelect.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/mailSelect.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/mailSelect.php Sat Jan 13 05:56:11 2007
@@ -83,14 +83,10 @@
 				$field_value[$count++] = $adb->query_result($result,0,$columnname);
 			}	
 			$entity_name = $adb->query_result($result,0,'contactname');
-			$emailid = $adb->query_result($result,0,'email');
-			$yahooid = $adb->query_result($result,0,'yahooid');
 			break;	
 	}	
 }
 $smarty->assign('ENTITY_NAME',$entity_name);
-$smarty->assign('EMAIL_ID',$emailid);
-$smarty->assign('YAHOO_ID',$yahooid);
 $smarty->assign('ONE_RECORD',$single_record);
 $smarty->assign('MAILDATA',$field_value);
 $smarty->assign('MAILINFO',$returnvalue);

Modified: vtigercrm/branches/5.0.3/modules/Leads/CallRelatedList.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Leads/CallRelatedList.php (original)
+++ vtigercrm/branches/5.0.3/modules/Leads/CallRelatedList.php Sat Jan 13 05:56:11 2007
@@ -66,6 +66,8 @@
 
 $smarty->assign("ID",$focus->id);
 $smarty->assign("NAME",$focus->lastname.' '.$focus->firstname);
+$smarty->assign("EMAIL",$focus->column_fields['email']);
+$smarty->assign("YAHOO",$focus->column_fields['yahooid']);
 $related_array = getRelatedLists($currentModule,$focus);
 $smarty->assign("RELATEDLISTS", $related_array);
 $smarty->assign("SINGLE_MOD",$app_strings['Lead']);

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 Sat Jan 13 05:56:11 2007
@@ -118,6 +118,9 @@
 $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
 $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
 $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
+
+$smarty->assign("EMAIL",$focus->column_fields['email']);
+$smarty->assign("YAHOO",$focus->column_fields['yahooid']);
       
 $check_button = Button_Check($module);
 $smarty->assign("CHECK", $check_button);





More information about the vtigercrm-commits mailing list