[Vtigercrm-commits] [vtiger-commits] r3950 - /vtigercrm/trunk/include/js/dtlviewajax.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Feb 27 03:01:49 EST 2006


Author: saraj
Date: Mon Feb 27 01:01:44 2006
New Revision: 3950

Log:
* handled response while saving popup values

Modified:
    vtigercrm/trunk/include/js/dtlviewajax.js

Modified: vtigercrm/trunk/include/js/dtlviewajax.js
==============================================================================
--- vtigercrm/trunk/include/js/dtlviewajax.js (original)
+++ vtigercrm/trunk/include/js/dtlviewajax.js Mon Feb 27 01:01:44 2006
@@ -1,130 +1,168 @@
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
-*
- ********************************************************************************/
-var globaldtlviewspanid = "";
-var globaleditareaspanid = ""; 
-var globaltxtboxid = "";
-var itsonview=false;
-
-function showHide(showId, hideId)
-{
-	show(showId);
-	hide(hideId);
-}
-
-function hndCancel(valuespanid,textareapanid,fieldlabel)
-{
-
-  showHide(valuespanid,textareapanid);
-  //fieldLabelObj = getObj(fieldlabel);
-  //fieldLabelObj.className="label";
-  itsonview=false;
-  return false;
-}
-
-function hndMouseOver(uitype,fieldLabel)
-{
-      var mouseArea="";
-      mouseArea="mouseArea_"+ fieldLabel;
-      
-      if(itsonview)
-      {
-            return;
-      }
-      
-      show("crmspanid");
-      //globalfieldlabel=fieldLabel;
-      globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid;
-      //globalsubvaluespanid="subvalue_"+ fieldLabel;//subvaluespanid;
-      globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid;
-      //globaluitype=uitype;
-      globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid;
-      //globalismandatory=ismandatory;
-      divObj = getObj('crmspanid'); 
-      crmy = findPosY(getObj(mouseArea));
-      crmx = findPosX(getObj(mouseArea));
-      if(document.all)
-      {
-          divObj.onclick=handleEdit;
-      }
-      else
-      {
-          divObj.setAttribute('onclick','handleEdit();');
-      }
-      divObj.style.left=(crmx+getObj(mouseArea).offsetWidth -divObj.offsetWidth)+"px";
-      divObj.style.top=crmy+"px";
-}
-
-function handleEdit()
-{
-     //setValue(globalvaluespanid,globaltextboxpanid,globalsubvaluespanid,globaluitype,globalfieldlabel);
-	//setValue(globalvaluespanid,globaltextboxpanid,globalsubvaluespanid,globaluitype,globalfieldlabel,globalismandatory);
-     show(globaleditareaspanid) ;
-     hide(globaldtlviewspanid);
-     getObj(globaltxtboxid).focus();
-     hide('crmspanid');
-     itsonview=true;
-     //if(dhtmlHistory.currentLocation!="start")
-     //{
-     //  window.historyStorage.put("start",getObj('show').innerHTML);
-     //}
-     return false;
-}
-
-function dtlViewAjaxResponse(response)
-{
-     var item = response.responseText;
-     if(item.indexOf(":#:FAILURE")>-1)
-     {
-          alert("Error while Editing");
-     }
-     else if(item.indexOf(":#:SUCCESS")>-1)
-     {
-          hide("vtbusy_info");
-     }
-}
-
-function trim(str)
-{
-	return(str.replace(/\s+$/,''));
-}
-
-var genUiType = "";
-var genFldValue = "";
-
-function dtlViewAjaxSave(fieldLabel,module,uitype,tableName,fieldName,crmId)
-{
-     var dtlView = "dtlview_"+ fieldLabel;
-     var editArea = "editarea_"+ fieldLabel;
-     var txtBox= "txtbox_"+ fieldLabel;
-      
-     var tagValue = trim(document.getElementById(txtBox).value);
-
-     var data = "module=" + module + "&action=" + module + "Ajax&recordid=" + crmId ;
-     data = data + "&fldName=" + fieldName + "&fieldValue=" + escape(tagValue) + "&ajxaction=DETAILVIEW";
-     show("vtbusy_info");
-     
-     var ajaxObj = new Ajax(dtlViewAjaxResponse);
-     ajaxObj.process("index.php?",data);
-     
-     if(uitype == '13')
-     {
-          getObj(dtlView).innerHTML = "<a href=\"mailto:"+ tagValue+"\" target=\"_blank\">"+tagValue+"&nbsp;</a>";
-     }
-     else if(uitype == '17')
-     {
-          getObj(dtlView).innerHTML = "<a href=\"http://"+ tagValue+"\" target=\"_blank\">"+tagValue+"&nbsp;</a>";
-     }
-     else
-     {
-          getObj(dtlView).innerHTML = tagValue;
-     }
-     showHide(dtlView,editArea);  //show,hide
-     itsonview=false;
-}
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+var globaldtlviewspanid = "";
+var globaleditareaspanid = ""; 
+var globaltxtboxid = "";
+var itsonview=false;
+
+function showHide(showId, hideId)
+{
+	show(showId);
+	hide(hideId);
+}
+
+function hndCancel(valuespanid,textareapanid,fieldlabel)
+{
+
+  showHide(valuespanid,textareapanid);
+  //fieldLabelObj = getObj(fieldlabel);
+  //fieldLabelObj.className="label";
+  itsonview=false;
+  return false;
+}
+
+function hndMouseOver(uitype,fieldLabel)
+{
+      var mouseArea="";
+      mouseArea="mouseArea_"+ fieldLabel;
+      
+      if(itsonview)
+      {
+            return;
+      }
+      
+      show("crmspanid");
+      //globalfieldlabel=fieldLabel;
+      globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid;
+      //globalsubvaluespanid="subvalue_"+ fieldLabel;//subvaluespanid;
+      globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid;
+      //globaluitype=uitype;
+      globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid;
+      //globalismandatory=ismandatory;
+      divObj = getObj('crmspanid'); 
+      crmy = findPosY(getObj(mouseArea));
+      crmx = findPosX(getObj(mouseArea));
+      if(document.all)
+      {
+          divObj.onclick=handleEdit;
+      }
+      else
+      {
+          divObj.setAttribute('onclick','handleEdit();');
+      }
+      divObj.style.left=(crmx+getObj(mouseArea).offsetWidth -divObj.offsetWidth)+"px";
+      divObj.style.top=crmy+"px";
+}
+
+function handleEdit()
+{
+     //setValue(globalvaluespanid,globaltextboxpanid,globalsubvaluespanid,globaluitype,globalfieldlabel);
+	//setValue(globalvaluespanid,globaltextboxpanid,globalsubvaluespanid,globaluitype,globalfieldlabel,globalismandatory);
+     show(globaleditareaspanid) ;
+     hide(globaldtlviewspanid);
+     getObj(globaltxtboxid).focus();
+     hide('crmspanid');
+     itsonview=true;
+     //if(dhtmlHistory.currentLocation!="start")
+     //{
+     //  window.historyStorage.put("start",getObj('show').innerHTML);
+     //}
+     return false;
+}
+
+function dtlViewAjaxResponse(response)
+{
+     var item = response.responseText;
+     if(item.indexOf(":#:FAILURE")>-1)
+     {
+          alert("Error while Editing");
+     }
+     else if(item.indexOf(":#:SUCCESS")>-1)
+     {
+          hide("vtbusy_info");
+     }
+}
+
+function trim(str)
+{
+	return(str.replace(/\s+$/,''));
+}
+
+var genUiType = "";
+var genFldValue = "";
+
+function dtlViewAjaxSave(fieldLabel,module,uitype,tableName,fieldName,crmId)
+{
+     var dtlView = "dtlview_"+ fieldLabel;
+     var editArea = "editarea_"+ fieldLabel;
+     var txtBox= "txtbox_"+ fieldLabel;
+     var popupTxt= "popuptxt_"+ fieldLabel;      
+
+     var tagValue = trim(document.getElementById(txtBox).value);
+
+     var data = "module=" + module + "&action=" + module + "Ajax&recordid=" + crmId ;
+     data = data + "&fldName=" + fieldName + "&fieldValue=" + escape(tagValue) + "&ajxaction=DETAILVIEW";
+     show("vtbusy_info");
+     
+     var ajaxObj = new Ajax(dtlViewAjaxResponse);
+     ajaxObj.process("index.php?",data);
+     //alert(getObj(popupTxt));
+     if(uitype == '13')
+     {
+          getObj(dtlView).innerHTML = "<a href=\"mailto:"+ tagValue+"\" target=\"_blank\">"+tagValue+"&nbsp;</a>";
+     }
+     else if(uitype == '17')
+     {
+          getObj(dtlView).innerHTML = "<a href=\"http://"+ tagValue+"\" target=\"_blank\">"+tagValue+"&nbsp;</a>";
+     }
+     else if(getObj(popupTxt))
+     {
+	var popObj = getObj(popupTxt);
+	if(uitype == '50' || uitype == '73' || uitype == '51')
+	{
+		getObj(dtlView).innerHTML = "<a href=\"index.php?module=Accounts&action=DetailView&record="+tagValue+"\">"+popObj.value+"&nbsp;</a>";
+	}
+	else if(uitype == '57')
+	{
+		getObj(dtlView).innerHTML = "<a href=\"index.php?module=Contacts&action=DetailView&record="+tagValue+"\">"+popObj.value+"&nbsp;</a>";
+	}
+	else if(uitype == '59')
+	{
+		getObj(dtlView).innerHTML = "<a href=\"index.php?module=Products&action=DetailView&record="+tagValue+"\">"+popObj.value+"&nbsp;</a>";
+	}
+	else if(uitype == '75' || uitype == '81' )
+	{
+		getObj(dtlView).innerHTML = "<a href=\"index.php?module=Vendors&action=DetailView&record="+tagValue+"\">"+popObj.value+"&nbsp;</a>";
+
+	}
+	else if(uitype == '76')
+	{
+		getObj(dtlView).innerHTML = "<a href=\"index.php?module=Potentials&action=DetailView&record="+tagValue+"\">"+popObj.value+"&nbsp;</a>";
+	}
+	else if(uitype == '78')
+	{
+		getObj(dtlView).innerHTML = "<a href=\"index.php?module=Quotes&action=DetailView&record="+tagValue+"\">"+popObj.value+"&nbsp;</a>";
+	}
+	else if(uitype == '80')
+	{
+		getObj(dtlView).innerHTML = "<a href=\"index.php?module=SalesOrder&action=DetailView&record="+tagValue+"\">"+popObj.value+"&nbsp;</a>";
+	}
+	else
+	{
+		getObj(dtlView).innerHTML = popObj.value;
+	}
+     }
+     else
+     {
+          getObj(dtlView).innerHTML = tagValue;
+     }
+     showHide(dtlView,editArea);  //show,hide
+     itsonview=false;
+}





More information about the vtigercrm-commits mailing list