[Vtigercrm-commits] [vtiger-commits] r4615 - in /vtigercrm/trunk/modules: Accounts/ Activities/ Campaigns/ Contacts/ Emails/ Faq/ HelpDesk/ Invoice/ Leads/ Notes/ Potentials/ PriceBooks/ Products/ PurchaseOrder/ Quotes/ SalesOrder/ Vendors/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Mar 29 00:52:55 EST 2006
Author: saraj
Date: Tue Mar 28 22:52:31 2006
New Revision: 4615
Log:
duplicate code moved to include/Ajax/CommonAjax.php
Modified:
vtigercrm/trunk/modules/Accounts/AccountsAjax.php
vtigercrm/trunk/modules/Activities/ActivitiesAjax.php
vtigercrm/trunk/modules/Campaigns/CampaignsAjax.php
vtigercrm/trunk/modules/Contacts/ContactsAjax.php
vtigercrm/trunk/modules/Emails/EmailsAjax.php
vtigercrm/trunk/modules/Faq/FaqAjax.php
vtigercrm/trunk/modules/HelpDesk/HelpDeskAjax.php
vtigercrm/trunk/modules/Invoice/InvoiceAjax.php
vtigercrm/trunk/modules/Leads/LeadsAjax.php
vtigercrm/trunk/modules/Notes/NotesAjax.php
vtigercrm/trunk/modules/Potentials/PotentialsAjax.php
vtigercrm/trunk/modules/PriceBooks/PriceBooksAjax.php
vtigercrm/trunk/modules/Products/ProductsAjax.php
vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrderAjax.php
vtigercrm/trunk/modules/Quotes/QuotesAjax.php
vtigercrm/trunk/modules/SalesOrder/SalesOrderAjax.php
vtigercrm/trunk/modules/Vendors/VendorsAjax.php
Modified: vtigercrm/trunk/modules/Accounts/AccountsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/AccountsAjax.php (original)
+++ vtigercrm/trunk/modules/Accounts/AccountsAjax.php Tue Mar 28 22:52:31 2006
@@ -17,19 +17,14 @@
$local_log =& LoggerManager::getLogger('AccountsAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-if($_REQUEST['file'] != '')
-{
- require_once('modules/Accounts/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
+if($ajaxaction == "DETAILVIEW")
{
$crmid = $_REQUEST["recordid"];
$tablename = $_REQUEST["tableName"];
$fieldname = $_REQUEST["fldName"];
$fieldvalue = $_REQUEST["fieldValue"];
-
if($crmid != "")
- {
+ {
$acntObj = new Account();
$acntObj->retrieve_entity_info($crmid,"Accounts");
$acntObj->column_fields[$fieldname] = $fieldvalue;
@@ -46,51 +41,10 @@
}else
{
echo ":#:FAILURE";
- }
+ }
}
-elseif($ajaxaction == "SAVETAG")
+else
{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
- $crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
- {
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
+ require_once('include/Ajax/CommonAjax.php');
}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
- {
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }else
- {
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
- {
- echo '';
- }
-}
-
?>
Modified: vtigercrm/trunk/modules/Activities/ActivitiesAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Activities/ActivitiesAjax.php (original)
+++ vtigercrm/trunk/modules/Activities/ActivitiesAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('ActivitiesAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
-{
- require_once('modules/Activities/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
+if($ajaxaction == "DETAILVIEW")
{
$crmid = $_REQUEST["recordid"];
$tablename = $_REQUEST["tableName"];
$fieldname = $_REQUEST["fldName"];
$fieldvalue = $_REQUEST["fieldValue"];
-
if($crmid != "")
- {
- $actObj = new Activity();
- $actObj->retrieve_entity_info($crmid,"Activities");
- $actObj->column_fields[$fieldname] = $fieldvalue;
- $actObj->id = $crmid;
- $actObj->mode = "edit";
- $actObj->save("Activities");
- if($actObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
+ {
+ $actObj = new Activity();
+ $actObj->retrieve_entity_info($crmid,"Activities");
+ $actObj->column_fields[$fieldname] = $fieldvalue;
+ $actObj->id = $crmid;
+ $actObj->mode = "edit";
+ $actObj->save("Activities");
+ if($actObj->id != "")
+ {
+ echo ":#:SUCCESS";
+ }else
+ {
+ echo ":#:FAILURE";
+ }
+ }else
{
echo ":#:FAILURE";
}
}
-elseif($ajaxaction == "SAVETAG")
+else
{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
- $crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
- {
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
- {
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }else
- {
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
- {
- echo '';
- }
+ require_once('include/Ajax/CommonAjax.php');
}
?>
Modified: vtigercrm/trunk/modules/Campaigns/CampaignsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/CampaignsAjax.php (original)
+++ vtigercrm/trunk/modules/Campaigns/CampaignsAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('CampaignsAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Campaigns/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Campaign();
- $modObj->retrieve_entity_info($crmid,"Campaigns");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Campaigns");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Campaign();
+ $modObj->retrieve_entity_info($crmid,"Campaigns");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Campaigns");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Contacts/ContactsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/ContactsAjax.php (original)
+++ vtigercrm/trunk/modules/Contacts/ContactsAjax.php Tue Mar 28 22:52:31 2006
@@ -18,81 +18,34 @@
$local_log =& LoggerManager::getLogger('ContactsAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
-{
- require_once('modules/Contacts/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
+if($ajaxaction == "DETAILVIEW")
{
$crmid = $_REQUEST["recordid"];
$tablename = $_REQUEST["tableName"];
$fieldname = $_REQUEST["fldName"];
$fieldvalue = $_REQUEST["fieldValue"];
-
if($crmid != "")
- {
- $cntObj = new Contact();
- $cntObj->retrieve_entity_info($crmid,"Contacts");
- $cntObj->column_fields[$fieldname] = $fieldvalue;
- $cntObj->id = $crmid;
- $cntObj->mode = "edit";
- $cntObj->save("Contacts");
- if($cntObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
+ {
+ $cntObj = new Contact();
+ $cntObj->retrieve_entity_info($crmid,"Contacts");
+ $cntObj->column_fields[$fieldname] = $fieldvalue;
+ $cntObj->id = $crmid;
+ $cntObj->mode = "edit";
+ $cntObj->save("Contacts");
+ if($cntObj->id != "")
+ {
+ echo ":#:SUCCESS";
+ }else
+ {
+ echo ":#:FAILURE";
+ }
+ }else
+ {
+ echo ":#:FAILURE";
+ }
}
-elseif($ajaxaction == "SAVETAG")
+else
{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
- $crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
- {
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
+ require_once('include/Ajax/CommonAjax.php');
}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
- {
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }else
- {
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
- {
- echo '';
- }
-}
-
?>
Modified: vtigercrm/trunk/modules/Emails/EmailsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/EmailsAjax.php (original)
+++ vtigercrm/trunk/modules/Emails/EmailsAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('EmailsAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Emails/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Email();
- $modObj->retrieve_entity_info($crmid,"Emails");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Emails");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Email();
+ $modObj->retrieve_entity_info($crmid,"Emails");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Emails");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Faq/FaqAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Faq/FaqAjax.php (original)
+++ vtigercrm/trunk/modules/Faq/FaqAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('FaqAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Faq/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Faq();
- $modObj->retrieve_entity_info($crmid,"Faq");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Faq");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Faq();
+ $modObj->retrieve_entity_info($crmid,"Faq");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Faq");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/HelpDesk/HelpDeskAjax.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/HelpDeskAjax.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/HelpDeskAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,35 @@
$local_log =& LoggerManager::getLogger('HelpDeskAjax');
$ajaxaction = $_REQUEST["ajxaction"];
+if($ajaxaction == "DETAILVIEW")
+{
+ $crmid = $_REQUEST["recordid"];
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
-if($_REQUEST['file'] != '')
-{
- require_once('modules/HelpDesk/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new HelpDesk();
- $modObj->retrieve_entity_info($crmid,"HelpDesk");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("HelpDesk");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
- $crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new HelpDesk();
+ $modObj->retrieve_entity_info($crmid,"HelpDesk");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("HelpDesk");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Invoice/InvoiceAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/InvoiceAjax.php (original)
+++ vtigercrm/trunk/modules/Invoice/InvoiceAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,35 @@
$local_log =& LoggerManager::getLogger('InvoiceAjax');
$ajaxaction = $_REQUEST["ajxaction"];
+if($ajaxaction == "DETAILVIEW")
+{
+ $crmid = $_REQUEST["recordid"];
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
-if($_REQUEST['file'] != '')
-{
- require_once('modules/Invoice/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Invoice();
- $modObj->retrieve_entity_info($crmid,"Invoice");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Invoice");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
- $crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Invoice();
+ $modObj->retrieve_entity_info($crmid,"Invoice");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Invoice");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Leads/LeadsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/LeadsAjax.php (original)
+++ vtigercrm/trunk/modules/Leads/LeadsAjax.php Tue Mar 28 22:52:31 2006
@@ -15,29 +15,22 @@
global $adb;
$local_log =& LoggerManager::getLogger('LeadsAjax');
-
$ajaxaction = $_REQUEST["ajxaction"];
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Leads/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- //$columname = $_REQUEST["clmnName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
+ $crmid = $_REQUEST["recordid"];
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $leadObj = new Lead();
- $leadObj->retrieve_entity_info($crmid,"Leads");
- $leadObj->column_fields[$fieldname] = $fieldvalue;
- $leadObj->id = $crmid;
- $leadObj->mode = "edit";
- $leadObj->save("Leads");
- if($leadObj->id != "")
+ $leadObj = new Lead();
+ $leadObj->retrieve_entity_info($crmid,"Leads");
+ $leadObj->column_fields[$fieldname] = $fieldvalue;
+ $leadObj->id = $crmid;
+ $leadObj->mode = "edit";
+ $leadObj->save("Leads");
+ if($leadObj->id != "")
{
echo ":#:SUCCESS";
}else
@@ -46,52 +39,11 @@
}
}else
{
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
- $crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
- {
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
- {
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }else
- {
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
- {
- echo '';
+ echo ":#:FAILURE";
}
}
-
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Notes/NotesAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/NotesAjax.php (original)
+++ vtigercrm/trunk/modules/Notes/NotesAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('NotesAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
-{
- require_once('modules/Notes/'.$_REQUEST['file'].'.php');
-}
if($ajaxaction == "DETAILVIEW")
{
$crmid = $_REQUEST["recordid"];
$tablename = $_REQUEST["tableName"];
$fieldname = $_REQUEST["fldName"];
$fieldvalue = $_REQUEST["fieldValue"];
-
if($crmid != "")
- {
- $modObj = new Note();
- $modObj->retrieve_entity_info($crmid,"Notes");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Notes");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
+ {
+ $modObj = new Note();
+ $modObj->retrieve_entity_info($crmid,"Notes");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Notes");
+ if($modObj->id != "")
+ {
+ echo ":#:SUCCESS";
+ }else
+ {
+ echo ":#:FAILURE";
+ }
+ }else
{
echo ":#:FAILURE";
}
}
-elseif($ajaxaction == "SAVETAG")
+else
{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
- $crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
- {
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
- {
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }else
- {
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
- {
- echo '';
- }
+ require_once('include/Ajax/CommonAjax.php');
}
?>
Modified: vtigercrm/trunk/modules/Potentials/PotentialsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/PotentialsAjax.php (original)
+++ vtigercrm/trunk/modules/Potentials/PotentialsAjax.php Tue Mar 28 22:52:31 2006
@@ -17,81 +17,34 @@
$local_log =& LoggerManager::getLogger('PotentialsAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Potentials/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Potential();
- $modObj->retrieve_entity_info($crmid,"Potentials");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Potentials");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Potential();
+ $modObj->retrieve_entity_info($crmid,"Potentials");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Potentials");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
-
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/PriceBooks/PriceBooksAjax.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/PriceBooksAjax.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/PriceBooksAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('PriceBooksAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/PriceBooks/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new PriceBook();
- $modObj->retrieve_entity_info($crmid,"PriceBooks");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("PriceBooks");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new PriceBook();
+ $modObj->retrieve_entity_info($crmid,"PriceBooks");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("PriceBooks");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Products/ProductsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Products/ProductsAjax.php (original)
+++ vtigercrm/trunk/modules/Products/ProductsAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('ProductsAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Products/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Product();
- $modObj->retrieve_entity_info($crmid,"Products");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Products");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Product();
+ $modObj->retrieve_entity_info($crmid,"Products");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Products");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrderAjax.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrderAjax.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrderAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('PurchaseOrderAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/PurchaseOrder/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Order();
- $modObj->retrieve_entity_info($crmid,"PurchaseOrder");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("PurchaseOrder");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Order();
+ $modObj->retrieve_entity_info($crmid,"PurchaseOrder");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("PurchaseOrder");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Quotes/QuotesAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/QuotesAjax.php (original)
+++ vtigercrm/trunk/modules/Quotes/QuotesAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('QuotesAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Quotes/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Quote();
- $modObj->retrieve_entity_info($crmid,"Quotes");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Quotes");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Quote();
+ $modObj->retrieve_entity_info($crmid,"Quotes");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Quotes");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/SalesOrder/SalesOrderAjax.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/SalesOrderAjax.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/SalesOrderAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('SalesOrderAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/SalesOrder/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new SalesOrder();
- $modObj->retrieve_entity_info($crmid,"SalesOrder");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("SalesOrder");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new SalesOrder();
+ $modObj->retrieve_entity_info($crmid,"SalesOrder");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("SalesOrder");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
Modified: vtigercrm/trunk/modules/Vendors/VendorsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/VendorsAjax.php (original)
+++ vtigercrm/trunk/modules/Vendors/VendorsAjax.php Tue Mar 28 22:52:31 2006
@@ -17,80 +17,34 @@
$local_log =& LoggerManager::getLogger('VendorsAjax');
$ajaxaction = $_REQUEST["ajxaction"];
-
-if($_REQUEST['file'] != '')
+if($ajaxaction == "DETAILVIEW")
{
- require_once('modules/Vendors/'.$_REQUEST['file'].'.php');
-}
-elseif($ajaxaction == "DETAILVIEW")
-{
- $crmid = $_REQUEST["recordid"];
- $tablename = $_REQUEST["tableName"];
- $fieldname = $_REQUEST["fldName"];
- $fieldvalue = $_REQUEST["fieldValue"];
-
- if($crmid != "")
- {
- $modObj = new Vendor();
- $modObj->retrieve_entity_info($crmid,"Vendors");
- $modObj->column_fields[$fieldname] = $fieldvalue;
- $modObj->id = $crmid;
- $modObj->mode = "edit";
- $modObj->save("Vendors");
- if($modObj->id != "")
- {
- echo ":#:SUCCESS";
- }else
- {
- echo ":#:FAILURE";
- }
- }else
- {
- echo ":#:FAILURE";
- }
-}
-elseif($ajaxaction == "SAVETAG")
-{
-
- require_once('include/freetag/freetag.class.php');
- global $current_user;
$crmid = $_REQUEST["recordid"];
- $module = $_REQUEST["module"];
- $tagfields = $_REQUEST["tagfields"];
- $userid = $current_user->id;
- $freetag = new freetag();
- if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+ $tablename = $_REQUEST["tableName"];
+ $fieldname = $_REQUEST["fldName"];
+ $fieldvalue = $_REQUEST["fieldValue"];
+ if($crmid != "")
{
- $freetag->tag_object($userid,$crmid,$tagfields,$module);
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
- }
-
-}
-elseif($ajaxaction == 'GETTAGCLOUD')
-{
- require_once('include/freetag/freetag.class.php');
- $freetag = new freetag();
- $module = $_REQUEST["module"];
- $useid = $current_user->id;
- global $adb;
- $query='select * from freetagged_objects where module = "'.$module .'"';
- $result=$adb->query($query);
- if($adb->num_rows($result) > 0)
- {
- if(trim($module) != "")
+ $modObj = new Vendor();
+ $modObj->retrieve_entity_info($crmid,"Vendors");
+ $modObj->column_fields[$fieldname] = $fieldvalue;
+ $modObj->id = $crmid;
+ $modObj->mode = "edit";
+ $modObj->save("Vendors");
+ if($modObj->id != "")
{
- $tagcloud = $freetag->get_tag_cloud_html($module);
- echo $tagcloud;
+ echo ":#:SUCCESS";
}else
{
- $tagcloud = $freetag->get_tag_cloud_html();
- echo $tagcloud;
- }
- }
- else
+ echo ":#:FAILURE";
+ }
+ }else
{
- echo '';
+ echo ":#:FAILURE";
}
}
+else
+{
+ require_once('include/Ajax/CommonAjax.php');
+}
?>
More information about the vtigercrm-commits
mailing list