更新到 5.2 正式版后第一次 SVN 提交。
yuchenghu@hawebs.net git-svn-id: https://svn.code.sf.net/p/hawebs/svn@571 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
<?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/utils.php');
|
||||
|
||||
global $app_strings, $default_charset, $currentModule, $current_user, $theme;
|
||||
|
||||
$smarty = new vtigerCRM_Smarty;
|
||||
if (!isset($where)) $where = "";
|
||||
|
||||
$parent_tab=getParentTab();
|
||||
$smarty->assign("CATEGORY",$parent_tab);
|
||||
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
|
||||
$smarty->assign("MOD", $mod_strings);
|
||||
$smarty->assign("APP", $app_strings);
|
||||
$smarty->assign("THEME", $theme);
|
||||
$smarty->assign("IMAGE_PATH",$image_path);
|
||||
$smarty->assign("MODULE",$currentModule);
|
||||
|
||||
$check_button = Button_Check($currentModule);
|
||||
$check_button['Import'] = 'no';
|
||||
$check_button['Export'] = 'no';
|
||||
$check_button['moduleSettings'] = 'no';
|
||||
$smarty->assign("CHECK", $check_button);
|
||||
|
||||
$focus = CRMEntity::getInstance($currentModule);
|
||||
$accountid = vtlib_purify($_REQUEST['accountid']);
|
||||
if (!empty($accountid)) {
|
||||
$hierarchy = $focus->getAccountHierarchy($accountid);
|
||||
}
|
||||
$smarty->assign("ACCOUNT_HIERARCHY",$hierarchy);
|
||||
$smarty->display("AccountHierarchy.tpl");
|
||||
|
||||
?>
|
||||
@@ -1,414 +0,0 @@
|
||||
/*********************************************************************************
|
||||
|
||||
** 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.
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
document.write("<script type='text/javascript' src='include/js/Inventory.js'></"+"script>");
|
||||
document.write("<script type='text/javascript' src='include/js/Mail.js'></"+"script>");
|
||||
document.write("<script type='text/javascript' src='include/js/Merge.js'></"+"script>");
|
||||
|
||||
function set_return(product_id, product_name) {
|
||||
if(document.getElementById('from_link').value != '') {
|
||||
window.opener.document.QcEditView.parent_name.value = product_name;
|
||||
window.opener.document.QcEditView.parent_id.value = product_id;
|
||||
} else {
|
||||
window.opener.document.EditView.parent_name.value = product_name;
|
||||
window.opener.document.EditView.parent_id.value = product_id;
|
||||
}
|
||||
}
|
||||
function set_return_specific(product_id, product_name) {
|
||||
|
||||
//getOpenerObj used for DetailView
|
||||
if(document.getElementById('from_link').value != '')
|
||||
{
|
||||
var fldName = window.opener.document.QcEditView.account_name;
|
||||
var fldId = window.opener.document.QcEditView.account_id;
|
||||
}else
|
||||
{
|
||||
var fldName = window.opener.document.EditView.account_name;
|
||||
var fldId = window.opener.document.EditView.account_id;
|
||||
}
|
||||
fldName.value = product_name;
|
||||
fldId.value = product_id;
|
||||
}
|
||||
function add_data_to_relatedlist(entity_id,recordid) {
|
||||
|
||||
opener.document.location.href="index.php?module=Emails&action=updateRelations&destination_module=Accounts&entityid="+entity_id+"&parentid="+recordid;
|
||||
}
|
||||
function set_return_formname_specific(formname,product_id, product_name) {
|
||||
window.opener.document.EditView1.account_name.value = product_name;
|
||||
window.opener.document.EditView1.account_id.value = product_id;
|
||||
}
|
||||
function set_return_address(account_id, account_name, bill_street, ship_street, bill_city, ship_city, bill_state, ship_state, bill_code, ship_code, bill_country, ship_country,bill_pobox,ship_pobox) {
|
||||
if(document.getElementById('from_link').value != '') {
|
||||
window.opener.document.QcEditView.account_name.value = account_name;
|
||||
window.opener.document.QcEditView.account_id.value = account_id;
|
||||
} else {
|
||||
window.opener.document.EditView.account_name.value = account_name;
|
||||
window.opener.document.EditView.account_id.value = account_id;
|
||||
}
|
||||
|
||||
//Ask the user to overwite the address or not - Modified on 06-01-2007
|
||||
if(confirm(alert_arr.OVERWRITE_EXISTING_ACCOUNT1+account_name+alert_arr.OVERWRITE_EXISTING_ACCOUNT2))
|
||||
{
|
||||
//made changes to avoid js error -- ref : hidding fields causes js error(ticket#4017)
|
||||
if(document.getElementById('from_link').value != '') {
|
||||
if(typeof(window.opener.document.QcEditView.bill_street) != 'undefined')
|
||||
window.opener.document.QcEditView.bill_street.value = bill_street;
|
||||
if(typeof(window.opener.document.QcEditView.ship_street) != 'undefined')
|
||||
window.opener.document.QcEditView.ship_street.value = ship_street;
|
||||
if(typeof(window.opener.document.QcEditView.bill_city) != 'undefined')
|
||||
window.opener.document.QcEditView.bill_city.value = bill_city;
|
||||
if(typeof(window.opener.document.QcEditView.ship_city) != 'undefined')
|
||||
window.opener.document.QcEditView.ship_city.value = ship_city;
|
||||
if(typeof(window.opener.document.QcEditView.bill_state) != 'undefined')
|
||||
window.opener.document.QcEditView.bill_state.value = bill_state;
|
||||
if(typeof(window.opener.document.QcEditView.ship_state) != 'undefined')
|
||||
window.opener.document.QcEditView.ship_state.value = ship_state;
|
||||
if(typeof(window.opener.document.QcEditView.bill_code) != 'undefined')
|
||||
window.opener.document.QcEditView.bill_code.value = bill_code;
|
||||
if(typeof(window.opener.document.QcEditView.ship_code) != 'undefined')
|
||||
window.opener.document.QcEditView.ship_code.value = ship_code;
|
||||
if(typeof(window.opener.document.QcEditView.bill_country) != 'undefined')
|
||||
window.opener.document.QcEditView.bill_country.value = bill_country;
|
||||
if(typeof(window.opener.document.QcEditView.ship_country) != 'undefined')
|
||||
window.opener.document.QcEditView.ship_country.value = ship_country;
|
||||
if(typeof(window.opener.document.QcEditView.bill_pobox) != 'undefined')
|
||||
window.opener.document.QcEditView.bill_pobox.value = bill_pobox;
|
||||
if(typeof(window.opener.document.QcEditView.ship_pobox) != 'undefined')
|
||||
window.opener.document.QcEditView.ship_pobox.value = ship_pobox;
|
||||
} else {
|
||||
if(typeof(window.opener.document.EditView.bill_street) != 'undefined')
|
||||
window.opener.document.EditView.bill_street.value = bill_street;
|
||||
if(typeof(window.opener.document.EditView.ship_street) != 'undefined')
|
||||
window.opener.document.EditView.ship_street.value = ship_street;
|
||||
if(typeof(window.opener.document.EditView.bill_city) != 'undefined')
|
||||
window.opener.document.EditView.bill_city.value = bill_city;
|
||||
if(typeof(window.opener.document.EditView.ship_city) != 'undefined')
|
||||
window.opener.document.EditView.ship_city.value = ship_city;
|
||||
if(typeof(window.opener.document.EditView.bill_state) != 'undefined')
|
||||
window.opener.document.EditView.bill_state.value = bill_state;
|
||||
if(typeof(window.opener.document.EditView.ship_state) != 'undefined')
|
||||
window.opener.document.EditView.ship_state.value = ship_state;
|
||||
if(typeof(window.opener.document.EditView.bill_code) != 'undefined')
|
||||
window.opener.document.EditView.bill_code.value = bill_code;
|
||||
if(typeof(window.opener.document.EditView.ship_code) != 'undefined')
|
||||
window.opener.document.EditView.ship_code.value = ship_code;
|
||||
if(typeof(window.opener.document.EditView.bill_country) != 'undefined')
|
||||
window.opener.document.EditView.bill_country.value = bill_country;
|
||||
if(typeof(window.opener.document.EditView.ship_country) != 'undefined')
|
||||
window.opener.document.EditView.ship_country.value = ship_country;
|
||||
if(typeof(window.opener.document.EditView.bill_pobox) != 'undefined')
|
||||
window.opener.document.EditView.bill_pobox.value = bill_pobox;
|
||||
if(typeof(window.opener.document.EditView.ship_pobox) != 'undefined')
|
||||
window.opener.document.EditView.ship_pobox.value = ship_pobox;
|
||||
}
|
||||
//end
|
||||
}
|
||||
}
|
||||
//added to populate address
|
||||
function set_return_contact_address(account_id, account_name, bill_street, ship_street, bill_city, ship_city, bill_state, ship_state, bill_code, ship_code, bill_country, ship_country,bill_pobox,ship_pobox ) {
|
||||
if(document.getElementById('from_link').value != '') {
|
||||
if(typeof(window.opener.document.QcEditView.account_name) != 'undefined')
|
||||
window.opener.document.QcEditView.account_name.value = account_name;
|
||||
if(typeof(window.opener.document.QcEditView.account_id) != 'undefined')
|
||||
window.opener.document.QcEditView.account_id.value = account_id;
|
||||
} else {
|
||||
if(typeof(window.opener.document.EditView.account_name) != 'undefined')
|
||||
window.opener.document.EditView.account_name.value = account_name;
|
||||
if(typeof(window.opener.document.EditView.account_id) != 'undefined')
|
||||
window.opener.document.EditView.account_id.value = account_id;
|
||||
if(typeof(window.opener.document.EditView.mailingstreet) != 'undefined')
|
||||
window.opener.document.EditView.mailingstreet.value = bill_street;
|
||||
if(typeof(window.opener.document.EditView.otherstreet) != 'undefined')
|
||||
window.opener.document.EditView.otherstreet.value = ship_street;
|
||||
if(typeof(window.opener.document.EditView.mailingcity) != 'undefined')
|
||||
window.opener.document.EditView.mailingcity.value = bill_city;
|
||||
if(typeof(window.opener.document.EditView.othercity) != 'undefined')
|
||||
window.opener.document.EditView.othercity.value = ship_city;
|
||||
if(typeof(window.opener.document.EditView.mailingstate) != 'undefined')
|
||||
window.opener.document.EditView.mailingstate.value = bill_state;
|
||||
if(typeof(window.opener.document.EditView.otherstate) != 'undefined')
|
||||
window.opener.document.EditView.otherstate.value = ship_state;
|
||||
if(typeof(window.opener.document.EditView.mailingzip) != 'undefined')
|
||||
window.opener.document.EditView.mailingzip.value = bill_code;
|
||||
if(typeof(window.opener.document.EditView.otherzip) != 'undefined')
|
||||
window.opener.document.EditView.otherzip.value = ship_code;
|
||||
if(typeof(window.opener.document.EditView.mailingcountry) != 'undefined')
|
||||
window.opener.document.EditView.mailingcountry.value = bill_country;
|
||||
if(typeof(window.opener.document.EditView.othercountry) != 'undefined')
|
||||
window.opener.document.EditView.othercountry.value = ship_country;
|
||||
if(typeof(window.opener.document.EditView.mailingpobox) != 'undefined')
|
||||
window.opener.document.EditView.mailingpobox.value = bill_pobox;
|
||||
if(typeof(window.opener.document.EditView.otherpobox) != 'undefined')
|
||||
window.opener.document.EditView.otherpobox.value = ship_pobox;
|
||||
}
|
||||
}
|
||||
|
||||
//added by rdhital/Raju for emails
|
||||
function submitform(id){
|
||||
document.massdelete.entityid.value=id;
|
||||
document.massdelete.submit();
|
||||
}
|
||||
|
||||
function searchMapLocation(addressType)
|
||||
{
|
||||
var mapParameter = '';
|
||||
if (addressType == 'Main')
|
||||
{
|
||||
if(fieldname.indexOf('bill_street') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_street')]))
|
||||
mapParameter = document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_street')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('bill_pobox') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_pobox')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_pobox')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('bill_city') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_city')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_city')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('bill_state') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_state')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_state')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('bill_country') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_country')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_country')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('bill_code') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_code')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_code')]).innerHTML+' ';
|
||||
}
|
||||
}
|
||||
else if (addressType == 'Other')
|
||||
{
|
||||
if(fieldname.indexOf('ship_street') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_street')]))
|
||||
mapParameter = document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_street')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('ship_pobox') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_pobox')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_pobox')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('ship_city') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_city')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_city')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('ship_state') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_state')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_state')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('ship_country') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_country')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_country')]).innerHTML+' ';
|
||||
}
|
||||
if(fieldname.indexOf('ship_code') > -1)
|
||||
{
|
||||
if(document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_code')]))
|
||||
mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_code')]).innerHTML+' ';
|
||||
}
|
||||
|
||||
}
|
||||
mapParameter = removeHTMLFormatting(mapParameter);
|
||||
window.open('http://maps.google.com/maps?q='+mapParameter,'goolemap','height=450,width=700,resizable=no,titlebar,location,top=200,left=250');
|
||||
}
|
||||
//javascript function will open new window to display traffic details for particular url using alexa.com
|
||||
function getRelatedLink()
|
||||
{
|
||||
var param='';
|
||||
param = getObj("website").value;
|
||||
window.open('http://www.alexa.com/data/details/traffic_details?q=&url='+param,'relatedlink','height=400,width=700,resizable=no,titlebar,location,top=250,left=250');
|
||||
}
|
||||
|
||||
/*
|
||||
* javascript function to populate fieldvalue in account editview
|
||||
* @param id1 :: div tag ID
|
||||
* @param id2 :: div tag ID
|
||||
*/
|
||||
function populateData(id1,id2)
|
||||
{
|
||||
document.EditView.description.value = document.getElementById('summary').innerHTML;
|
||||
document.EditView.employees.value = getObj('emp').value;
|
||||
document.EditView.website.value = getObj('site').value;
|
||||
document.EditView.phone.value = getObj('Phone').value;
|
||||
document.EditView.fax.value = getObj('Fax').value;
|
||||
document.EditView.bill_street.value = getObj('address').value;
|
||||
|
||||
showhide(id1,id2);
|
||||
}
|
||||
/*
|
||||
* javascript function to show/hide the div tag
|
||||
* @param argg1 :: div tag ID
|
||||
* @param argg2 :: div tag ID
|
||||
*/
|
||||
function showhide(argg1,argg2)
|
||||
{
|
||||
var x=document.getElementById(argg1).style;
|
||||
var y=document.getElementById(argg2).style;
|
||||
if (y.display=="none")
|
||||
{
|
||||
y.display="block"
|
||||
x.display="none"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// JavaScript Document
|
||||
|
||||
if (document.all) var browser_ie=true
|
||||
else if (document.layers) var browser_nn4=true
|
||||
else if (document.layers || (!document.all && document.getElementById)) var browser_nn6=true
|
||||
|
||||
function getObj(n,d) {
|
||||
var p,i,x;
|
||||
if(!d)d=document;
|
||||
if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
|
||||
if(!(x=d[n])&&d.all)x=d.all[n];
|
||||
for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
|
||||
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=getObj(n,d.layers[i].document);
|
||||
if(!x && d.getElementById) x=d.getElementById(n);
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
function findPosX(obj) {
|
||||
var curleft = 0;
|
||||
if (document.getElementById || document.all) {
|
||||
while (obj.offsetParent) { curleft += obj.offsetLeft; obj = obj.offsetParent;}
|
||||
}
|
||||
else if (document.layers) { curleft += obj.x; }
|
||||
return curleft;
|
||||
}
|
||||
|
||||
|
||||
function findPosY(obj) {
|
||||
var curtop = 0;
|
||||
if (document.getElementById || document.all) {
|
||||
while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; }
|
||||
}
|
||||
else if (document.layers) {curtop += obj.y;}
|
||||
return curtop;
|
||||
}
|
||||
|
||||
ScrollEffect = function(){ };
|
||||
ScrollEffect.lengthcount=202;
|
||||
ScrollEffect.closelimit=0;
|
||||
ScrollEffect.limit=0;
|
||||
|
||||
|
||||
function just(){
|
||||
ig=getObj("company");
|
||||
if(ScrollEffect.lengthcount > ScrollEffect.closelimit ){closet();return;}
|
||||
ig.style.display="block";
|
||||
ig.style.height=ScrollEffect.lengthcount+'px';
|
||||
ScrollEffect.lengthcount=ScrollEffect.lengthcount+10;
|
||||
if(ScrollEffect.lengthcount < ScrollEffect.limit){setTimeout("just()",25);}
|
||||
else{ getObj("innerLayer").style.display="block";return;}
|
||||
}
|
||||
|
||||
function closet(){
|
||||
ig=getObj("company");
|
||||
getObj("innerLayer").style.display="none";
|
||||
ScrollEffect.lengthcount=ScrollEffect.lengthcount-10;
|
||||
ig.style.height=ScrollEffect.lengthcount+'px';
|
||||
if(ScrollEffect.lengthcount<20){ig.style.display="none";return;}
|
||||
else{setTimeout("closet()", 25);}
|
||||
}
|
||||
|
||||
|
||||
function fnDown(obj){
|
||||
var tagName = document.getElementById(obj);
|
||||
document.EditView.description.value = document.getElementById('summary').innerHTML;
|
||||
document.EditView.employees.value = getObj('emp').value;
|
||||
document.EditView.website.value = getObj('site').value;
|
||||
document.EditView.phone.value = getObj('Phone').value;
|
||||
document.EditView.fax.value = getObj('Fax').value;
|
||||
document.EditView.bill_street.value = getObj('address').value;
|
||||
if(tagName.style.display == 'none')
|
||||
tagName.style.display = 'block';
|
||||
else
|
||||
tagName.style.display = 'none';
|
||||
}
|
||||
|
||||
function set_return_todo(product_id, product_name) {
|
||||
window.opener.document.createTodo.task_parent_name.value = product_name;
|
||||
window.opener.document.createTodo.task_parent_id.value = product_id;
|
||||
}
|
||||
//When changing the Account Address Information it should also change the related contact address.
|
||||
function checkAddress(form,id)
|
||||
{
|
||||
var url='';
|
||||
if(typeof(form.bill_street) != 'undefined')
|
||||
url +="&bill_street="+form.bill_street.value;
|
||||
if(typeof(form.ship_street) != 'undefined')
|
||||
url +="&ship_street="+form.ship_street.value;
|
||||
if(typeof(form.bill_city) != 'undefined')
|
||||
url +="&bill_city="+form.bill_city.value;
|
||||
if(typeof(form.ship_city) != 'undefined')
|
||||
url +="&ship_city="+form.ship_city.value;
|
||||
if(typeof(form.bill_state) != 'undefined')
|
||||
url +="&bill_state="+form.bill_state.value;
|
||||
if(typeof(form.ship_state) != 'undefined')
|
||||
url +="&ship_state="+form.ship_state.value;
|
||||
if(typeof(form.bill_code) != 'undefined')
|
||||
url +="&bill_code="+ form.bill_code.value;
|
||||
if(typeof(form.ship_code) != 'undefined')
|
||||
url +="&ship_code="+ form.ship_code.value;
|
||||
if(typeof(form.bill_country) != 'undefined')
|
||||
url +="&bill_country="+form.bill_country.value;
|
||||
if(typeof(form.ship_country) != 'undefined')
|
||||
url +="&ship_country="+form.ship_country.value;
|
||||
if(typeof(form.bill_pobox) != 'undefined')
|
||||
url +="&bill_pobox="+ form.bill_pobox.value;
|
||||
if(typeof(form.ship_pobox) != 'undefined')
|
||||
url +="&ship_pobox="+ form.ship_pobox.value;
|
||||
|
||||
url +="&record="+id;
|
||||
|
||||
$("status").style.display="inline";
|
||||
new Ajax.Request(
|
||||
'index.php',
|
||||
{queue: {position: 'end', scope: 'command'},
|
||||
method: 'post',
|
||||
postBody:"module=Accounts&action=AccountsAjax&ajax=true&file=AddressChange"+url,
|
||||
onComplete: function(response) {
|
||||
if(response.responseText == 'address_change')
|
||||
{
|
||||
if(confirm(alert_arr.WANT_TO_CHANGE_CONTACT_ADDR) == true)
|
||||
{
|
||||
form.address_change.value='yes';
|
||||
form.submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
//Changing account address info - ENDS
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
<?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');
|
||||
?>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?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/Accounts/Accounts.php');
|
||||
require_once('modules/Contacts/Contacts.php');
|
||||
require_once('include/utils/utils.php');
|
||||
require_once('user_privileges/default_module_view.php');
|
||||
global $adb;
|
||||
global $log;
|
||||
//When changing the Account Address Information it should also change the related contact address --Dinakaran
|
||||
$record = $_REQUEST['record'];
|
||||
$sql ="select vtiger_account.accountid,vtiger_accountbillads.bill_street as billingstreet, vtiger_accountbillads.bill_city as billingcity,vtiger_accountbillads.bill_code as billingcode,vtiger_accountbillads.bill_country as billingcountry,vtiger_accountbillads.bill_state as billingstate,vtiger_accountbillads.bill_pobox as billingpobox ,vtiger_accountshipads.* from vtiger_account inner join vtiger_accountbillads on vtiger_accountbillads.accountaddressid=vtiger_account.accountid inner join vtiger_accountshipads on vtiger_accountshipads.accountaddressid = vtiger_account.accountid where accountid=?";
|
||||
//$sql ="select vtiger_account.accountid,vtiger_accountbillads.* ,vtiger_accountshipads.* from vtiger_accountbillads,vtiger_accountshipads,vtiger_account where accountid =".$record;
|
||||
$result = $adb->pquery($sql, array($record));
|
||||
$value = $adb->fetch_row($result);
|
||||
|
||||
if(($_REQUEST['bill_city'] != $value['billingcity'] && isset($_REQUEST['bill_city'])) ||
|
||||
($_REQUEST['bill_street'] != $value['billingstreet'] && isset($_REQUEST['bill_street'])) ||
|
||||
($_REQUEST['bill_country']!=$value['billingcountry'] && isset($_REQUEST['bill_country']))||
|
||||
($_REQUEST['bill_code']!=$value['billingcode'] && isset($_REQUEST['bill_code']))||
|
||||
($_REQUEST['bill_pobox']!=$value['billingpobox'] && isset($_REQUEST['bill_pobox'])) ||
|
||||
($_REQUEST['bill_state']!=$value['billingstate'] && isset($_REQUEST['bill_state']))||
|
||||
($_REQUEST['ship_country']!=$value['ship_country'] && isset($_REQUEST['ship_country']))||
|
||||
($_REQUEST['ship_city']!=$value['ship_city'] && isset($_REQUEST['ship_city']))||
|
||||
($_REQUEST['ship_state']!=$value['ship_state'] && isset($_REQUEST['ship_state']))||
|
||||
($_REQUEST['ship_code']!=$value['ship_code'] && isset($_REQUEST['ship_code']))||
|
||||
($_REQUEST['ship_street']!=$value['ship_street'] && isset($_REQUEST['ship_street']))||
|
||||
($_REQUEST['ship_pobox']!=$value['ship_pobox'] && isset($_REQUEST['ship_pobox'])))
|
||||
{
|
||||
$sql1="select contactid from vtiger_contactdetails where accountid=?";
|
||||
$result1 = $adb->pquery($sql1, array($record));
|
||||
if($adb->num_rows($result1) > 0)
|
||||
{
|
||||
echo 'address_change';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'No Changes';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'No Changes';
|
||||
}
|
||||
?>
|
||||
@@ -1,87 +0,0 @@
|
||||
<?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');
|
||||
//Redirecting Header for single page layout
|
||||
require_once('user_privileges/default_module_view.php');
|
||||
global $singlepane_view;
|
||||
$currentmodule = vtlib_purify($_REQUEST['module']);
|
||||
$RECORD = vtlib_purify($_REQUEST['record']);
|
||||
$category = getParentTab();
|
||||
if($singlepane_view == 'true' && $_REQUEST['action'] == 'CallRelatedList') {
|
||||
header("Location:index.php?action=DetailView&module=$currentmodule&record=$RECORD&parenttab=$category");
|
||||
} else {
|
||||
$focus = CRMEntity::getInstance($currentmodule);
|
||||
if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {
|
||||
$focus->retrieve_entity_info($RECORD,$currentmodule);
|
||||
$focus->id = $RECORD;
|
||||
$focus->name=$focus->column_fields['accountname'];
|
||||
$log->debug("id is ".$focus->id);
|
||||
$log->debug("name is ".$focus->name);
|
||||
}
|
||||
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
global $theme, $currentModule;
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
|
||||
$smarty = new vtigerCRM_Smarty;
|
||||
|
||||
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
|
||||
$focus->id = "";
|
||||
}
|
||||
if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') {
|
||||
$smarty->assign("OP_MODE",vtlib_purify($_REQUEST['mode']));
|
||||
}
|
||||
if(!$_SESSION['rlvs'][$module]) {
|
||||
unset($_SESSION['rlvs']);
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
$smarty->assign("TODO_PERMISSION",CheckFieldPermission('parent_id','Calendar'));
|
||||
$smarty->assign("EVENT_PERMISSION",CheckFieldPermission('parent_id','Events'));
|
||||
$smarty->assign("CATEGORY",$category);
|
||||
$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);
|
||||
$smarty->assign("SINGLE_MOD",$app_strings['Account']);
|
||||
$smarty->assign("MOD",$mod_strings);
|
||||
$smarty->assign("APP",$app_strings);
|
||||
$smarty->assign("THEME", $theme);
|
||||
$smarty->assign("IMAGE_PATH", $image_path);
|
||||
$check_button = Button_Check($module);
|
||||
|
||||
$smarty->assign("CHECK", $check_button);
|
||||
|
||||
$smarty->display("RelatedLists.tpl");
|
||||
}
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?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/CustomAction.php');
|
||||
?>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?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');
|
||||
|
||||
?>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/Delete.php,v 1.5 2005/03/10 09:28:34 shaw Exp $
|
||||
* Description: Deletes an Account record and then redirects the browser to the
|
||||
* defined return URL.
|
||||
********************************************************************************/
|
||||
|
||||
global $currentModule;
|
||||
$focus = CRMEntity::getInstance($currentModule);
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
require_once('include/logging.php');
|
||||
$log = LoggerManager::getLogger('contact_delete');
|
||||
|
||||
//Added to fix 4600
|
||||
$url = getBasic_Advance_SearchURL();
|
||||
if(!isset($_REQUEST['record']))
|
||||
die($mod_strings['ERR_DELETE_RECORD']);
|
||||
|
||||
DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
|
||||
|
||||
$parenttab = getParentTab();
|
||||
|
||||
header("Location: index.php?module=".vtlib_purify($_REQUEST['return_module'])."&action=".vtlib_purify($_REQUEST['return_action'])."&record=".vtlib_purify($_REQUEST['return_id'])."&parenttab=".$parenttab."&relmodule=".vtlib_purify($_REQUEST['module']).$url);
|
||||
?>
|
||||
@@ -1,172 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/DetailView.php,v 1.37 2005/04/18 10:37:49 samk Exp $
|
||||
* Description: TODO To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('Smarty_setup.php');
|
||||
require_once('data/Tracker.php');
|
||||
require_once('include/CustomFieldUtil.php');
|
||||
require_once('include/utils/utils.php');
|
||||
require_once('user_privileges/default_module_view.php');
|
||||
require_once 'modules/CustomView/CustomView.php';
|
||||
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
global $app_list_strings;
|
||||
global $log, $currentModule, $singlepane_view;
|
||||
|
||||
$focus = CRMEntity::getInstance($currentModule);
|
||||
if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
|
||||
$focus->retrieve_entity_info($_REQUEST['record'],"Accounts");
|
||||
$focus->id = $_REQUEST['record'];
|
||||
$focus->name=$focus->column_fields['accountname'];
|
||||
$log->debug("id is ".$focus->id);
|
||||
$log->debug("name is ".$focus->name);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
|
||||
$focus->id = "";
|
||||
}
|
||||
|
||||
global $theme;
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
|
||||
$log->info("Account detail view");
|
||||
$smarty = new vtigerCRM_Smarty;
|
||||
$smarty->assign("MOD", $mod_strings);
|
||||
$smarty->assign("APP", $app_strings);
|
||||
|
||||
$smarty->assign("THEME", $theme);
|
||||
$smarty->assign("IMAGE_PATH", $image_path);
|
||||
$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
|
||||
|
||||
if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
|
||||
else $smarty->assign("NAME", "");
|
||||
$smarty->assign("BLOCKS", getBlocks("Accounts","detail_view",'',$focus->column_fields));
|
||||
$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
|
||||
|
||||
$smarty->assign("CUSTOMFIELD", $cust_fld);
|
||||
$smarty->assign("ID", $_REQUEST['record']);
|
||||
$smarty->assign("SINGLE_MOD",'Account');
|
||||
$category = getParentTab();
|
||||
$smarty->assign("CATEGORY",$category);
|
||||
|
||||
if(useInternalMailer() == 1)
|
||||
$smarty->assign("INT_MAILER","true");
|
||||
|
||||
|
||||
if(isPermitted("Accounts","EditView",$_REQUEST['record']) == 'yes')
|
||||
$smarty->assign("EDIT_DUPLICATE","permitted");
|
||||
|
||||
if(isPermitted("Accounts","Delete",$_REQUEST['record']) == 'yes')
|
||||
$smarty->assign("DELETE","permitted");
|
||||
|
||||
if(isPermitted("Emails","EditView",'') == 'yes')
|
||||
{
|
||||
$smarty->assign("SENDMAILBUTTON","permitted");
|
||||
$smarty->assign("EMAIL1", $focus->column_fields['email1']);
|
||||
$smarty->assign("EMAIL2", $focus->column_fields['email2']);
|
||||
}
|
||||
|
||||
if(isPermitted("Accounts","Merge",'') == 'yes')
|
||||
{
|
||||
global $current_user;
|
||||
require("user_privileges/user_privileges_".$current_user->id.".php");
|
||||
require_once('include/utils/UserInfoUtil.php');
|
||||
$wordTemplateResult = fetchWordTemplateList("Accounts");
|
||||
$tempCount = $adb->num_rows($wordTemplateResult);
|
||||
$tempVal = $adb->fetch_array($wordTemplateResult);
|
||||
for($templateCount=0;$templateCount<$tempCount;$templateCount++)
|
||||
{
|
||||
$optionString[$tempVal["templateid"]]=$tempVal["filename"];
|
||||
$tempVal = $adb->fetch_array($wordTemplateResult);
|
||||
}
|
||||
if($is_admin)
|
||||
$smarty->assign("MERGEBUTTON","permitted");
|
||||
elseif($tempCount >0)
|
||||
$smarty->assign("MERGEBUTTON","permitted");
|
||||
$smarty->assign("TEMPLATECOUNT",$tempCount);
|
||||
$smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']);
|
||||
$smarty->assign("TOPTIONS",$optionString);
|
||||
}
|
||||
|
||||
$tabid = getTabid("Accounts");
|
||||
$validationData = getDBValidationData($focus->tab_name,$tabid);
|
||||
$data = split_validationdataArray($validationData);
|
||||
|
||||
$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
|
||||
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
|
||||
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
|
||||
|
||||
|
||||
$check_button = Button_Check($module);
|
||||
$smarty->assign("CHECK", $check_button);
|
||||
|
||||
$smarty->assign("MODULE",$currentModule);
|
||||
$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST['record']));
|
||||
|
||||
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("USE_ASTERISK", get_use_asterisk($current_user->id));
|
||||
|
||||
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'));
|
||||
|
||||
$smarty->assign("SinglePane_View", $singlepane_view);
|
||||
|
||||
// Record Change Notification
|
||||
$focus->markAsViewed($current_user->id);
|
||||
// END
|
||||
|
||||
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));
|
||||
|
||||
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
|
||||
|
||||
$smarty->display("DetailView.tpl");
|
||||
?>
|
||||
@@ -1,83 +0,0 @@
|
||||
<?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/logging.php');
|
||||
require_once('include/database/PearDatabase.php');
|
||||
global $adb,$mod_strings;
|
||||
|
||||
$local_log =& LoggerManager::getLogger('AccountsAjax');
|
||||
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,"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
|
||||
{
|
||||
$modObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);
|
||||
}
|
||||
$modObj->id = $crmid;
|
||||
$modObj->mode = "edit";
|
||||
$modObj->save("Accounts");
|
||||
|
||||
if($modObj->id != "")
|
||||
{
|
||||
echo ":#:SUCCESS";
|
||||
}else
|
||||
{
|
||||
echo ":#:FAILURE";
|
||||
}
|
||||
}else
|
||||
{
|
||||
echo ":#:FAILURE";
|
||||
}
|
||||
}elseif($ajaxaction == "LOADRELATEDLIST" || $ajaxaction == "DISABLEMODULE"){
|
||||
require_once 'include/ListView/RelatedListViewContents.php';
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,134 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/EditView.php,v 1.19 2005/03/24 16:18:38 samk Exp $
|
||||
* Description: TODO To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('Smarty_setup.php');
|
||||
require_once('data/Tracker.php');
|
||||
require_once('include/CustomFieldUtil.php');
|
||||
require_once('include/utils/utils.php');
|
||||
|
||||
global $app_strings,$mod_strings,$currentModule,$theme;
|
||||
$smarty=new vtigerCRM_Smarty;
|
||||
|
||||
$focus = CRMEntity::getInstance($currentModule);
|
||||
|
||||
//added to fix the issue4600
|
||||
$searchurl = getBasic_Advance_SearchURL();
|
||||
$smarty->assign("SEARCH", $searchurl);
|
||||
//ends 4600
|
||||
if(isset($_REQUEST['record']))
|
||||
{
|
||||
$focus->id = $_REQUEST['record'];
|
||||
$focus->mode = 'edit';
|
||||
$focus->retrieve_entity_info($_REQUEST['record'],"Accounts");
|
||||
$focus->name=$focus->column_fields['accountname'];
|
||||
}
|
||||
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['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("Accounts",$disp_view,$mode,$focus->column_fields));
|
||||
else
|
||||
{
|
||||
$smarty->assign("BASBLOCKS",getBlocks("Accounts",$disp_view,$mode,$focus->column_fields,'BAS'));
|
||||
$smarty->assign("ADVBLOCKS",getBlocks("Accounts",$disp_view,$mode,$focus->column_fields,'ADV'));
|
||||
}
|
||||
|
||||
$smarty->assign("OP_MODE",$disp_view);
|
||||
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
|
||||
$log->info("Account detail view");
|
||||
|
||||
$smarty->assign("MOD", $mod_strings);
|
||||
$smarty->assign("APP", $app_strings);
|
||||
|
||||
if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
|
||||
else $smarty->assign("NAME", "");
|
||||
if(isset($cust_fld))
|
||||
{
|
||||
$smarty->assign("CUSTOMFIELD", $cust_fld);
|
||||
}
|
||||
if($focus->mode == 'edit')
|
||||
{
|
||||
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
|
||||
$smarty->assign("MODE", $focus->mode);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['return_module'])) $smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module']));
|
||||
else $smarty->assign("RETURN_MODULE","Accounts");
|
||||
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']));
|
||||
$category = getParentTab();
|
||||
$smarty->assign("CATEGORY",$category);
|
||||
$smarty->assign("THEME", $theme);
|
||||
$smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
|
||||
$smarty->assign("ID", $focus->id);
|
||||
$smarty->assign("MODULE",$currentModule);
|
||||
$smarty->assign("SINGLE_MOD",'Account');
|
||||
|
||||
$smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
|
||||
$smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
|
||||
|
||||
$tabid = getTabid("Accounts");
|
||||
$validationData = getDBValidationData($focus->tab_name,$tabid);
|
||||
$data = split_validationdataArray($validationData);
|
||||
|
||||
$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
|
||||
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
|
||||
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
|
||||
|
||||
$check_button = Button_Check($module);
|
||||
$smarty->assign("CHECK", $check_button);
|
||||
$smarty->assign("DUPLICATE",vtlib_purify($_REQUEST['isDuplicate']));
|
||||
|
||||
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
|
||||
|
||||
if ($focus->mode == 'edit')
|
||||
$smarty->display('salesEditView.tpl');
|
||||
else
|
||||
$smarty->display('CreateView.tpl');
|
||||
|
||||
?>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?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');
|
||||
?>
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
<?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');
|
||||
|
||||
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=$_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='". vtiger_imageurl('denied.gif', $theme) ."' ></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');
|
||||
|
||||
?>
|
||||
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
|
||||
* the specific language governing rights and limitations under the License.
|
||||
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
|
||||
* All Rights Reserved.
|
||||
|
||||
* Contributor(s): ______________________________________.
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* $Header$
|
||||
|
||||
* Description: TODO: To be written.
|
||||
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
include('modules/Import/index.php');
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,352 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
|
||||
require_once('Smarty_setup.php');
|
||||
require_once("data/Tracker.php");
|
||||
require_once('modules/Accounts/Accounts.php');
|
||||
require_once('include/logging.php');
|
||||
require_once('include/ListView/ListView.php');
|
||||
require_once('include/utils/utils.php');
|
||||
require_once('modules/CustomView/CustomView.php');
|
||||
require_once('include/database/Postgres8.php');
|
||||
|
||||
global $app_strings;
|
||||
global $list_max_entries_per_page;
|
||||
|
||||
$log = LoggerManager::getLogger('account_list');
|
||||
|
||||
global $currentModule;
|
||||
global $theme;
|
||||
|
||||
$category = getParentTab();
|
||||
|
||||
// focus_list is the means of passing data to a ListView.
|
||||
global $focus_list;
|
||||
|
||||
if (!isset($where)) $where = "";
|
||||
|
||||
$url_string = '';
|
||||
|
||||
$focus = new Accounts();
|
||||
// Initialize sort by fields
|
||||
$focus->initSortbyField('Accounts');
|
||||
// END
|
||||
$smarty = new vtigerCRM_Smarty;
|
||||
$other_text = Array();
|
||||
|
||||
if(!$_SESSION['lvs'][$currentModule])
|
||||
{
|
||||
unset($_SESSION['lvs']);
|
||||
$modObj = new ListViewSession();
|
||||
$modObj->sorder = $sorder;
|
||||
$modObj->sortby = $order_by;
|
||||
$_SESSION['lvs'][$currentModule] = get_object_vars($modObj);
|
||||
}
|
||||
|
||||
if($_REQUEST['errormsg'] != '')
|
||||
{
|
||||
$errormsg = vtlib_purify($_REQUEST['errormsg']);
|
||||
$smarty->assign("ERROR","The User does not have permission to Change/Delete ".$errormsg." ".$currentModule);
|
||||
}else
|
||||
{
|
||||
$smarty->assign("ERROR","");
|
||||
}
|
||||
|
||||
//<<<<<<< sort ordering >>>>>>>>>>>>>
|
||||
$sorder = $focus->getSortOrder();
|
||||
$order_by = $focus->getOrderBy();
|
||||
|
||||
$_SESSION['ACCOUNTS_ORDER_BY'] = $order_by;
|
||||
$_SESSION['ACCOUNTS_SORT_ORDER'] = $sorder;
|
||||
//<<<<<<< sort ordering >>>>>>>>>>>>>
|
||||
|
||||
//<<<<cutomview>>>>>>>
|
||||
$oCustomView = new CustomView($currentModule);
|
||||
$viewid = $oCustomView->getViewId($currentModule);
|
||||
$customviewcombo_html = $oCustomView->getCustomViewCombo($viewid);
|
||||
$viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
|
||||
|
||||
//Added to handle approving or denying status-public by the admin in CustomView
|
||||
$statusdetails = $oCustomView->isPermittedChangeStatus($viewnamedesc['status']);
|
||||
$smarty->assign("CUSTOMVIEW_PERMISSION",$statusdetails);
|
||||
|
||||
//To check if a user is able to edit/delete a customview
|
||||
$edit_permit = $oCustomView->isPermittedCustomView($viewid,'EditView',$currentModule);
|
||||
$delete_permit = $oCustomView->isPermittedCustomView($viewid,'Delete',$currentModule);
|
||||
$smarty->assign("CV_EDIT_PERMIT",$edit_permit);
|
||||
$smarty->assign("CV_DELETE_PERMIT",$delete_permit);
|
||||
|
||||
//<<<<<customview>>>>>
|
||||
$smarty->assign("CHANGE_OWNER",getUserslist());
|
||||
$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
|
||||
if($viewid != 0)
|
||||
{
|
||||
$CActionDtls = $oCustomView->getCustomActionDetails($viewid);
|
||||
}
|
||||
elseif($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 class='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;
|
||||
}
|
||||
|
||||
if(isPermitted('Accounts','Delete','') == 'yes')
|
||||
{
|
||||
$other_text['del'] = $app_strings[LBL_MASS_DELETE];
|
||||
}
|
||||
if(isPermitted('Accounts','EditView','') == 'yes')
|
||||
{
|
||||
$other_text['mass_edit'] = $app_strings[LBL_MASS_EDIT];
|
||||
$other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
|
||||
}
|
||||
if(isPermitted('Emails','EditView','') == 'yes')
|
||||
{
|
||||
$other_text['s_mail'] = $app_strings[LBL_SEND_MAIL_BUTTON];
|
||||
}
|
||||
if(isset($CActionDtls))
|
||||
{
|
||||
$other_text['s_cmail'] = $app_strings[LBL_SEND_CUSTOM_MAIL_BUTTON];
|
||||
}
|
||||
// mailer export
|
||||
if(isPermitted('Accounts','Export','') == 'yes')
|
||||
{
|
||||
$other_text['mailer_exp'] = $mod_strings[LBL_MAILER_EXPORT];
|
||||
}
|
||||
// end of mailer export
|
||||
if($viewnamedesc['viewname'] == 'All')
|
||||
{
|
||||
$smarty->assign("ALL", 'All');
|
||||
}
|
||||
|
||||
global $theme;
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
$smarty->assign("MOD", $mod_strings);
|
||||
$smarty->assign("APP", $app_strings);
|
||||
$smarty->assign("THEME", $theme);
|
||||
$smarty->assign("IMAGE_PATH",$image_path);
|
||||
$smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html);
|
||||
$smarty->assign("VIEWID", $viewid);
|
||||
$smarty->assign("BUTTONS",$other_text);
|
||||
$smarty->assign("MODULE",$currentModule);
|
||||
$smarty->assign("SINGLE_MOD",'Account');
|
||||
|
||||
|
||||
//Retreive the list from Database
|
||||
//<<<<<<<<<customview>>>>>>>>>
|
||||
global $current_user;
|
||||
$queryGenerator = new QueryGenerator($currentModule, $current_user);
|
||||
if ($viewid != "0") {
|
||||
$queryGenerator->initForCustomViewById($viewid);
|
||||
} else {
|
||||
$queryGenerator->initForDefaultCustomView();
|
||||
}
|
||||
//<<<<<<<<customview>>>>>>>>>
|
||||
|
||||
// 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']);
|
||||
}
|
||||
|
||||
$view_script = "<script language='javascript'>
|
||||
function set_selected()
|
||||
{
|
||||
len=document.massdelete.viewname.length;
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(document.massdelete.viewname[i].value == '$viewid')
|
||||
document.massdelete.viewname[i].selected = true;
|
||||
}
|
||||
}
|
||||
set_selected();
|
||||
</script>";
|
||||
// mailer_export
|
||||
if (isset($other_text['mailer_exp']))
|
||||
{
|
||||
$view_script .= "<script language='javascript'>
|
||||
function mailer_export()
|
||||
{
|
||||
document.massdelete.action.value=\"MailerExport\";
|
||||
document.massdelete.step.value=\"ask\";
|
||||
window.locate=\"index.php?module=Accounts&action=MailerExport&from=Accounts&step=ask\";
|
||||
}
|
||||
</script>";
|
||||
}
|
||||
// end of mailer export
|
||||
if(isset($order_by) && $order_by != '')
|
||||
{
|
||||
if($order_by == 'smownerid')
|
||||
{
|
||||
if( $adb->dbType == "pgsql")
|
||||
$query .= ' GROUP BY user_name';
|
||||
$query .= ' ORDER BY user_name '.$sorder;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tablename = getTableNameForField('Accounts',$order_by);
|
||||
$tablename = (($tablename != '')?($tablename."."):'');
|
||||
if( $adb->dbType == "pgsql")
|
||||
$query .= ' GROUP BY '.$tablename.$order_by;
|
||||
|
||||
$query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Postgres 8 fixes
|
||||
if( $adb->dbType == "pgsql")
|
||||
$query = fixPostgresQuery( $query, $log, 0);
|
||||
|
||||
if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){
|
||||
$count_result = $adb->query( mkCountQuery( $query));
|
||||
$noofrows = $adb->query_result($count_result,0,"count");
|
||||
}else{
|
||||
$noofrows = null;
|
||||
}
|
||||
|
||||
$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true');
|
||||
$start = ListViewSession::getRequestCurrentPage($currentModule, $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($query. " OFFSET $limit_start_rec LIMIT $list_max_entries_per_page", array());
|
||||
else
|
||||
$list_result = $adb->pquery($query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array());
|
||||
|
||||
$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[$focus->table_index];
|
||||
}
|
||||
if(isset($ids))
|
||||
{
|
||||
$smarty->assign("ALLIDS", implode($ids,";"));
|
||||
}
|
||||
if(isPermitted("Accounts","Merge") == 'yes')
|
||||
{
|
||||
$wordTemplateResult = fetchWordTemplateList("Accounts");
|
||||
$tempCount = $adb->num_rows($wordTemplateResult);
|
||||
$tempVal = $adb->fetch_array($wordTemplateResult);
|
||||
for($templateCount=0;$templateCount<$tempCount;$templateCount++)
|
||||
{
|
||||
$optionString .="<option value=\"".$tempVal["templateid"]."\">" .$tempVal["filename"] ."</option>";
|
||||
$tempVal = $adb->fetch_array($wordTemplateResult);
|
||||
}
|
||||
if($tempCount > 0)
|
||||
{
|
||||
$smarty->assign("WORDTEMPLATEOPTIONS","<td>".$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']."</td><td style=\"padding-left:5px;padding-right:5px\"><select class=\"small\" name=\"mergefile\">".$optionString."</select></td>");
|
||||
|
||||
$smarty->assign("MERGEBUTTON","<td><input title=\"$app_strings[LBL_MERGE_BUTTON_TITLE]\" accessKey=\"$app_strings[LBL_MERGE_BUTTON_KEY]\" class=\"crmbutton small create\" onclick=\"return massMerge('Accounts')\" type=\"submit\" name=\"Merge\" value=\" $app_strings[LBL_MERGE_BUTTON_LABEL]\"></td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
global $current_user;
|
||||
require("user_privileges/user_privileges_".$current_user->id.".php");
|
||||
if($is_admin == true)
|
||||
{
|
||||
$smarty->assign("MERGEBUTTON",'<td><a href=index.php?module=Settings&action=upload&tempModule='.$currentModule.'&parenttab=Settings>'. $app_strings["LBL_CREATE_MERGE_TEMPLATE"].'</td>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//mass merge for word templates
|
||||
|
||||
//Retreive the List View Table Header
|
||||
if($viewid !='')
|
||||
$url_string .= "&viewname=".$viewid;
|
||||
|
||||
$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 = $controller->getBasicSearchFieldInfoList();
|
||||
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
|
||||
|
||||
$listview_entries = $controller->getListViewEntries($focus,$currentModule,$list_result,
|
||||
$navigation_array);
|
||||
|
||||
$smarty->assign("LISTENTITY", $listview_entries);
|
||||
$smarty->assign("SELECT_SCRIPT", $view_script);
|
||||
$smarty->assign("CATEGORY",$category);
|
||||
|
||||
$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),";"));
|
||||
|
||||
$navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string,"Accounts","index",$viewid);
|
||||
$alphabetical = AlphabeticalSearch($currentModule,'index','accountname','true','basic',"","","","",$viewid);
|
||||
$fieldnames = $controller->getAdvancedSearchOptionString();
|
||||
$criteria = getcriteria_options();
|
||||
$smarty->assign("CRITERIA", $criteria);
|
||||
$smarty->assign("FIELDNAMES", $fieldnames);
|
||||
$smarty->assign("ALPHABETICAL", $alphabetical);
|
||||
$smarty->assign("NAVIGATION", $navigationOutput);
|
||||
|
||||
$check_button = Button_Check($currentModule);
|
||||
$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");
|
||||
|
||||
?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?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';
|
||||
?>
|
||||
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* $Header$
|
||||
* Description: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
/**Function to get the top 5 Accounts order by Amount in Descending Order
|
||||
*return array $values - array with the title, header and entries like Array('Title'=>$title,'Header'=>$listview_header,'Entries'=>$listview_entries) where as listview_header and listview_entries are arrays of header and entity values which are returned from function getListViewHeader and getListViewEntries
|
||||
*/
|
||||
function getTopAccounts($maxval,$calCnt)
|
||||
{
|
||||
$log = LoggerManager::getLogger('top accounts_list');
|
||||
$log->debug("Entering getTopAccounts() method ...");
|
||||
require_once("data/Tracker.php");
|
||||
require_once('modules/Potentials/Potentials.php');
|
||||
require_once('include/logging.php');
|
||||
require_once('include/ListView/ListView.php');
|
||||
global $app_strings;
|
||||
global $adb;
|
||||
global $current_language;
|
||||
global $current_user;
|
||||
$current_module_strings = return_module_language($current_language, "Accounts");
|
||||
|
||||
require('user_privileges/user_privileges_'.$current_user->id.'.php');
|
||||
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
|
||||
|
||||
$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);
|
||||
|
||||
if($calCnt == 'calculateCnt') {
|
||||
$list_result_rows = $adb->query(mkCountQuery($list_query));
|
||||
return $adb->query_result($list_result_rows, 0, 'count');
|
||||
}
|
||||
|
||||
$list_result=$adb->query($list_query);
|
||||
$open_accounts_list = array();
|
||||
$noofrows = $adb->num_rows($list_result);
|
||||
|
||||
if ($noofrows) {
|
||||
for($i=0;$i<$noofrows;$i++)
|
||||
{
|
||||
$open_accounts_list[] = Array('accountid' => $adb->query_result($list_result,$i,'accountid'),
|
||||
'accountname' => $adb->query_result($list_result,$i,'accountname'),
|
||||
'amount' => $adb->query_result($list_result,$i,'amount'),
|
||||
'tickersymbol' => $adb->query_result($list_result,$i,'tickersymbol'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$title=array();
|
||||
$title[]='myTopAccounts.gif';
|
||||
$title[]=$current_module_strings['LBL_TOP_ACCOUNTS'];
|
||||
$title[]='home_myaccount';
|
||||
|
||||
$header=array();
|
||||
$header[]=$current_module_strings['LBL_LIST_ACCOUNT_NAME'];
|
||||
$currencyid=fetchCurrency($current_user->id);
|
||||
$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_POTENTIAL_TITLE'];
|
||||
|
||||
$entries=array();
|
||||
foreach($open_accounts_list as $account)
|
||||
{
|
||||
$value=array();
|
||||
$account_fields = array(
|
||||
'ACCOUNT_ID' => $account['accountid'],
|
||||
'ACCOUNT_NAME' => $account['accountname'],
|
||||
'AMOUNT' => ($account['amount']),
|
||||
);
|
||||
|
||||
$Top_Accounts = (strlen($account['accountname']) > 20) ? (substr($account['accountname'],0,20).'...') : $account['accountname'];
|
||||
$value[]='<a href="index.php?action=DetailView&module=Accounts&record='.$account['accountid'].'">'.$Top_Accounts.'</a>';
|
||||
$value[]=convertFromDollar($account['amount'],$rate);
|
||||
$entries[$account['accountid']]=$value;
|
||||
}
|
||||
$values=Array('ModuleName'=>'Accounts','Title'=>$title,'Header'=>$header,'Entries'=>$entries);
|
||||
$log->debug("Exiting getTopAccounts method ...");
|
||||
if (($display_empty_home_blocks && count($entries) == 0 ) || (count($entries)>0))
|
||||
return $values;
|
||||
}
|
||||
?>
|
||||
@@ -1,325 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* $Header:
|
||||
* Description: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
global $app_strings;
|
||||
global $mod_strings;
|
||||
global $currentModule;
|
||||
global $theme, $adb;
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
global $current_language,$default_charset;
|
||||
|
||||
$category = htmlspecialchars($_REQUEST['parenttab'],ENT_QUOTES,$default_charset);
|
||||
|
||||
//Function added to convert line breaks to space in description during export
|
||||
function br2nl_int($str) {
|
||||
$str = preg_replace("/(\r\n)/", " ", $str);
|
||||
return $str;
|
||||
}
|
||||
|
||||
if (isset($_SESSION['export_where']))
|
||||
$exportWhere = $_SESSION['export_where'];
|
||||
else
|
||||
$exportWhere = stripslashes(htmlspecialchars_decode($_POST['exportwhere']));
|
||||
|
||||
if (isset($_GET['step']))
|
||||
$step = $_GET['step'];
|
||||
else
|
||||
$step = $_POST['step'];
|
||||
|
||||
$export_type = $_POST['export_type'];
|
||||
|
||||
|
||||
function getStdContactFlds(&$queryFields, $adb, $valueArray)
|
||||
{
|
||||
global $current_language, $mod_strings;
|
||||
require_once('modules/Contacts/language/'.$current_language.'.lang.php');
|
||||
$query = "SELECT fieldid, columnname, fieldlabel FROM vtiger_field WHERE tablename='vtiger_contactdetails' AND uitype='56' and vtiger_field.presence in (0,2)";
|
||||
$result = $adb->query ($query,true,"Error: "."<BR>$query");
|
||||
for ($tmp=0; $tmp < $adb->num_rows($result); $tmp++)
|
||||
{
|
||||
$myData = $adb->fetchByAssoc ($result);
|
||||
$queryFields[] = Array('columnname'=>$myData['columnname']
|
||||
,'uitype'=>'56','fieldlabel'=>$mod_strings[$myData['fieldlabel']]
|
||||
,'value'=> $valueArray);
|
||||
}
|
||||
}
|
||||
|
||||
if ($step == "ask")
|
||||
{
|
||||
require_once('config.php');
|
||||
require_once('include/database/PearDatabase.php');
|
||||
require_once('Smarty_setup.php');
|
||||
$smarty = new vtigerCRM_Smarty;
|
||||
$valueArray = Array('' => $mod_strings['LBL_MAILER_EXPORT_IGNORE'],
|
||||
'0' => $mod_strings['LBL_MAILER_EXPORT_NOTCHECKED'],
|
||||
'1' => $mod_strings['LBL_MAILER_EXPORT_CHECKED']);
|
||||
|
||||
$smarty->assign("MOD", return_module_language($current_language,'Accounts'));
|
||||
$smarty->assign("CMOD", $mod_strings);
|
||||
$smarty->assign("APP", $app_strings);
|
||||
$smarty->assign("IMAGE_PATH",$image_path);
|
||||
$smarty->assign("MODULE",$currentModule);
|
||||
$smarty->assign("EXPORTWHERE",$exportWhere);
|
||||
$queryFields = Array();
|
||||
// get the Contacts CF fields
|
||||
$cfquery = "SELECT columnname,fieldlabel,uitype FROM vtiger_field WHERE tablename='vtiger_contactscf' and vtiger_field.presence in (0,2)";
|
||||
$result = $adb->query ($cfquery,true,"Error: "."<BR>$cfquery");
|
||||
for ($tmp=0; $tmp < $adb->num_rows($result); $tmp++)
|
||||
{
|
||||
$cfTmp = $adb->fetchByAssoc ($result);
|
||||
$cfColName=$cfTmp['columnname'];
|
||||
if ($cfTmp['uitype'] == 1)
|
||||
$queryFields[$tmp] = $cfTmp;
|
||||
elseif ($cfTmp['uitype'] == 15)
|
||||
{
|
||||
$queryFields[$tmp] = $cfTmp;
|
||||
$queryFields[$tmp]['value'][''] = $mod_strings['LBL_MAILER_EXPORT_IGNORE'];
|
||||
$cfValues = "SELECT ".$cfColName.",".$cfColName."id FROM vtiger_".$cfColName;
|
||||
$resVal = $adb->query ($cfValues,true,"Error: "."<BR>$cfValues");
|
||||
for ($tmp1=0; $tmp1 < $adb->num_rows($resVal); $tmp1++)
|
||||
{
|
||||
$cfTmp=$adb->fetchByAssoc ($resVal);
|
||||
$queryFields[$tmp]['value'][$cfTmp[$cfColName]] = $cfTmp[$cfColName];
|
||||
}
|
||||
}
|
||||
elseif ($cfTmp['uitype'] == 56)
|
||||
{
|
||||
$queryFields[$tmp] = $cfTmp;
|
||||
$queryFields[$tmp]['value'] = $valueArray;
|
||||
}
|
||||
}
|
||||
// now add the standard fields
|
||||
getStdContactFlds(&$queryFields, $adb, $valueArray);
|
||||
// get the list of fields
|
||||
$fieldList="";
|
||||
foreach ($queryFields as $myField)
|
||||
{
|
||||
if (strlen($fieldList) > 0)
|
||||
$fieldList .= ',';
|
||||
$fieldList .= $myField['columnname'];
|
||||
}
|
||||
$smarty->assign("FIELDLIST",$fieldList);
|
||||
// and their types
|
||||
$typeList ="";
|
||||
foreach ($queryFields as $myField)
|
||||
{
|
||||
if (strlen($typeList) > 0)
|
||||
$typeList .= ',';
|
||||
$typeList .= $myField['uitype'];
|
||||
}
|
||||
|
||||
$smarty->assign("TYPELIST",$typeList);
|
||||
$smarty->assign("QUERYFIELDS",$queryFields);
|
||||
$smarty->assign("CATEGORY",$category);
|
||||
$smarty->display('MailerExport.tpl');
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once('../../config.php');
|
||||
chdir ($root_directory);
|
||||
require_once("include/utils/CommonUtils.php");
|
||||
require_once('include/database/PearDatabase.php');
|
||||
require_once('include/logging.php');
|
||||
$exquery = Array();
|
||||
$fields = explode(",",$_POST['fieldlist']);
|
||||
$types = explode(",",$_POST['typelist']);
|
||||
$escapxportWhere = $adb->sql_escape_string($exportWhere);
|
||||
if (($export_type == "email") || ($export_type == "emailplus") )
|
||||
{
|
||||
|
||||
$where = "";
|
||||
|
||||
if(count($fields) > 0)
|
||||
$where .= getExpWhereClause($fields,$types);
|
||||
$exquery[0] = "SELECT crmentity.crmid, contactdetails.contactid,
|
||||
contactdetails.salutation, contactdetails.firstname,
|
||||
contactdetails.lastname, contactdetails.email FROM vtiger_account
|
||||
INNER JOIN vtiger_crmentity crmentity on crmentity.crmid=vtiger_account.accountid
|
||||
INNER JOIN vtiger_accountbillads ON vtiger_account.accountid=vtiger_accountbillads.accountaddressid
|
||||
INNER JOIN vtiger_accountshipads ON vtiger_account.accountid=vtiger_accountshipads.accountaddressid
|
||||
INNER JOIN vtiger_accountscf ON vtiger_account.accountid = vtiger_accountscf.accountid
|
||||
INNER JOIN vtiger_contactdetails contactdetails ON vtiger_account.accountid = contactdetails.accountid
|
||||
INNER JOIN vtiger_contactscf contactscf ON contactscf.contactid = contactdetails.contactid
|
||||
WHERE crmentity.deleted=0 AND contactdetails.email != '' ".$where;
|
||||
|
||||
if (strlen ($exportWhere))
|
||||
$exquery[0] .= " AND ".$exportWhere;
|
||||
|
||||
if ($export_type == "emailplus")
|
||||
{
|
||||
$exquery[1] = "SELECT crmentity.crmid, contactdetails.contactid,
|
||||
contactdetails.salutation, contactdetails.firstname,
|
||||
contactdetails.lastname, vtiger_account.email1 FROM vtiger_account
|
||||
INNER JOIN vtiger_crmentity crmentity ON crmentity.crmid=vtiger_account.accountid
|
||||
INNER JOIN vtiger_accountbillads ON vtiger_account.accountid=vtiger_accountbillads.accountaddressid
|
||||
INNER JOIN vtiger_accountshipads ON vtiger_account.accountid=vtiger_accountshipads.accountaddressid
|
||||
INNER JOIN vtiger_accountscf ON vtiger_account.accountid = vtiger_accountscf.accountid
|
||||
INNER JOIN vtiger_contactdetails contactdetails ON vtiger_account.accountid = contactdetails.accountid
|
||||
INNER JOIN vtiger_contactscf contactscf ON contactscf.contactid = contactdetails.contactid
|
||||
WHERE crmentity.deleted=0
|
||||
AND contactdetails.email = '' AND vtiger_account.email1 != '' ".$where;
|
||||
|
||||
if (strlen ($exportWhere))
|
||||
$exquery[1] .= " AND ".$exportWhere;
|
||||
}
|
||||
}
|
||||
else if ($export_type == "full")
|
||||
{
|
||||
$where = '';
|
||||
if(count($fields) > 0)
|
||||
$where .= getExpWhereClause($fields,$types);
|
||||
$exquery[0] = "select crmentity.crmid, contactdetails.contactid,
|
||||
contactdetails.salutation, contactdetails.firstname,
|
||||
contactdetails.lastname, contactdetails.email, vtiger_account.accountname,"
|
||||
." vtiger_account.phone, vtiger_account.website, vtiger_accountshipads.ship_street,"
|
||||
." vtiger_accountshipads.ship_code,"
|
||||
." vtiger_accountshipads.ship_city, vtiger_accountshipads.ship_state,"
|
||||
." vtiger_accountshipads.ship_country,"
|
||||
." vtiger_accountbillads.bill_street, vtiger_accountbillads.bill_code,"
|
||||
." vtiger_accountbillads.bill_city, vtiger_accountbillads.bill_state,"
|
||||
." vtiger_accountbillads.bill_country"
|
||||
." FROM vtiger_account INNER JOIN vtiger_crmentity crmentity ON crmentity.crmid=vtiger_account.accountid"
|
||||
." LEFT JOIN vtiger_accountbillads ON vtiger_account.accountid=vtiger_accountbillads.accountaddressid"
|
||||
." LEFT JOIN vtiger_accountshipads ON vtiger_account.accountid=vtiger_accountshipads.accountaddressid"
|
||||
." INNER JOIN vtiger_accountscf ON vtiger_account.accountid = vtiger_accountscf.accountid"
|
||||
." INNER JOIN vtiger_contactdetails contactdetails ON vtiger_account.accountid = contactdetails.accountid"
|
||||
." INNER JOIN vtiger_contactscf contactscf ON contactscf.contactid = contactdetails.contactid"
|
||||
." WHERE crmentity.deleted=0 ".$where;
|
||||
|
||||
if (strlen ($exportWhere))
|
||||
$exquery[0] .= " AND ".$exportWhere;
|
||||
}
|
||||
// Added for getting field labels of the fields selected in the above export queries. If any new fields added in the select clause then the below array need to be updated with the corresponding lablels
|
||||
$fld_label_arr = Array("salutation"=>getTranslatedString('Salutation','Contacts'),
|
||||
"lastname"=>getTranslatedString('Last Name','Contacts'),
|
||||
"firstname"=>getTranslatedString('First Name','Contacts'),
|
||||
"email"=>getTranslatedString('Email','Contacts'),
|
||||
"accountname"=>getTranslatedString('Account Name','Accounts'),
|
||||
"phone"=>getTranslatedString('Phone','Accounts'),
|
||||
"website"=>getTranslatedString('Website','Accounts'),
|
||||
"ship_street"=>getTranslatedString('Shipping Address','Accounts'),
|
||||
"ship_code"=>getTranslatedString('Shipping Code','Accounts'),
|
||||
"ship_city"=>getTranslatedString('Shipping City','Accounts'),
|
||||
"ship_state"=>getTranslatedString('Shipping State','Accounts'),
|
||||
"ship_country"=>getTranslatedString('Shipping Country','Accounts'),
|
||||
"bill_street"=>getTranslatedString('Billing Address','Accounts'),
|
||||
"bill_code"=>getTranslatedString('Billing Code','Accounts'),
|
||||
"bill_city"=>getTranslatedString('Billing City','Accounts'),
|
||||
"bill_state"=>getTranslatedString('Billing State','Accounts'),
|
||||
"bill_country"=>getTranslatedString('Billing Country','Accounts')
|
||||
);
|
||||
|
||||
for ($temp = 0; $temp < count($exquery); $temp++)
|
||||
{
|
||||
$result = $adb->query ($exquery[$temp],true,"Error exporting: "."<BR>$query");
|
||||
if ($temp == 0) // We only need the headers for first query
|
||||
{
|
||||
$fields_array = $adb->getFieldsArray($result);
|
||||
// Now walk through the array and replace any cf_* with the content of the
|
||||
// name array, the index is the cf_ var name
|
||||
for ($arraywalk = 0; $arraywalk < count($fields_array); $arraywalk++)
|
||||
{
|
||||
// echo "Checking: ".$fields_array[$arraywalk];
|
||||
if (strstr ($fields_array[$arraywalk], "vtiger_cf_"))
|
||||
{
|
||||
$fields_array[$arraywalk] = $name[$fields_array[$arraywalk]];
|
||||
// echo "Changing to: ".$fields_array[$arraywalk];
|
||||
}
|
||||
else
|
||||
$fields_array[$arraywalk] = ($fld_label_arr[$fields_array[$arraywalk]]!='')?$fld_label_arr[$fields_array[$arraywalk]]:$fields_array[$arraywalk];
|
||||
}
|
||||
|
||||
|
||||
$header = implode("\",\"",array_values($fields_array));
|
||||
$header = "\"" .$header;
|
||||
$header .= "\"\r\n";
|
||||
$content .= $header;
|
||||
|
||||
$column_list = implode(",",array_values($fields_array));
|
||||
}
|
||||
|
||||
while($val = $adb->fetchByAssoc($result, -1, false))
|
||||
{
|
||||
$new_arr = array();
|
||||
|
||||
// foreach (array_values($val) as $value)
|
||||
foreach ($val as $key => $value)
|
||||
{
|
||||
$value=br2nl_int($value);
|
||||
array_push($new_arr, preg_replace("/\"/","\"\"",$value));
|
||||
}
|
||||
|
||||
$line = implode("\",\"",$new_arr);
|
||||
$line = "\"" .$line;
|
||||
$line .= "\"\r\n";
|
||||
|
||||
$content .= $line;
|
||||
}
|
||||
}
|
||||
|
||||
// echo "<br>Rows: ".$adb->num_rows($result);
|
||||
header( "Content-Disposition: inline; filename=MailerExport.csv");
|
||||
header( "Content-Type: text/csv; charset=".$app_strings['LBL_CHARSET']);
|
||||
header( "Expires: Mon, 26 Jul 2007 05:00:00 GMT" );
|
||||
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
|
||||
header( "Cache-Control: post-check=0, pre-check=0", false );
|
||||
header( "Content-Length: ".strlen($content));
|
||||
print $content;
|
||||
exit ();
|
||||
|
||||
}
|
||||
|
||||
function getExpWhereClause($fields,$types)
|
||||
{
|
||||
global $adb;
|
||||
$where_cond = "";
|
||||
|
||||
foreach ($fields as $myField)
|
||||
{
|
||||
$myType = each($types);
|
||||
if (strlen($_POST[$myField]) > 0)
|
||||
{
|
||||
// type 1 should use a LIKE search
|
||||
if ($myType['value'] == 1)
|
||||
{
|
||||
$equals = " LIKE '";
|
||||
$postfix = "%'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$equals = " = '";
|
||||
$postfix = "'";
|
||||
}
|
||||
// is customer field
|
||||
if (substr($myField,0,3) == 'cf_')
|
||||
$where_cond .= " AND contactscf.".$myField.$equals.$adb->sql_escape_string($_POST[$myField]).$postfix;
|
||||
else
|
||||
$where_cond .= " AND contactdetails.".$myField.$equals.$adb->sql_escape_string($_POST[$myField]).$postfix;
|
||||
}
|
||||
}
|
||||
return $where_cond;
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,45 +0,0 @@
|
||||
<?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);
|
||||
|
||||
$smarty = new vtigerCRM_Smarty;
|
||||
$smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));
|
||||
$smarty->assign("IDS",$_REQUEST['idstring']);
|
||||
$smarty->assign("MASS_EDIT","1");
|
||||
$smarty->assign("MODULE",$currentModule);
|
||||
$smarty->assign("APP",$app_strings);
|
||||
$smarty->assign("CATEGORY",getParentTab());
|
||||
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
$smarty->assign("THEME", $theme);
|
||||
$smarty->assign("IMAGE_PATH", $image_path);
|
||||
|
||||
// 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');
|
||||
|
||||
?>
|
||||
@@ -1,67 +0,0 @@
|
||||
<?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);
|
||||
|
||||
$idlist= vtlib_purify($_REQUEST['massedit_recordids']);
|
||||
$viewid = vtlib_purify($_REQUEST['viewname']);
|
||||
$return_module = vtlib_purify($_REQUEST['massedit_module']);
|
||||
$return_action = 'index';
|
||||
|
||||
global $rstart;
|
||||
//Added to fix 4600
|
||||
$url = getBasic_Advance_SearchURL();
|
||||
|
||||
if(isset($_REQUEST['start']) && $_REQUEST['start']!=''){
|
||||
$rstart = "&start=".vtlib_purify($_REQUEST['start']);
|
||||
}
|
||||
|
||||
if(isset($idlist)) {
|
||||
$recordids = explode(';', $idlist);
|
||||
for($index = 0; $index < count($recordids); ++$index) {
|
||||
$recordid = $recordids[$index];
|
||||
if($recordid == '') continue;
|
||||
if(isPermitted($currentModule,'EditView',$recordid) == 'yes') {
|
||||
|
||||
// Save each module record with update value.
|
||||
$focus->retrieve_entity_info($recordid, $currentModule);
|
||||
$focus->mode = 'edit';
|
||||
$focus->id = $recordid;
|
||||
foreach($focus->column_fields as $fieldname => $val)
|
||||
{
|
||||
if(isset($_REQUEST[$fieldname."_mass_edit_check"]))
|
||||
{
|
||||
if($fieldname == 'assigned_user_id'){
|
||||
if($_REQUEST['assigntype'] == 'U') {
|
||||
$value = $_REQUEST['assigned_user_id'];
|
||||
} elseif($_REQUEST['assigntype'] == 'T') {
|
||||
$value = $_REQUEST['assigned_group_id'];
|
||||
}
|
||||
} else {
|
||||
if(is_array($_REQUEST[$fieldname]))
|
||||
$value = $_REQUEST[$fieldname];
|
||||
else
|
||||
$value = trim($_REQUEST[$fieldname]);
|
||||
}
|
||||
$focus->column_fields[$fieldname] = $value;
|
||||
}
|
||||
else{
|
||||
$focus->column_fields[$fieldname] = decode_html($focus->column_fields[$fieldname]);
|
||||
}
|
||||
}
|
||||
$focus->save($currentModule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$parenttab = getParentTab();
|
||||
header("Location: index.php?module=$return_module&action=$return_action&parenttab=$parenttab$rstart");
|
||||
?>
|
||||
@@ -1,298 +0,0 @@
|
||||
<?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.
|
||||
*
|
||||
********************************************************************************/
|
||||
?>
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
if (document.layers)
|
||||
{
|
||||
document.write("This feature requires IE 5.5 or higher for Windows on Microsoft Windows 2000, Windows NT4 SP6, Windows XP.");
|
||||
document.write("<br><br>Click <a href='#' onclick='window.history.back();'>here</a> to return to the previous page");
|
||||
}
|
||||
else if (document.layers || (!document.all && document.getElementById))
|
||||
{
|
||||
document.write("This feature requires IE 5.5 or higher for Windows on Microsoft Windows 2000, Windows NT4 SP6, Windows XP.");
|
||||
document.write("<br><br>Click <a href='#' onclick='window.history.back();'>here</a> to return to the previous page");
|
||||
}
|
||||
else if(document.all)
|
||||
{
|
||||
document.write("<br><br>Click <a href='#' onclick='window.history.back();'>here</a> to return to the previous page");
|
||||
document.write("<OBJECT Name='vtigerCRM' codebase='modules/Settings/vtigerCRM.CAB#version=1,5,0,0' id='objMMPage' classid='clsid:0FC436C2-2E62-46EF-A3FB-E68E94705126' width=0 height=0></object>");
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
require_once('include/database/PearDatabase.php');
|
||||
require_once('config.php');
|
||||
|
||||
global $default_charset;
|
||||
|
||||
// Fix For: http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/2107
|
||||
$randomfilename = "vt_" . str_replace(array("."," "), "", microtime());
|
||||
|
||||
$templateid = $_REQUEST['mergefile'];
|
||||
|
||||
if($templateid == "")
|
||||
{
|
||||
die("Select Mail Merge Template");
|
||||
}
|
||||
//get the particular file from db and store it in the local hard disk.
|
||||
//store the path to the location where the file is stored and pass it as parameter to the method
|
||||
$sql = "select filename,data,filesize from vtiger_wordtemplates where templateid=?";
|
||||
|
||||
$result = $adb->pquery($sql, array($templateid));
|
||||
$temparray = $adb->fetch_array($result);
|
||||
|
||||
$fileContent = $temparray['data'];
|
||||
$filename=html_entity_decode($temparray['filename'], ENT_QUOTES, $default_charset);
|
||||
// Fix For: http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/2107
|
||||
$filename= $randomfilename . "_word.doc";
|
||||
|
||||
$filesize=$temparray['filesize'];
|
||||
$wordtemplatedownloadpath =$root_directory ."/test/wordtemplatedownload/";
|
||||
|
||||
$handle = fopen($wordtemplatedownloadpath.$filename,"wb");
|
||||
fwrite($handle,base64_decode($fileContent),$filesize);
|
||||
fclose($handle);
|
||||
|
||||
//<<<<<<<<<<<<<<<<<<<<<<<<<<<for mass merge>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
$mass_merge = $_REQUEST['allselectedboxes'];
|
||||
$single_record = $_REQUEST['record'];
|
||||
|
||||
if($mass_merge != "")
|
||||
{
|
||||
$mass_merge = explode(";",$mass_merge);
|
||||
$temp_mass_merge = $mass_merge;
|
||||
if(array_pop($temp_mass_merge)=="")
|
||||
array_pop($mass_merge);
|
||||
//$mass_merge = implode(",",$mass_merge);
|
||||
}else if($single_record != "")
|
||||
{
|
||||
$mass_merge = $single_record;
|
||||
}else
|
||||
{
|
||||
die("Record Id is not found, cannot merge the document");
|
||||
}
|
||||
|
||||
//echo $mass_merge;
|
||||
//die;
|
||||
//for setting vtiger_accountid=0 for the contacts which are deleted
|
||||
$ct_query = "select crmid from vtiger_crmentity where setype='Contacts' and deleted=1";
|
||||
$result = $adb->pquery($ct_query, array());
|
||||
|
||||
while($row = $adb->fetch_array($result))
|
||||
{
|
||||
$deleted_id[] = $row['crmid'];
|
||||
}
|
||||
|
||||
if(count($deleted_id) > 0)
|
||||
{
|
||||
$update_query = "update vtiger_contactdetails set accountid = 0 where contactid in (". generateQuestionMarks($deleted_id) .")";
|
||||
$result = $adb->pquery($update_query, array($deleted_id));
|
||||
}
|
||||
//End setting vtiger_accountid=0 for the contacts which are deleted
|
||||
|
||||
//<<<<<<<<<<<<<<<<header for csv and select columns for query>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
global $current_user;
|
||||
require('user_privileges/user_privileges_'.$current_user->id.'.php');
|
||||
if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == "Users" || $module == "Emails")
|
||||
{
|
||||
$query1="select vtiger_tab.name,vtiger_field.tablename,vtiger_field.columnname,vtiger_field.fieldlabel from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid where vtiger_field.tabid in (4,6) and vtiger_field.block <> 75 and vtiger_field.presence in (0,2) order by vtiger_field.tablename";
|
||||
$params1 = array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$profileList = getCurrentUserProfileList();
|
||||
$query1="select vtiger_tab.name,vtiger_field.tablename,vtiger_field.columnname,vtiger_field.fieldlabel from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid in (4,6) and vtiger_field.block <> 75 AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN (". generateQuestionMarks($profileList) .") and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid order by vtiger_field.tablename";
|
||||
$params1 = array($profileList);
|
||||
//Postgres 8 fixes
|
||||
if( $adb->dbType == "pgsql")
|
||||
$query1 = fixPostgresQuery( $query1, $log, 0);
|
||||
}
|
||||
|
||||
$result = $adb->pquery($query1, $params1);
|
||||
$y=$adb->num_rows($result);
|
||||
|
||||
for ($x=0; $x<$y; $x++)
|
||||
{
|
||||
$tablename = $adb->query_result($result,$x,"tablename");
|
||||
$columnname = $adb->query_result($result,$x,"columnname");
|
||||
$modulename = $adb->query_result($result,$x,"name");
|
||||
|
||||
if($tablename == "crmentity")
|
||||
{
|
||||
if($modulename == "Contacts")
|
||||
{
|
||||
$tablename = "vtiger_crmentityContacts";
|
||||
}
|
||||
}
|
||||
$querycolumns[$x] = $tablename.".".$columnname;
|
||||
if($columnname == "smownerid")
|
||||
{
|
||||
if($modulename == "Accounts")
|
||||
{
|
||||
$querycolumns[$x] = "case when (vtiger_users.user_name not like '') then concat(vtiger_users.last_name,' ',vtiger_users.first_name) else vtiger_groups.groupname end as userjoinname,vtiger_users.first_name,vtiger_users.last_name,vtiger_users.user_name,vtiger_users.yahoo_id,vtiger_users.title,vtiger_users.phone_work,vtiger_users.department,vtiger_users.phone_mobile,vtiger_users.phone_other,vtiger_users.phone_fax,vtiger_users.email1,vtiger_users.phone_home,vtiger_users.email2,vtiger_users.address_street,vtiger_users.address_city,vtiger_users.address_state,vtiger_users.address_postalcode,vtiger_users.address_country";
|
||||
}
|
||||
if($modulename == "Contacts")
|
||||
{
|
||||
$querycolumns[$x] = "case when (usersContacts.user_name not like '') then concat(usersContacts.last_name,' ',usersContacts.first_name) else groupsContacts.groupname end as userjoincname";
|
||||
}
|
||||
}
|
||||
if($columnname == "parentid")
|
||||
{
|
||||
$querycolumns[$x] = "vtiger_accountAccount.accountname";
|
||||
}
|
||||
if($columnname == "accountid")
|
||||
{
|
||||
$querycolumns[$x] = "vtiger_accountContacts.accountname";
|
||||
}
|
||||
if($columnname == "reportsto")
|
||||
{
|
||||
$querycolumns[$x] = "vtiger_contactdetailsContacts.lastname";
|
||||
}
|
||||
|
||||
if($modulename == "Accounts")
|
||||
{
|
||||
$field_label[$x] = "ACCOUNT_".strtoupper(str_replace(" ","",$adb->query_result($result,$x,"fieldlabel")));
|
||||
if($columnname == "smownerid")
|
||||
{
|
||||
$field_label[$x] = $field_label[$x].",USER_FIRSTNAME,USER_LASTNAME,USER_USERNAME,USER_YAHOOID,USER_TITLE,USER_OFFICEPHONE,USER_DEPARTMENT,USER_MOBILE,USER_OTHERPHONE,USER_FAX,USER_EMAIL,USER_HOMEPHONE,USER_OTHEREMAIL,USER_PRIMARYADDRESS,USER_CITY,USER_STATE,USER_POSTALCODE,USER_COUNTRY";
|
||||
}
|
||||
}
|
||||
|
||||
if($modulename == "Contacts")
|
||||
{
|
||||
$field_label[$x] = "CONTACT_".strtoupper(str_replace(" ","",$adb->query_result($result,$x,"fieldlabel")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$csvheader = implode(",",$field_label);
|
||||
//<<<<<<<<<<<<<<<<End>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
if(count($querycolumns) > 0)
|
||||
{
|
||||
$selectcolumns = implode($querycolumns,",");
|
||||
|
||||
$query = "select $selectcolumns from vtiger_account
|
||||
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid
|
||||
inner join vtiger_accountbillads on vtiger_account.accountid=vtiger_accountbillads.accountaddressid
|
||||
inner join vtiger_accountshipads on vtiger_account.accountid=vtiger_accountshipads.accountaddressid
|
||||
inner join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid
|
||||
left join vtiger_account as vtiger_accountAccount on vtiger_accountAccount.accountid = vtiger_account.parentid
|
||||
left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid
|
||||
LEFT JOIN vtiger_groups
|
||||
ON vtiger_groups.groupid = vtiger_crmentity.smownerid
|
||||
left join vtiger_contactdetails on vtiger_contactdetails.accountid=vtiger_account.accountid
|
||||
left join vtiger_crmentity as vtiger_crmentityContacts on vtiger_crmentityContacts.crmid = vtiger_contactdetails.contactid
|
||||
left join vtiger_contactaddress on vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid
|
||||
left join vtiger_contactsubdetails on vtiger_contactdetails.contactid = vtiger_contactsubdetails.contactsubscriptionid
|
||||
left join vtiger_contactscf on vtiger_contactdetails.contactid = vtiger_contactscf.contactid
|
||||
left join vtiger_customerdetails on vtiger_contactdetails.contactid = vtiger_customerdetails.customerid
|
||||
left join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto
|
||||
left join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.accountid
|
||||
left join vtiger_users as usersContacts on usersContacts.id = vtiger_crmentityContacts.smownerid
|
||||
LEFT JOIN vtiger_groups as groupsContacts
|
||||
ON groupsContacts.groupid = vtiger_crmentity.smownerid
|
||||
where vtiger_crmentity.deleted=0 and (vtiger_crmentityContacts.deleted=0 || vtiger_crmentityContacts.deleted is null) and vtiger_account.accountid in(". generateQuestionMarks($mass_merge) .")";
|
||||
//echo $query;
|
||||
//die;
|
||||
$result = $adb->pquery($query, array($mass_merge));
|
||||
$avail_pick_arr = getAccessPickListValues('Accounts');
|
||||
while($columnValues = $adb->fetch_array($result))
|
||||
{
|
||||
$y=$adb->num_fields($result);
|
||||
for($x=0; $x<$y; $x++)
|
||||
{
|
||||
$value = $columnValues[$x];
|
||||
foreach($columnValues as $key=>$val)
|
||||
{
|
||||
if($val == $value && $value != '')
|
||||
{
|
||||
if(array_key_exists($key,$avail_pick_arr))
|
||||
{
|
||||
if(!in_array($val,$avail_pick_arr[$key]))
|
||||
{
|
||||
$value = "Not Accessible";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//<<<<<<<<<<<<<<<for modifing default values>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
if(trim($value) == "--None--" || trim($value) == "--none--")
|
||||
{
|
||||
$value = "";
|
||||
}
|
||||
//<<<<<<<<<<<<<<<End>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
$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]))
|
||||
{
|
||||
$actual_values[$x] = '"'.$actual_values[$x].'"';
|
||||
}
|
||||
$actual_values[$x] = decode_html(str_replace(","," ",$actual_values[$x]));
|
||||
}
|
||||
$mergevalue[] = implode($actual_values,",");
|
||||
}
|
||||
$csvdata = implode($mergevalue,"###");
|
||||
}else
|
||||
{
|
||||
die("No fields to do Merge");
|
||||
}
|
||||
|
||||
// Fix for: http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/2107
|
||||
$datafilename = $randomfilename . "_data.csv";
|
||||
|
||||
$handle = fopen($wordtemplatedownloadpath.$datafilename,"wb");
|
||||
fwrite($handle,$csvheader."\r\n");
|
||||
fwrite($handle,str_replace("###","\r\n",$csvdata));
|
||||
fclose($handle);
|
||||
?>
|
||||
<script>
|
||||
if (window.ActiveXObject){
|
||||
try
|
||||
{
|
||||
ovtigerVM = eval("new ActiveXObject('vtigerCRM.ActiveX');");
|
||||
if(ovtigerVM)
|
||||
{
|
||||
var filename = "<?php echo $filename?>";
|
||||
if(filename != "")
|
||||
{
|
||||
if(objMMPage.bDLTempDoc("<?php echo $site_URL;?>/test/wordtemplatedownload/<?php echo $filename; ?>","MMTemplate.doc"))
|
||||
{
|
||||
try
|
||||
{
|
||||
if(objMMPage.Init())
|
||||
{
|
||||
objMMPage.vLTemplateDoc();
|
||||
objMMPage.bBulkHDSrc("<?php echo $site_URL;?>/test/wordtemplatedownload/<?php echo $datafilename ?>");
|
||||
objMMPage.vBulkOpenDoc();
|
||||
objMMPage.UnInit()
|
||||
window.history.back();
|
||||
}
|
||||
}catch(errorObject)
|
||||
{
|
||||
document.write("Error while processing mail merge operation");
|
||||
}
|
||||
}else
|
||||
{
|
||||
document.write("Cannot get template document");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
document.write("Requires to download ActiveX Control from vtigerCRM. Please, ensure that you have administration privilage");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
require_once('Popup.php');
|
||||
?>
|
||||
@@ -1,134 +0,0 @@
|
||||
<?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('database/DatabaseConnection.php');
|
||||
require_once('modules/Users/Users.php');
|
||||
require_once('include/utils/utils.php');
|
||||
|
||||
$module = vtlib_purify($_REQUEST['module']);
|
||||
$focus = CRMEntity::getInstance($module);
|
||||
|
||||
global $mod_strings, $app_strings, $app_list_strings;
|
||||
global $current_language, $currentModule, $theme;
|
||||
global $adb;
|
||||
|
||||
$theme_path="themes/".$theme."/";
|
||||
$image_path=$theme_path."images/";
|
||||
|
||||
$mode = $_REQUEST['mergemode'];
|
||||
|
||||
if($mode == 'mergesave') {
|
||||
|
||||
$return_module=vtlib_purify($_REQUEST['return_module']);
|
||||
$action=vtlib_purify($_REQUEST['action']);
|
||||
$return_action=vtlib_purify($_REQUEST['return_action']);
|
||||
$parenttab=vtlib_purify($_REQUEST['parent']);
|
||||
$merge_id=vtlib_purify($_REQUEST['record']);
|
||||
$recordids=vtlib_purify($_REQUEST['pass_rec']);
|
||||
|
||||
$result = $adb->pquery("SELECT count(*) AS count FROM vtiger_crmentity WHERE crmid=? and deleted=0", array($merge_id));
|
||||
$count = $adb->query_result($result,0,'count');
|
||||
|
||||
if($count > 0)
|
||||
{
|
||||
// First, save the primary record
|
||||
$focus->mode="edit";
|
||||
setObjectValuesFromRequest($focus);
|
||||
$focus->save($module);
|
||||
$rec_values=$focus->column_fields;
|
||||
|
||||
// Remove the id of primary record from the list of records to be deleted.
|
||||
$del_value=explode(",",$recordids,-1);
|
||||
$offset = array_search($merge_id,$del_value);
|
||||
unset($del_value[$offset]);
|
||||
|
||||
// Transfer the related lists of the records to be deleted, to the primary record's related list
|
||||
if(method_exists($focus, 'transferRelatedRecords')){
|
||||
$focus->transferRelatedRecords($module,$del_value,$merge_id);
|
||||
} else {
|
||||
transferRelatedRecords($module,$del_value,$merge_id);
|
||||
}
|
||||
|
||||
// Delete the records by id specified in the list
|
||||
foreach($del_value as $value)
|
||||
{
|
||||
DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$value,"");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
window.self.close();window.opener.location.href=window.opener.location.href;
|
||||
</script>
|
||||
<?php
|
||||
} elseif ($mode == 'mergefields') {
|
||||
|
||||
$idstring=vtlib_purify($_REQUEST['passurl']);
|
||||
$parent_tab=getParentTab();
|
||||
|
||||
$exploded_id=explode(",",$idstring,-1);
|
||||
$record_count = count($exploded_id);
|
||||
|
||||
$smarty = new vtigerCRM_Smarty;
|
||||
$smarty->assign("EDIT_DUPLICATE","");
|
||||
if($record_count == 2) {
|
||||
if(isPermitted($currentModule,"EditView",$exploded_id[0]) == 'yes' && isPermitted($currentModule,"EditView",$exploded_id[1]) == 'yes'
|
||||
&& isPermitted($currentModule,"Delete",$exploded_id[0]) == 'yes' && isPermitted($currentModule,"Delete",$exploded_id[1]) == 'yes')
|
||||
$smarty->assign("EDIT_DUPLICATE","permitted");
|
||||
}
|
||||
else {
|
||||
if(isPermitted($currentModule,"EditView",$exploded_id[0]) == 'yes' && isPermitted($currentModule,"EditView",$exploded_id[1]) == 'yes' && isPermitted($currentModule,"EditView",$exploded_id[2]) == 'yes'
|
||||
&& isPermitted($currentModule,"Delete",$exploded_id[0]) == 'yes' && isPermitted($currentModule,"Delete",$exploded_id[1]) == 'yes' && isPermitted($currentModule,"Delete",$exploded_id[2]) == 'yes')
|
||||
$smarty->assign("EDIT_DUPLICATE","permitted");
|
||||
}
|
||||
|
||||
$all_values_array=getRecordValues($exploded_id,$module);
|
||||
$all_values=$all_values_array[0];
|
||||
$js_arr_val=$all_values_array[1];
|
||||
$fld_array=$all_values_array[2];
|
||||
$js_arr=implode(",",$js_arr_val);
|
||||
|
||||
$imported_records = Array();
|
||||
$sql="select bean_id from vtiger_users_last_import where bean_type=? and deleted=0";
|
||||
$result = $adb->pquery($sql, array($module));
|
||||
$num_rows=$adb->num_rows($result);
|
||||
$count=0;
|
||||
for($i=0; $i<$num_rows;$i++)
|
||||
{
|
||||
foreach($exploded_id as $value)
|
||||
if($value == $adb->query_result($result,$i,"bean_id"))
|
||||
$count++;
|
||||
array_push($imported_records,$adb->query_result($result,$i,"bean_id"));
|
||||
}
|
||||
|
||||
if ($record_count == $count)
|
||||
$no_existing=1;
|
||||
else
|
||||
$no_existing=0;
|
||||
|
||||
$smarty->assign("MOD", $mod_strings);
|
||||
$smarty->assign("APP", $app_strings);
|
||||
$smarty->assign("RECORD_COUNT",$record_count);
|
||||
$smarty->assign("THEME", $theme);
|
||||
$smarty->assign("IMAGE_PATH", $image_path);
|
||||
$smarty->assign("MODULENAME", $module);
|
||||
$smarty->assign("PARENT_TAB", $parent_tab);
|
||||
$smarty->assign("JS_ARRAY", $js_arr);
|
||||
$smarty->assign("ID_ARRAY", $exploded_id);
|
||||
$smarty->assign("IDSTRING",$idstring);
|
||||
$smarty->assign("ALLVALUES", $all_values);
|
||||
$smarty->assign("FIELD_ARRAY", $fld_array);
|
||||
$smarty->assign("IMPORTED_RECORDS", $imported_records);
|
||||
$smarty->assign("NO_EXISTING", $no_existing);
|
||||
$smarty->display("MergeFields.tpl");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?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/quickcreate.php');
|
||||
?>
|
||||
@@ -1,231 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/Save.php,v 1.7 2005/03/15 09:55:31 shaw Exp $
|
||||
* Description: Saves an Account record and then redirects the browser to the
|
||||
* defined return URL.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('modules/Accounts/Accounts.php');
|
||||
require_once('include/logging.php');
|
||||
require_once('include/database/PearDatabase.php');
|
||||
|
||||
//added to fix 4600
|
||||
$search=vtlib_purify($_REQUEST['search_url']);
|
||||
if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check'] != '')
|
||||
{
|
||||
//started
|
||||
$value = $_REQUEST['accountname'];
|
||||
$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);
|
||||
$id = $_REQUEST['record'];
|
||||
if(isset($id) && $id !='') {
|
||||
$query .= " and vtiger_account.accountid != ?";
|
||||
array_push($params, $id);
|
||||
}
|
||||
$result = $adb->pquery($query, $params);
|
||||
if($adb->num_rows($result) > 0)
|
||||
{
|
||||
echo $mod_strings['LBL_ACCOUNT_EXIST'];
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'SUCCESS';
|
||||
}
|
||||
die;
|
||||
}
|
||||
//Ended
|
||||
|
||||
$local_log =& LoggerManager::getLogger('index');
|
||||
global $log;
|
||||
$focus = new Accounts();
|
||||
global $current_user;
|
||||
$currencyid=fetchCurrency($current_user->id);
|
||||
$rate_symbol = getCurrencySymbolandCRate($currencyid);
|
||||
$rate = $rate_symbol['rate'];
|
||||
$curr_symbol = $rate_symbol['symbol'];
|
||||
if(isset($_REQUEST['record']))
|
||||
{
|
||||
$focus->id = $_REQUEST['record'];
|
||||
$log->info("id is ".$focus->id);
|
||||
}
|
||||
if(isset($_REQUEST['mode']))
|
||||
{
|
||||
$focus->mode = $_REQUEST['mode'];
|
||||
}
|
||||
|
||||
foreach($focus->column_fields as $fieldname => $val)
|
||||
{
|
||||
if(isset($_REQUEST[$fieldname]))
|
||||
{
|
||||
if(is_array($_REQUEST[$fieldname]))
|
||||
$value = $_REQUEST[$fieldname];
|
||||
else
|
||||
$value = trim($_REQUEST[$fieldname]);
|
||||
$log->DEBUG($fieldname."=Field Name &first& Value =".$value);
|
||||
$focus->column_fields[$fieldname] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['annual_revenue']))
|
||||
{
|
||||
$value = convertToDollar($_REQUEST['annual_revenue'],$rate);
|
||||
$focus->column_fields['annual_revenue'] = $value;
|
||||
}
|
||||
|
||||
if($_REQUEST['assigntype'] == 'U') {
|
||||
$focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_user_id'];
|
||||
} elseif($_REQUEST['assigntype'] == 'T') {
|
||||
$focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_group_id'];
|
||||
}
|
||||
|
||||
//When changing the Account Address Information it should also change the related contact address - dina
|
||||
if($focus->mode == 'edit' && $_REQUEST['address_change'] == 'yes')
|
||||
{
|
||||
$query = "update vtiger_contactaddress set mailingcity=?,mailingstreet=?,mailingcountry=?,mailingzip=?,mailingpobox=?,mailingstate=?,othercountry=?,othercity=?,otherstate=?,otherzip=?,otherstreet=?,otherpobox=? where contactaddressid in (select contactid from vtiger_contactdetails where accountid=?)" ;
|
||||
$params = array($focus->column_fields['bill_city'], $focus->column_fields['bill_street'], $focus->column_fields['bill_country'],
|
||||
$focus->column_fields['bill_code'], $focus->column_fields['bill_pobox'], $focus->column_fields['bill_state'], $focus->column_fields['ship_country'],
|
||||
$focus->column_fields['ship_city'], $focus->column_fields['ship_state'], $focus->column_fields['ship_code'], $focus->column_fields['ship_street'],
|
||||
$focus->column_fields['ship_pobox'], $focus->id);
|
||||
$adb->pquery($query, $params);
|
||||
}
|
||||
//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();
|
||||
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = vtlib_purify($_REQUEST['return_module']);
|
||||
else $return_module = "Accounts";
|
||||
if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") $return_action = vtlib_purify($_REQUEST['return_action']);
|
||||
else $return_action = "DetailView";
|
||||
if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = vtlib_purify($_REQUEST['return_id']);
|
||||
|
||||
$local_log->debug("Saved record with id of ".$return_id);
|
||||
|
||||
//code added for returning back to the current view after edit from list view
|
||||
if($_REQUEST['return_viewname'] == '') $return_viewname='0';
|
||||
if($_REQUEST['return_viewname'] != '')$return_viewname=vtlib_purify($_REQUEST['return_viewname']);
|
||||
|
||||
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
|
||||
*/
|
||||
function save_customfields($entity_id)
|
||||
{
|
||||
global $log;
|
||||
$log->debug("Entering save_customfields(".$entity_id.") method ...");
|
||||
$log->info("save customfields invoked");
|
||||
global $adb;
|
||||
$dbquery = "SELECT * FROM customfields WHERE module = 'Accounts'";
|
||||
$result = $adb->pquery($dbquery, array());
|
||||
|
||||
$custquery = "SELECT * FROM vtiger_accountcf WHERE vtiger_accountid = ?";
|
||||
$cust_result = $adb->pquery($custquery, array($entity_id));
|
||||
if($adb->num_rows($result) != 0)
|
||||
{
|
||||
|
||||
$columns='';
|
||||
$values='';
|
||||
$ins_params = array();
|
||||
$update='';
|
||||
$upd_params = array();
|
||||
|
||||
$noofrows = $adb->num_rows($result);
|
||||
for($i=0; $i<$noofrows; $i++)
|
||||
{
|
||||
$fldName=$adb->query_result($result,$i,"fieldlabel");
|
||||
$colName=$adb->query_result($result,$i,"column_name");
|
||||
if(isset($_REQUEST[$colName]))
|
||||
{
|
||||
$fldvalue=$_REQUEST[$colName];
|
||||
if(get_magic_quotes_gpc() == 1)
|
||||
{
|
||||
$fldvalue = stripslashes($fldvalue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$fldvalue = '';
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $adb->num_rows($cust_result) !=0)
|
||||
{
|
||||
//Update Block
|
||||
if($i == 0)
|
||||
{
|
||||
$update = $colName."=?";
|
||||
array_push($upd_params, $fldvalue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$update .= ', '.$colName."=?";
|
||||
array_push($upd_params, $fldvalue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Insert Block
|
||||
if($i == 0)
|
||||
{
|
||||
$columns='accountid, '.$colName;
|
||||
array_push($ins_params, $entity_id, $fldvalue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$columns .= ', '.$colName;
|
||||
array_push($ins_params, $fldvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $adb->num_rows($cust_result) !=0)
|
||||
{
|
||||
//Update Block
|
||||
$query = "UPDATE vtiger_accountcf SET $update WHERE vtiger_accountid=?";
|
||||
array_push($upd_params, $entity_id);
|
||||
$adb->pquery($query, $upd_params);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Insert Block
|
||||
$query = "INSERT INTO vtiger_accountcf ($columns) VALUES(" . generateQuestionMarks($ins_params) .")";
|
||||
$adb->pquery($query, $ins_params);
|
||||
}
|
||||
|
||||
}
|
||||
$log->debug("Exiting save_customfields method ...");
|
||||
}
|
||||
?>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?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/Vtiger/Settings.php');
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?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/TagCloud.php')
|
||||
?>
|
||||
@@ -1,100 +0,0 @@
|
||||
<?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/Accounts/Accounts.php");
|
||||
require_once("getCompanyProfile.php");
|
||||
$variable = vtlib_purify($_REQUEST['tickersymbol']);
|
||||
$url = "http://moneycentral.msn.com/investor/research/profile.asp?Symbol=".trim($variable);
|
||||
$data = getComdata($url,trim($variable));
|
||||
if(is_array($data))
|
||||
{
|
||||
$summary = array_shift($data);
|
||||
list($comp, $address, $phone, $fax, $site, $industry, $emp,$desc1,$desc2) = explode(":", $summary);
|
||||
$address = str_replace("Company Report","",$address);
|
||||
$address = str_replace("Phone","",$address);
|
||||
$phone = str_replace("Fax","",$phone);
|
||||
$fax = str_replace("http","",$fax);
|
||||
$site = str_replace("Industry","",$site);
|
||||
$site = str_replace("//","",$site);
|
||||
$industry = str_replace("Employees","",$industry);
|
||||
$emp = str_replace("Exchange","",$emp);
|
||||
$first_array =array_slice($data,0, 8);
|
||||
$second_array = array_slice($data,8);
|
||||
$output='';
|
||||
$output .= '<table border="0" cellpadding="0" cellspacing="0" width="80%" align=center>
|
||||
<tr><td class="detailedViewHeader" style="cursor:pointer;" onclick=\'just();\'><b>Company Report</b></td></tr>
|
||||
<tr><td>
|
||||
<div id="company">
|
||||
<div id="innerLayer">
|
||||
<input type="hidden" name="address" value="'.trim($address).'">
|
||||
<input type="hidden" name="Phone" value="'.trim($phone).'">
|
||||
<input type="hidden" name="Fax" value="'.trim($fax).'">
|
||||
<input type="hidden" name="site" value="'.trim($site).'">
|
||||
<input type="hidden" name="emp" value="'.trim($emp).'">
|
||||
<table class="small" border="0" cellpadding="0" cellspacing="0" width="60%" align="center">
|
||||
<tr>
|
||||
<td colspan="2" class="detailedViewHeader"><b>'.$comp.'</b></td>
|
||||
</tr>';
|
||||
$output .='<tr><td><table><tr><td><table width="185">';
|
||||
foreach($first_array as $arr => $val)
|
||||
{
|
||||
$output .= '<tr>';
|
||||
for($j=0;$j<count($val);$j+=2)
|
||||
{
|
||||
$output .= '<td class="dvtCellLabel" align="right" width="20%">'.$val[$j].'</td>
|
||||
<td width="30%" align="left" class="dvtCellInfo">'.$val[$j+1].'</td>';
|
||||
}
|
||||
$output .= '</tr>';
|
||||
}
|
||||
$output .='</table></td>';
|
||||
$output .='<td><table width="185">';
|
||||
array_shift($second_array[0]);
|
||||
array_shift($second_array[0]);
|
||||
foreach($second_array as $arr => $val)
|
||||
{
|
||||
$output .= '<tr>';
|
||||
for($j=0;$j<count($val);$j+=2)
|
||||
{
|
||||
$output .= '<td lass="dvtCellLabel" align="right" width="20%">'.$val[$j].'</td>
|
||||
<td width="30%" align="left" class="dvtCellInfo">'.$val[$j+1].'</td>';
|
||||
}
|
||||
$output .= '</tr>';
|
||||
}
|
||||
$output .='</table></td><td align=left><a href="http://finance.yahoo.com/q/bc?s='.trim($variable).'&t=1d" target="_blank"><img src="http://ichart.finance.yahoo.com/t?s='.trim($variable).'" width="192" height="96" alt="[Chart]" border="0"></a></td></tr></table></td></tr>';
|
||||
$output .= '<tr style="height: 25px;">
|
||||
<td colspan="2" style="border-top:1px solid #eaeaea;"> </td>
|
||||
</tr></table>';
|
||||
$output .= '<table class="small" border="0" cellpadding="0" cellspacing="0" width="60%" align="center" id="conf">
|
||||
<tr>
|
||||
<td colspan="2" class="detailedViewHeader"><b>BUSINESS SUMMARY</b></td>
|
||||
</tr>
|
||||
<td width="30%" align="left" class="dvtCellInfo"><textarea id="summary" cols=80 rows=5 readonly>'.$desc1.' '.$desc2.'</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding: 5px;border-top:1px solid #eaeaea;">
|
||||
<div align="center">
|
||||
<input title="Save [Alt+S]" accesskey="S" class="small" name="button" value="Yes" style="width: 70px;" type="button" onclick=\'fnDown("conf");\' />
|
||||
<input title="Cancel [Alt+X]" accesskey="X" class="small" name="button" value="No" style="width: 70px;" type="button" onclick=\'just();\'/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></div>
|
||||
</td></tr></table>';
|
||||
echo $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = '';
|
||||
$output .= "<div style='display:block'>";
|
||||
$output .= "<b><font color='red'>".$data."</font>";
|
||||
$output .= "</div>";
|
||||
echo $output;
|
||||
}
|
||||
?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?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/Home/UnifiedSearch.php';
|
||||
?>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
|
||||
* the specific language governing rights and limitations under the License.
|
||||
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
|
||||
* All Rights Reserved.
|
||||
|
||||
* Contributor(s): ______________________________________.
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/index.php,v 1.4 2005/03/17 10:53:29 samk Exp $
|
||||
|
||||
* Description: TODO To be written.
|
||||
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
|
||||
* All Rights Reserved.
|
||||
|
||||
* Contributor(s): ______________________________________..
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
global $theme;
|
||||
|
||||
$theme_path="themes/".$theme."/";
|
||||
|
||||
$image_path=$theme_path."images/";
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
include ('modules/Accounts/ListView.php');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
|
||||
* ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/language/en_us.lang.php,v 1.18 2005/03/19 08:59:20 rank Exp $
|
||||
* Description: Defines the English language pack
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = Array(
|
||||
'LBL_MODULE_NAME'=>'Accounts',
|
||||
'LBL_MODULE_TITLE'=>'Accounts: Home',
|
||||
'LBL_SEARCH_FORM_TITLE'=>'Account Search',
|
||||
'LBL_LIST_FORM_TITLE'=>'Account List',
|
||||
'LBL_NEW_FORM_TITLE'=>'New Account',
|
||||
'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations',
|
||||
// Label for Top Accounts in Home Page, added for 4.2 GA
|
||||
'LBL_TOP_ACCOUNTS'=>'My Top Accounts',
|
||||
'LBL_TOP_AMOUNT'=>'Amount',
|
||||
'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
|
||||
'LBL_LIST_CITY'=>'City',
|
||||
'LBL_LIST_WEBSITE'=>'Website',
|
||||
'LBL_LIST_STATE'=>'State',
|
||||
'LBL_LIST_PHONE'=>'Phone',
|
||||
'LBL_LIST_EMAIL_ADDRESS'=>'Email Address',
|
||||
'LBL_LIST_CONTACT_NAME'=>'Contact Name',
|
||||
'LBL_LIST_AMOUNT' => 'Total Amount',
|
||||
|
||||
//DON'T CONVERT THESE THEY ARE MAPPINGS
|
||||
'db_name' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'db_website' => 'LBL_LIST_WEBSITE',
|
||||
'db_billing_address_city' => 'LBL_LIST_CITY',
|
||||
|
||||
//END DON'T CONVERT
|
||||
|
||||
'LBL_ACCOUNT'=>'Account:',
|
||||
'LBL_ACCOUNT_NAME'=>'Account Name:',
|
||||
'LBL_PHONE'=>'Phone:',
|
||||
'LBL_WEBSITE'=>'Website:',
|
||||
'LBL_FAX'=>'Fax:',
|
||||
'LBL_TICKER_SYMBOL'=>'Ticker Symbol:',
|
||||
'LBL_OTHER_PHONE'=>'Other Phone:',
|
||||
'LBL_ANY_PHONE'=>'Any Phone:',
|
||||
'LBL_MEMBER_OF'=>'Member of:',
|
||||
'LBL_EMAIL'=>'Email:',
|
||||
'LBL_EMPLOYEES'=>'Employees:',
|
||||
'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:',
|
||||
'LBL_ANY_EMAIL'=>'Any Email:',
|
||||
'LBL_OWNERSHIP'=>'Ownership:',
|
||||
'LBL_RATING'=>'Rating:',
|
||||
'LBL_INDUSTRY'=>'Industry:',
|
||||
'LBL_SIC_CODE'=>'SIC Code:',
|
||||
'LBL_TYPE'=>'Type:',
|
||||
'LBL_ANNUAL_REVENUE'=>'Annual Revenue:',
|
||||
'LBL_ADDRESS_INFORMATION'=>'Address Information',
|
||||
'LBL_ACCOUNT_INFORMATION'=>'Account Information',
|
||||
'LBL_CUSTOM_INFORMATION'=>'Custom Information',
|
||||
'LBL_BILLING_ADDRESS'=>'Billing Address:',
|
||||
'LBL_SHIPPING_ADDRESS'=>'Shipping Address:',
|
||||
'LBL_ANY_ADDRESS'=>'Any Address:',
|
||||
'LBL_CITY'=>'City:',
|
||||
'LBL_STATE'=>'State:',
|
||||
'LBL_POSTAL_CODE'=>'Postal Code:',
|
||||
'LBL_COUNTRY'=>'Country:',
|
||||
'LBL_DESCRIPTION_INFORMATION'=>'Description Information',
|
||||
'LBL_DESCRIPTION'=>'Description:',
|
||||
'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address',
|
||||
'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address',
|
||||
'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?',
|
||||
'LBL_DUPLICATE'=>'Potential Duplicate Accounts',
|
||||
'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.',
|
||||
|
||||
'LBL_INVITEE'=>'Contacts',
|
||||
'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.",
|
||||
|
||||
'LBL_SELECT_ACCOUNT'=>'Select Account',
|
||||
'LBL_GENERAL_INFORMATION'=>'General Information',
|
||||
|
||||
//for v4 release added
|
||||
'LBL_NEW_POTENTIAL'=>'New Potential',
|
||||
'LBL_POTENTIAL_TITLE'=>'Potentials',
|
||||
|
||||
'LBL_NEW_TASK'=>'New Task',
|
||||
'LBL_TASK_TITLE'=>'Tasks',
|
||||
'LBL_NEW_CALL'=>'New Call',
|
||||
'LBL_CALL_TITLE'=>'Calls',
|
||||
'LBL_NEW_MEETING'=>'New Meeting',
|
||||
'LBL_MEETING_TITLE'=>'Meetings',
|
||||
'LBL_NEW_EMAIL'=>'New Email',
|
||||
'LBL_EMAIL_TITLE'=>'Emails',
|
||||
'LBL_NEW_CONTACT'=>'New Contact',
|
||||
'LBL_CONTACT_TITLE'=>'Contacts',
|
||||
|
||||
//Added vtiger_fields after RC1 - Release
|
||||
'LBL_ALL'=>'All',
|
||||
'LBL_PROSPECT'=>'Prospect',
|
||||
'LBL_INVESTOR'=>'Investor',
|
||||
'LBL_RESELLER'=>'Reseller',
|
||||
'LBL_PARTNER'=>'Partner',
|
||||
|
||||
// Added for 4GA
|
||||
'LBL_TOOL_FORM_TITLE'=>'Account Tools',
|
||||
//Added for 4GA
|
||||
'Account Name'=>'Account Name',
|
||||
'Phone'=>'Phone',
|
||||
'Website'=>'Website',
|
||||
'Fax'=>'Fax',
|
||||
'Ticker Symbol'=>'Ticker Symbol',
|
||||
'Other Phone'=>'Other Phone',
|
||||
'Member Of'=>'Member Of',
|
||||
'Email'=>'Email',
|
||||
'Employees'=>'Employees',
|
||||
'Other Email'=>'Other Email',
|
||||
'Ownership'=>'Ownership',
|
||||
'Rating'=>'Rating',
|
||||
'industry'=>'Industry',
|
||||
'SIC Code'=>'SIC Code',
|
||||
'Type'=>'Type',
|
||||
'Annual Revenue'=>'Annual Revenue',
|
||||
'Assigned To'=>'Assigned To',
|
||||
'Billing Address'=>'Billing Address',
|
||||
'Shipping Address'=>'Shipping Address',
|
||||
'Billing City'=>'Billing City',
|
||||
'Shipping City'=>'Shipping City',
|
||||
'Billing State'=>'Billing State',
|
||||
'Shipping State'=>'Shipping State',
|
||||
'Billing Code'=>'Billing Postal Code',
|
||||
'Shipping Code'=>'Shipping Postal Code',
|
||||
'Billing Country'=>'Billing Country',
|
||||
'Shipping Country'=>'Shipping Country',
|
||||
'Created Time'=>'Created Time',
|
||||
'Modified Time'=>'Modified Time',
|
||||
'Description'=>'Description',
|
||||
'Shipping Po Box'=>'Shipping PO Box',
|
||||
'Billing Po Box'=>'Billing PO Box',
|
||||
|
||||
//Added after 4.2 patch 2
|
||||
'Email Opt Out'=>'Email Opt Out',
|
||||
'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:',
|
||||
|
||||
//Added after 5Alpha5
|
||||
'Notify Owner'=>'Notify Owner',
|
||||
|
||||
//Added for existing picklist entries
|
||||
|
||||
'--None--'=>'--None--',
|
||||
|
||||
'Acquired'=>'Acquired',
|
||||
'Active'=>'Active',
|
||||
'Market Failed'=>'Market Failed',
|
||||
'Project Cancelled'=>'Project Cancelled',
|
||||
'Shutdown'=>'Shutdown',
|
||||
|
||||
'Apparel'=>'Apparel',
|
||||
'Banking'=>'Banking',
|
||||
'Biotechnology'=>'Biotechnology',
|
||||
'Chemicals'=>'Chemicals',
|
||||
'Communications'=>'Communications',
|
||||
'Construction'=>'Construction',
|
||||
'Consulting'=>'Consulting',
|
||||
'Education'=>'Education',
|
||||
'Electronics'=>'Electronics',
|
||||
'Energy'=>'Energy',
|
||||
'Engineering'=>'Engineering',
|
||||
'Entertainment'=>'Entertainment',
|
||||
'Environmental'=>'Environmental',
|
||||
'Finance'=>'Finance',
|
||||
'Food & Beverage'=>'Food & Beverage',
|
||||
'Government'=>'Government',
|
||||
'Healthcare'=>'Healthcare',
|
||||
'Hospitality'=>'Hospitality',
|
||||
'Insurance'=>'Insurance',
|
||||
'Machinery'=>'Machinery',
|
||||
'Manufacturing'=>'Manufacturing',
|
||||
'Media'=>'Media',
|
||||
'Not For Profit'=>'Not For Profit',
|
||||
'Recreation'=>'Recreation',
|
||||
'Retail'=>'Retail',
|
||||
'Shipping'=>'Shipping',
|
||||
'Technology'=>'Technology',
|
||||
'Telecommunications'=>'Telecommunications',
|
||||
'Transportation'=>'Transportation',
|
||||
'Utilities'=>'Utilities',
|
||||
'Other'=>'Other',
|
||||
|
||||
'Analyst'=>'Analyst',
|
||||
'Competitor'=>'Competitor',
|
||||
'Customer'=>'Customer',
|
||||
'Integrator'=>'Integrator',
|
||||
'Investor'=>'Investor',
|
||||
'Partner'=>'Partner',
|
||||
'Press'=>'Press',
|
||||
'Prospect'=>'Prospect',
|
||||
'Reseller'=>'Reseller',
|
||||
'LBL_START_DATE' => 'Start Date',
|
||||
'LBL_END_DATE' => 'End Date',
|
||||
|
||||
// Added/Updated for vtiger CRM 5.0.4
|
||||
|
||||
//added to fix the issue #4081
|
||||
'LBL_ACCOUNT_EXIST' => 'Account Name Already Exists!',
|
||||
|
||||
// mailer export
|
||||
'LBL_MAILER_EXPORT' => 'Mailer Export',
|
||||
'LBL_MAILER_EXPORT_CONTACTS_TYPE'=>'Select Contacts:',
|
||||
'LBL_MAILER_EXPORT_CONTACTS_DESCR'=>'Contacts can also be selected via "Custom Fields" and some standard fields.',
|
||||
'LBL_MAILER_EXPORT_RESULTS_TYPE'=>'Select export type:',
|
||||
'LBL_MAILER_EXPORT_RESULTS_DESCR'=>'The data will gathered from the Accounts and their Contacts, that were returned
|
||||
from the previous search.',
|
||||
'LBL_EXPORT_RESULTS_EMAIL' => 'Export E-Mailer data',
|
||||
'LBL_EXPORT_RESULTS_EMAIL_CORP'=>'Export E-Mail data, using "Company Email" from the Account if the Contacts "Email" is empty',
|
||||
'LBL_EXPORT_RESULTS_FULL'=>'Export data with the Contacts, E-Mail, Account name, Address, Telephone, etc.',
|
||||
'LBL_EXPORT_RESULTS_GO'=>'Export',
|
||||
'LBL_MAILER_EXPORT_IGNORE' => '--ignore--',
|
||||
'LBL_MAILER_EXPORT_CHECKED' =>'Checked',
|
||||
'LBL_MAILER_EXPORT_NOTCHECKED' => 'Not Checked',
|
||||
|
||||
// Added after 5.0.4 GA
|
||||
|
||||
//Module Sequence Numbering
|
||||
'Account No'=>'Account No',
|
||||
// END
|
||||
|
||||
// Account Hierarchy
|
||||
'LBL_SHOW_ACCOUNT_HIERARCHY' => 'Show Account Hierarchy',
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -1,242 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2006-2010 YUCHENG HU
|
||||
*
|
||||
* ---------------------------------------------
|
||||
* HA WEBSYSTEMS
|
||||
* http://www.hawebs.net
|
||||
* https://www.hawebs.org/forums/computer/
|
||||
*
|
||||
* CONTACT
|
||||
* huyuchengus@gmail.com / yuchenghu@hawebs.net
|
||||
*
|
||||
* ---------------------------------------------
|
||||
* [A] GNU GENERAL PUBLIC LICENSE GNU/LGPL
|
||||
* [B] Apache License, Version 2.0
|
||||
*
|
||||
* ---------------------------------------------
|
||||
* NOTE
|
||||
* 1. 所有的语言配置文件请采用 UTF-8 编码
|
||||
*
|
||||
* ---------------------------------------------
|
||||
*/
|
||||
$mod_strings=Array(
|
||||
'LBL_MODULE_NAME'=>'客户',
|
||||
'LBL_MODULE_TITLE'=>'客户:首页',
|
||||
'LBL_SEARCH_FORM_TITLE'=>'搜寻客户',
|
||||
'LBL_LIST_FORM_TITLE'=>'客户列表',
|
||||
'LBL_NEW_FORM_TITLE'=>'新增客户',
|
||||
'LBL_MEMBER_ORG_FORM_TITLE'=>'成员组织性质',
|
||||
//LabelforTopAccountsinHomePage,addedfor4.2GA
|
||||
'LBL_TOP_ACCOUNTS'=>'我的重要客户',
|
||||
'LBL_TOP_AMOUNT'=>'金额',
|
||||
'LBL_LIST_ACCOUNT_NAME'=>'客户名称',
|
||||
'LBL_LIST_CITY'=>'乡镇市区',
|
||||
'LBL_LIST_WEBSITE'=>'网站',
|
||||
'LBL_LIST_STATE'=>'县市',
|
||||
'LBL_LIST_PHONE'=>'电话',
|
||||
'LBL_LIST_EMAIL_ADDRESS'=>'电子邮件地址',
|
||||
'LBL_LIST_CONTACT_NAME'=>'联系人姓名',
|
||||
'LBL_LIST_AMOUNT'=>'机会总计',
|
||||
|
||||
//DON'TCONVERTTHESETHEYAREMAPPINGS
|
||||
'db_name'=>'LBL_LIST_ACCOUNT_NAME',
|
||||
'db_website'=>'LBL_LIST_WEBSITE',
|
||||
'db_billing_address_city'=>'LBL_LIST_CITY',
|
||||
|
||||
//ENDDON'TCONVERT
|
||||
|
||||
'LBL_ACCOUNT'=>'客户:',
|
||||
'LBL_ACCOUNT_NAME'=>'客户名称:',
|
||||
'LBL_PHONE'=>'电话:',
|
||||
'LBL_WEBSITE'=>'网站:',
|
||||
'LBL_FAX'=>'传真:',
|
||||
'LBL_TICKER_SYMBOL'=>'传票符号:',
|
||||
'LBL_OTHER_PHONE'=>'其它电话:',
|
||||
'LBL_ANY_PHONE'=>'其它电话:',
|
||||
'LBL_MEMBER_OF'=>'成员:',
|
||||
'LBL_EMAIL'=>'电子邮件:',
|
||||
'LBL_EMPLOYEES'=>'员工:',
|
||||
'LBL_OTHER_EMAIL_ADDRESS'=>'其它电子邮件:',
|
||||
'LBL_ANY_EMAIL'=>'其它电子邮件:',
|
||||
'LBL_OWNERSHIP'=>'所有者:',
|
||||
'LBL_RATING'=>'评价:',
|
||||
'LBL_INDUSTRY'=>'行业别:',
|
||||
'LBL_SIC_CODE'=>'统一编号:',
|
||||
'LBL_TYPE'=>'类型:',
|
||||
'LBL_ANNUAL_REVENUE'=>'年营业额:',
|
||||
'LBL_ADDRESS_INFORMATION'=>'地址信息',
|
||||
'LBL_ACCOUNT_INFORMATION'=>'账号信息',
|
||||
'LBL_CUSTOM_INFORMATION'=>'客户信息',
|
||||
'LBL_BILLING_ADDRESS'=>'账单地址:',
|
||||
'LBL_SHIPPING_ADDRESS'=>'送货地址:',
|
||||
'LBL_ANY_ADDRESS'=>'其它地址:',
|
||||
'LBL_CITY'=>'乡镇市区:',
|
||||
'LBL_STATE'=>'县市:',
|
||||
'LBL_POSTAL_CODE'=>'邮政编码:',
|
||||
'LBL_COUNTRY'=>'国家:',
|
||||
'LBL_DESCRIPTION_INFORMATION'=>'描述信息',
|
||||
'LBL_DESCRIPTION'=>'描述:',
|
||||
'NTC_COPY_BILLING_ADDRESS'=>'复制账单地址内容到送货地址',
|
||||
'NTC_COPY_SHIPPING_ADDRESS'=>'复制送货地址内容到账单地址',
|
||||
'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'您确定要删除这笔成员/组织的记录吗?',
|
||||
'LBL_DUPLICATE'=>'复制潜在案件客户',
|
||||
'MSG_DUPLICATE'=>'由潜在案件客户中复制建立新客户,您可以点选客户列表中的客户以复制建立新的客户,并且继承它的相关数据。',
|
||||
|
||||
'LBL_INVITEE'=>'联系人',
|
||||
'ERR_DELETE_RECORD'=>'要删除账号您必须指定一笔记录编号.',
|
||||
|
||||
'LBL_SELECT_ACCOUNT'=>'选择客户',
|
||||
'LBL_GENERAL_INFORMATION'=>'主要信息',
|
||||
|
||||
//forv4releaseadded
|
||||
'LBL_NEW_POTENTIAL'=>'新增潜在案件',
|
||||
'LBL_POTENTIAL_TITLE'=>'潜在案件',
|
||||
|
||||
'LBL_NEW_TASK'=>'新增任务',
|
||||
'LBL_TASK_TITLE'=>'任务',
|
||||
'LBL_NEW_CALL'=>'新增电话记录',
|
||||
'LBL_CALL_TITLE'=>'电话记录',
|
||||
'LBL_NEW_MEETING'=>'新增会议记录',
|
||||
'LBL_MEETING_TITLE'=>'会议',
|
||||
'LBL_NEW_EMAIL'=>'新增电子邮件',
|
||||
'LBL_EMAIL_TITLE'=>'邮件',
|
||||
'LBL_NEW_CONTACT'=>'新增联系人',
|
||||
'LBL_CONTACT_TITLE'=>'联系人',
|
||||
|
||||
//Addedvtiger_fieldsafterRC1-Release
|
||||
'LBL_ALL'=>'全部',
|
||||
'LBL_PROSPECT'=>'期望',
|
||||
'LBL_INVESTOR'=>'投资者',
|
||||
'LBL_RESELLER'=>'转售人',
|
||||
'LBL_PARTNER'=>'伙伴',
|
||||
|
||||
//Addedfor4GA
|
||||
'LBL_TOOL_FORM_TITLE'=>'客户工具',
|
||||
//Addedfor4GA
|
||||
'AccountName'=>'客户名称',
|
||||
'Phone'=>'电话',
|
||||
'Website'=>'网址',
|
||||
'Fax'=>'传真',
|
||||
'TickerSymbol'=>'传票符号',
|
||||
'OtherPhone'=>'其它电话',
|
||||
'MemberOf'=>'成员',
|
||||
'Email'=>'电子邮件',
|
||||
'Employees'=>'员工',
|
||||
'OtherEmail'=>'其它电子邮件',
|
||||
'Ownership'=>'拥有者',
|
||||
'Rating'=>'评价',
|
||||
'industry'=>'行业别',
|
||||
'SICCode'=>'统一编号',
|
||||
'Type'=>'类型',
|
||||
'AnnualRevenue'=>'年营业额',
|
||||
'AssignedTo'=>'负责人',
|
||||
'BillingAddress'=>'账单地址',
|
||||
'ShippingAddress'=>'送货地址',
|
||||
'BillingCity'=>'乡镇市区',
|
||||
'ShippingCity'=>'乡镇市区',
|
||||
'BillingState'=>'县市',
|
||||
'ShippingState'=>'县市',
|
||||
'BillingCode'=>'邮政编码',
|
||||
'ShippingCode'=>'邮政编码',
|
||||
'BillingCountry'=>'国家',
|
||||
'ShippingCountry'=>'国家',
|
||||
'CreatedTime'=>'建立时间',
|
||||
'ModifiedTime'=>'修改时间',
|
||||
'Description'=>'描述',
|
||||
'ShippingPoBox'=>'付款地址采购订单信箱',
|
||||
'BillingPoBox'=>'付款地址采购订单信箱',
|
||||
|
||||
//Addedafter4.2patch2
|
||||
'EmailOptOut'=>'拒绝电子邮件打扰',
|
||||
'LBL_EMAIL_OPT_OUT'=>'拒绝电子邮件打扰:',
|
||||
|
||||
//Addedafter5Alpha5
|
||||
'NotifyOwner'=>'提醒负责人',
|
||||
|
||||
//Addedforexistingpicklistentries
|
||||
|
||||
'--None--'=>'--无--',
|
||||
|
||||
'Acquired'=>'取得',
|
||||
'Active'=>'启用',
|
||||
'MarketFailed'=>'市场失利',
|
||||
'ProjectCancelled'=>'项目取消',
|
||||
'Shutdown'=>'关闭',
|
||||
|
||||
'Apparel'=>'存在',
|
||||
'Banking'=>'银行',
|
||||
'Biotechnology'=>'生物科技',
|
||||
'Chemicals'=>'化学',
|
||||
'Communications'=>'交通',
|
||||
'Construction'=>'建筑',
|
||||
'Consulting'=>'顾问',
|
||||
'Education'=>'教育',
|
||||
'Electronics'=>'电子',
|
||||
'Energy'=>'能源',
|
||||
'Engineering'=>'工程',
|
||||
'Entertainment'=>'娱乐',
|
||||
'Environmental'=>'环境',
|
||||
'Finance'=>'财务',
|
||||
'Food&Beverage'=>'饮食',
|
||||
'Government'=>'政府',
|
||||
'Healthcare'=>'健康照护',
|
||||
'Hospitality'=>'医院',
|
||||
'Insurance'=>'保险',
|
||||
'Machinery'=>'机械',
|
||||
'Manufacturing'=>'工厂',
|
||||
'Media'=>'媒体',
|
||||
'NotForProfit'=>'非营利',
|
||||
'Recreation'=>'娱乐中心',
|
||||
'Retail'=>'零售',
|
||||
'Shipping'=>'运输',
|
||||
'Technology'=>'科技',
|
||||
'Telecommunications'=>'通讯',
|
||||
'Transportation'=>'传输',
|
||||
'Utilities'=>'工具',
|
||||
'Other'=>'其它',
|
||||
|
||||
'Analyst'=>'分析师',
|
||||
'Competitor'=>'竞争者',
|
||||
'Customer'=>'客户',
|
||||
'Integrator'=>'整合者',
|
||||
'Investor'=>'投资者',
|
||||
'Partner'=>'伙伴',
|
||||
'Press'=>'新闻',
|
||||
'Prospect'=>'潜在客户',
|
||||
'Reseller'=>'盘商',
|
||||
'LBL_START_DATE'=>'开始日期',
|
||||
'LBL_END_DATE'=>'结束日期',
|
||||
|
||||
//Added/UpdatedforvtigerCRM5.0.4
|
||||
|
||||
//addedtofixtheissue#4081
|
||||
'LBL_ACCOUNT_EXIST'=>'帐户名称已存在!',
|
||||
|
||||
//mailerexport
|
||||
'LBL_MAILER_EXPORT'=>'邮寄导出',
|
||||
'LBL_MAILER_EXPORT_CONTACTS_TYPE'=>'选择通讯录:',
|
||||
'LBL_MAILER_EXPORT_CONTACTS_DESCR'=>'联络可能被选择通过"自定义字段"和一些标准字段。.',
|
||||
'LBL_MAILER_EXPORT_RESULTS_TYPE'=>'选择导出类型:',
|
||||
'LBL_MAILER_EXPORT_RESULTS_DESCR'=>'聚集从账户及其联系人的数据,还给前次搜索.',
|
||||
'LBL_EXPORT_RESULTS_EMAIL'=>'导出邮件联系人数据',
|
||||
'LBL_EXPORT_RESULTS_EMAIL_CORP'=>'导出邮件数据,如果联系人"电邮"为空则用"公司电邮"',
|
||||
'LBL_EXPORT_RESULTS_FULL'=>'导出联系人数据,电子邮件帐户名称,地址,电话等.',
|
||||
|
||||
'LBL_EXPORT_RESULTS_GO'=>'导出',
|
||||
'LBL_MAILER_EXPORT_IGNORE'=>'--忽略--',
|
||||
'LBL_MAILER_EXPORT_CHECKED'=>'检查',
|
||||
'LBL_MAILER_EXPORT_NOTCHECKED'=>'不进行检查',
|
||||
|
||||
//Addedafter5.0.4GA
|
||||
|
||||
//ModuleSequenceNumbering
|
||||
'AccountNo'=>'帐号',
|
||||
//END
|
||||
|
||||
//AccountHierarchy
|
||||
'LBL_SHOW_ACCOUNT_HIERARCHY'=>'查看账号级别',
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?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/database/PearDatabase.php');
|
||||
require_once('user_privileges/default_module_view.php');
|
||||
|
||||
global $adb, $singlepane_view, $currentModule;
|
||||
$idlist = vtlib_purify($_REQUEST['idlist']);
|
||||
$dest_mod = vtlib_purify($_REQUEST['destination_module']);
|
||||
$parenttab = getParentTab();
|
||||
|
||||
$forCRMRecord = vtlib_purify($_REQUEST['parentid']);
|
||||
|
||||
if($singlepane_view == 'true')
|
||||
$action = "DetailView";
|
||||
else
|
||||
$action = "CallRelatedList";
|
||||
|
||||
$storearray = array();
|
||||
if(!empty($_REQUEST['idlist'])) {
|
||||
// Split the string of ids
|
||||
$storearray = explode (";",trim($idlist,";"));
|
||||
} else if(!empty($_REQUEST['entityid'])){
|
||||
$storearray = array($_REQUEST['entityid']);
|
||||
}
|
||||
$focus = CRMEntity::getInstance($currentModule);
|
||||
foreach($storearray as $id)
|
||||
{
|
||||
if($id != '')
|
||||
{
|
||||
if($dest_mod == 'Documents')
|
||||
$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));
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: index.php?action=$action&module=$currentModule&record=".$forCRMRecord."&parenttab=".$parenttab);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user