[Vtigercrm-commits] [vtiger-commits] r7506 - in /vtigercrm/trunk: Smarty/templates/DetailViewUI.tpl include/js/dtlviewajax.js include/utils/DetailViewUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Jun 26 01:49:43 EDT 2006


Author: richie
Date: Sun Jun 25 23:49:37 2006
New Revision: 7506

Log:
issue in ajax edit for assigned user

Modified:
    vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl
    vtigercrm/trunk/include/js/dtlviewajax.js
    vtigercrm/trunk/include/utils/DetailViewUtils.php

Modified: vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl Sun Jun 25 23:49:37 2006
@@ -190,7 +190,9 @@
                    	<input type="hidden" id="hdtxt_{$label}" value="{$keyval}"></input>
 					{if $keyoptions.0 eq 'User'}
 						<input name="assigntype" id="assigntype" checked="checked" value="U" onclick="toggleAssignType(this.value),setSelectValue('{$label}');" type="radio">&nbsp;User
-						<input name="assigntype" id="assigntype" value="T" onclick="toggleAssignType(this.value),setSelectValue('{$label}');" type="radio">&nbsp;Group
+						{if $keyoptions.2 neq ''}
+							<input name="assigntype" id="assigntype" value="T" onclick="toggleAssignType(this.value),setSelectValue('{$label}');" type="radio">&nbsp;Group
+						{/if}
 						<span id="assign_user" style="display: block;">
 					{else}
 						<input name="assigntype" id="assigntype" value="U" onclick="toggleAssignType(this.value),setSelectValue('{$label}');" type="radio">&nbsp;User

Modified: vtigercrm/trunk/include/js/dtlviewajax.js
==============================================================================
--- vtigercrm/trunk/include/js/dtlviewajax.js (original)
+++ vtigercrm/trunk/include/js/dtlviewajax.js Sun Jun 25 23:49:37 2006
@@ -54,12 +54,18 @@
 	  globalfieldlabel = fieldLabel;
 	  if(globaluitype == 53)
 	  {
-		  var assign_type_U = document.DetailView.assigntype[0].checked;
-		  var assign_type_G = document.DetailView.assigntype[1].checked;
-		  if(assign_type_U == true)
+		  if(typeof(document.DetailView.assigntype[0]) != 'undefined')
+		  {
+			  var assign_type_U = document.DetailView.assigntype[0].checked;
+			  var assign_type_G = document.DetailView.assigntype[1].checked;
+			  if(assign_type_U == true)
+				  globaltxtboxid= 'txtbox_U'+fieldLabel;
+			  else if(assign_type_G == true)
+				  globaltxtboxid= 'txtbox_G'+fieldLabel;
+		  }else
+		  {
 			  globaltxtboxid= 'txtbox_U'+fieldLabel;
-		  else if(assign_type_G == true)
-			  globaltxtboxid= 'txtbox_G'+fieldLabel;
+		  }
 	  }else
 	  {
       	  globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid;
@@ -108,8 +114,14 @@
 	var groupurl = "";
 	if(globaluitype == 53)
 	{
-		var assign_type_U = document.DetailView.assigntype[0].checked;
-		var assign_type_G = document.DetailView.assigntype[1].checked;
+		if(typeof(document.DetailView.assigntype[0]) != 'undefined')
+		{
+			var assign_type_U = document.DetailView.assigntype[0].checked;
+			var assign_type_G = document.DetailView.assigntype[1].checked;
+		}else
+		{
+			var assign_type_U = document.DetailView.assigntype.checked;
+		}
 		if(assign_type_U == true)
 		{
 			var txtBox= 'txtbox_U'+fieldLabel;
@@ -192,8 +204,14 @@
 	else if(uitype == '53')
 	{
 		var hdObj = getObj(hdTxt);
-		var assign_type_U = document.DetailView.assigntype[0].checked;
-		var assign_type_G = document.DetailView.assigntype[1].checked;
+		if(typeof(document.DetailView.assigntype[0]) != 'undefined')
+        {
+			var assign_type_U = document.DetailView.assigntype[0].checked;
+			var assign_type_G = document.DetailView.assigntype[1].checked;
+		}else
+		{
+			var assign_type_U = document.DetailView.assigntype.checked;
+		}
 		if(isAdmin == "0")
 		{
 			getObj(dtlView).innerHTML = hdObj.value;
@@ -307,12 +325,18 @@
 {
 	if(globaluitype == 53)
 	{
-		var assign_type_U = document.DetailView.assigntype[0].checked;
-        var assign_type_G = document.DetailView.assigntype[1].checked;
-		if(assign_type_U == true)
+		if(typeof(document.DetailView.assigntype[0]) != 'undefined')
+		{
+			var assign_type_U = document.DetailView.assigntype[0].checked;
+			var assign_type_G = document.DetailView.assigntype[1].checked;
+			if(assign_type_U == true)
+				var selCombo= 'txtbox_U'+fieldLabel;
+			else if(assign_type_G == true)	
+				var selCombo= 'txtbox_G'+fieldLabel;
+		}else
+		{
 			var selCombo= 'txtbox_U'+fieldLabel;
-		else if(assign_type_G == true)	
-			var selCombo= 'txtbox_G'+fieldLabel;
+		}
 	}else
 	{
 			var selCombo= 'txtbox_'+fieldLabel;

Modified: vtigercrm/trunk/include/utils/DetailViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/DetailViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/DetailViewUtils.php Sun Jun 25 23:49:37 2006
@@ -243,21 +243,21 @@
 		{
 			$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
 		}
-			do
-			{
+			do{
 				$groupname=$nameArray["groupname"];
+				$group_id=$nameArray["groupid"];
 				$selected = '';	
 				if($groupname == $selected_groupname[0])
 				{
 					$selected = "selected";
 				}	
-				$group_option[] = array($groupname=>$selected);
-
+				if($groupname != '')
+					$group_option[$group_id] = array($groupname=>$selected);
 			}while($nameArray = $adb->fetch_array($result));
-
-
+			
 			$label_fld ["options"][] = $users_combo;
-			$label_fld ["options"][] = $group_option; 
+			if(count($group_option) >0)
+				$label_fld ["options"][] = $group_option; 
 	}
 	elseif($uitype == 55)
         {





More information about the vtigercrm-commits mailing list