[Vtigercrm-commits] [vtiger-commits] r6159 - in /vtigercrm/trunk: Smarty/templates/ include/js/ modules/Emails/language/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu May 18 12:39:23 EDT 2006


Author: don
Date: Thu May 18 10:38:57 2006
New Revision: 6159

Log:
send mail feature has been added

Modified:
    vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl
    vtigercrm/trunk/Smarty/templates/DetailView.tpl
    vtigercrm/trunk/Smarty/templates/ListView.tpl
    vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl
    vtigercrm/trunk/Smarty/templates/RelatedLists.tpl
    vtigercrm/trunk/include/js/Mail.js
    vtigercrm/trunk/modules/Emails/language/en_us.lang.php

Modified: vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl Thu May 18 10:38:57 2006
@@ -32,11 +32,6 @@
 <input type="hidden" name="record" value="{$ID}">
 <input type="hidden" name="mode" value="{$MODE}">
 <input type="hidden" name="action">
-<input type="hidden" name="parenttab" value="{$CATEGORY}">
-<input type="hidden" name="return_module" value="{$RETURN_MODULE}">
-<input type="hidden" name="return_id" value="{$RETURN_ID}">
-<input type="hidden" name="return_action" value="{$RETURN_ACTION}">
-<input type="hidden" name="return_viewname" value="{$RETURN_VIEWNAME}">
 <input type="hidden" name="popupaction" value="create">
 <input type="hidden" name="hidden_toid">
 <table class="small" border="0" cellpadding="0" cellspacing="0" width="100%">
@@ -92,7 +87,8 @@
 	{elseif $elements.2.0 eq 'subject'}
    <tr>
 	<td class="lvtCol" style="padding: 5px;" align="right" nowrap><font color="red">*</font>{$elements.1.0}  :</td>
-	<td colspan="2" class="dvtCellLabel" style="padding: 5px;"><input type="text" class="txtBox" name="{$elements.2.0}" value="{$elements.3.0}" id="{$elements.2.0}"></td>
+	<td class="dvtCellLabel" style="padding: 5px;"><input type="text" class="txtBox" name="{$elements.2.0}" value="{$elements.3.0}" id="{$elements.2.0}" style="width:99%"></td>
+	<td class="dvtCellLabel">&nbsp;</td>
    </tr>
 	{elseif $elements.2.0 eq 'filename'}
 

Modified: vtigercrm/trunk/Smarty/templates/DetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/DetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/DetailView.tpl Thu May 18 10:38:57 2006
@@ -15,7 +15,9 @@
 
 
 <script language="JavaScript" type="text/javascript" src="include/js/dtlviewajax.js"></script>
-
+{if $MODULE eq 'Leads' or $MODULE eq 'Contacts' or $MODULE eq 'Accounts'}
+<div id="sendmail_cont" style="z-index:100001;position:absolute;"></div>
+{/if}
 
 <div id="convertleaddiv" style="display:block;position:absolute;left:225px;top:150px;"></div>
 <script>
@@ -121,7 +123,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="small" onclick="this.form.return_module.value='{$MODULE}'; this.form.module.value='Emails';this.form.email_directing_module.value='{$REDIR_MOD}';this.form.return_action.value='DetailView';this.form.action.value='EditView';" type="submit" name="SendMail" value="{$APP.LBL_SENDMAIL_BUTTON_LABEL}">&nbsp;
+                                                                <input title="{$APP.LBL_SENDMAIL_BUTTON_TITLE}" accessKey="{$APP.LBL_SENDMAIL_BUTTON_KEY}" class="small" onclick="fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$ID});" 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'}
@@ -417,6 +419,7 @@
 	<td align=right valign=top><img src="themes/blue/images/showPanelTopRight.gif"></td>
 </tr>
 </table>
+
 {if $MODULE eq 'Products'}
 <script language="JavaScript" type="text/javascript" src="modules/Products/Productsslide.js"></script>
 <script language="JavaScript" type="text/javascript">Carousel();</script>

Modified: vtigercrm/trunk/Smarty/templates/ListView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListView.tpl Thu May 18 10:38:57 2006
@@ -224,7 +224,7 @@
                                         {if $button_check eq 'del'}
                                              <input class="small" type="button" value="{$button_label}" onclick="return massDelete('{$MODULE}')"/>
                                         {elseif $button_check eq 's_mail'}
-                                             <input class="small" type="submit" value="{$button_label}" onclick="return eMail('{$MODULE}')"/>
+                                             <input class="small" type="button" value="{$button_label}" onclick="return eMail('{$MODULE}',this);"/>
                                         {elseif $button_check eq 's_cmail'}
                                              <input class="small" type="submit" value="{$button_label}" onclick="return massMail('{$MODULE}')"/>
                                         {elseif $button_check eq 'c_status'}
@@ -289,7 +289,7 @@
                                         {if $button_check eq 'del'}
                                             <input class="small" type="button" value="{$button_label}" onclick="return massDelete('{$MODULE}')"/>
                                         {elseif $button_check eq 's_mail'}
-                                             <input class="small" type="submit" value="{$button_label}" onclick="return eMail('{$MODULE}')"/>
+                                             <input class="small" type="button" value="{$button_label}" onclick="return eMail('{$MODULE}',this)"/>
                                         {elseif $button_check eq 's_cmail'}
                                              <input class="small" type="submit" value="{$button_label}" onclick="return massMail('{$MODULE}')"/>
                                         {elseif $button_check eq 'c_status'}
@@ -389,8 +389,13 @@
 </table>
 </div>
 {/if}
+{if $MODULE eq 'Leads' or $MODULE eq 'Contacts' or $MODULE eq 'Accounts'}
+<div id="sendmail_cont" style="z-index:100001;position:absolute;"></div>
+
+{/if}
 <script>
 {literal}
+
 function ajaxChangeStatus(statusname)
 {
 	show("status");

Modified: vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl Thu May 18 10:38:57 2006
@@ -25,7 +25,7 @@
                                         {if $button_check eq 'del'}
                                              <input class="small" type="button" value="{$button_label}" onclick="return massDelete('{$MODULE}')"/>
                                         {elseif $button_check eq 's_mail'}
-                                             <input class="small" type="submit" value="{$button_label}" onclick="return eMail()"/>
+                                             <input class="small" type="button" value="{$button_label}" onclick="return eMail('{$MODULE}',this)"/>
                                         {elseif $button_check eq 's_cmail'}
                                              <input class="small" type="button" value="{$button_label}" onclick="return massMail()"/>
                                         {elseif $button_check eq 'c_status'}
@@ -96,8 +96,8 @@
                                  {foreach key=button_check item=button_label from=$BUTTONS}
                                         {if $button_check eq 'del'}
                                              <input class="small" type="button" value="{$button_label}" onclick="return massDelete('{$MODULE}')"/>
-                       `                 {elseif $button_check eq 's_mail'}
-                                             <input class="small" type="submit" value="{$button_label}" onclick="return eMail()"/>
+                                        {elseif $button_check eq 's_mail'}
+                                             <input class="small" type="button" value="{$button_label}" onclick="return eMail('{$MODULE}',this)"/>
                                         {elseif $button_check eq 's_cmail'}
                                              <input class="small" type="submit" value="{$button_label}" onclick="return massMail()"/>
                                         {elseif $button_check eq 'c_status'}

Modified: vtigercrm/trunk/Smarty/templates/RelatedLists.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/RelatedLists.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/RelatedLists.tpl Thu May 18 10:38:57 2006
@@ -12,6 +12,7 @@
 
 -->*}
 <script language="JavaScript" type="text/javascript" src="modules/PriceBooks/PriceBook.js"></script>
+<script type="text/javascript" src="modules/{$MODULE}/{$SINGLE_MOD}.js"></script>
 
 	{include file='Buttons_List1.tpl'}
 
@@ -134,7 +135,7 @@
 							{elseif $header eq 'Emails'}
 							<input type="hidden" name="email_directing_module">
 							<input type="hidden" name="record">
-							<input title="New Email" accessyKey="F" class="small" onclick="this.form.action.value='EditView'; this.form.module.value='Emails'; this.form.email_directing_module.value='{$REDIR_MOD}'; this.form.record.value='{$id}'; this.form.return_action.value='CallRelatedList'" type="submit" name="button" value="Add new Email"></td>
+							<input title="New Email" accessyKey="F" class="small" onclick="fnvshobj(this,'sendmail_cont');sendmail('{$MODULE}',{$id});" type="button" name="button" value="Add new Email"></td>
 							{elseif $header eq 'Users'}
                                                                 {if $MODULE eq 'Activities'}
                                                                 <input title="Change" accessKey="" tabindex="2" type="button" class="small" value="Select User" name="button" LANGUAGE=javascript onclick='return window.open("index.php?module=Users&return_module=Activities&return_action=CallRelatedList&activity_mode=Events&action=Popup&popuptype=detailview&form=EditView&form_submit=true&return_id={$id}&recordid={$ID}","test","width=600,height=400,resizable=1,scrollbars=1")';>
@@ -208,4 +209,7 @@
 </table>
 
 </td></tr></table>
-
+{if $MODULE eq 'Leads' or $MODULE eq 'Contacts' or $MODULE eq 'Accounts'}
+<div id="sendmail_cont" style="z-index:100001;position:absolute;"></div>
+{/if}
+

Modified: vtigercrm/trunk/include/js/Mail.js
==============================================================================
--- vtigercrm/trunk/include/js/Mail.js (original)
+++ vtigercrm/trunk/include/js/Mail.js Thu May 18 10:38:57 2006
@@ -9,11 +9,10 @@
  ********************************************************************************/
 //added by raju for emails
 
-function eMail(module)
+function eMail(module,oButton)
 {
     x = document.massdelete.selected_id.length;
 	var viewid = document.massdelete.viewname.value;
-	idstring = "";
 
         if ( x == undefined)
         {
@@ -30,18 +29,19 @@
         }
         else
         {
+				var idstring= new Array();
                 xx = 0;
                 for(i = 0; i < x ; i++)
                 {
                         if(document.massdelete.selected_id[i].checked)
                         {
-                                idstring = document.massdelete.selected_id[i].value +";"+idstring
+                                idstring[xx]= document.massdelete.selected_id[i].value;
                                 xx++
                         }
                 }
                 if (xx != 0)
                 {
-                        document.massdelete.idlist.value=idstring;
+                        document.massdelete.idlist.value=idstring.join(':');
                 }
                 else
                 {
@@ -49,7 +49,9 @@
                         return false;
                 }
         }
-        document.massdelete.action="index.php?module=Emails&action=SelectEmails&return_module="+module+"&return_action=index";
+	allids = document.massdelete.idlist.value;	
+	fnvshobj(oButton,'sendmail_cont');
+	sendmail(module,allids);
 }
 
 
@@ -113,3 +115,44 @@
 }	
 //added by raju for emails
 
+function validate_sendmail(idlist,module)
+{
+	var j=0;
+	var chk_emails = document.SendMail.elements.length;
+	var oFsendmail = document.SendMail.elements
+	email_type = new Array();
+	for(var i=0 ;i < chk_emails ;i++)
+	{
+		if(oFsendmail[i].type != 'button')
+		{
+			if(oFsendmail[i].checked != false)
+			{
+				email_type [j++]= oFsendmail[i].value;
+			}
+		}
+	}
+	if(email_type != '')
+	{
+		var field_lists = email_type.join(':');
+		var url= 'index.php?module=Emails&action=EmailsAjax&pmodule='+module+'&file=EditView&sendmail=true&idlist='+idlist+'&field_lists='+field_lists;
+		openPopUp('xComposeEmail',this,url,'createemailWin',797,652,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
+		fninvsh('roleLay');
+		return true;
+	}
+	else
+	{
+		alert('Please Select a mailid');
+	}
+}
+function sendmail(module,idstrings)
+{
+	var ajaxObj = new Ajax(ajaxSendmailResponse);
+	var urlstring ="module=Emails&return_module="+module+"&action=EmailsAjax&file=mailSelect&idlist="+idstrings;
+	alert(urlstring)
+	ajaxObj.process("index.php?",urlstring);
+}
+function ajaxSendmailResponse(response)
+{
+	getObj('sendmail_cont').innerHTML=response.responseText;
+}
+	

Modified: vtigercrm/trunk/modules/Emails/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/language/en_us.lang.php (original)
+++ vtigercrm/trunk/modules/Emails/language/en_us.lang.php Thu May 18 10:38:57 2006
@@ -140,6 +140,7 @@
 'LBL_IN_SUBJECT'=>'in Subject',
 'LBL_IN_SENDER'=>'in Sender',
 'LBL_IN_SUBJECT_OR_SENDER'=>'in Subject or Sender',
+'CHOSE_EMAIL'=>'Choose Email ID',
 );
 
 ?>





More information about the vtigercrm-commits mailing list