更新到 5.2 后第一次 SVN 提交。

[email protected]



git-svn-id: https://svn.code.sf.net/p/hawebs/svn@539 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-08-21 15:24:22 +00:00
parent cb87254354
commit fce9ce115a
124 changed files with 7391 additions and 942 deletions
+66 -45
View File
@@ -73,11 +73,13 @@ class Accounts extends CRMEntity {
var $search_fields = Array(
'Account Name'=>Array('vtiger_account'=>'accountname'),
'Billing City'=>Array('vtiger_accountbillads'=>'bill_city'),
'Assigned To'=>Array('vtiger_crmentity'=>'smownerid'),
);
var $search_fields_name = Array(
'Account Name'=>'accountname',
'Billing City'=>'bill_city',
'Assigned To'=>'assigned_user_id',
);
// This is the list of vtiger_fields that are required
var $required_fields = array();
@@ -145,6 +147,60 @@ class Accounts extends CRMEntity {
}
// Mike Crowe Mod --------------------------------------------------------
/** Returns a list of the associated Campaigns
* @param $id -- campaign id :: Type Integer
* @returns list of campaigns in array format
*/
function get_campaigns($id, $cur_tab_id, $rel_tab_id, $actions=false) {
global $log, $singlepane_view,$currentModule,$current_user;
$log->debug("Entering get_campaigns(".$id.") method ...");
$this_module = $currentModule;
$related_module = vtlib_getModuleNameById($rel_tab_id);
require_once("modules/$related_module/$related_module.php");
$other = new $related_module();
vtlib_setup_modulevars($related_module, $other);
$singular_modname = vtlib_toSingular($related_module);
$parenttab = getParentTab();
if($singlepane_view == 'true')
$returnset = '&return_module='.$this_module.'&return_action=DetailView&return_id='.$id;
else
$returnset = '&return_module='.$this_module.'&return_action=CallRelatedList&return_id='.$id;
$button = '';
$button .= '<input type="hidden" name="email_directing_module"><input type="hidden" name="record">';
if($actions) {
if(is_string($actions)) $actions = explode(',', strtoupper($actions));
if(in_array('SELECT', $actions) && isPermitted($related_module,4, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_SELECT')." ". getTranslatedString($related_module). "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id&parenttab=$parenttab','test','width=640,height=602,resizable=0,scrollbars=0');\" value='". getTranslatedString('LBL_SELECT'). " " . getTranslatedString($related_module) ."'>&nbsp;";
}
if(in_array('ADD', $actions) && isPermitted($related_module,1, '') == 'yes') {
$button .= "<input title='". getTranslatedString('LBL_ADD_NEW')." ". getTranslatedString($singular_modname)."' accessyKey='F' class='crmbutton small create' onclick='fnvshobj(this,\"sendmail_cont\");sendmail(\"$this_module\",$id);' type='button' name='button' value='". getTranslatedString('LBL_ADD_NEW')." ". getTranslatedString($singular_modname)."'></td>";
}
}
$query = "SELECT case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,
vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus,
vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
vtiger_crmentity.modifiedtime from vtiger_campaign
inner join vtiger_campaignaccountrel on vtiger_campaignaccountrel.campaignid=vtiger_campaign.campaignid
inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid
left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid
left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid
where vtiger_campaignaccountrel.accountid=".$id." and vtiger_crmentity.deleted=0";
$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
if($return_value == null) $return_value = Array();
$return_value['CUSTOM_BUTTON'] = $button;
$log->debug("Exiting get_campaigns method ...");
return $return_value;
}
/** Returns a list of the associated contacts
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
@@ -371,9 +427,7 @@ class Accounts extends CRMEntity {
ON vtiger_groups.groupid = vtiger_crmentity.smownerid
LEFT JOIN vtiger_users
ON vtiger_users.id=vtiger_crmentity.smownerid
WHERE (vtiger_activity.activitytype = 'Meeting'
OR vtiger_activity.activitytype = 'Call'
OR vtiger_activity.activitytype = 'Task')
WHERE (vtiger_activity.activitytype != 'Emails')
AND (vtiger_activity.status = 'Completed'
OR vtiger_activity.status = 'Deferred'
OR (vtiger_activity.eventstatus = 'Held'
@@ -690,34 +744,7 @@ class Accounts extends CRMEntity {
ON vtiger_users.id=vtiger_crmentity.smownerid
LEFT JOIN vtiger_groups
ON vtiger_groups.groupid = vtiger_crmentity.smownerid
WHERE vtiger_crmentity.deleted = 0 and ( vtiger_troubletickets.parent_id=".$id." or " ;
$query .= " vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid
FROM vtiger_contactdetails
INNER JOIN vtiger_crmentity
ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid
LEFT JOIN vtiger_groups
ON vtiger_groups.groupid = vtiger_crmentity.smownerid
LEFT JOIN vtiger_users
ON vtiger_crmentity.smownerid = vtiger_users.id
WHERE vtiger_crmentity.deleted = 0
AND vtiger_contactdetails.accountid = ".$id;
//Appending the security parameter
global $current_user;
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
$tab_id=getTabid('Contacts');
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3)
{
$sec_parameter=getListViewSecurityParameter('Contacts');
$query .= ' '.$sec_parameter;
}
$query .= ") )";
WHERE vtiger_crmentity.deleted = 0 and vtiger_troubletickets.parent_id=$id" ;
$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
if($return_value == null) $return_value = Array();
@@ -816,7 +843,7 @@ class Accounts extends CRMEntity {
ON vtiger_account2.accountid = vtiger_account.parentid
";//vtiger_account2 is added to get the Member of account
$query .= $this->getNonAdminAccessControlQuery('Accounts',$current_user);
$where_auto = " vtiger_crmentity.deleted = 0 ";
if($where != "")
@@ -824,15 +851,6 @@ class Accounts extends CRMEntity {
else
$query .= " WHERE ".$where_auto;
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
//we should add security check when the user has Private Access
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[6] == 3)
{
//Added security check to get the permitted records only
$query = $query." ".getListViewSecurityParameter("Accounts");
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
@@ -865,7 +883,7 @@ class Accounts extends CRMEntity {
for($i=0; $i < $numRows;$i++)
{
$custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel");
$custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]);
$custom_fields[$i] = preg_replace("/\s+/","",$custom_fields[$i]);
$custom_fields[$i] = strtoupper($custom_fields[$i]);
}
$mergeflds = $custom_fields;
@@ -935,6 +953,7 @@ class Accounts extends CRMEntity {
"HelpDesk" => array("vtiger_troubletickets"=>array("parent_id","ticketid"),"vtiger_account"=>"accountid"),
"Products" => array("vtiger_seproductsrel"=>array("crmid","productid"),"vtiger_account"=>"accountid"),
"Documents" => array("vtiger_senotesrel"=>array("crmid","notesid"),"vtiger_account"=>"accountid"),
"Campaigns" => array("vtiger_campaignaccountrel"=>array("accountid","campaignid"),"vtiger_account"=>"accountid"),
);
return $rel_tables[$secmodule];
}
@@ -1218,7 +1237,10 @@ class Accounts extends CRMEntity {
global $log;
if(empty($return_module) || empty($return_id)) return;
if($return_module == 'Products') {
if($return_module == 'Campaigns') {
$sql = 'DELETE FROM vtiger_campaignaccountrel WHERE accountid=? AND campaignid=?';
$this->db->pquery($sql, array($id, $return_id));
} else if($return_module == 'Products') {
$sql = 'DELETE FROM vtiger_seproductsrel WHERE crmid=? AND productid=?';
$this->db->pquery($sql, array($id, $return_id));
} else {
@@ -1227,7 +1249,6 @@ class Accounts extends CRMEntity {
$this->db->pquery($sql, $params);
}
}
}
?>
?>
@@ -62,6 +62,14 @@ if($singlepane_view == 'true' && $_REQUEST['action'] == 'CallRelatedList') {
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
$related_array=getRelatedLists("Accounts",$focus);
require_once('include/ListView/RelatedListViewSession.php');
if(!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
$relationId = vtlib_purify($_REQUEST['relation_id']);
RelatedListViewSession::addRelatedModuleToSession($relationId,
vtlib_purify($_REQUEST['selected_header']));
}
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
$smarty->assign("RELATEDLISTS", $related_array);
$smarty->assign("ID",$focus->id);
$smarty->assign("MODULE",$currentmodule);
@@ -145,6 +145,13 @@ if($singlepane_view == 'true')
{
$related_array = getRelatedLists($currentModule,$focus);
$smarty->assign("RELATEDLISTS", $related_array);
require_once('include/ListView/RelatedListViewSession.php');
if(!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']),
vtlib_purify($_REQUEST['selected_header']));
}
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
}
$smarty->assign("TODO_PERMISSION",CheckFieldPermission('parent_id','Calendar'));
$smarty->assign("EVENT_PERMISSION",CheckFieldPermission('parent_id','Events'));
@@ -157,7 +164,7 @@ $focus->markAsViewed($current_user->id);
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'RECORD'=>$focus->id, 'ACTION'=>vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('DETAILVIEWBASIC','DETAILVIEW'), $customlink_params));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('DETAILVIEWBASIC','DETAILVIEW','DETAILVIEWWIDGET'), $customlink_params));
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
@@ -10,11 +10,11 @@
require_once('include/logging.php');
require_once('include/database/PearDatabase.php');
global $adb;
global $adb,$mod_strings;
$local_log =& LoggerManager::getLogger('AccountsAjax');
global $currentModule;
$acntObj = CRMEntity::getInstance($currentModule);
$modObj = CRMEntity::getInstance($currentModule);
$ajaxaction = $_REQUEST["ajxaction"];
if($ajaxaction == "DETAILVIEW")
@@ -25,20 +25,47 @@ if($ajaxaction == "DETAILVIEW")
$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]);
if($crmid != "")
{
$acntObj->retrieve_entity_info($crmid,"Accounts");
$acntObj->column_fields[$fieldname] = $fieldvalue;
$modObj->retrieve_entity_info($crmid,"Accounts");
$modObj->column_fields[$fieldname] = $fieldvalue;
if($fieldname=='accountname'){
$value = $fieldvalue;
$query = "SELECT accountname FROM vtiger_account,vtiger_crmentity WHERE accountname =? and vtiger_account.accountid = vtiger_crmentity.crmid and vtiger_crmentity.deleted != 1";
$params = array($value);
if(isset($crmid) && $crmid !='') {
$query .= " and vtiger_account.accountid != ?";
array_push($params, $crmid);
}
$result = $adb->pquery($query, $params);
if($adb->num_rows($result) > 0)
{
echo ":#:ERR".$mod_strings['LBL_ACCOUNT_EXIST'];
return false;
}
}
if($fieldname=='accountname'){
$value = $fieldvalue;
$query = "SELECT accountname FROM vtiger_account,vtiger_crmentity WHERE accountname =? and vtiger_account.accountid = vtiger_crmentity.crmid and vtiger_crmentity.deleted != 1";
$params = array($value);
if(isset($crmid) && $crmid !='') {
$query .= " and vtiger_account.accountid != ?";
array_push($params, $crmid);
}
$result = $adb->pquery($query, $params);
if($adb->num_rows($result) > 0)
{
echo ":#:ERR".$mod_strings['LBL_ACCOUNT_EXIST'];
return false;
}
}
if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving
{
$acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);
$modObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);
}
$acntObj->id = $crmid;
$acntObj->mode = "edit";
$acntObj->save("Accounts");
if($acntObj->column_fields['notify_owner'] == 1 )
{
sendNotificationToOwner('Accounts',&$acntObj);
}
if($acntObj->id != "")
$modObj->id = $crmid;
$modObj->mode = "edit";
$modObj->save("Accounts");
if($modObj->id != "")
{
echo ":#:SUCCESS";
}else
@@ -49,5 +76,8 @@ if($ajaxaction == "DETAILVIEW")
{
echo ":#:FAILURE";
}
}elseif($ajaxaction == "LOADRELATEDLIST" || $ajaxaction == "DISABLEMODULE"){
require_once 'include/ListView/RelatedListViewContents.php';
}
?>
?>
+36 -28
View File
@@ -91,15 +91,6 @@ $smarty->assign("CV_DELETE_PERMIT",$delete_permit);
//<<<<<customview>>>>>
$smarty->assign("CHANGE_OWNER",getUserslist());
$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
{
list($where, $ustring) = split("#@@#",getWhereCondition($currentModule));
// we have a query
$url_string .="&query=true".$ustring;
$log->info("Here is the where clause for the list view: $where");
$smarty->assign("SEARCH_URL",$url_string);
}
if($viewid != 0)
{
$CActionDtls = $oCustomView->getCustomActionDetails($viewid);
@@ -170,23 +161,31 @@ $smarty->assign("SINGLE_MOD",'Account');
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if($viewid != "0")
{
$listquery = getListQuery("Accounts");
$query = $oCustomView->getModifiedCvListQuery($viewid,$listquery,"Accounts");
}else
{
$query = getListQuery("Accounts");
global $current_user;
$queryGenerator = new QueryGenerator($currentModule, $current_user);
if ($viewid != "0") {
$queryGenerator->initForCustomViewById($viewid);
} else {
$queryGenerator->initForDefaultCustomView();
}
//<<<<<<<<customview>>>>>>>>>
if(isset($where) && $where != '')
{
$query .= ' and '.$where;
// Enabling Module Search
$url_string = '';
if($_REQUEST['query'] == 'true') {
$queryGenerator->addUserSearchConditions($_REQUEST);
$ustring = getSearchURL($_REQUEST);
$url_string .= "&query=true$ustring";
$smarty->assign('SEARCH_URL', $url_string);
}
$query = $queryGenerator->getQuery();
$where = $queryGenerator->getConditionalWhere();
if(isset($where) && $where != '') {
$_SESSION['export_where'] = $where;
} else {
unset($_SESSION['export_where']);
}
else
unset($_SESSION['export_where']);
$view_script = "<script language='javascript'>
function set_selected()
@@ -257,13 +256,13 @@ if( $adb->dbType == "pgsql")
else
$list_result = $adb->pquery($query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array());
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec);
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec,$noofrows);
$smarty->assign('recordListRange',$recordListRangeMsg);
//mass merge for word templates -- *Raj*17/11
while($row = $adb->fetch_array($list_result))
{
$ids[] = $row["crmid"];
$ids[] = $row[$focus->table_index];
}
if(isset($ids))
{
@@ -302,13 +301,16 @@ if(isPermitted("Accounts","Merge") == 'yes')
if($viewid !='')
$url_string .= "&viewname=".$viewid;
$listview_header = getListViewHeader($focus,"Accounts",$url_string,$sorder,$order_by,"",$oCustomView);
$controller = new ListViewController($adb, $current_user, $queryGenerator);
$listview_header = $controller->getListViewHeader($focus,$currentModule,$url_string,$sorder,
$order_by);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search=getSearchListHeaderValues($focus,"Accounts",$url_string,$sorder,$order_by,"",$oCustomView);
$listview_header_search = $controller->getBasicSearchFieldInfoList();
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
$listview_entries = getListViewEntries($focus,"Accounts",$list_result,$navigation_array,"","","EditView","Delete",$oCustomView);
$listview_entries = $controller->getListViewEntries($focus,$currentModule,$list_result,
$navigation_array);
$smarty->assign("LISTENTITY", $listview_entries);
$smarty->assign("SELECT_SCRIPT", $view_script);
@@ -324,7 +326,7 @@ $smarty->assign("CURRENT_PAGE_BOXES", implode(array_keys($listview_entries),";")
$navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string,"Accounts","index",$viewid);
$alphabetical = AlphabeticalSearch($currentModule,'index','accountname','true','basic',"","","","",$viewid);
$fieldnames = getAdvSearchfields($currentModule);
$fieldnames = $controller->getAdvancedSearchOptionString();
$criteria = getcriteria_options();
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("FIELDNAMES", $fieldnames);
@@ -336,9 +338,15 @@ $smarty->assign("CHECK", $check_button);
$_SESSION[$currentModule.'_listquery'] = $query;
// Gather the custom link information to display
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'ACTION'=>vtlib_purify($_REQUEST['action']), 'CATEGORY'=> $category);
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('LISTVIEWBASIC','LISTVIEW'), $customlink_params));
// END
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("ListViewEntries.tpl");
else
$smarty->display("ListView.tpl");
?>
?>
@@ -40,14 +40,16 @@ function getTopAccounts($maxval,$calCnt)
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
$list_query = "select vtiger_account.accountid, vtiger_account.accountname, vtiger_account.tickersymbol, sum(vtiger_potential.amount) as amount from vtiger_potential inner join vtiger_crmentity on (vtiger_potential.potentialid=vtiger_crmentity.crmid) left join vtiger_account on (vtiger_potential.related_to=vtiger_account.accountid) left join vtiger_groups on (vtiger_groups.groupid = vtiger_crmentity.smownerid) where vtiger_crmentity.deleted=0 AND vtiger_crmentity.smownerid='".$current_user->id."' and vtiger_potential.sales_stage not in ('Closed Won', 'Closed Lost','".$app_strings['LBL_CLOSE_WON']."','".$app_strings['LBL_CLOSE_LOST']."')";
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[6] == 3)
{
$sec_parameter=getListViewSecurityParameter('Accounts');
$list_query .= $sec_parameter;
}
$list_query .= " group by vtiger_account.accountid, vtiger_account.accountname, vtiger_account.tickersymbol order by amount desc";
$list_query = "select vtiger_potential.potentialname,vtiger_account.accountid, vtiger_account.accountname, ".
"vtiger_account.tickersymbol, sum(vtiger_potential.amount) as amount from vtiger_potential ".
"inner join vtiger_crmentity on (vtiger_potential.potentialid=vtiger_crmentity.crmid) ".
"left join vtiger_account on (vtiger_potential.related_to=vtiger_account.accountid) ";
$list_query .= " WHERE vtiger_crmentity.deleted = 0 ".$where.
" AND vtiger_potential.potentialid>0";
$list_query .= " AND vtiger_crmentity.smownerid='".$current_user->id."' ".
"and vtiger_potential.sales_stage not in ('Closed Won', 'Closed Lost','".
$app_strings['LBL_CLOSE_WON']."','".$app_strings['LBL_CLOSE_LOST']."')";
$list_query .= " group by vtiger_account.accountid, vtiger_account.tickersymbol order by amount desc";
$list_query .= " LIMIT 0," . $adb->sql_escape_string($maxval);
@@ -82,7 +84,8 @@ function getTopAccounts($maxval,$calCnt)
$rate_symbol = getCurrencySymbolandCRate($currencyid);
$rate = $rate_symbol['rate'];
$curr_symbol = $rate_symbol['symbol'];
$header[]=$current_module_strings['LBL_LIST_AMOUNT'].'('.$curr_symbol.')';
$header[]=$current_module_strings['LBL_LIST_AMOUNT'].'('.$curr_symbol.')';
$header[] = $current_module_strings['LBL_POTENTIAL_TITLE'];
$entries=array();
foreach($open_accounts_list as $account)
+1 -1
View File
@@ -234,7 +234,7 @@ while($columnValues = $adb->fetch_array($result))
$actual_values[$x] = $value;
$actual_values[$x] = str_replace('"'," ",$actual_values[$x]);
//if value contains any line feed or carriage return replace the value with ".value."
if (preg_match ("/(\r\n)/", $actual_values[$x]))
if (preg_match ("/(\r?\n)/", $actual_values[$x]))
{
$actual_values[$x] = '"'.$actual_values[$x].'"';
}
+19 -5
View File
@@ -107,6 +107,24 @@ if($focus->mode == 'edit' && $_REQUEST['address_change'] == 'yes')
//Changing account address - Ends
$focus->save("Accounts");
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == "Campaigns")
{
if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "")
{
$campAccStatusResult = $adb->pquery("select campaignrelstatusid from vtiger_campaignaccountrel where campaignid=? AND accountid=?",array($_REQUEST['return_id'], $focus->id));
$accountStatus = $adb->query_result($campAccStatusResult,0,'campaignrelstatusid');
$sql = "delete from vtiger_campaignaccountrel where accountid = ?";
$adb->pquery($sql, array($focus->id));
if(isset($accountStatus) && $accountStatus!=''){
$sql = "insert into vtiger_campaignaccountrel values (?,?,?)";
$adb->pquery($sql, array($_REQUEST['return_id'], $focus->id,$accountStatus));
}
else{
$sql = "insert into vtiger_campaignaccountrel values (?,?,1)";
$adb->pquery($sql, array($_REQUEST['return_id'], $focus->id));
}
}
}
$return_id = $focus->id;
$parenttab = getParentTab();
@@ -122,10 +140,6 @@ $local_log->debug("Saved record with id of ".$return_id);
if($_REQUEST['return_viewname'] == '') $return_viewname='0';
if($_REQUEST['return_viewname'] != '')$return_viewname=vtlib_purify($_REQUEST['return_viewname']);
//Send notification mail to the assigned to owner about the vtiger_account creation
if($focus->column_fields['notify_owner'] == 1 || $focus->column_fields['notify_owner'] == 'on')
$status = sendNotificationToOwner('Accounts',$focus);
header("Location: index.php?action=$return_action&module=$return_module&parenttab=$parenttab&record=$return_id&viewname=$return_viewname&start=".vtlib_purify($_REQUEST['pagenumber']).$search);
/** Function to save Accounts custom field info into database
* @param integer $entity_id - accountid
@@ -214,4 +228,4 @@ function save_customfields($entity_id)
}
$log->debug("Exiting save_customfields method ...");
}
?>
?>
@@ -39,7 +39,9 @@ foreach($storearray as $id)
$adb->pquery("insert into vtiger_senotesrel values (?,?)", array($forCRMRecord,$id));
elseif($dest_mod == 'Products')
$adb->pquery("insert into vtiger_seproductsrel values(?,?,?)", array($forCRMRecord, $id, $currentModule));
else {
elseif($dest_mod == 'Campaigns')
$adb->pquery("insert into vtiger_campaignaccountrel values(?,?,1)", array($id, $forCRMRecord));
else {
$focus->save_related_module($currentModule, $forCRMRecord, $dest_mod, $id);
}
}
@@ -47,4 +49,4 @@ foreach($storearray as $id)
header("Location: index.php?action=$action&module=$currentModule&record=".$forCRMRecord."&parenttab=".$parenttab);
?>
?>
@@ -16,10 +16,8 @@
* $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Administration/index.php,v 1.1 2004/08/17 15:03:27 gjayakrishnan Exp $
* Description: TODO: To be written.
********************************************************************************/
$_SESSION['user_sorder']='';
$_SESSION['user_orderby']='';
$_SESSION['user_pagestart'] = 1;
$currentModule = 'Users';
include("modules/Users/ListView.php");
?>
@@ -17,9 +17,6 @@
* Description: Defines the English language pack for the Account module.
********************************************************************************/
$mod_strings = Array(
'LBL_MODULE_NAME'=>'Administration',
'LBL_MODULE_TITLE'=>'Administration: Home',
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,11 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
require_once('include/Ajax/CommonAjax.php');
?>
@@ -0,0 +1,85 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
require_once('Smarty_setup.php');
require_once('user_privileges/default_module_view.php');
global $mod_strings, $app_strings, $currentModule, $current_user, $theme, $singlepane_view;
$category = getParentTab();
$action = vtlib_purify($_REQUEST['action']);
$record = vtlib_purify($_REQUEST['record']);
$isduplicate = vtlib_purify($_REQUEST['isDuplicate']);
if($singlepane_view == 'true' && $action == 'CallRelatedList') {
header("Location:index.php?action=DetailView&module=$currentModule&record=$record&parenttab=$category");
} else {
$tool_buttons = Button_Check($currentModule);
$focus = CRMEntity::getInstance($currentModule);
if($record != '') {
$focus->retrieve_entity_info($record, $currentModule);
$focus->id = $record;
$service_base_currency = getProductBaseCurrency($focus->id,$currentModule);
} else {
$service_base_currency = fetchCurrency($current_user->id);
}
$smarty = new vtigerCRM_Smarty;
if($isduplicate == 'true') $focus->id = '';
if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') $smarty->assign("OP_MODE",vtlib_purify($_REQUEST['mode']));
if(!$_SESSION['rlvs'][$currentModule]) unset($_SESSION['rlvs']);
// Identify this module as custom module.
$smarty->assign('CUSTOM_MODULE', true);
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('MODULE', $currentModule);
// TODO: Update Single Module Instance name here.
$smarty->assign('SINGLE_MOD', getTranslatedString($currentModule));
$smarty->assign('CATEGORY', $category);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
$smarty->assign('THEME', $theme);
$smarty->assign('ID', $focus->id);
$smarty->assign('MODE', $focus->mode);
$smarty->assign('CHECK', $tool_buttons);
$smarty->assign('NAME', $focus->column_fields[$focus->def_detailview_recname]);
$smarty->assign('UPDATEINFO',updateInfo($focus->id));
$smarty->assign("CURRENCY_ID",$service_base_currency);
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if ($mod_seq_field != null) {
$mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
} else {
$mod_seq_id = $focus->id;
}
$smarty->assign('MOD_SEQ_ID', $mod_seq_id);
// END
$related_array = getRelatedLists($currentModule, $focus);
$smarty->assign('RELATEDLISTS', $related_array);
require_once('include/ListView/RelatedListViewSession.php');
if(!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
$relationId = vtlib_purify($_REQUEST['relation_id']);
RelatedListViewSession::addRelatedModuleToSession($relationId,
vtlib_purify($_REQUEST['selected_header']));
}
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
$smarty->display('RelatedLists.tpl');
}
?>
@@ -0,0 +1,12 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
include('modules/CustomView/index.php');
?>
@@ -0,0 +1,32 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
global $currentModule;
$focus = CRMEntity::getInstance($currentModule);
$record = vtlib_purify($_REQUEST['record']);
$module = vtlib_purify($_REQUEST['module']);
$return_module = vtlib_purify($_REQUEST['return_module']);
$return_action = vtlib_purify($_REQUEST['return_action']);
$return_id = vtlib_purify($_REQUEST['return_id']);
$parenttab = getParentTab();
//Added to fix 4600
$url = getBasic_Advance_SearchURL();
DeleteEntity($currentModule, $return_module, $focus, $record, $return_id);
$parenttab = getParentTab();
if(isset($_REQUEST['activity_mode']))
$url .= '&activity_mode='.vtlib_purify($_REQUEST['activity_mode']);
header("Location: index.php?module=$return_module&action=$return_action&record=$return_id&parenttab=$parenttab&relmodule=$module".$url);
?>
@@ -0,0 +1,29 @@
<?php
/*+********************************************************************************
* 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.
********************************************************************************/
global $adb;
global $log;
$return_id = vtlib_purify($_REQUEST['return_id']);
$record = vtlib_purify($_REQUEST['record']);
$return_module = vtlib_purify($_REQUEST['return_module']);
$return_action = vtlib_purify($_REQUEST['return_action']);
if($return_action !='' && $return_module == "PriceBooks" && $return_action == "CallRelatedList") {
$log->info("Products :: Deleting Price Book - Delete from PriceBook RelatedList");
$query = "delete from vtiger_pricebookproductrel where pricebookid=? and productid=?";
$adb->pquery($query, array($return_id, $record));
} else {
$log->info("Products :: Deleting Price Book");
$query = "delete from vtiger_pricebookproductrel where pricebookid=? and productid=?";
$adb->pquery($query, array($record, $return_id));
}
header("Location: index.php?module=".$return_module."&action=".$return_module."Ajax&file=$return_action&ajax=delpbprorel&record=".$return_id);
?>
@@ -0,0 +1,110 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
require_once('Smarty_setup.php');
require_once('user_privileges/default_module_view.php');
global $mod_strings, $app_strings, $currentModule, $current_user, $theme, $singlepane_view;
$focus = CRMEntity::getInstance($currentModule);
$tool_buttons = Button_Check($currentModule);
$smarty = new vtigerCRM_Smarty();
$record = $_REQUEST['record'];
$isduplicate = vtlib_purify($_REQUEST['isDuplicate']);
$tabid = getTabid($currentModule);
$category = getParentTab($currentModule);
if($record != '') {
$focus->id = $record;
$focus->retrieve_entity_info($record, $currentModule);
}
if($isduplicate == 'true') $focus->id = '';
// Identify this module as custom module.
$smarty->assign('CUSTOM_MODULE', true);
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('MODULE', $currentModule);
// TODO: Update Single Module Instance name here.
$smarty->assign('SINGLE_MOD', 'SINGLE_'.$currentModule);
$smarty->assign('CATEGORY', $category);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
$smarty->assign('THEME', $theme);
$smarty->assign('ID', $focus->id);
$smarty->assign('MODE', $focus->mode);
$recordName = array_values(getEntityName($currentModule, $focus->id));
$recordName = $recordName[0];
$smarty->assign('NAME', $recordName);
$smarty->assign('UPDATEINFO',updateInfo($focus->id));
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if ($mod_seq_field != null) {
$mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
} else {
$mod_seq_id = $focus->id;
}
$smarty->assign('MOD_SEQ_ID', $mod_seq_id);
// END
$validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, $tabid));
$smarty->assign('VALIDATION_DATA_FIELDNAME',$validationArray['fieldname']);
$smarty->assign('VALIDATION_DATA_FIELDDATATYPE',$validationArray['datatype']);
$smarty->assign('VALIDATION_DATA_FIELDLABEL',$validationArray['fieldlabel']);
$smarty->assign('EDIT_PERMISSION', isPermitted($currentModule, 'EditView', $record));
$smarty->assign('CHECK', $tool_buttons);
if(PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule.'_listquery'])){
$recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
VT_detailViewNavigation($smarty,$recordNavigationInfo,$focus->id);
}
$smarty->assign('IS_REL_LIST', isPresentRelatedLists($currentModule));
$smarty->assign('SinglePane_View', $singlepane_view);
if($singlepane_view == 'true') {
$related_array = getRelatedLists($currentModule,$focus);
$smarty->assign("RELATEDLISTS", $related_array);
require_once('include/ListView/RelatedListViewSession.php');
if(!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']),
vtlib_purify($_REQUEST['selected_header']));
}
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
}
if(isPermitted($currentModule, 'EditView', $record) == 'yes')
$smarty->assign('EDIT_DUPLICATE', 'permitted');
if(isPermitted($currentModule, 'Delete', $record) == 'yes')
$smarty->assign('DELETE', 'permitted');
$smarty->assign('BLOCKS', getBlocks($currentModule,'detail_view','',$focus->column_fields));
// Gather the custom link information to display
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'RECORD'=>$focus->id, 'ACTION'=>vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('DETAILVIEWBASIC','DETAILVIEW','DETAILVIEWWIDGET'), $customlink_params));
// END
// Record Change Notification
$focus->markAsViewed($current_user->id);
// END
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display('DetailView.tpl');
?>
@@ -0,0 +1,41 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
global $currentModule;
$modObj = CRMEntity::getInstance($currentModule);
$ajaxaction = $_REQUEST["ajxaction"];
if($ajaxaction == 'DETAILVIEW')
{
$crmid = $_REQUEST['recordid'];
$tablename = $_REQUEST['tableName'];
$fieldname = $_REQUEST['fldName'];
$fieldvalue = utf8RawUrlDecode($_REQUEST['fieldValue']);
if($crmid != '')
{
$modObj->retrieve_entity_info($crmid, $currentModule);
$modObj->column_fields[$fieldname] = $fieldvalue;
$modObj->id = $crmid;
$modObj->mode = 'edit';
$modObj->save($currentModule);
if($modObj->id != '')
{
echo ':#:SUCCESS';
}else
{
echo ':#:FAILURE';
}
}else
{
echo ':#:FAILURE';
}
} elseif($ajaxaction == "LOADRELATEDLIST" || $ajaxaction == "DISABLEMODULE"){
require_once 'include/ListView/RelatedListViewContents.php';
}
?>
@@ -0,0 +1,72 @@
<?php
/*+********************************************************************************
* 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.
********************************************************************************/
global $mod_strings;
global $app_strings;
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module']=="PriceBooks")
{
$pricebook_id = vtlib_purify($_REQUEST['pricebook_id']);
$product_id = vtlib_purify($_REQUEST['record']);
$listprice = vtlib_purify($_REQUEST['listprice']);
$return_action = "CallRelatedList";
$return_id = vtlib_purify($_REQUEST['pricebook_id']);
}
else
{
$product_id = vtlib_purify($_REQUEST['record']);
$pricebook_id = vtlib_purify($_REQUEST['pricebook_id']);
$listprice = getListPrice($product_id,$pricebook_id);
$return_action = "CallRelatedList";
$return_id = vtlib_purify($_REQUEST['pricebook_id']);
}
$output='';
$output ='<div id="roleLay" style="display:block;" class="layerPopup">
<form action="index.php" name="index" onSubmit="if(verify_data(index) == true) gotoUpdateListPrice('.$return_id.','.$pricebook_id.','.$product_id.'); else document.getElementById(\'roleLay\').style.display=\'inline\'; return false;" >
<input type="hidden" name="module" value="Products">
<input type="hidden" name="action" value="UpdateListPrice">
<input type="hidden" name="record" value="'.$return_id.'">
<input type="hidden" name="pricebook_id" value="'.$pricebook_id.'">
<input type="hidden" name="product_id" value="'.$product_id.'">
<table border=0 cellspacing=0 cellpadding=5 width=100% class=layerHeadingULine>
<tr>
<td class=layerPopupHeading " align="left">'.$mod_strings["LBL_EDITLISTPRICE"].'</td>
<td align="right" class="small"><img src="' . vtiger_imageurl('close.gif', $theme) . '" border=0 alt="'.$app_strings["LBL_CLOSE"].'" title="'.$app_strings["LBL_CLOSE"].'" style="cursor:pointer" onClick="document.getElementById(\'editlistprice\').style.display=\'none\';"></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=5 width=95% align=center>
<tr>
<td class="small">
<table border=0 celspacing=0 cellpadding=5 width=100% align=center bgcolor=white>
<tr>
<td width="50%" class="cellLabel small"><b>'.$mod_strings["LBL_EDITLISTPRICE"].'</b></td>
<td width="50%" class="cellText small"><input class="dataInput" type="text" id="list_price" name="list_price" value="'.$listprice.'" /></td>
</tr>
</table>
</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=5 width=100% class="layerPopupTransport">
<tr>
<td colspan="3" align="center" class="small">
<input type="submit" name="button" value="'.$app_strings["LBL_SAVE_BUTTON_LABEL"].'" class="crmbutton small save">
<input title="'.$app_strings["LBL_CANCEL_BUTTON_LABEL"].'" accessKey="'.$app_strings["LBL_CANCEL_BUTTON_KEY"].'" class="crmbutton small cancel" onClick="document.getElementById(\'editlistprice\').style.display=\'none\';" type="button" name="button" value="'.$app_strings["LBL_CANCEL_BUTTON_LABEL"].'">
</td>
</tr>
</table>
</form>
</div>';
echo $output;
?>
@@ -0,0 +1,113 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
global $app_strings, $mod_strings, $current_language, $currentModule, $theme;
require_once('Smarty_setup.php');
$focus = CRMEntity::getInstance($currentModule);
$smarty = new vtigerCRM_Smarty();
$category = getParentTab($currentModule);
$record = $_REQUEST['record'];
$isduplicate = vtlib_purify($_REQUEST['isDuplicate']);
//added to fix the issue4600
$searchurl = getBasic_Advance_SearchURL();
$smarty->assign("SEARCH", $searchurl);
//4600 ends
if($record) {
$focus->id = $record;
$focus->mode = 'edit';
$focus->retrieve_entity_info($record, $currentModule);
}
if($isduplicate == 'true') {
$focus->id = '';
$focus->mode = '';
}
if(empty($_REQUEST['record']) && $focus->mode != 'edit'){
setObjectValuesFromRequest($focus);
}
$disp_view = getView($focus->mode);
if($disp_view == 'edit_view')
$smarty->assign('BLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields));
else
$smarty->assign('BASBLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields, 'BAS'));
$smarty->assign('OP_MODE',$disp_view);
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('MODULE', $currentModule);
// TODO: Update Single Module Instance name here.
$smarty->assign('SINGLE_MOD', getTranslatedString('SINGLE_'.$currentModule));
$smarty->assign('CATEGORY', $category);
$smarty->assign("THEME", $theme);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
$smarty->assign('ID', $focus->id);
$smarty->assign('MODE', $focus->mode);
$smarty->assign('CHECK', Button_Check($currentModule));
$smarty->assign('DUPLICATE', $isduplicate);
if($focus->mode == 'edit' || $isduplicate) {
$recordName = array_values(getEntityName($currentModule, $record));
$recordName = $recordName[0];
$smarty->assign('NAME', $recordName);
$smarty->assign('UPDATEINFO',updateInfo($record));
}
if(isset($_REQUEST['return_module'])) $smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module']));
if(isset($_REQUEST['return_action'])) $smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action']));
if(isset($_REQUEST['return_id'])) $smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id']));
if (isset($_REQUEST['return_viewname'])) $smarty->assign("RETURN_VIEWNAME", vtlib_purify($_REQUEST['return_viewname']));
// Field Validation Information
$tabid = getTabid($currentModule);
$validationData = getDBValidationData($focus->tab_name,$tabid);
$validationArray = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME",$validationArray['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$validationArray['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$validationArray['fieldlabel']);
// In case you have a date field
$smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
global $adb;
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if($focus->mode != 'edit' && $mod_seq_field != null) {
$autostr = getTranslatedString('MSG_AUTO_GEN_ON_SAVE');
$mod_seq_string = $adb->pquery("SELECT prefix, cur_id from vtiger_modentity_num where semodule = ? and active=1",array($currentModule));
$mod_seq_prefix = $adb->query_result($mod_seq_string,0,'prefix');
$mod_seq_no = $adb->query_result($mod_seq_string,0,'cur_id');
if($adb->num_rows($mod_seq_string) == 0 || $focus->checkModuleSeqNumber($focus->table_name, $mod_seq_field['column'], $mod_seq_prefix.$mod_seq_no))
echo '<br><font color="#FF0000"><b>'. getTranslatedString('LBL_DUPLICATE'). ' '. getTranslatedString($mod_seq_field['label'])
.' - '. getTranslatedString('LBL_CLICK') .' <a href="index.php?module=Settings&action=CustomModEntityNo&parenttab=Settings&selmodule='.$currentModule.'">'.getTranslatedString('LBL_HERE').'</a> '
. getTranslatedString('LBL_TO_CONFIGURE'). ' '. getTranslatedString($mod_seq_field['label']) .'</b></font>';
else
$smarty->assign("MOD_SEQ_ID",$autostr);
} else {
$smarty->assign("MOD_SEQ_ID", $focus->column_fields[$mod_seq_field['name']]);
}
// END
// Gather the help information associated with fields
$smarty->assign('FIELDHELPINFO', vtlib_getFieldHelpInfo($currentModule));
// END
if($focus->mode == 'edit') {
$smarty->display('salesEditView.tpl');
} else {
$smarty->display('CreateView.tpl');
}
?>
@@ -0,0 +1,12 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
require_once('include/utils/ExportRecords.php');
?>
@@ -0,0 +1,106 @@
<?php
/*+********************************************************************************
* 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.
********************************************************************************/
require_once('Smarty_setup.php');
require_once('include/utils/utils.php');
require_once('database/DatabaseConnection.php');
global $mod_strings, $app_strings, $app_list_strings;
global $current_language, $currentModule, $current_userid, $theme;
require_once('themes/'.$theme.'/layout_utils.php');
$req_module = vtlib_purify($_REQUEST['module']);
$focus = CRMEntity::getInstance($req_module);
$return_module=vtlib_purify($_REQUEST['module']);
$delete_idstring=vtlib_purify($_REQUEST['idlist']);
$parenttab = getParenttab();
$smarty = new vtigerCRM_Smarty;
$ids_list = array();
$errormsg = '';
if(isset($_REQUEST['del_rec']))
{
$url = getBasic_Advance_SearchURL();
$delete_id_array=explode(",",$delete_idstring,-1);
foreach ($delete_id_array as $id)
{
if(isPermitted($req_module,'Delete',$id) == 'yes') {
$sql="update vtiger_crmentity set deleted=1 where crmid=?";
$result = $adb->pquery($sql, array($id));
DeleteEntity($req_module,$return_module,$focus,$id,"");
}
else {
$ids_list[] = $id;
}
}
if(count($ids_list) > 0) {
$ret = getEntityName($req_module,$ids_list);
if(count($ret) > 0)
{
$errormsg = implode(',',$ret);
}
echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>
<table border='0' cellpadding='5' cellspacing='0' width='98%'>
<tbody><tr>
<td rowspan='2' width='11%'><img src='themes/$theme/images/denied.gif' ></td>
<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'>
<span class='genHeaderSmall'>$app_strings[LBL_DUP_PERMISSION] $req_module $errormsg</span></td>
</tr>
<tr>
<td class='small' align='right' nowrap='nowrap'>
<a href='javascript:window.location.reload();'>$app_strings[LBL_GO_BACK]</a><br>
</td>
</tr>
</tbody></table>
</div>";
echo "</td></tr></table>";
exit;
}
}
include("include/saveMergeCriteria.php");
$ret_arr=getDuplicateRecordsArr($req_module);
$fld_values=$ret_arr[0];
$total_num_group=count($fld_values);
$fld_name=$ret_arr[1];
$ui_type=$ret_arr[2];
$smarty->assign("NAVIGATION",$ret_arr["navigation"]);//Added for page navigation
$smarty->assign("MODULE",$req_module);
$smarty->assign("NUM_GROUP",$total_num_group);
$smarty->assign("FIELD_NAMES",$fld_name);
$smarty->assign("CATEGORY",$parenttab);
$smarty->assign("ALL_VALUES",$fld_values);
if(isPermitted($req_module,'Delete','') == 'yes')
$button_del = $app_strings['LBL_MASS_DELETE'];
$smarty->assign("DELETE",$button_del);
$smarty->assign("MOD", return_module_language($current_language,$req_module));
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("MODE",'view');
if(isset($_REQUEST['button_view']))
{
$smarty->assign("VIEW",'true');
}
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("FindDuplicateAjax.tpl");
else
$smarty->display('FindDuplicateDisplay.tpl');
?>
@@ -0,0 +1,12 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
require_once('modules/Import/index.php');
?>
@@ -0,0 +1,36 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
global $theme, $log;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$currencyid = $_REQUEST['currencyid'];
$products_list = $_REQUEST['productsList'];
$product_ids = explode("::", $products_list);
$price_list = array();
if (count($product_ids) > 0) {
$product_prices = getPricesForProducts($currencyid, $product_ids);
}
// To get the Price Values in the same order as the Products
for ($i=0;$i<count($product_ids);++$i) {
$product_id = $product_ids[$i];
$price_list[] = $product_prices[$product_id];
}
$price_values = implode("::", $price_list);
echo "SUCCESS$".$price_values;
?>
@@ -0,0 +1,68 @@
<?php
/*+********************************************************************************
* 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.
********************************************************************************/
global $theme, $mod_strings, $app_strings;
$theme_path="themes/".$theme."/";
$productid = vtlib_purify($_REQUEST['productid']);
$rowid = vtlib_purify($_REQUEST['curr_row']);
$product_total = vtlib_purify($_REQUEST['productTotal']);
$tax_details = getTaxDetailsForProduct($productid,'all');//we should pass available instead of all if we want to display only the available taxes.
$associated_tax_count = count($tax_details);
$tax_div = '
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small" id="tax_table'.$rowid.'">
<tr>
<td id="tax_div_title'.$rowid.'" nowrap align="left" ><b>'.$app_strings['LABEL_SET_TAX_FOR'].' : '.$product_total.'</b></td>
<td>&nbsp;</td>
<td align="right"><img src="'. vtiger_imageurl('close.gif', $theme) .'" border="0" onClick="fnHidePopDiv(\'tax_div'.$rowid.'\')" style="cursor:pointer;"></td>
</tr>
';
$net_tax_total = 0.00;
for($i=0,$j=$i+1;$i<count($tax_details);$i++,$j++)
{
$tax_name = $tax_details[$i]['taxname'];
$tax_label = $tax_details[$i]['taxlabel'];
$tax_percentage = $tax_details[$i]['percentage'];
$tax_name_percentage = $tax_name."_percentage".$rowid;
$tax_id_name = "hidden_tax".$j."_percentage".$rowid;//used to store the tax name, used in function callTaxCalc
$tax_name_total = "popup_tax_row".$rowid;//$tax_name."_total".$rowid;
$tax_total = $product_total*$tax_percentage/100.00;
$net_tax_total += $tax_total;
$tax_div .= '
<tr>
<td align="left" class="lineOnTop">
<input type="text" class="small" size="5" name="'.$tax_name_percentage.'" id="'.$tax_name_percentage.'" value="'.$tax_percentage.'" onBlur="calcCurrentTax(\''.$tax_name_percentage.'\','.$rowid.','.$i.');calcTotal();">&nbsp;%
<input type="hidden" id="'.$tax_id_name.'" value="'.$tax_name_percentage.'">
</td>
<td align="center" class="lineOnTop">'.$tax_label.'</td>
<td align="right" class="lineOnTop">
<input type="text" class="small" size="6" name="'.$tax_name_total.'" id="'.$tax_name_total.'" style="cursor:pointer;" value="'.$tax_total.'" readonly>
</td>
</tr>
';
}
$tax_div .= '</table>';
if($associated_tax_count == 0)
{
$tax_div .= '<div align="left" class="lineOnTop" width="100%">'.$mod_strings['LBL_NO_TAXES_ASSOCIATED'].'.</div>';
}
$tax_div .= '<input type="hidden" id="hdnTaxTotal'.$rowid.'" name="hdnTaxTotal'.$rowid.'" value="'.$net_tax_total.'">';
echo $tax_div;
?>
@@ -0,0 +1,212 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
global $app_strings, $mod_strings, $current_language, $currentModule, $theme;
global $list_max_entries_per_page;
require_once('Smarty_setup.php');
require_once('include/ListView/ListView.php');
require_once('modules/CustomView/CustomView.php');
require_once('include/DatabaseUtil.php');
checkFileAccess("modules/$currentModule/$currentModule.php");
require_once("modules/$currentModule/$currentModule.php");
$category = getParentTab();
$url_string = '';
$tool_buttons = Button_Check($currentModule);
$list_buttons = Array();
if(isPermitted($currentModule,'Delete','') == 'yes') $list_buttons['del'] = $app_strings[LBL_MASS_DELETE];
if(isPermitted($currentModule,'EditView','') == 'yes') {
$list_buttons['mass_edit'] = $app_strings[LBL_MASS_EDIT];
// Mass Edit could be used to change the owner as well!
//$list_buttons['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
$focus = new $currentModule();
$focus->initSortbyField($currentModule);
$sorder = $focus->getSortOrder();
$order_by = $focus->getOrderBy();
$_SESSION[$currentModule."_Order_By"] = $order_by;
$_SESSION[$currentModule."_Sort_Order"]=$sorder;
$smarty = new vtigerCRM_Smarty();
// Identify this module as custom module.
$smarty->assign('CUSTOM_MODULE', true);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('APP', $app_strings);
$smarty->assign('MODULE', $currentModule);
$smarty->assign('SINGLE_MOD', getTranslatedString('SINGLE_'.$currentModule));
$smarty->assign('CATEGORY', $category);
$smarty->assign('BUTTONS', $list_buttons);
$smarty->assign('CHECK', $tool_buttons);
$smarty->assign('THEME', $theme);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
$smarty->assign('CHANGE_OWNER', getUserslist());
$smarty->assign('CHANGE_GROUP_OWNER', getGroupslist());
// Custom View
$customView = new CustomView($currentModule);
$viewid = $customView->getViewId($currentModule);
$customview_html = $customView->getCustomViewCombo($viewid);
$viewinfo = $customView->getCustomViewByCvid($viewid);
// Feature available from 5.1
if(method_exists($customView, 'isPermittedChangeStatus')) {
// Approving or Denying status-public by the admin in CustomView
$statusdetails = $customView->isPermittedChangeStatus($viewinfo['status']);
// To check if a user is able to edit/delete a CustomView
$edit_permit = $customView->isPermittedCustomView($viewid,'EditView',$currentModule);
$delete_permit = $customView->isPermittedCustomView($viewid,'Delete',$currentModule);
$smarty->assign("CUSTOMVIEW_PERMISSION",$statusdetails);
$smarty->assign("CV_EDIT_PERMIT",$edit_permit);
$smarty->assign("CV_DELETE_PERMIT",$delete_permit);
}
// END
$smarty->assign("VIEWID", $viewid);
if($viewinfo['viewname'] == 'All') $smarty->assign('ALL', 'All');
if($viewid ==0)
{
echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>
<table border='0' cellpadding='5' cellspacing='0' width='98%'>
<tbody><tr>
<td rowspan='2' width='11%'><img src='". vtiger_imageurl('denied.gif', $theme) ."' ></td>
<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span clas
s='genHeaderSmall'>$app_strings[LBL_PERMISSION]</span></td>
</tr>
<tr>
<td class='small' align='right' nowrap='nowrap'>
<a href='javascript:window.history.back();'>$app_strings[LBL_GO_BACK]</a><br>
</td>
</tr>
</tbody></table>
</div>";
echo "</td></tr></table>";
exit;
}
global $current_user;
$queryGenerator = new QueryGenerator($currentModule, $current_user);
if ($viewid != "0") {
$queryGenerator->initForCustomViewById($viewid);
} else {
$queryGenerator->initForDefaultCustomView();
}
// Enabling Module Search
$url_string = '';
if($_REQUEST['query'] == 'true') {
$queryGenerator->addUserSearchConditions($_REQUEST);
$ustring = getSearchURL($_REQUEST);
$url_string .= "&query=true$ustring";
$smarty->assign('SEARCH_URL', $url_string);
}
$list_query = $queryGenerator->getQuery();
$where = $queryGenerator->getConditionalWhere();
if(isset($where) && $where != '') {
$_SESSION['export_where'] = $where;
} else {
unset($_SESSION['export_where']);
}
// Sorting
if(!empty($order_by)) {
if($order_by == 'smownerid') $list_query .= ' ORDER BY user_name '.$sorder;
else {
$tablename = getTableNameForField($currentModule, $order_by);
$tablename = ($tablename != '')? ($tablename . '.') : '';
$list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
}
}
//Postgres 8 fixes
if( $adb->dbType == "pgsql")
$list_query = fixPostgresQuery( $list_query, $log, 0);
if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){
$count_result = $adb->query( mkCountQuery( $list_query));
$noofrows = $adb->query_result($count_result,0,"count");
}else{
$noofrows = null;
}
$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true');
$start = ListViewSession::getRequestCurrentPage($currentModule, $list_query, $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start,$list_max_entries_per_page,$noofrows);
$limit_start_rec = ($start-1) * $list_max_entries_per_page;
if( $adb->dbType == "pgsql")
$list_result = $adb->pquery($list_query. " OFFSET $limit_start_rec LIMIT $list_max_entries_per_page", array());
else
$list_result = $adb->pquery($list_query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array());
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec,$noofrows);
$smarty->assign('recordListRange',$recordListRangeMsg);
$smarty->assign("CUSTOMVIEW_OPTION",$customview_html);
// Navigation
$navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string, $currentModule, 'index', $viewid);
$smarty->assign("NAVIGATION", $navigationOutput);
$controller = new ListViewController($adb, $current_user, $queryGenerator);
$listview_header = $controller->getListViewHeader($focus,$currentModule,$url_string,$sorder,
$order_by);
$listview_entries = $controller->getListViewEntries($focus,$currentModule,$list_result,
$navigation_array);
$listview_header_search = $controller->getBasicSearchFieldInfoList();
$smarty->assign('LISTHEADER', $listview_header);
$smarty->assign('LISTENTITY', $listview_entries);
$smarty->assign('SEARCHLISTHEADER',$listview_header_search);
// Module Search
$alphabetical = AlphabeticalSearch($currentModule,'index',$focus->def_basicsearch_col,'true','basic','','','','',$viewid);
$fieldnames = $controller->getAdvancedSearchOptionString();
$criteria = getcriteria_options();
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("AVALABLE_FIELDS", getMergeFields($currentModule,"available_fields"));
$smarty->assign("FIELDS_TO_MERGE", getMergeFields($currentModule,"fileds_to_merge"));
//Added to select Multiple records in multiple pages
$smarty->assign("SELECTEDIDS", vtlib_purify($_REQUEST['selobjs']));
$smarty->assign("ALLSELECTEDIDS", vtlib_purify($_REQUEST['allselobjs']));
$smarty->assign("CURRENT_PAGE_BOXES", implode(array_keys($listview_entries),";"));
$_SESSION[$currentModule.'_listquery'] = $list_query;
// Gather the custom link information to display
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'ACTION'=>vtlib_purify($_REQUEST['action']), 'CATEGORY'=> $category);
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('LISTVIEWBASIC','LISTVIEW'), $customlink_params));
// END
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("ListViewEntries.tpl");
else
$smarty->display('ListView.tpl');
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* 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.
*********************************************************************************/
require_once 'include/ListView/ListViewPagging.php';
?>
@@ -0,0 +1,44 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
global $mod_strings,$app_strings,$theme,$currentModule,$current_user;
require_once('Smarty_setup.php');
require_once('include/utils/utils.php');
$focus = CRMEntity::getInstance($currentModule);
$focus->mode = '';
$mode = 'mass_edit';
$disp_view = getView($focus->mode);
$idstring = $_REQUEST['idstring'];
$smarty = new vtigerCRM_Smarty;
$smarty->assign('MODULE',$currentModule);
$smarty->assign('APP',$app_strings);
$smarty->assign('THEME', $theme);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
$smarty->assign('IDS',$idstring);
$smarty->assign('MASS_EDIT','1');
$smarty->assign('BLOCKS',getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));
$smarty->assign("CATEGORY",getParentTab());
// Field Validation Information
$tabid = getTabid($currentModule);
$validationData = getDBValidationData($focus->tab_name,$tabid);
$validationArray = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME",$validationArray['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$validationArray['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$validationArray['fieldlabel']);
$smarty->display('MassEditForm.tpl');
?>

Some files were not shown because too many files have changed in this diff Show More