[Vtigercrm-commits] [vtiger-commits] r10568 - in /vtigercrm/branches/5.0.3: include/js/general.js include/utils/EditViewUtils.php modules/Calendar/EditView.php modules/Calendar/Save.php modules/Calendar/addEventUI.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 5 10:51:30 EDT 2007


Author: richie
Date: Thu Apr  5 08:51:20 2007
New Revision: 10568

Log:
fix for activities relate to. Fixes #3596 #3597 --minnie

Modified:
    vtigercrm/branches/5.0.3/include/js/general.js
    vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php
    vtigercrm/branches/5.0.3/modules/Calendar/EditView.php
    vtigercrm/branches/5.0.3/modules/Calendar/Save.php
    vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php

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 Thu Apr  5 08:51:20 2007
@@ -1826,7 +1826,6 @@
 		if(record_id != '' && module[0] == "Leads")
 		{
 			alert(alert_arr.CANT_SELECT_CONTACTS);
-			formName.selectcnt.disabled="true";
 		}
 		else
 		{
@@ -1862,8 +1861,6 @@
 		if(task_recordid != '' && task_module[0] == "Leads" )
 		{
 			alert(alert_arr.CANT_SELECT_CONTACTS);
-			frmName.contact_name.value = '';
- 	                frmName.selectcnt.disabled="true"
 		}
 		else
 		{

Modified: vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Thu Apr  5 08:51:20 2007
@@ -650,13 +650,15 @@
 	elseif($uitype == 66)
 	{
 		if(isset($_REQUEST['parent_id']) && $_REQUEST['parent_id'] != '')
+		{
 			$value = $_REQUEST['parent_id'];
+			$parent_module = getSalesEntityType($value);
+		}	
 		// Check for vtiger_activity type if task orders to be added in select option
 		$act_mode = $_REQUEST['activity_mode'];
 
-		if($value != '')
-		{
-			$parent_module = getSalesEntityType($value);
+		if($parent_module != "Contacts")
+		{
 			if($parent_module == "Leads")
 			{
 				$sql = "select * from vtiger_leaddetails where leadid=".$value;
@@ -683,14 +685,14 @@
 				$potential_selected = "selected";
 
 			}
-			elseif($parent_module == "Quotes")
-			{
-				$sql = "select * from  vtiger_quotes where quoteid=".$value;
+			elseif($parent_module == "HelpDesk")
+			{
+				$sql = "select title from vtiger_troubletickets where ticketid=".$value;
 				$result = $adb->query($sql);
-				$parent_name = $adb->query_result($result,0,"subject");
-				$quote_selected = "selected";
-
-			}
+				$parent_name = $adb->query_result($result,0,"title");
+				$ticket_selected = "selected";
+			}
+
 			elseif($act_mode == "Task")
 			{
 				if($parent_module == "PurchaseOrder")
@@ -721,79 +723,59 @@
 					$parent_name = $adb->query_result($result,0,"campaignname");
 					$campaign_selected = "selected";
 				}
-				if($parent_module == "HelpDesk")
+				if($parent_module == "Quotes")
 				{
-					$sql = "select title from vtiger_troubletickets where ticketid=".$value;
+					$sql = "select * from  vtiger_quotes where quoteid=".$value;
 					$result = $adb->query($sql);
-					$parent_name = $adb->query_result($result,0,"title");
-					$ticket_selected = "selected";
+					$parent_name = $adb->query_result($result,0,"subject");
+					$quote_selected = "selected";
 				}
 			}
-			elseif($act_mode == "Events")
-			{
-				if($parent_module == "HelpDesk")
-				{
-					$sql = "select title from vtiger_troubletickets where ticketid=".$value;
-					$result = $adb->query($sql);
-					$parent_name = $adb->query_result($result,0,"title");
-					$ticket_selected = "selected";
-				}
-			}
-
-		}
+			$fieldvalue[] =$parent_name;
+			$fieldvalue[] = $value;
+		}
+		$editview_label[0] = array(
+			$app_strings['COMBO_LEADS'],
+			$app_strings['COMBO_ACCOUNTS'],
+			$app_strings['COMBO_POTENTIALS'],
+		);
+		$editview_label[1] = array(
+			$lead_selected,
+			$account_selected,
+			$potential_selected
+		);
+		$editview_label[2] = array(
+			"Leads&action=Popup",
+			"Accounts&action=Popup",
+			"Potentials&action=Popup"
+		);
+
 		if($act_mode == "Task")
                 {
-                        $editview_label[] = array($app_strings['COMBO_LEADS'],
-                                $app_strings['COMBO_ACCOUNTS'],
-                                $app_strings['COMBO_POTENTIALS'],
+                        array_push($editview_label[0],
                                 $app_strings['COMBO_QUOTES'],
                                 $app_strings['COMBO_PORDER'],
                                 $app_strings['COMBO_SORDER'],
                                 $app_strings['COMBO_INVOICES'],
 				$app_strings['COMBO_CAMPAIGNS'],
 				$app_strings['COMBO_HELPDESK']
-                                        );
-			$editview_label[] = array($lead_selected,
-                                $account_selected,
-                                $potential_selected,
+                        );
+			array_push($editview_label[1],
                                 $quote_selected,
                                 $purchase_selected,
                                 $sales_selected,
                                 $invoice_selected,
 				$campaign_selected,
 				$ticket_selected
-                                        );
-                        $editview_label[] = array("Leads&action=Popup","Accounts&action=Popup","Potentials&action=Popup","Quotes&action=Popup","PurchaseOrder&action=Popup","SalesOrder&action=Popup","Invoice&action=Popup","Campaigns&action=Popup","HelpDesk&action=Popup");
+                        );
+                        array_push($editview_label[2],"Quotes&action=Popup","PurchaseOrder&action=Popup","SalesOrder&action=Popup","Invoice&action=Popup","Campaigns&action=Popup","HelpDesk&action=Popup");
                 }
 		elseif($act_mode == "Events")
 		{
-			$editview_label[] = array($app_strings['COMBO_LEADS'],
-				$app_strings['COMBO_ACCOUNTS'],
-				$app_strings['COMBO_POTENTIALS'],
-				$app_strings['COMBO_HELPDESK']
-			);
-			$editview_label[] = array($lead_selected,
-				$account_selected,
-				$potential_selected,
-				$ticket_selected
-			);
-			$editview_label[] = array("Leads&action=Popup","Accounts&action=Popup","Potentials&action=Popup","HelpDesk&action=Popup");
-		}
-                else
-                {
-                        $editview_label[] = array($app_strings['COMBO_LEADS'],
-                                $app_strings['COMBO_ACCOUNTS'],
-                                $app_strings['COMBO_POTENTIALS'],
-                                );
-                        $editview_label[] = array($lead_selected,
-                                $account_selected,
-                                $potential_selected
-                                );
-                        $editview_label[] = array("Leads&action=Popup","Accounts&action=Popup","Potentials&action=Popup");
-
-                }
-		$fieldvalue[] =$parent_name;
-		$fieldvalue[] = $value;
+			array_push($editview_label[0],$app_strings['COMBO_HELPDESK']);
+			array_push($editview_label[1],$ticket_selected);
+			array_push($editview_label[2],"HelpDesk&action=Popup");
+		}
 	}
 	//added by rdhital/Raju for better email support
 	elseif($uitype == 357)

Modified: vtigercrm/branches/5.0.3/modules/Calendar/EditView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/EditView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/EditView.php Thu Apr  5 08:51:20 2007
@@ -124,6 +124,13 @@
 	    $value['recurringcheck'] = 'No';
     }
 
+}else
+{
+	if(isset($_REQUEST['contact_id']) && $_REQUEST['contact_id']!=''){
+		$smarty->assign("CONTACTSID",$_REQUEST['contact_id']);
+		$contact_name = getContactName($_REQUEST['contact_id']);
+		$smarty->assign("CONTACTSNAME",$contact_name);
+	}	
 }
 if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
 	$focus->id = "";

Modified: vtigercrm/branches/5.0.3/modules/Calendar/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/Save.php Thu Apr  5 08:51:20 2007
@@ -102,6 +102,7 @@
 	else
 	        $focus->column_fields['visibility'] = 'Private';
 	$focus->save($tab_type);
+	$heldevent_id = $focus->id;
 	/* For Followup START -- by Minnie */
 	if(isset($_REQUEST['followup']) && $_REQUEST['followup'] == 'on' && $activity_mode == 'Events' && isset($_REQUEST['followup_time_start']) &&  $_REQUEST['followup_time_start'] != '')
 	{
@@ -146,6 +147,10 @@
 	        {
 	                $sql = "insert into vtiger_cntactivityrel values (".$_REQUEST['return_id'].",".$focus->id.")";
 	                $adb->query($sql);
+			if(!empty($heldevent_id)){
+				$sql = "insert into vtiger_cntactivityrel values (".$_REQUEST['return_id'].",".$heldevent_id.")";
+				$adb->query($sql);
+			}
 	        }
 }
 									

Modified: vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php (original)
+++ vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php Thu Apr  5 08:51:20 2007
@@ -591,7 +591,7 @@
 							<td><b><?php echo $mod_strings['LBL_RELATEDTO']?></b></td>
 							<td>
 								<input name="parent_id" value="" type="hidden">
-								<select name="parent_type" class="small" id="parent_type" onChange="document.EditView.parent_name.value='';">
+								<select name="parent_type" class="small" id="parent_type" onChange="document.EditView.parent_name.value='';document.EditView.parent_id.value=''">
 									<option value="Leads"><?php echo $app_strings['Leads']?></option>
 									<option value="Accounts"><?php echo $app_strings['Accounts']?></option>
 									<option value="Potentials"><?php echo $app_strings['Potentials']?></option>
@@ -610,8 +610,8 @@
 						<td><b><?php echo $app_strings['Contacts'] ?></b></td>
 							<td colspan="2">
 								<input name="contactidlist" id="contactidlist" value="" type="hidden">
-								<textarea rows="5" name="contactlist" readonly="readonly" class="calTxt"></textarea>&nbsp;
-								<input type="button" onclick="return window.open('index.php?module=Contacts&action=Popup&return_module=Calendar&popuptype=detailview&select=enable&form=EditView&form_submit=false','test','width=640,height=602,resizable=0,scrollbars=0');" class="crmButton small edit" name="selectcnt" value="<?php echo $mod_strings['LBL_SELECT_CONTACT'] ; ?>">
+								<textarea rows="5" name="contactlist" readonly="readonly" class="calTxt" id='parentid'></textarea>&nbsp;
+								<input type="button" onclick="selectContact('true','general',document.EditView);" class="crmButton small edit" name="selectcnt" value="<?php echo $mod_strings['LBL_SELECT_CONTACT'] ; ?>">
 							</td>
 						</tr>
 					</table>
@@ -846,7 +846,7 @@
 			<td><b><?php echo $mod_strings['LBL_CONTACT_NAME'] ?></b></td>
 			<td colspan="2">
 				<input name="task_contact_name" id="contact_name" readonly type="text" class="calTxt" value=""><input name="task_contact_id" id="contact_id" type="hidden" value="">&nbsp;
-				<input type="button" onclick="return window.open('index.php?module=Contacts&action=Popup&html=Popup_picker&popuptype=specific&form=EditView','test','width=640,height=602,resizable=0,scrollbars=0');" class="crmButton small edit" name="selectcnt" value="<?php echo $mod_strings['LBL_SELECT_CONTACT'] ; ?>">
+				<input type="button" onclick="selectContact('false','task',document.createTodo);" class="crmButton small edit" name="selectcnt" value="<?php echo $mod_strings['LBL_SELECT_CONTACT'] ; ?>">
 			</td>
 			  </tr>
 			<?php } ?>





More information about the vtigercrm-commits mailing list