[Vtigercrm-commits] [vtiger-commits] r6630 - in /vtigercrm/trunk: Smarty/templates/EmailContents.tpl Smarty/templates/Emails.tpl include/utils/ListViewUtils.php modules/Emails/Email.js modules/Emails/ListView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sun May 28 13:52:57 EDT 2006


Author: don
Date: Sun May 28 11:52:50 2006
New Revision: 6630

Log:
issues in Emails has been fixed

Modified:
    vtigercrm/trunk/Smarty/templates/EmailContents.tpl
    vtigercrm/trunk/Smarty/templates/Emails.tpl
    vtigercrm/trunk/include/utils/ListViewUtils.php
    vtigercrm/trunk/modules/Emails/Email.js
    vtigercrm/trunk/modules/Emails/ListView.php

Modified: vtigercrm/trunk/Smarty/templates/EmailContents.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/EmailContents.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/EmailContents.tpl Sun May 28 11:52:50 2006
@@ -18,15 +18,21 @@
             <th width="15%">{$LISTHEADER.2}</th>
         </tr>
 		{foreach key=id item=row from=$LISTENTITY}
-	    <tr onmouseover="this.className='prvPrfHoverOn'" onmouseout="this.className='prvPrfHoverOff'">
+	    <tr id="row_{$id}">
 			<td>
 			<span><input type="checkbox" name="selected_id" value= '{$id}' onClick=toggleSelectAll(this.name,"selectall")>
 </span></td>
-			<td><b>{$row.0}</b></td>
-			<td><b>{$row.1}</b></td>
-			<td><b>{$row.2}</b></td>
+			<td onClick="getEmailContents('{$id}'),setSubject('{$row.0}');"><b>{$row.0}</b></td>
+			<td onClick="getEmailContents('{$id}'),setSubject('{$row.0}');"><b>{$row.1}</b></td>
+			<td onClick="getEmailContents('{$id}'),setSubject('{$row.0}');"><b>{$row.2}</b></td>
         </tr>
 		{/foreach}
     </table>
 </div>
-
+<SCRIPT>
+	if(gselectedrowid != 0)
+	{ldelim}
+		var rowid = 'row_'+gselectedrowid;
+	    getObj(rowid).className = 'prvPrfHoverOn';
+	{rdelim}
+</SCRIPT>

Modified: vtigercrm/trunk/Smarty/templates/Emails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Emails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Emails.tpl Sun May 28 11:52:50 2006
@@ -15,6 +15,7 @@
 {ldelim}
 	hide("status");
 	document.getElementById("email_con").innerHTML=response.responseText;
+	execJS(document.getElementById('email_con'));
 {rdelim}
 function ajaxgetResponse(response)
 {ldelim}
@@ -28,6 +29,14 @@
 function getEmailContents(id)
 {ldelim}
 	show("status");
+	var rowid = 'row_'+id;
+	getObj(rowid).className = 'prvPrfHoverOn';
+	if(gselectedrowid != 0 && gselectedrowid != id)
+	{ldelim}
+		var prev_selected_rowid = 'row_'+gselectedrowid;
+		getObj(prev_selected_rowid).className = 'prvPrfHoverOff';
+	{rdelim}
+	gselectedrowid = id;
 	var ajaxObj = new Ajax(ajaxgetResponse);
 	var urlstring ="module=Emails&action=EmailsAjax&file=DetailView&mode=ajax&record="+id;
 	ajaxObj.process("index.php?",urlstring);
@@ -40,12 +49,22 @@
 	document.getElementById('EmailDetails').innerHTML = '<table valign="top" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="forwardBg"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td colspan="2">&nbsp;</td></tr></tbody></table></td></tr><tr><td style="padding-top: 10px;" bgcolor="#ffffff" height="300" valign="top"></td></tr></tbody></table>';
 	document.getElementById("subjectsetter").innerHTML='';
 	document.getElementById("email_con").innerHTML=response.responseText;
+	execJS(document.getElementById('email_con'));
 }
 
 {/literal}
 function ShowFolders(folderid)
 {ldelim}
-    var ajaxObj = new Ajax(ajaxDelResponse);
+	show("status");
+	if(gFolderid != folderid)
+	{ldelim}	
+    	var ajaxObj = new Ajax(ajaxSaveResponse);
+		gselectedrowid = 0;
+	{rdelim}
+	else
+	{ldelim}
+		var ajaxObj = new Ajax(ajaxDelResponse);
+	{rdelim}
 	gFolderid = folderid;
 	getObj('search_text').value = '';
 	switch(folderid)
@@ -70,6 +89,14 @@
 	{rdelim}
     var urlstring ="module=Emails&ajax=true&action=EmailsAjax&file=ListView&folderid="+folderid;
    	ajaxObj.process("index.php?",urlstring);
+{rdelim}
+function getListViewEntries_js(module,url)
+{ldelim}
+		show("status");
+        var ajaxObj = new Ajax(ajaxSaveResponse);
+        var urlstring ="module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url;
+        ajaxObj.process("index.php?",urlstring);
+
 {rdelim}
 </script>
 <script language="JavaScript" type="text/javascript" src="modules/Emails/Email.js"></script>
@@ -200,27 +227,10 @@
 					<td bgcolor="#ECECEC" height="8" style="font-size:1px;" ></td>
 					<td width="8" height="8" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}bottom_right.jpg" align="bottom" /></td>
 				</tr>
-			</table><br />
+			</table><br/>
 		</td>
 		<td>&nbsp;</td>
 	</tr>
 </table>
 <!-- END -->
-<script>
-function OpenCompose(id,mode) 
-{ldelim}
-	switch(mode)
-		{ldelim}
-		case 'edit':
-			url = 'index.php?module=Emails&action=EmailsAjax&file=EditView&record='+id;
-			break;
-		case 'create':
-			url = 'index.php?module=Emails&action=EmailsAjax&file=EditView';
-			break;
-		case 'forward':
-			url = 'index.php?module=Emails&action=EmailsAjax&file=EditView&record='+id+'&forward=true';
-			break;
-		{rdelim}
-	openPopUp('xComposeEmail',this,url,'createemailWin',820,652,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
-{rdelim}
-</script>
+

Modified: vtigercrm/trunk/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/ListViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/ListViewUtils.php Sun May 28 11:52:50 2006
@@ -177,7 +177,7 @@
 							if($relatedlist !='')
 								$name = "<a href='index.php?module=".$relatedmodule."&action=CallRelatedList&relmodule=".$module."&order_by=".$col."&record=".$relatedlist."&sorder=".$temp_sorder."' class='listFormHeaderLinks'>".$lbl_name."&nbsp;".$arrow."</a>";
 							else
-								$name = "<a href='javascript:;' onClick='getListViewEntries_js(\"".$module."\",\"order_by=".$col."&sorder=".$temp_sorder."\");' class='listFormHeaderLinks'>".$lbl_name."&nbsp;".$arrow."</a>";
+								$name = "<a href='javascript:;' onClick='getListViewEntries_js(\"".$module."\",\"order_by=".$col."&sorder=".$temp_sorder."".$sort_qry."\");' class='listFormHeaderLinks'>".$lbl_name."&nbsp;".$arrow."</a>";
 							$arrow = '';
 						//}
 					}
@@ -1438,7 +1438,7 @@
 				}
 				elseif($module == 'Emails')
 				{
-					$value = '<a href="javascript:;"onClick="getEmailContents(\''.$entity_id.'\'),setSubject(\''.$temp_val.'\')">'.$temp_val.'</a>';
+					$value = $temp_val;
 				}
                 else
                 {

Modified: vtigercrm/trunk/modules/Emails/Email.js
==============================================================================
--- vtigercrm/trunk/modules/Emails/Email.js (original)
+++ vtigercrm/trunk/modules/Emails/Email.js Sun May 28 11:52:50 2006
@@ -9,8 +9,10 @@
  ********************************************************************************/
 
 var gFolderid = 1;
+var gselectedrowid = 0;
 function massDelete()
 {
+		var delete_selected_row = false;
         x = document.massdelete.selected_id.length;
         idstring = "";
         if ( x == undefined)
@@ -18,6 +20,11 @@
 
                 if (document.massdelete.selected_id.checked)
                 {
+					if(document.massdelete.selected_id.value == gselectedrowid)
+					{
+						gselectedrowid = 0;
+						delete_selected_row = true;						
+					}
                         idstring = document.massdelete.selected_id.value;
 						xx = 1;
                 }
@@ -33,10 +40,15 @@
                 for(i = 0; i < x ; i++)
                 {
                         if(document.massdelete.selected_id[i].checked)
-                        {
-                                idstring = document.massdelete.selected_id[i].value +";"+idstring
-                        xx++
-                        }
+						{
+							if(document.massdelete.selected_id[i].value == gselectedrowid)
+							{
+								gselectedrowid = 0;
+								delete_selected_row = true;						
+							}
+							idstring = document.massdelete.selected_id[i].value +";"+idstring
+							xx++
+						}
                 }
                 if (xx != 0)
                 {
@@ -52,7 +64,10 @@
 		{	
 			getObj('search_text').value = '';
 			show("status");
-			var ajaxObj = new Ajax(ajaxSaveResponse);
+			if(!delete_selected_row)
+				var ajaxObj = new Ajax(ajaxSaveResponse);
+			else	
+				var ajaxObj = new Ajax(ajaxDelResponse);
 			var urlstring ="module=Users&action=massdelete&folderid="+gFolderid+"&return_module=Emails&idlist="+idstring;
 		    ajaxObj.process("index.php?",urlstring);
 		}
@@ -66,6 +81,7 @@
 	if(confirm("Are you sure you want to delete ?"))
 	{	
 		getObj('search_text').value = '';
+		gselectedrowid = 0;
 		show("status");
 		var ajaxObj = new Ajax(ajaxDelResponse);
 		var urlstring ="module=Users&action=massdelete&return_module=Emails&folderid="+gFolderid+"&idlist="+id;
@@ -78,10 +94,29 @@
 }
 function Searchfn()
 {
+	gselectedrowid = 0;
 	var osearch_field = document.getElementById('search_field');
 	var search_field = osearch_field.options[osearch_field.options.selectedIndex].value;
 	var search_text = document.getElementById('search_text').value;
-	var ajaxObj = new Ajax(ajaxSaveResponse);
+	var ajaxObj = new Ajax(ajaxDelResponse);
 	var urlstring ="module=Emails&action=EmailsAjax&ajax=true&file=ListView&folderid="+gFolderid+"&search=true&search_field="+search_field+"&search_text="+search_text;
     ajaxObj.process("index.php?",urlstring);
 }
+
+function OpenCompose(id,mode) 
+{
+	switch(mode)
+	{		
+		case 'edit':
+			url = 'index.php?module=Emails&action=EmailsAjax&file=EditView&record='+id;
+			break;
+		case 'create':
+			url = 'index.php?module=Emails&action=EmailsAjax&file=EditView';
+			break;
+		case 'forward':
+			url = 'index.php?module=Emails&action=EmailsAjax&file=EditView&record='+id+'&forward=true';
+			break;
+	}
+	openPopUp('xComposeEmail',this,url,'createemailWin',820,652,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
+}
+

Modified: vtigercrm/trunk/modules/Emails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/ListView.php (original)
+++ vtigercrm/trunk/modules/Emails/ListView.php Sun May 28 11:52:50 2006
@@ -28,51 +28,6 @@
 require_once('include/utils/utils.php');
 require_once('modules/CustomView/CustomView.php');
 global $current_user;
-//$submenu = array('LBL_EMAILS_TITLE'=>'index.php?module=Emails&action=ListView.php','LBL_WEBMAILS_TITLE'=>'index.php?module=Webmails&action=index&parenttab=My Home Page');
-
-//$sec_arr = array('index.php?module=Emails&action=ListView.php'=>'Emails','index.php?module=Webmails&action=index&parenttab=parenttab=My Home Page'=>'Emails');
-
-/*if($_REQUEST['ajax'] == '')
-{
-
-	if(isset($_REQUEST['smodule']) && $_REQUEST['smodule'] != '')
-	{
-		$classname = "tabOff";
-	}
-	else
-	{
-		$classname = "tabOn";
-	}
-	$listView = "ListView.php";
-	foreach($submenu as $label=>$filename)
-	{
-		$cur_mod = $sec_arr[$filename];
-		$cur_tabid = getTabid($cur_mod);
-
-		if($tab_per_Data[$cur_tabid] == 0)
-		{
-			list($lbl,$sname,$title)=split("_",$label);
-			if(stristr($label,"EMAILS"))
-			{
-				//echo '<td class="tabOn" nowrap><a href="index.php?module=Emails&action=ListView" class="tabLink">'.$mod_strings[$label].'</a>&nbsp;&nbsp;&nbsp;</td>';
-				$listView = $filename;
-				$classname = "tabOff";
-			}
-			elseif(stristr($label,$_REQUEST['smodule']))
-			{
-				//echo '<td class="tabOn" nowrap><a href="index.php?module=Webmails&action=index&smodule='.$_REQUEST['smodule'].'&parenttab=My Home Page" class="tabLink">'.$mod_strings[$label].'</a></td>';	
-				$listView = $filename;
-				$classname = "tabOff";
-			}
-			else
-			{
-				//echo '<td class="'.$classname.'" nowrap><a href="index.php?module=Webmails&action=index&smodule='.$sname.'&parenttab=My Home Page" class="tabLink">'.$mod_strings[$label].'</a></td>';	
-			}
-			$classname = "tabOff";
-		}
-
-	}
-}*/
 global $app_strings;
 global $mod_strings;
 
@@ -136,6 +91,7 @@
 //to get the search field if exists
 if(isset($_REQUEST['search']) && $_REQUEST['search'] != '' && $_REQUEST['search_text'] != '')
 {
+	$url_string .= "&search=".$_REQUEST['search']."&search_field=".$_REQUEST['search_field']."&search_text=".$_REQUEST['search_text'];
 	if($_REQUEST['search_field'] != 'join')
 		$where = $_REQUEST['search_field']." like '%".$_REQUEST['search_text']."%'";	
 	else
@@ -204,47 +160,22 @@
 //Retreiving the no of rows
 $noofrows = $adb->num_rows($list_result);
 
-//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
-	$start = $_REQUEST['start'];
-
-	//added to remain the navigation when sort
-	$url_string = "&start=".$_REQUEST['start'];
-}
-else
-{
-	$start = 1;
-}
 //Retreive the Navigation array
-$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-//modified by rdhital
-$start_rec = $navigation_array['start'];
-$end_rec = $navigation_array['end_val']; 
-//By Raju Ends
-
-$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
+$_REQUEST['allflag'] = 'All';
+$navigation_array = getNavigationValues(1, $noofrows, $list_max_entries_per_page);
 
 //Retreive the List View Table Header
 if($viewid !='')
 	$url_string .="&viewname=".$viewid;
-
+if(isset($_REQUEST['folderid']) && $_REQUEST['folderid'] != '')
+	$url_string .= "&folderid=".$_REQUEST['folderid'];
 $listview_header = getListViewHeader($focus,"Emails",$url_string,$sorder,$order_by,"",$oCustomView);
 $smarty->assign("LISTHEADER", $listview_header);
 
-$listview_header = getSearchListHeaderValues($focus,"Emails",$url_string,$sorder,$order_by,"",$oCustomView);
-$smarty->assign("SEARCHLISTHEADER",$listview_header_search);
 $listview_entries = getListViewEntries($focus,"Emails",$list_result,$navigation_array,"","","EditView","Delete",$oCustomView);
 $smarty->assign("LISTENTITY", $listview_entries);                                                  
 $smarty->assign("SELECT_SCRIPT", $view_script);
 
-$navigationOutput = getTableHeaderNavigation($navigation_array,$url_string,"Emails","index",$viewid);
-$alphabetical = AlphabeticalSearch($currentModule,'index','subject','true','basic',"","","","",$viewid);
-$smarty->assign("ALPHABETICAL", $alphabetical);
-$smarty->assign("NAVIGATION", $navigationOutput);
-$smarty->assign("RECORD_COUNTS", $record_string);
 $smarty->assign("USERID", $current_user->id);
 
 $check_button = Button_Check($module);
@@ -253,5 +184,4 @@
 	$smarty->display("EmailContents.tpl");
 else
 	$smarty->display("Emails.tpl");
-
 ?>





More information about the vtigercrm-commits mailing list