添加到 trunk

+YUCHENG HU+



git-svn-id: https://svn.code.sf.net/p/hawebs/svn@111 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-06-10 20:18:29 +00:00
parent bcc474fefb
commit 2c19d432c2
1830 changed files with 196588 additions and 0 deletions
@@ -0,0 +1,43 @@
<?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");
?>
@@ -0,0 +1,414 @@
/*********************************************************************************
** 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
@@ -0,0 +1,14 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/Ajax/CommonAjax.php');
?>
@@ -0,0 +1,52 @@
<?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';
}
?>
@@ -0,0 +1,79 @@
<?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);
$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");
}
?>
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
include('modules/CustomView/CustomAction.php');
?>
@@ -0,0 +1,14 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
include('modules/CustomView/index.php');
?>
@@ -0,0 +1,39 @@
<?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);
?>
@@ -0,0 +1,165 @@
<?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);
}
$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'), $customlink_params));
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display("DetailView.tpl");
?>
@@ -0,0 +1,53 @@
<?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;
$local_log =& LoggerManager::getLogger('AccountsAjax');
global $currentModule;
$acntObj = CRMEntity::getInstance($currentModule);
$ajaxaction = $_REQUEST["ajxaction"];
if($ajaxaction == "DETAILVIEW")
{
$crmid = $_REQUEST["recordid"];
$tablename = $_REQUEST["tableName"];
$fieldname = $_REQUEST["fldName"];
$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]);
if($crmid != "")
{
$acntObj->retrieve_entity_info($crmid,"Accounts");
$acntObj->column_fields[$fieldname] = $fieldvalue;
if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving
{
$acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);
}
$acntObj->id = $crmid;
$acntObj->mode = "edit";
$acntObj->save("Accounts");
if($acntObj->column_fields['notify_owner'] == 1 )
{
sendNotificationToOwner('Accounts',&$acntObj);
}
if($acntObj->id != "")
{
echo ":#:SUCCESS";
}else
{
echo ":#:FAILURE";
}
}else
{
echo ":#:FAILURE";
}
}
?>
@@ -0,0 +1,134 @@
<?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');
?>
@@ -0,0 +1,14 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/utils/ExportRecords.php');
?>
@@ -0,0 +1,106 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require_once('Smarty_setup.php');
require_once('include/utils/utils.php');
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');
?>
@@ -0,0 +1,45 @@
<?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');
?>
@@ -0,0 +1,344 @@
<?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(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
{
list($where, $ustring) = split("#@@#",getWhereCondition($currentModule));
// we have a query
$url_string .="&query=true".$ustring;
$log->info("Here is the where clause for the list view: $where");
$smarty->assign("SEARCH_URL",$url_string);
}
if($viewid != 0)
{
$CActionDtls = $oCustomView->getCustomActionDetails($viewid);
}
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>>>>>>>>>
if($viewid != "0")
{
$listquery = getListQuery("Accounts");
$query = $oCustomView->getModifiedCvListQuery($viewid,$listquery,"Accounts");
}else
{
$query = getListQuery("Accounts");
}
//<<<<<<<<customview>>>>>>>>>
if(isset($where) && $where != '')
{
$query .= ' and '.$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);
$smarty->assign('recordListRange',$recordListRangeMsg);
//mass merge for word templates -- *Raj*17/11
while($row = $adb->fetch_array($list_result))
{
$ids[] = $row["crmid"];
}
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;
$listview_header = getListViewHeader($focus,"Accounts",$url_string,$sorder,$order_by,"",$oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search=getSearchListHeaderValues($focus,"Accounts",$url_string,$sorder,$order_by,"",$oCustomView);
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
$listview_entries = getListViewEntries($focus,"Accounts",$list_result,$navigation_array,"","","EditView","Delete",$oCustomView);
$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 = getAdvSearchfields($currentModule);
$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;
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("ListViewEntries.tpl");
else
$smarty->display("ListView.tpl");
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*********************************************************************************/
require_once 'include/ListView/ListViewPagging.php';
?>
@@ -0,0 +1,107 @@
<?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_account.accountid, vtiger_account.accountname, vtiger_account.tickersymbol, sum(vtiger_potential.amount) as amount from vtiger_potential inner join vtiger_crmentity on (vtiger_potential.potentialid=vtiger_crmentity.crmid) left join vtiger_account on (vtiger_potential.related_to=vtiger_account.accountid) left join vtiger_groups on (vtiger_groups.groupid = vtiger_crmentity.smownerid) where vtiger_crmentity.deleted=0 AND vtiger_crmentity.smownerid='".$current_user->id."' and vtiger_potential.sales_stage not in ('Closed Won', 'Closed Lost','".$app_strings['LBL_CLOSE_WON']."','".$app_strings['LBL_CLOSE_LOST']."')";
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[6] == 3)
{
$sec_parameter=getListViewSecurityParameter('Accounts');
$list_query .= $sec_parameter;
}
$list_query .= " group by vtiger_account.accountid, vtiger_account.accountname, vtiger_account.tickersymbol order by amount desc";
$list_query .= " 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.')';
$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;
}
?>
@@ -0,0 +1,325 @@
<?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;
}
?>
@@ -0,0 +1,45 @@
<?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');
?>
@@ -0,0 +1,67 @@
<?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");
?>
+298
View File
@@ -0,0 +1,298 @@
<?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>
@@ -0,0 +1,16 @@
<?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');
?>
@@ -0,0 +1,134 @@
<?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");
}
?>
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/quickcreate.php');
?>
+217
View File
@@ -0,0 +1,217 @@
<?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");
$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']);
//Send notification mail to the assigned to owner about the vtiger_account creation
if($focus->column_fields['notify_owner'] == 1 || $focus->column_fields['notify_owner'] == 'on')
$status = sendNotificationToOwner('Accounts',$focus);
header("Location: index.php?action=$return_action&module=$return_module&parenttab=$parenttab&record=$return_id&viewname=$return_viewname&start=".vtlib_purify($_REQUEST['pagenumber']).$search);
/** Function to save Accounts custom field info into database
* @param integer $entity_id - accountid
*/
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 ...");
}
?>
@@ -0,0 +1,13 @@
<?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');
?>
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/Ajax/TagCloud.php')
?>
@@ -0,0 +1,100 @@
<?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).'&amp;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;">&nbsp;</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;
}
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*********************************************************************************/
require_once 'modules/Home/UnifiedSearch.php';
?>
@@ -0,0 +1,57 @@
<?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');
?>
@@ -0,0 +1,242 @@
<?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',
);
?>
@@ -0,0 +1,240 @@
<?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' => '客户',
'LBL_MODULE_TITLE' => '客户: 首页',
'LBL_SEARCH_FORM_TITLE' => '搜寻客户',
'LBL_LIST_FORM_TITLE' => '客户列表',
'LBL_NEW_FORM_TITLE' => '新增客户',
'LBL_MEMBER_ORG_FORM_TITLE' => '成员组织性质',
// Label for Top Accounts in Home Page, added for 4.2 GA
'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'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' => '客户:',
'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' => '主要信息',
//for v4 release added
'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' => '联系人',
//Added vtiger_fields after RC1 - Release
'LBL_ALL' => '全部',
'LBL_PROSPECT' => '期望',
'LBL_INVESTOR' => '投资者',
'LBL_RESELLER' => '转售人',
'LBL_PARTNER' => '伙伴',
// Added for 4GA
'LBL_TOOL_FORM_TITLE' => '客户工具',
//Added for 4GA
'Account Name' => '客户名称',
'Phone' => '电话',
'Website' => '网址',
'Fax' => '传真',
'Ticker Symbol' => '传票符号',
'Other Phone' => '其它电话',
'Member Of' => '成员',
'Email' => '电子邮件',
'Employees' => '员工',
'Other Email' => '其它电子邮件',
'Ownership' => '拥有者',
'Rating' => '评价',
'industry' => '行业别',
'SIC Code' => '统一编号',
'Type' => '类型',
'Annual Revenue' => '年营业额',
'Assigned To' => '负责人',
'Billing Address' => '账单地址',
'Shipping Address' => '送货地址',
'Billing City' => '乡镇市区',
'Shipping City' => '乡镇市区',
'Billing State' => '县市',
'Shipping State' => '县市',
'Billing Code' => '邮政编码',
'Shipping Code' => '邮政编码',
'Billing Country' => '国家',
'Shipping Country' => '国家',
'Created Time' => '建立时间',
'Modified Time' => '修改时间',
'Description' => '描述',
'Shipping Po Box' => '付款地址采购订单信箱',
'Billing Po Box' => '付款地址采购订单信箱',
//Added after 4.2 patch 2
'Email Opt Out' => '拒绝电子邮件打扰',
'LBL_EMAIL_OPT_OUT' => '拒绝电子邮件打扰:',
//Added after 5Alpha5
'Notify Owner' => '提醒负责人',
//Added for existing picklist entries
'--None--' => '-- 无 --',
'Acquired' => '取得',
'Active' => '启用',
'Market Failed' => '市场失利',
'Project Cancelled' => '项目取消',
'Shutdown' => '关闭',
'Apparel' => '存在',
'Banking' => '银行',
'Biotechnology' => '生物科技',
'Chemicals' => '化学',
'Communications' => '交通',
'Construction' => '建筑',
'Consulting' => '顾问',
'Education' => '教育',
'Electronics' => '电子',
'Energy' => '能源',
'Engineering' => '工程',
'Entertainment' => '娱乐',
'Environmental' => '环境',
'Finance' => '财务',
'Food & Beverage' => '饮食',
'Government' => '政府',
'Healthcare' => '健康照护',
'Hospitality' => '医院',
'Insurance' => '保险',
'Machinery' => '机械',
'Manufacturing' => '工厂',
'Media' => '媒体',
'Not For Profit' => '非营利',
'Recreation' => '娱乐中心',
'Retail' => '零售',
'Shipping' => '运输',
'Technology' => '科技',
'Telecommunications' => '通讯',
'Transportation' => '传输',
'Utilities' => '工具',
'Other' => '其它',
'Analyst' => '分析师',
'Competitor' => '竞争者',
'Customer' => '客户',
'Integrator' => '整合者',
'Investor' => '投资者',
'Partner' => '伙伴',
'Press' => '新闻',
'Prospect' => '潜在客户',
'Reseller' => '盘商',
'LBL_START_DATE' => '开始日期',
'LBL_END_DATE' => '结束日期',
//added to fix the issue #4081
'LBL_ACCOUNT_EXIST' => '帐户名称已存在!',
// mailer export
'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' => '不进行检查',
// Added after 5.0.4 GA
//Module Sequence Numbering
'Account No'=>'帐号',
// END
// Account Hierarchy
'LBL_SHOW_ACCOUNT_HIERARCHY' => '查看账号级别',
);
?>
@@ -0,0 +1,50 @@
<?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));
else {
$focus->save_related_module($currentModule, $forCRMRecord, $dest_mod, $id);
}
}
}
header("Location: index.php?action=$action&module=$currentModule&record=".$forCRMRecord."&parenttab=".$parenttab);
?>
@@ -0,0 +1,89 @@
<?php
$mod_strings = array (
'LBL_MODULE_NAME' => '活动',
'LBL_MODULE_TITLE' => '活动:首页',
'LBL_SEARCH_FORM_TITLE' => '活动查找',
'LBL_LIST_FORM_TITLE' => '活动列表',
'LBL_NEW_FORM_TITLE' => '新增活动',
'LBL_TASK_INFORMATION' => '任务信息',
'LBL_EVENT_INFORMATION' => '事件信息',
'LBL_NAME' => '主题:',
'LBL_CONTACT_NAME' => '联系人:',
'LBL_OPEN_ACTIVITIES' => '在做的活动',
'LBL_ACTIVITY' => '活动:',
'LBL_HISTORY' => '历史纪录',
'LBL_UPCOMING' => '最近安排',
'LBL_TODAY' => '显示到时间',
'LBL_NEW_TASK_BUTTON_TITLE' => '新增任务 [Alt+N]',
'LBL_NEW_TASK_BUTTON_KEY' => 'N',
'LBL_NEW_TASK_BUTTON_LABEL' => '新增任务',
'LBL_SCHEDULE_MEETING_BUTTON_TITLE' => '安排会议 [Alt+M]',
'LBL_SCHEDULE_MEETING_BUTTON_KEY' => 'M',
'LBL_SCHEDULE_MEETING_BUTTON_LABEL' => '安排会议',
'LBL_SCHEDULE_CALL_BUTTON_TITLE' => '安排电话 [Alt+C]',
'LBL_SCHEDULE_CALL_BUTTON_KEY' => 'C',
'LBL_SCHEDULE_CALL_BUTTON_LABEL' => '安排电话',
'LBL_NEW_NOTE_BUTTON_TITLE' => '新增备忘录 [Alt+T]',
'LBL_NEW_ATTACH_BUTTON_TITLE' => '附加文件 [Alt+F]',
'LBL_NEW_NOTE_BUTTON_KEY' => 'T',
'LBL_NEW_ATTACH_BUTTON_KEY' => 'F',
'LBL_NEW_NOTE_BUTTON_LABEL' => '新增备忘录',
'LBL_NEW_ATTACH_BUTTON_LABEL' => '附加文件',
'LBL_TRACK_EMAIL_BUTTON_TITLE' => '撰写邮件 [Alt+K]',
'LBL_TRACK_EMAIL_BUTTON_KEY' => 'K',
'LBL_TRACK_EMAIL_BUTTON_LABEL' => '撰写邮件',
'LBL_LIST_CLOSE' => '完成',
'LBL_LIST_STATUS' => '状态',
'LBL_LIST_CONTACT' => '联系人',
'LBL_LIST_ACCOUNT'=> '客户',
'LBL_LIST_RELATED_TO' => '相关对象',
'LBL_LIST_DUE_DATE' => '到期日期',
'LBL_LIST_DATE' => '日期',
'LBL_LIST_SUBJECT' => '主题',
'LBL_LIST_LAST_MODIFIED' => '最新修改',
'LBL_LIST_RECURRING_TYPE' => '重复类型',
'ERR_DELETE_RECORD' => '必须指定纪录编号才能删除客户.',
'NTC_NONE_SCHEDULED' => '沒有安排.',
'LBL_ATTACHMENTS' => '附件',
'LBL_NEW_ATTACHMENT' => '新增附件',
'LBL_ALL' => '所有',
'LBL_CALL' => '电话',
'LBL_MEETING' => '会议:',
'LBL_TASK' => '任务',
'Subject' => '主题',
'Assigned To' => '负责人',
'Start Date & Time' => '开始日期和时间',
'Time Start' => '开始时间',
'New Event' => '新增事件',
'New Task' => '新增事件',
'Due Date' => '到期日期',
'Related To' => '相关对象',
'Contact Name' => '联系人姓名:',
'Status' => '状态',
'Priority' => '优先级',
'Send Notification' => '发送通知',
'Created Time' => '创建时间',
'Modified Time' => '修改时间',
'Activity Type' => '活动类型',
'Description' => '描述',
'Duration' => '持续',
'Duration Minutes' => '持续分钟',
'Location' => '地点',
'Send Reminder' => '发送提醒',
'LBL_YES' => '是',
'LBL_NO' => '不是',
'LBL_DAYS' => '天',
'LBL_MINUTES' => '分钟',
'LBL_HOURS' => '小时',
'LBL_BEFORE_EVENT' => '前',
'Close' => '完成',
'Start Date' => '开始日期',
'Type' => '活动类型',
'End Date' => '结束日期',
'Recurrence' => '重复事件',
'Recurring Type' => '重复类型',
'LBL_NOTIFICATION_ERROR' => '邮件错误:请在 设置=>发送邮件服务器设置 检查您的发送邮件服务器设置或是目前使用者没有设置邮箱',
'hours/minutes' => '小时/分钟',
);
?>
@@ -0,0 +1,24 @@
<?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/Administration/Forms.php,v 1.2 2004/10/06 09:02:05 jack Exp $
* Description: Contains a variety of utility functions specific to this module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
?>
@@ -0,0 +1,25 @@
<?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/Administration/index.php,v 1.1 2004/08/17 15:03:27 gjayakrishnan Exp $
* Description: TODO: To be written.
********************************************************************************/
$_SESSION['user_sorder']='';
$_SESSION['user_orderby']='';
$_SESSION['user_pagestart'] = 1;
include("modules/Users/ListView.php");
?>
@@ -0,0 +1,28 @@
<?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/Administration/language/en_us.lang.php,v 1.3 2005/01/25 05:54:44 jack Exp $
* Description: Defines the English language pack for the Account module.
********************************************************************************/
$mod_strings = Array(
'LBL_MODULE_NAME'=>'Administration',
'LBL_MODULE_TITLE'=>'Administration: Home',
'LBL_NEW_FORM_TITLE'=>'New Account',
'ERR_DELETE_RECORD'=>"A record number must be specified to delete the account.",
);
?>
@@ -0,0 +1,27 @@
<?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/Administration/language/en_us.lang.php,v 1.3 2005/01/25 05:54:44 jack Exp $
* Description: Defines the English language pack for the Account module.
********************************************************************************/
$mod_strings = Array(
'LBL_MODULE_NAME' => '管理',
'LBL_MODULE_TITLE' => '管理: 首页',
'LBL_NEW_FORM_TITLE' => '新增账号',
'ERR_DELETE_RECORD' => '在删除账号前必须输入正确的记录编号.',
);
?>
@@ -0,0 +1,952 @@
<?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/Activities/Activity.php,v 1.26 2005/03/26 10:42:13 rank Exp $
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
include_once('config.php');
require_once('include/logging.php');
require_once('include/database/PearDatabase.php');
require_once('modules/Calendar/RenderRelatedListUI.php');
require_once('data/CRMEntity.php');
// Task is used to store customer information.
class Activity extends CRMEntity {
var $log;
var $db;
var $table_name = "vtiger_activity";
var $table_index= 'activityid';
var $reminder_table = 'vtiger_activity_reminder';
var $tab_name = Array('vtiger_crmentity','vtiger_activity','vtiger_activitycf');
var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid','vtiger_activitycf'=>'activityid');
var $column_fields = Array();
var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype','lastname'); //Sorting is added for due date and start date
// This is used to retrieve related vtiger_fields from form posts.
var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name');
/**
* Mandatory table for supporting custom fields.
*/
var $customFieldTable = Array('vtiger_activitycf', 'activityid');
// This is the list of vtiger_fields that are in the lists.
var $list_fields = Array(
'Close'=>Array('activity'=>'status'),
'Type'=>Array('activity'=>'activitytype'),
'Subject'=>Array('activity'=>'subject'),
'Related to'=>Array('seactivityrel'=>'parent_id'),
'Start Date'=>Array('activity'=>'date_start'),
'Start Time'=>Array('activity','time_start'),
'End Date'=>Array('activity'=>'due_date'),
'End Time'=>Array('activity','time_end'),
'Recurring Type'=>Array('recurringevents'=>'recurringtype'),
'Assigned To'=>Array('crmentity'=>'smownerid'),
'Contact Name'=>Array('contactdetails'=>'lastname')
);
var $range_fields = Array(
'name',
'date_modified',
'start_date',
'id',
'status',
'date_due',
'time_start',
'description',
'contact_name',
'priority',
'duehours',
'dueminutes',
'location'
);
var $list_fields_name = Array(
'Close'=>'status',
'Type'=>'activitytype',
'Subject'=>'subject',
'Contact Name'=>'lastname',
'Related to'=>'parent_id',
'Start Date & Time'=>'date_start',
'End Date & Time'=>'due_date',
'Recurring Type'=>'recurringtype',
'Assigned To'=>'assigned_user_id');
var $list_link_field= 'subject';
//Added these variables which are used as default order by and sortorder in ListView
var $default_order_by = 'due_date';
var $default_sort_order = 'ASC';
//var $groupTable = Array('vtiger_activitygrouprelation','activityid');
function Activity() {
$this->log = LoggerManager::getLogger('Calendar');
$this->db = PearDatabase::getInstance();
$this->column_fields = getColumnFields('Calendar');
}
function save_module($module)
{
global $adb;
//Handling module specific save
//Insert into seactivity rel
if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')
{
$this->insertIntoEntityTable("vtiger_seactivityrel", $module);
}
elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit")
{
$this->deleteRelation("vtiger_seactivityrel");
}
//Insert into cntactivity rel
if(isset($this->column_fields['contact_id']) && $this->column_fields['contact_id'] != '')
{
$this->insertIntoEntityTable('vtiger_cntactivityrel', $module);
}
elseif($this->column_fields['contact_id'] =='' && $insertion_mode=="edit")
{
$this->deleteRelation('vtiger_cntactivityrel');
}
$recur_type='';
if(($recur_type == "--None--" || $recur_type == '') && $this->mode == "edit")
{
$sql = 'delete from vtiger_recurringevents where activityid=?';
$adb->pquery($sql, array($this->id));
}
//Handling for recurring type
//Insert into vtiger_recurring event table
if(isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype']!='' && $this->column_fields['recurringtype']!='--None--')
{
$recur_type = trim($this->column_fields['recurringtype']);
$recur_data = getrecurringObjValue();
if(is_object($recur_data))
$this->insertIntoRecurringTable($recur_data);
}
//Insert into vtiger_activity_remainder table
$this->insertIntoReminderTable('vtiger_activity_reminder',$module,"");
//Handling for invitees
$selected_users_string = $_REQUEST['inviteesid'];
$invitees_array = explode(';',$selected_users_string);
$this->insertIntoInviteeTable($module,$invitees_array);
//Inserting into sales man activity rel
$this->insertIntoSmActivityRel($module);
$this->insertIntoActivityReminderPopup($module);
}
/** Function to insert values in vtiger_activity_reminder_popup table for the specified module
* @param $cbmodule -- module:: Type varchar
*/
function insertIntoActivityReminderPopup($cbmodule) {
global $adb;
$cbrecord = $this->id;
if(isset($cbmodule) && isset($cbrecord)) {
$cbdate = $this->column_fields['date_start'];
$cbtime = $this->column_fields['time_start'];
$reminder_query = "SELECT reminderid FROM vtiger_activity_reminder_popup WHERE semodule = ? and recordid = ?";
$reminder_params = array($cbmodule, $cbrecord);
$reminderidres = $adb->pquery($reminder_query, $reminder_params);
$reminderid = null;
if($adb->num_rows($reminderidres) > 0) {
$reminderid = $adb->query_result($reminderidres, 0, "reminderid");
}
if(isset($reminderid)) {
$callback_query = "UPDATE vtiger_activity_reminder_popup set status = 0, date_start = ?, time_start = ? WHERE reminderid = ?";
$callback_params = array($cbdate, $cbtime, $reminderid);
} else {
$callback_query = "INSERT INTO vtiger_activity_reminder_popup (recordid, semodule, date_start, time_start) VALUES (?,?,?,?)";
$callback_params = array($cbrecord, $cbmodule, $cbdate, $cbtime);
}
$adb->pquery($callback_query, $callback_params);
}
}
/** Function to insert values in vtiger_activity_remainder table for the specified module,
* @param $table_name -- table name:: Type varchar
* @param $module -- module:: Type varchar
*/
function insertIntoReminderTable($table_name,$module,$recurid)
{
global $log;
$log->info("in insertIntoReminderTable ".$table_name." module is ".$module);
if($_REQUEST['set_reminder'] == 'Yes')
{
$log->debug("set reminder is set");
$rem_days = $_REQUEST['remdays'];
$log->debug("rem_days is ".$rem_days);
$rem_hrs = $_REQUEST['remhrs'];
$log->debug("rem_hrs is ".$rem_hrs);
$rem_min = $_REQUEST['remmin'];
$log->debug("rem_minutes is ".$rem_min);
$reminder_time = $rem_days * 24 * 60 + $rem_hrs * 60 + $rem_min;
$log->debug("reminder_time is ".$reminder_time);
if ($recurid == "")
{
if($_REQUEST['mode'] == 'edit')
{
$this->activity_reminder($this->id,$reminder_time,0,$recurid,'edit');
}
else
{
$this->activity_reminder($this->id,$reminder_time,0,$recurid,'');
}
}
else
{
$this->activity_reminder($this->id,$reminder_time,0,$recurid,'');
}
}
elseif($_REQUEST['set_reminder'] == 'No')
{
$this->activity_reminder($this->id,'0',0,$recurid,'delete');
}
}
// Code included by Jaguar - starts
/** Function to insert values in vtiger_recurringevents table for the specified tablename,module
* @param $recurObj -- Recurring Object:: Type varchar
*/
function insertIntoRecurringTable(& $recurObj)
{
global $log,$adb;
$log->info("in insertIntoRecurringTable ");
$st_date = $recurObj->startdate->get_formatted_date();
$log->debug("st_date ".$st_date);
$end_date = $recurObj->enddate->get_formatted_date();
$log->debug("end_date is set ".$end_date);
$type = $recurObj->recur_type;
$log->debug("type is ".$type);
$flag="true";
if($_REQUEST['mode'] == 'edit')
{
$activity_id=$this->id;
$sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from vtiger_recurringevents where activityid=? group by activityid, recurringtype';
$result = $adb->pquery($sql, array($activity_id));
$noofrows = $adb->num_rows($result);
for($i=0; $i<$noofrows; $i++)
{
$recur_type_b4_edit = $adb->query_result($result,$i,"recurringtype");
$date_start_b4edit = $adb->query_result($result,$i,"min_date");
$end_date_b4edit = $adb->query_result($result,$i,"max_date");
}
if(($st_date == $date_start_b4edit) && ($end_date==$end_date_b4edit) && ($type == $recur_type_b4_edit))
{
if($_REQUEST['set_reminder'] == 'Yes')
{
$sql = 'delete from vtiger_activity_reminder where activity_id=?';
$adb->pquery($sql, array($activity_id));
$sql = 'delete from vtiger_recurringevents where activityid=?';
$adb->pquery($sql, array($activity_id));
$flag="true";
}
elseif($_REQUEST['set_reminder'] == 'No')
{
$sql = 'delete from vtiger_activity_reminder where activity_id=?';
$adb->pquery($sql, array($activity_id));
$flag="false";
}
else
$flag="false";
}
else
{
$sql = 'delete from vtiger_activity_reminder where activity_id=?';
$adb->pquery($sql, array($activity_id));
$sql = 'delete from vtiger_recurringevents where activityid=?';
$adb->pquery($sql, array($activity_id));
}
}
$date_array = $recurObj->recurringdates;
if(isset($recurObj->recur_freq) && $recurObj->recur_freq != null)
$recur_freq = $recurObj->recur_freq;
else
$recur_freq = 1;
if($recurObj->recur_type == 'Daily' || $recurObj->recur_type == 'Yearly')
$recurringinfo = $recurObj->recur_type;
elseif($recurObj->recur_type == 'Weekly')
{
$recurringinfo = $recurObj->recur_type;
if($recurObj->dayofweek_to_rpt != null)
$recurringinfo = $recurringinfo.'::'.implode('::',$recurObj->dayofweek_to_rpt);
}
elseif($recurObj->recur_type == 'Monthly')
{
$recurringinfo = $recurObj->recur_type.'::'.$recurObj->repeat_monthby;
if($recurObj->repeat_monthby == 'date')
$recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_datevalue;
else
$recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_daytype.'::'.$recurObj->dayofweek_to_rpt[0];
}
else
{
$recurringinfo = '';
}
if($flag=="true")
{
for($k=0; $k< count($date_array); $k++)
{
$tdate=$date_array[$k];
if($tdate <= $end_date)
{
$max_recurid_qry = 'select max(recurringid) AS recurid from vtiger_recurringevents;';
$result = $adb->pquery($max_recurid_qry, array());
$noofrows = $adb->num_rows($result);
for($i=0; $i<$noofrows; $i++)
{
$recur_id = $adb->query_result($result,$i,"recurid");
}
$current_id =$recur_id+1;
$recurring_insert = "insert into vtiger_recurringevents values (?,?,?,?,?,?)";
$rec_params = array($current_id, $this->id, $tdate, $type, $recur_freq, $recurringinfo);
$adb->pquery($recurring_insert, $rec_params);
if($_REQUEST['set_reminder'] == 'Yes')
{
$this->insertIntoReminderTable("vtiger_activity_reminder",$module,$current_id,'');
}
}
}
}
}
/** Function to insert values in vtiger_invitees table for the specified module,tablename ,invitees_array
* @param $table_name -- table name:: Type varchar
* @param $module -- module:: Type varchar
* @param $invitees_array Array
*/
function insertIntoInviteeTable($module,$invitees_array)
{
global $log,$adb;
$log->debug("Entering insertIntoInviteeTable(".$module.",".$invitees_array.") method ...");
if($this->mode == 'edit'){
$sql = "delete from vtiger_invitees where activityid=?";
$adb->pquery($sql, array($this->id));
}
foreach($invitees_array as $inviteeid)
{
if($inviteeid != '')
{
$query="insert into vtiger_invitees values(?,?)";
$adb->pquery($query, array($this->id, $inviteeid));
}
}
$log->debug("Exiting insertIntoInviteeTable method ...");
}
/** Function to insert values in vtiger_salesmanactivityrel table for the specified module
* @param $module -- module:: Type varchar
*/
function insertIntoSmActivityRel($module)
{
global $adb;
global $current_user;
if($this->mode == 'edit'){
$sql = "delete from vtiger_salesmanactivityrel where activityid=?";
$adb->pquery($sql, array($this->id));
}
$user_sql = $adb->pquery("select count(*) as count from vtiger_users where id=?", array($this->column_fields['assigned_user_id']));
if($adb->query_result($user_sql, 0, 'count') != 0) {
$sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(?,?)";
$adb->pquery($sql_qry, array($this->column_fields['assigned_user_id'], $this->id));
if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='')
{
$selected_users_string = $_REQUEST['inviteesid'];
$invitees_array = explode(';',$selected_users_string);
foreach($invitees_array as $inviteeid)
{
if($inviteeid != '')
{
$resultcheck = $adb->pquery("select * from vtiger_salesmanactivityrel where activityid=? and smid=?",array($this->id,$inviteeid));
if($adb->num_rows($resultcheck) != 1){
$query="insert into vtiger_salesmanactivityrel values(?,?)";
$adb->pquery($query, array($inviteeid, $this->id));
}
}
}
}
}
}
// Mike Crowe Mod --------------------------------------------------------Default ordering for us
/**
* Function to get sort order
* return string $sorder - sortorder string either 'ASC' or 'DESC'
*/
function getSortOrder()
{
global $log;
$log->debug("Entering getSortOrder() method ...");
if(isset($_REQUEST['sorder']))
$sorder = $this->db->sql_escape_string($_REQUEST['sorder']);
else
$sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order));
$log->debug("Exiting getSortOrder method ...");
return $sorder;
}
/**
* Function to get order by
* return string $order_by - fieldname(eg: 'subject')
*/
function getOrderBy()
{
global $log;
$log->debug("Entering getOrderBy() method ...");
$use_default_order_by = '';
if(PerformancePrefs::getBoolean('LISTVIEW_DEFAULT_SORTING', true)) {
$use_default_order_by = $this->default_order_by;
}
if (isset($_REQUEST['order_by']))
$order_by = $this->db->sql_escape_string($_REQUEST['order_by']);
else
$order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($use_default_order_by));
$log->debug("Exiting getOrderBy method ...");
return $order_by;
}
// Mike Crowe Mod --------------------------------------------------------
//Function Call for Related List -- Start
/**
* Function to get Activity related Contacts
* @param integer $id - activityid
* returns related Contacts record in array format
*/
function get_contacts($id, $cur_tab_id, $rel_tab_id, $actions=false) {
global $log, $singlepane_view,$currentModule,$current_user;
$log->debug("Entering get_contacts(".$id.") method ...");
$this_module = $currentModule;
$related_module = vtlib_getModuleNameById($rel_tab_id);
require_once("modules/$related_module/$related_module.php");
$other = new $related_module();
vtlib_setup_modulevars($related_module, $other);
$singular_modname = vtlib_toSingular($related_module);
$parenttab = getParentTab();
$returnset = '&return_module='.$this_module.'&return_action=DetailView&activity_mode=Events&return_id='.$id;
$search_string = '';
$button = '';
if($actions) {
if(is_string($actions)) $actions = explode(',', strtoupper($actions));
if(in_array('SELECT', $actions) && isPermitted($related_module,4, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_SELECT')." ". getTranslatedString($related_module). "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id&parenttab=$parenttab$search_string','test','width=640,height=602,resizable=0,scrollbars=0');\" value='". getTranslatedString('LBL_SELECT'). " " . getTranslatedString($related_module) ."'>&nbsp;";
}
}
$query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0';
$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
if($return_value == null) $return_value = Array();
$return_value['CUSTOM_BUTTON'] = $button;
$log->debug("Exiting get_contacts method ...");
return $return_value;
}
/**
* Function to get Activity related Users
* @param integer $id - activityid
* returns related Users record in array format
*/
function get_users($id) {
global $log;
$log->debug("Entering get_contacts(".$id.") method ...");
global $app_strings;
$focus = new Users();
$button = '<input title="Change" accessKey="" tabindex="2" type="button" class="crmbutton small edit"
value="'.getTranslatedString('LBL_SELECT_USER_BUTTON_LABEL').'" name="button" LANGUAGE=javascript
onclick=\'return window.open("index.php?module=Users&return_module=Calendar&return_action={$return_modname}&activity_mode=Events&action=Popup&popuptype=detailview&form=EditView&form_submit=true&select=enable&return_id='.$id.'&recordid='.$id.'","test","width=640,height=525,resizable=0,scrollbars=0")\';>';
$returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id;
$query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id;
$return_data = GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset);
if($return_data == null) $return_data = Array();
$return_data['CUSTOM_BUTTON'] = $button;
$log->debug("Exiting get_users method ...");
return $return_data;
}
/**
* Function to get activities for given criteria
* @param string $criteria - query string
* returns activity records in array format($list) or null value
*/
function get_full_list($criteria) {
global $log;
$log->debug("Entering get_full_list(".$criteria.") method ...");
$query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*,
vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid
from vtiger_activity
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid
left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid
left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid
left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid
WHERE vtiger_crmentity.deleted=0 ".$criteria;
$result =& $this->db->query($query);
if($this->db->getRowCount($result) > 0){
// We have some data.
while ($row = $this->db->fetchByAssoc($result)) {
foreach($this->list_fields_name as $field)
{
if (isset($row[$field])) {
$this->$field = $row[$field];
}
else {
$this->$field = '';
}
}
$list[] = $this;
}
}
if (isset($list))
{
$log->debug("Exiting get_full_list method ...");
return $list;
}
else
{
$log->debug("Exiting get_full_list method ...");
return null;
}
}
//calendarsync
/**
* Function to get meeting count
* @param string $user_name - User Name
* return integer $row["count(*)"] - count
*/
function getCount_Meeting($user_name)
{
global $log;
$log->debug("Entering getCount_Meeting(".$user_name.") method ...");
$query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name=? and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'";
$result = $this->db->pquery($query, array($user_name),true,"Error retrieving contacts count");
$rows_found = $this->db->getRowCount($result);
$row = $this->db->fetchByAssoc($result, 0);
$log->debug("Exiting getCount_Meeting method ...");
return $row["count(*)"];
}
function get_calendars($user_name,$from_index,$offset)
{
global $log;
$log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ...");
$query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset;
$log->debug("Exiting get_calendars method ...");
return $this->process_list_query1($query);
}
//calendarsync
/**
* Function to get task count
* @param string $user_name - User Name
* return integer $row["count(*)"] - count
*/
function getCount($user_name)
{
global $log;
$log->debug("Entering getCount(".$user_name.") method ...");
$query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name=? and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'";
$result = $this->db->pquery($query,array($user_name), true,"Error retrieving contacts count");
$rows_found = $this->db->getRowCount($result);
$row = $this->db->fetchByAssoc($result, 0);
$log->debug("Exiting getCount method ...");
return $row["count(*)"];
}
/**
* Function to get list of task for user with given limit
* @param string $user_name - User Name
* @param string $from_index - query string
* @param string $offset - query string
* returns tasks in array format
*/
function get_tasks($user_name,$from_index,$offset)
{
global $log;
$log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ...");
$query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset;
$log->debug("Exiting get_tasks method ...");
return $this->process_list_query1($query);
}
/**
* Function to process the activity list query
* @param string $query - query string
* return array $response - activity lists
*/
function process_list_query1($query)
{
global $log;
$log->debug("Entering process_list_query1(".$query.") method ...");
$result =& $this->db->query($query,true,"Error retrieving $this->object_name list: ");
$list = Array();
$rows_found = $this->db->getRowCount($result);
if($rows_found != 0)
{
$task = Array();
for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index))
{
foreach($this->range_fields as $columnName)
{
if (isset($row[$columnName])) {
$task[$columnName] = $row[$columnName];
}
else
{
$task[$columnName] = "";
}
}
$task[contact_name] = return_name($row, 'cfn', 'cln');
$list[] = $task;
}
}
$response = Array();
$response['list'] = $list;
$response['row_count'] = $rows_found;
$response['next_offset'] = $next_offset;
$response['previous_offset'] = $previous_offset;
$log->debug("Exiting process_list_query1 method ...");
return $response;
}
/**
* Function to get reminder for activity
* @param integer $activity_id - activity id
* @param string $reminder_time - reminder time
* @param integer $reminder_sent - 0 or 1
* @param integer $recurid - recuring eventid
* @param string $remindermode - string like 'edit'
*/
function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='')
{
global $log;
$log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ...");
//Check for vtiger_activityid already present in the reminder_table
$query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ?";
$result_exist = $this->db->pquery($query_exist, array($activity_id));
if($remindermode == 'edit')
{
if($this->db->num_rows($result_exist) > 0)
{
$query = "UPDATE ".$this->reminder_table." SET";
$query .=" reminder_sent = ?, reminder_time = ? WHERE activity_id =?";
$params = array($reminder_sent, $reminder_time, $activity_id);
}
else
{
$query = "INSERT INTO ".$this->reminder_table." VALUES (?,?,?,?)";
$params = array($activity_id, $reminder_time, 0, $recurid);
}
}
elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) > 0))
{
$query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ?";
$params = array($activity_id);
}
else
{
$query = "INSERT INTO ".$this->reminder_table." VALUES (?,?,?,?)";
$params = array($activity_id, $reminder_time, 0, $recurid);
}
$this->db->pquery($query,$params,true,"Error in processing vtiger_table $this->reminder_table");
$log->debug("Exiting vtiger_activity_reminder method ...");
}
//Used for vtigerCRM Outlook Add-In
/**
* Function to get tasks to display in outlookplugin
* @param string $username - User name
* return string $query - sql query
*/
function get_tasksforol($username)
{
global $log,$adb;
$log->debug("Entering get_tasksforol(".$username.") method ...");
global $current_user;
require_once("modules/Users/Users.php");
$seed_user=new Users();
$user_id=$seed_user->retrieve_user_id($username);
$current_user=$seed_user;
$current_user->retrieve_entity_info($user_id, 'Users');
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0)
{
$sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.presence in (0,2)";
$params1 = array();
}else
{
$profileList = getCurrentUserProfileList();
$sql1 = "select tablename,columnname from vtiger_field 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=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4,3) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
$params1 = array();
if (count($profileList) > 0) {
$sql1 .= " and vtiger_profile2field.profileid in (". generateQuestionMarks($profileList) .")";
array_push($params1, $profileList);
}
}
$result1 = $adb->pquery($sql1,$params1);
for($i=0;$i < $adb->num_rows($result1);$i++)
{
$permitted_lists[] = $adb->query_result($result1,$i,'tablename');
$permitted_lists[] = $adb->query_result($result1,$i,'columnname');
/*if($adb->query_result($result1,$i,'columnname') == "parentid")
{
$permitted_lists[] = 'vtiger_account';
$permitted_lists[] = 'accountname';
}*/
}
$permitted_lists = array_chunk($permitted_lists,2);
$column_table_lists = array();
for($i=0;$i < count($permitted_lists);$i++)
{
$column_table_lists[] = implode(".",$permitted_lists[$i]);
}
$query = "select vtiger_activity.activityid as taskid, ".implode(',',$column_table_lists)." from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid
inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid
left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid
left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid
left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid
where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'";
$log->debug("Exiting get_tasksforol method ...");
return $query;
}
/**
* Function to get calendar query for outlookplugin
* @param string $username - User name * return string $query - sql query */
function get_calendarsforol($user_name)
{
global $log,$adb;
$log->debug("Entering get_calendarsforol(".$user_name.") method ...");
global $current_user;
require_once("modules/Users/Users.php");
$seed_user=new Users();
$user_id=$seed_user->retrieve_user_id($user_name);
$current_user=$seed_user;
$current_user->retrieve_entity_info($user_id, 'Users');
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0)
{
$sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.presence in (0,2)";
$params1 = array();
}else
{
$profileList = getCurrentUserProfileList();
$sql1 = "select tablename,columnname from vtiger_field 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=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4,3) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
$params1 = array();
if (count($profileList) > 0) {
$sql1 .= " and vtiger_profile2field.profileid in (". generateQuestionMarks($profileList) .")";
array_push($params1,$profileList);
}
}
$result1 = $adb->pquery($sql1, $params1);
for($i=0;$i < $adb->num_rows($result1);$i++)
{
$permitted_lists[] = $adb->query_result($result1,$i,'tablename');
$permitted_lists[] = $adb->query_result($result1,$i,'columnname');
if($adb->query_result($result1,$i,'columnname') == "date_start")
{
$permitted_lists[] = 'vtiger_activity';
$permitted_lists[] = 'time_start';
}
if($adb->query_result($result1,$i,'columnname') == "due_date")
{
$permitted_lists[] = 'vtiger_activity';
$permitted_lists[] = 'time_end';
}
}
$permitted_lists = array_chunk($permitted_lists,2);
$column_table_lists = array();
for($i=0;$i < count($permitted_lists);$i++)
{
$column_table_lists[] = implode(".",$permitted_lists[$i]);
}
$query = "select vtiger_activity.activityid as clndrid, ".implode(',',$column_table_lists)." from vtiger_activity
inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid
inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid
left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid
left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid
left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid
where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'";
$log->debug("Exiting get_calendarsforol method ...");
return $query;
}
// Function to unlink all the dependent entities of the given Entity by Id
function unlinkDependencies($module, $id) {
global $log;
$sql = 'DELETE FROM vtiger_activity_reminder WHERE activity_id=?';
$this->db->pquery($sql, array($id));
$sql = 'DELETE FROM vtiger_recurringevents WHERE activityid=?';
$this->db->pquery($sql, array($id));
parent::unlinkDependencies($module, $id);
}
// Function to unlink an entity with given Id from another entity
function unlinkRelationship($id, $return_module, $return_id) {
global $log;
if(empty($return_module) || empty($return_id)) return;
if($return_module == 'Contacts') {
$sql = 'DELETE FROM vtiger_cntactivityrel WHERE contactid = ? AND activityid = ?';
$this->db->pquery($sql, array($return_id, $id));
} elseif($return_module == 'HelpDesk') {
$sql = 'DELETE FROM vtiger_seticketsrel WHERE ticketid = ? AND crmid = ?';
$this->db->pquery($sql, array($return_id, $id));
} else {
$sql='DELETE FROM vtiger_seactivityrel WHERE activityid=?';
$this->db->pquery($sql, array($id));
$sql = 'DELETE FROM vtiger_crmentityrel WHERE (crmid=? AND relmodule=? AND relcrmid=?) OR (relcrmid=? AND module=? AND crmid=?)';
$params = array($id, $return_module, $return_id, $id, $return_module, $return_id);
$this->db->pquery($sql, $params);
}
}
/**
* this function sets the status flag of activity to true or false depending on the status passed to it
* @param string $status - the status of the activity flag to set
* @return:: true if successful; false otherwise
*/
function setActivityReminder($status){
global $adb;
if($status == "on"){
$flag = 0;
}elseif($status == "off"){
$flag = 1;
}else{
return false;
}
$sql = "update vtiger_activity_reminder_popup set status=1 where recordid=?";
$adb->pquery($sql, array($this->id));
return true;
}
/*
* Function to get the relation tables for related modules
* @param - $secmodule secondary module name
* returns the array with table names and fieldnames storing relations between module and this module
*/
function setRelationTables($secmodule){
$rel_tables = array (
"Contacts" => array("vtiger_cntactivityrel"=>array("activityid","contactid"),"vtiger_activity"=>"activityid"),
"Leads" => array("vtiger_seactivityrel"=>array("activityid","crmid"),"vtiger_activity"=>"activityid"),
"Accounts" => array("vtiger_seactivityrel"=>array("activityid","crmid"),"vtiger_activity"=>"activityid"),
"Potentials" => array("vtiger_seactivityrel"=>array("activityid","crmid"),"vtiger_activity"=>"activityid"),
);
return $rel_tables[$secmodule];
}
/*
* Function to get the secondary query part of a report
* @param - $module primary module name
* @param - $secmodule secondary module name
* returns the query string formed on fetching the related data for report for secondary module
*/
function generateReportsSecQuery($module,$secmodule){
$query = $this->getRelationQuery($module,$secmodule,"vtiger_activity","activityid");
$query .=" left join vtiger_crmentity as vtiger_crmentityCalendar on vtiger_crmentityCalendar.crmid=vtiger_activity.activityid and vtiger_crmentityCalendar.deleted=0
left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid
left join vtiger_contactdetails as vtiger_contactdetailsCalendar on vtiger_contactdetailsCalendar.contactid= vtiger_cntactivityrel.contactid
left join vtiger_activitycf on vtiger_activitycf.activityid = vtiger_crmentity.crmid
left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid
left join vtiger_activity_reminder on vtiger_activity_reminder.activity_id = vtiger_activity.activityid
left join vtiger_recurringevents on vtiger_recurringevents.activityid = vtiger_activity.activityid
left join vtiger_crmentity as vtiger_crmentityRelCalendar on vtiger_crmentityRelCalendar.crmid = vtiger_seactivityrel.crmid and vtiger_crmentityRelCalendar.deleted=0
left join vtiger_account as vtiger_accountRelCalendar on vtiger_accountRelCalendar.accountid=vtiger_crmentityRelCalendar.crmid
left join vtiger_leaddetails as vtiger_leaddetailsRelCalendar on vtiger_leaddetailsRelCalendar.leadid = vtiger_crmentityRelCalendar.crmid
left join vtiger_potential as vtiger_potentialRelCalendar on vtiger_potentialRelCalendar.potentialid = vtiger_crmentityRelCalendar.crmid
left join vtiger_quotes as vtiger_quotesRelCalendar on vtiger_quotesRelCalendar.quoteid = vtiger_crmentityRelCalendar.crmid
left join vtiger_purchaseorder as vtiger_purchaseorderRelCalendar on vtiger_purchaseorderRelCalendar.purchaseorderid = vtiger_crmentityRelCalendar.crmid
left join vtiger_invoice as vtiger_invoiceRelCalendar on vtiger_invoiceRelCalendar.invoiceid = vtiger_crmentityRelCalendar.crmid
left join vtiger_salesorder as vtiger_salesorderRelCalendar on vtiger_salesorderRelCalendar.salesorderid = vtiger_crmentityRelCalendar.crmid
left join vtiger_troubletickets as vtiger_troubleticketsRelCalendar on vtiger_troubleticketsRelCalendar.ticketid = vtiger_crmentityRelCalendar.crmid
left join vtiger_campaign as vtiger_campaignRelCalendar on vtiger_campaignRelCalendar.campaignid = vtiger_crmentityRelCalendar.crmid
left join vtiger_groups as vtiger_groupsCalendar on vtiger_groupsCalendar.groupid = vtiger_crmentityCalendar.smownerid
left join vtiger_users as vtiger_usersCalendar on vtiger_usersCalendar.id = vtiger_crmentityCalendar.smownerid";
return $query;
}
}
?>
@@ -0,0 +1,239 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
global $theme,$mod_strings,$current_language,$currentModule,$current_user,$app_strings;
$theme_path = "themes/".$theme."/";
$image_path = $theme_path."images/";
require_once("modules/Calendar/calendarLayout.php");
require_once('include/utils/utils.php');
require_once("modules/Calendar/Calendar.php");
require_once('include/logging.php');
$cal_log =& LoggerManager::getLogger('calendar');
$cal_log->debug("In CalendarAjax file");
$mysel = vtlib_purify($_REQUEST['view']);
if($_REQUEST['file'] == 'OpenListView')
{
require_once('Smarty_setup.php');
$smarty = new vtigerCRM_Smarty;
require_once("modules/Calendar/OpenListView.php");
$smarty->assign("APP",$app_strings);
$smarty->assign("IMAGE_PATH",$image_path);
if($_REQUEST['mode'] == '0')
{
$activities[0] = getPendingActivities(0);
$smarty->assign("ACTIVITIES",$activities);
$smarty->display("upcomingActivities.tpl");
}
else if($_REQUEST['mode'] == '1')
{
$activities[1] = getPendingActivities(1);
$smarty->assign("ACTIVITIES",$activities);
$smarty->display("pendingActivities.tpl");
}
die();
}
$calendar_arr = Array();
$calendar_arr['IMAGE_PATH'] = $image_path;
$date_data = array();
if ( isset($_REQUEST['day']))
{
$date_data['day'] = $_REQUEST['day'];
}
if ( isset($_REQUEST['month']))
{
$date_data['month'] = $_REQUEST['month'];
}
if ( isset($_REQUEST['week']))
{
$date_data['week'] = $_REQUEST['week'];
}
if ( isset($_REQUEST['year']))
{
if ($_REQUEST['year'] > 2037 || $_REQUEST['year'] < 1970)
{
print("<font color='red'>".$app_strings['LBL_CAL_LIMIT_MSG']."</font>");
exit;
}
$date_data['year'] = $_REQUEST['year'];
}
if((isset($_REQUEST['type']) && $_REQUEST['type'] !='') || (isset($_REQUEST['n_type']) && $_REQUEST['n_type'] !=''))
{
$type = $_REQUEST['type'];
$n_type = $_REQUEST['n_type'];
$cal_log->debug("type value is:".$type);
if($type == 'minical')
{
$cal_log->debug("going to get mini calendar");
$temp_module = $currentModule;
$mod_strings = return_module_language($current_language,'Calendar');
$currentModule = 'Calendar';
$calendar_arr['IMAGE_PATH'] = $image_path;
$calendar_arr['calendar'] = new Calendar('month',$date_data);
$calendar_arr['view'] = 'month';
$calendar_arr['size'] = 'small';
if($current_user->hour_format != '')
$calendar_arr['calendar']->hour_format=$current_user->hour_format;
$calendar_arr['calendar']->add_Activities($current_user);
calendar_layout($calendar_arr);
$mod_strings = return_module_language($current_language,$temp_module);
$currentModule = vtlib_purify($_REQUEST['module']);
}
elseif($type == 'settings')
{
$cal_log->debug("going to get calendar Settings");
require_once('modules/Calendar/calendar_share.php');
}
else
{
$subtab = vtlib_purify($_REQUEST['subtab']);
if(empty($mysel))
{
$mysel = 'day';
}
$calendar_arr['calendar'] = new Calendar($mysel,$date_data);
$calendar_arr['view'] = $mysel;
if($calendar_arr['calendar']->view == 'day')
$start_date = $end_date = $calendar_arr['calendar']->date_time->get_formatted_date();
elseif($calendar_arr['calendar']->view == 'week')
{
$start_date = $calendar_arr['calendar']->slices[0];
$end_date = $calendar_arr['calendar']->slices[6];
}
elseif($calendar_arr['calendar']->view == 'month')
{
$start_date = $calendar_arr['calendar']->date_time->getThismonthDaysbyIndex(0);
$end_date = $calendar_arr['calendar']->date_time->getThismonthDaysbyIndex($calendar_arr['calendar']->date_time->daysinmonth - 1);
$start_date = $start_date->get_formatted_date();
$end_date = $end_date->get_formatted_date();
}
elseif($calendar_arr['calendar']->view == 'year')
{
$start_date = $calendar_arr['calendar']->date_time->getThisyearMonthsbyIndex(0);
$end_date = $calendar_arr['calendar']->date_time->get_first_day_of_changed_year('increment');
$start_date = $start_date->get_formatted_date();
$end_date = $end_date->get_formatted_date();
}
else
{
die("view:".$calendar_arr['calendar']->view." is not defined");
}
if($type == 'change_owner' || $type == 'activity_delete' || $type == 'change_status' || $type == 'activity_postpone' || $n_type == 'nav')
{
if($current_user->hour_format != '')
$calendar_arr['calendar']->hour_format=$current_user->hour_format;
if($type == 'change_status')
{
$return_id = vtlib_purify($_REQUEST['record']);
if(isset($_REQUEST['status']))
{
$status = $_REQUEST['status'];
$activity_type = "Task";
}
elseif(isset($_REQUEST['eventstatus']))
{
$status = $_REQUEST['eventstatus'];
$activity_type = "Events";
}
ChangeStatus($status,$return_id,$activity_type);
$mail_data = getActivityMailInfo($return_id,$status,$activity_type);
if($mail_data['sendnotification'] == 1)
{
getEventNotification($activity_type,$mail_data['subject'],$mail_data);
}
$invitee_qry = "select * from vtiger_invitees where activityid=?";
$invitee_res = $adb->pquery($invitee_qry, array($return_id));
$count = $adb->num_rows($invitee_res);
if($count != 0)
{
for($j = 0; $j < $count; $j++)
{
$invitees_ids[]= $adb->query_result($invitee_res,$j,"inviteeid");
}
$invitees_ids_string = implode(';',$invitees_ids);
sendInvitation($invitees_ids_string,$activity_type,$mail_data['subject'],$mail_data);
}
}
if($type == 'activity_postpone')
{
}
if ($_REQUEST['viewOption'] == 'hourview' && ($mysel == 'day' || $mysel == 'week' || $mysel == 'month' || $mysel == 'year'))
{
$calendar_arr['calendar']->add_Activities($current_user);
}
if(isset($_REQUEST['viewOption']) && $_REQUEST['viewOption'] != null && $subtab == 'event')
{
if($_REQUEST['viewOption'] == 'hourview')
{
$cal_log->debug("going to get calendar Event HourView");
if($calendar_arr['view'] == 'day')
{
echo getDayViewLayout($calendar_arr)."####".getEventInfo($calendar_arr,'listcnt');
}
elseif($calendar_arr['view'] == 'week')
{
echo getWeekViewLayout($calendar_arr)."####".getEventInfo($calendar_arr,'listcnt');
}
elseif($calendar_arr['view'] == 'month')
{
echo getMonthViewLayout($calendar_arr)."####".getEventInfo($calendar_arr,'listcnt');
}
elseif($calendar_arr['view'] == 'year')
{
echo getYearViewLayout($calendar_arr)."####".getEventInfo($calendar_arr,'listcnt');
}
else
{
die("view:".$view['view']." is not defined");
}
}
elseif($_REQUEST['viewOption'] == 'listview')
{
$cal_log->debug("going to get calendar Event ListView");
//To get Events List
$activity_arr = getEventList($calendar_arr, $start_date, $end_date);
$activity_list = $activity_arr[0];
$navigation_arr = $activity_arr[1];
echo constructEventListView($calendar_arr,$activity_list,$navigation_arr)."####".getEventInfo($calendar_arr,'listcnt');
}
}
elseif($subtab == 'todo')
{
$cal_log->debug("going to get calendar Todo ListView");
//To get Todos List
$todo_arr = getTodoList($calendar_arr, $start_date, $end_date);
$todo_list = $todo_arr[0];
$navigation_arr = $todo_arr[1];
echo constructTodoListView($todo_list,$calendar_arr,$subtab,$navigation_arr)."####".getTodoInfo($calendar_arr,'listcnt');
}
}
elseif($type == 'view')
{
checkFileAccess('modules/Calendar/'.$_REQUEST['file'].'.php');
require_once('modules/Calendar/'.$_REQUEST['file'].'.php');
}
else
{
die("View option is not defined");
}
}
}
else
{
require_once('include/Ajax/CommonAjax.php');
//die("type is not set");
}
?>
@@ -0,0 +1,128 @@
<?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): ______________________________________.
********************************************************************************/
global $app_strings;
global $currentModule,$image_path,$theme,$adb, $current_user;
require_once('Smarty_setup.php');
require_once("data/Tracker.php");
require_once('themes/'.$theme.'/layout_utils.php');
require_once('include/utils/utils.php');
require_once('modules/Calendar/Activity.php');
$log = LoggerManager::getLogger('Activity_Reminder');
$smarty = new vtigerCRM_Smarty;
if(isPermitted('Calendar','index') == 'yes'){
$active = $adb->pquery("select * from vtiger_users where id=?",array($current_user->id));
$active_res = $adb->query_result($active,0,'reminder_interval');
if($active_res!='None'){
$reminder_next=$adb->query_result($active,0,"reminder_next_time");
$lastlogin_time =$adb->query_result($active,0,"date_entered");
if(empty($reminder_next)) {
$reminder_next = date('Y-m-d H:i');
}
if(strtotime($lastlogin_time) > strtotime($reminder_next)) {
$reminder_next = $lastlogin_time;
}
$reminder_next_time = strtotime($reminder_next);
$cur_time = mktime(date('H'),date('i'),0,date('m'),date('d'),date('Y'));
if($reminder_next_time <= $cur_time)
{
$cb_time=$adb->query_result($active,0,"reminder_interval");
$cb_time = ConvertToMinutes($cb_time);
$cb_mktime = strtotime($reminder_next);
$cbdate1 = date('Y-m-d', strtotime("+$cb_time minutes", $cb_mktime));
$cbtime1 = date('H:i', strtotime("+$cb_time minutes", $cb_mktime));
$callback_query =
"SELECT * FROM vtiger_activity_reminder_popup inner join vtiger_crmentity where " .
" vtiger_activity_reminder_popup.status = 0 and " .
" vtiger_activity_reminder_popup.recordid = vtiger_crmentity.crmid " .
" and vtiger_crmentity.smownerid = ".$current_user->id." and vtiger_crmentity.deleted = 0 " .
" and ((DATE_FORMAT(vtiger_activity_reminder_popup.date_start,'%Y-%m-%d') < '" . $cbdate1 . "')" .
" OR ((DATE_FORMAT(vtiger_activity_reminder_popup.date_start,'%Y-%m-%d') = '" . $cbdate1 . "')" .
" AND (TIME_FORMAT(vtiger_activity_reminder_popup.time_start,'%H:%i') <= '" . $cbtime1 . "')))";
$result = $adb->query($callback_query);
$cbrows = $adb->num_rows($result);
if($cbrows > 0) {
for($index = 0; $index < $cbrows; ++$index) {
$reminderid = $adb->query_result($result, $index, "reminderid");
$cbrecord = $adb->query_result($result, $index, "recordid");
$cbmodule = $adb->query_result($result, $index, "semodule");
$focus = CRMEntity::getInstance($cbmodule);
if($cbmodule == 'Calendar') {
$focus->retrieve_entity_info($cbrecord,$cbmodule);
$cbsubject = $focus->column_fields['subject'];
$cbactivitytype = $focus->column_fields['activitytype'];
$cbdate = $focus->column_fields["date_start"];
$cbtime = $focus->column_fields["time_start"];
} else {
// For non-calendar records.
$cbsubject = array_values(getEntityName($cbmodule, $cbrecord));
$cbsubject = $cbsubject[0];
$cbactivitytype = getTranslatedString($cbmodule, $cbmodule);
$cbdate = $adb->query_result($result, $index, 'date_start');
$cbtime = $adb->query_result($result, $index, 'time_start');
}
if($cbactivitytype=='Task')
$cbstatus = $focus->column_fields["taskstatus"];
else
$cbstatus = $focus->column_fields["eventstatus"];
// Appending recordid we can get unique callback dom id for that record.
$popupid = "ActivityReminder_$cbrecord";
if($cbdate <= date('Y-m-d')){
if($cbdate == date('Y-m-d') && $cbtime > date('H:i')) $cbcolor = '';
else $cbcolor= '#FF1515';
}
$smarty->assign("THEME", $theme);
$smarty->assign("popupid", $popupid);
$smarty->assign("APP", $app_strings);
$smarty->assign("cbreminderid", $reminderid);
$smarty->assign("cbdate", $cbdate);
$smarty->assign("cbtime", $cbtime);
$smarty->assign("cbsubject", $cbsubject);
$smarty->assign("cbmodule", $cbmodule);
$smarty->assign("cbrecord", $cbrecord);
$smarty->assign("cbstatus", $cbstatus);
$smarty->assign("cbcolor", $cbcolor);
$smarty->assign("cblinkdtl", $cblinkdtl);
$smarty->assign("activitytype", $cbactivitytype);
$smarty->display("ActivityReminderCallback.tpl");
$mark_reminder_as_read = "UPDATE vtiger_activity_reminder_popup set status = 1 where reminderid = ?";
$adb->pquery($mark_reminder_as_read, array($reminderid));
}
}
$reminder_next = date('Y-m-d H:i', strtotime("+$cb_time minutes", $cur_time));
// NOTE date_entered has CURRENT_TIMESTAMP constraint, so we need to reset when updating the table
$adb->pquery("UPDATE vtiger_users set reminder_next_time=?, date_entered=? where id=?",array($reminder_next, $lastlogin_time, $current_user->id));
$reminder_interval_reset = (strtotime($reminder_next) - $cur_time) * 1000;
// NOTE (Overcome Browser's issue): If required comment out the following line if condition below.
// To make popup work fine when interval is set to 1 minute, we need decrement the timeout
// if($reminder_interval_reset / 1000 == 60) $reminder_interval_reset = (40 * 1000);
echo "<script type='text/javascript' id='_vtiger_activityreminder_callback_interval_'>$reminder_interval_reset</script>";
}
}
}
?>
@@ -0,0 +1,45 @@
<?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): ______________________________________.
********************************************************************************/
global $app_strings;
global $currentModule,$image_path,$theme,$adb, $current_user;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once("data/Tracker.php");
require_once('themes/'.$theme.'/layout_utils.php');
require_once('include/utils/utils.php');
$log = LoggerManager::getLogger('Activity_Reminder');
$cbaction = $_REQUEST['cbaction'];
$cbmodule = $_REQUEST['cbmodule'];
$cbrecord = $_REQUEST['cbrecord'];
if($cbaction == 'POSTPONE') {
if(isset($cbmodule) && isset($cbrecord)) {
$reminderid = $_REQUEST['cbreminderid'];
if(!empty($reminderid) ) {
$reminder_query = "UPDATE vtiger_activity_reminder_popup set status = 0 WHERE reminderid = ? AND semodule = ? AND recordid = ?";
$adb->pquery($reminder_query, array($reminderid, $cbmodule, $cbrecord));
echo ":#:SUCCESS";
} else {
echo ":#:FAILURE";
}
}
}
?>
@@ -0,0 +1,297 @@
<?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/Calendar/CalendarCommon.php');
require_once('include/utils/CommonUtils.php');
require_once('include/utils/UserInfoUtil.php');
require_once('include/database/PearDatabase.php');
require_once('modules/Calendar/Activity.php');
class Appointment
{
var $start_time;
var $end_time;
var $subject;
var $participant;
var $participant_state;
var $contact_name;
var $account_id;
var $account_name;
var $creatorid;
var $creator;
var $owner;
var $ownerid;
var $assignedto;
var $eventstatus;
var $priority;
var $activity_type;
var $description;
var $record;
var $temphour;
var $tempmin;
var $image_name;
var $formatted_datetime;
var $duration_min;
var $duration_hour;
var $shared = false;
var $recurring;
var $dur_hour;
function Appointment()
{
$this->participant = Array();
$this->participant_state = Array();
$this->description = "";
}
/** To get the events of the specified user and shared events
* @param $userid -- The user Id:: Type integer
* @param $from_datetime -- The start date Obj :: Type Array
* @param $to_datetime -- The end date Obj :: Type Array
* @param $view -- The calendar view :: Type String
* @returns $list :: Type Array
*/
function readAppointment($userid, &$from_datetime, &$to_datetime, $view)
{
global $current_user,$adb;
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
$and = "AND ((vtiger_activity.date_start between ? AND ?)
OR (vtiger_activity.date_start < ? AND vtiger_activity.due_date > ?)
OR (vtiger_activity.due_date between ? AND ?))";
$q= "select vtiger_activity.*, vtiger_crmentity.*, case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name FROM vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid left join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid WHERE vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype not in ('Emails','Task') $and ";
// User Select Customization: Changes should made also in (calendayLaout getEventList) and one more BELOW
$query_filter_prefix = calendarview_getSelectedUserFilterQuerySuffix();
$q .= $query_filter_prefix;
// END
$params = array($from_datetime->get_formatted_date(), $to_datetime->get_formatted_date(), $from_datetime->get_formatted_date(), $from_datetime->get_formatted_date(), $from_datetime->get_formatted_date(), $to_datetime->get_formatted_date());
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3)
{
//Added for User Based Custom View for Calendar
$sec_parameter=getCalendarViewSecurityParameter();
$q .= $sec_parameter;
}
$q .= " AND vtiger_recurringevents.activityid is NULL ";
$q .= " group by vtiger_activity.activityid ORDER by vtiger_activity.date_start,vtiger_activity.time_start";
$r = $adb->pquery($q, $params);
$n = $adb->getRowCount($r);
$a = 0;
$list = Array();
while ( $a < $n )
{
$result = $adb->fetchByAssoc($r);
$start_timestamp = strtotime($result["date_start"]);
$end_timestamp = strtotime($result["due_date"]);
if($from_datetime->ts <= $start_timestamp) $from = $start_timestamp;
else $from = $from_datetime->ts;
if($to_datetime->ts <= $end_timestamp) $to = $to_datetime->ts;
else $to = $end_timestamp;
for($j = $from; $j <= $to; $j=$j+(60*60*24))
{
$obj = &new Appointment();
$temp_start = date("Y-m-d",$j);
$result["date_start"]= $temp_start ;
list($obj->temphour,$obj->tempmin) = explode(":",$result["time_start"]);
if($start_timestamp != $end_timestamp && $view == 'day'){
if($j == $start_timestamp){
$result["duration_hours"] = 24 - $obj->temphour;
}elseif($j > $start_timestamp && $j < $end_timestamp){
list($obj->temphour,$obj->tempmin)= $current_user->start_hour !=''?explode(":",$current_user->start_hour):explode(":","08:00");
$result["duration_hours"] = 24 - $obj->temphour;
}elseif($j == $end_timestamp){
list($obj->temphour,$obj->tempmin)= $current_user->start_hour !=''?explode(":",$current_user->start_hour):explode(":","08:00");
list($ehr,$emin) = explode(":",$result["time_end"]);
$result["duration_hours"] = $ehr - $obj->temphour;
}
}
$obj->readResult($result, $view);
$list[] = $obj;
unset($obj);
}
$a++;
}
//Get Recurring events
$q = "SELECT vtiger_activity.*, vtiger_crmentity.*, case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name , vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_groups.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid ";
$q.=" where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype not in ('Emails','Task') AND (recurringdate between ? and ?) ";
// User Select Customization
$q .= $query_filter_prefix;
// END
$params = array($from_datetime->get_formatted_date(), $to_datetime->get_formatted_date());
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3)
{
$sec_parameter=getListViewSecurityParameter('Calendar');
$q .= $sec_parameter;
}
$q .= " ORDER by vtiger_recurringevents.recurringid";
$r = $adb->pquery($q, $params);
$n = $adb->getRowCount($r);
$a = 0;
while ( $a < $n )
{
$obj = &new Appointment();
$result = $adb->fetchByAssoc($r);
list($obj->temphour,$obj->tempmin) = explode(":",$result["time_start"]);
$obj->readResult($result,$view);
$a++;
$list[] = $obj;
unset($obj);
}
usort($list,'compare');
return $list;
}
/** To read and set the events value in Appointment Obj
* @param $act_array -- The vtiger_activity array :: Type Array
* @param $view -- The calendar view :: Type String
*/
function readResult($act_array, $view)
{
global $adb,$current_user,$app_strings;
$format_sthour='';
$format_stmin='';
$this->description = $act_array["description"];
$this->eventstatus = getRoleBasesdPickList('eventstatus',$act_array["eventstatus"]);
$this->priority = getRoleBasesdPickList('taskpriority',$act_array["priority"]);
$this->subject = $act_array["subject"];
$this->activity_type = $act_array["activitytype"];
$this->duration_hour = $act_array["duration_hours"];
$this->duration_minute = $act_array["duration_minutes"];
$this->creatorid = $act_array["smcreatorid"];
//$this->creator = getUserName($act_array["smcreatorid"]);
$this->assignedto = $act_array["user_name"];
$this->owner = $act_array["user_name"];
if(!is_admin($current_user))
{
if($act_array["smownerid"]!=0 && $act_array["smownerid"] != $current_user->id && $act_array["visibility"] == "Public"){
$que = "select * from vtiger_sharedcalendar where sharedid=? and userid=?";
$row = $adb->pquery($que, array($current_user->id, $act_array["smownerid"]));
$no = $adb->getRowCount($row);
if($no > 0)
$this->shared = true;
}
}
$this->image_name = $act_array["activitytype"].".gif";
if(!empty($act_array["recurringid"]) && !empty($act_array["recurringtype"]))
$this->recurring="Recurring.gif";
$this->record = $act_array["activityid"];
list($styear,$stmonth,$stday) = explode("-",$act_array["date_start"]);
if($act_array["notime"] != 1){
$st_hour = twoDigit($this->temphour);
list($sthour,$stmin) = split(":",$act_array["time_start"]);
}else{
$st_hour = 'notime';
$stmin = '00';
$sthour= '00';
}
list($eyear,$emonth,$eday) = explode("-",$act_array["due_date"]);
list($end_hour,$end_min) = split(":",$act_array["time_end"]);
$start_date_arr = Array(
'min' => $stmin,
'hour' => $sthour,
'day' => $stday,
'month' => $stmonth,
'year' => $styear
);
$end_date_arr = Array(
'min' => $end_min,
'hour' => $end_hour,
'day' => $eday,
'month' => $emonth,
'year' => $eyear
);
$this->start_time = new vt_DateTime($start_date_arr,true);
$this->end_time = new vt_DateTime($end_date_arr,true);
if($view == 'day' || $view == 'week')
{
$this->formatted_datetime= $act_array["date_start"].":".$st_hour;
}
elseif($view == 'year')
{
list($year,$month,$date) = explode("-",$act_array["date_start"]);
$this->formatted_datetime = $month;
}
else
{
$this->formatted_datetime= $act_array["date_start"];
}
return;
}
}
/** To two array values
* @param $a -- The vtiger_activity array :: Type Array
* @param $b -- The vtiger_activity array :: Type Array
* @returns value 0 or 1 or -1 depends on comparision result
*/
function compare($a,$b)
{
if ($a->start_time->ts == $b->start_time->ts)
{
return 0;
}
return ($a->start_time->ts < $b->start_time->ts) ? -1 : 1;
}
function getRoleBasesdPickList($fldname,$exist_val)
{
global $adb,$app_strings,$current_user;
$is_Admin = $current_user->is_admin;
if($is_Admin == 'off' && $fldname != '')
{
$roleid=$current_user->roleid;
$roleids = Array();
$subrole = getRoleSubordinates($roleid);
if(count($subrole)> 0)
$roleids = $subrole;
array_push($roleids, $roleid);
//here we are checking wheather the table contains the sortorder column .If sortorder is present in the main picklist table, then the role2picklist will be applicable for this table...
$sql="select * from vtiger_$fldname where $fldname=?";
$res = $adb->pquery($sql,array(decode_html($exist_val)));
$picklistvalueid = $adb->query_result($res,0,'picklist_valueid');
if ($picklistvalueid != null) {
$pick_query="select * from vtiger_role2picklist where picklistvalueid=$picklistvalueid and roleid in (". generateQuestionMarks($roleids) .")";
$res_val=$adb->pquery($pick_query,array($roleids));
$num_val = $adb->num_rows($res_val);
}
if($num_val > 0)
$pick_val = $exist_val;
else
$pick_val = $app_strings['LBL_NOT_ACCESSIBLE'];
}else
$pick_val = $exist_val;
return $pick_val;
}
?>
@@ -0,0 +1,99 @@
/*********************************************************************************
** 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.
********************************************************************************/
function set_values(form) {
if (form.duedate_flag.checked) {
form.duedate_flag.value='on';
form.duedate.value="";
form.duetime.value="";
form.duedate.readOnly=true;
form.duetime.readOnly=true;
document.images.jscal_trigger.width = 0;
document.images.jscal_trigger.height = 0;
}
else {
form.duedate_flag.value='off';
form.duedate.readOnly=false;
form.duetime.readOnly=false;
if (form.duetime.readonly) alert (alert_arr.READONLY);
document.images.jscal_trigger.width = 16;
document.images.jscal_trigger.height = 16;
}
}
function toggleTime()
{
if(getObj("notime").checked)
{
getObj("notime").value = 'on';
getObj("duration_hours").disabled = true;
getObj("duration_minutes").disabled = true;
}
else
{
getObj("notime").value = 'off';
getObj("duration_minutes").disabled = false;
getObj("duration_hours").disabled = false;
}
}
function toggleAssignType(currType)
{
if (currType=="U")
{
getObj("assign_user").style.display="block"
getObj("assign_team").style.display="none"
}
else
{
getObj("assign_user").style.display="none"
getObj("assign_team").style.display="block"
}
}
function showActivityView(selectactivity_view)
{
//script to reload the page with the view type when the combo values are changed
View_name = selectactivity_view.options[selectactivity_view.options.selectedIndex].value;
document.frmOpenLstView.action = "index.php?module=Home&action=index&activity_view="+View_name;
document.frmOpenLstView.submit();
}
@@ -0,0 +1,297 @@
<?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/Calendar/Appointment.php');
require_once('modules/Calendar/Date.php');
class Calendar
{
var $view='day';
var $date_time;
var $hour_format = 'am/pm';
var $day_slice;
var $week_slice;
var $week_array;
var $month_array;
var $week_hour_slices = Array();
var $slices = Array();
/* for dayview */
var $day_start_hour=0;
var $day_end_hour=23;
var $sharedusers=Array();
/*
constructor
*/
//var $groupTable = Array('vtiger_activitygrouprelation','activityid');
function Calendar($view='',$data=Array())
{
$this->view = $view;
$this->date_time = new vt_DateTime($data,true);
$this->constructLayout();
}
/**
* Function to get calendarview Label
* @param string $view - calendarview
* return string - calendarview Label
*/
function getCalendarView($view)
{
switch($view)
{
case 'day':
return "DAY";
case 'week':
return "WEEK";
case 'month':
return "MON";
case 'year':
return "YEAR";
}
}
/**
* Function to set values for calendar object depends on calendar view
*/
function constructLayout()
{
global $current_user;
switch($this->view)
{
case 'day':
for($i=-1;$i<=23;$i++)
{
if($i == -1)
{
$layout = new Layout('hour',$this->date_time->getTodayDatetimebyIndex(0));
$this->day_slice[$layout->start_time->get_formatted_date().':notime'] = $layout;
$this->slices['notime'] = $layout->start_time->get_formatted_date().":notime";
}
else
{
$layout = new Layout('hour',$this->date_time->getTodayDatetimebyIndex($i));
$this->day_slice[$layout->start_time->get_formatted_date().':'.$layout->start_time->z_hour] = $layout;
array_push($this->slices, $layout->start_time->get_formatted_date().":".$layout->start_time->z_hour);
}
}
break;
case 'week':
$weekview_days = 7;
for($i=0;$i<$weekview_days;$i++)
{
$layout = new Layout('day',$this->date_time->getThisweekDaysbyIndex($i));
$this->week_array[$layout->start_time->get_formatted_date()] = $layout;
for($h=-1;$h<=23;$h++)
{
if($h == -1)
{
$hour_list = new Layout('hour',$this->date_time->getTodayDatetimebyIndex(0,$layout->start_time->day,$layout->start_time->month,$layout->start_time->year));
$this->week_slice[$layout->start_time->get_formatted_date().':notime'] = $hour_list;
$this->week_hour_slices['notime'] = $layout->start_time->get_formatted_date().":notime";
}
else
{
$hour_list = new Layout('hour',$this->date_time->getTodayDatetimebyIndex($h,$layout->start_time->day,$layout->start_time->month,$layout->start_time->year));
$this->week_slice[$layout->start_time->get_formatted_date().':'.$hour_list->start_time->z_hour] = $hour_list;
array_push($this->week_hour_slices, $layout->start_time->get_formatted_date().":".$hour_list->start_time->z_hour);
}
}
array_push($this->slices, $layout->start_time->get_formatted_date());
}
break;
case 'month':
$arr = getCalendarDaysInMonth($this->date_time);
$this->month_array = $arr["month_array"];
$this->slices = $arr["slices"];
$this->date_time = $arr["date_time"];
break;
case 'year':
$this->month_day_slices = Array();
for($i=0;$i<12;$i++){
$currMonth = $this->date_time->getThisyearMonthsbyIndex($i);
$layout = new Layout('month',$this->date_time->getThisyearMonthsbyIndex($i));
$this->year_array[$layout->start_time->z_month] = $layout;
$arr = getCalendarDaysInMonth($currMonth);
$slices = $arr["slices"];
$this->month_day_slices[$i] = $slices;
array_push($this->slices, $layout->start_time->z_month);
}
break;
}
}
/**
* Function to get date info depends on calendarview
* @param string $type - string 'increment' or 'decrment'
*/
function get_datechange_info($type)
{
if($type == 'next')
$mode = 'increment';
if($type == 'prev')
$mode = 'decrment';
switch($this->view)
{
case 'day':
$day = $this->date_time->get_changed_day($mode);
break;
case 'week':
$day = $this->date_time->get_first_day_of_changed_week($mode);
break;
case 'month':
$day = $this->date_time->get_first_day_of_changed_month($mode);
break;
case 'year':
$day = $this->date_time->get_first_day_of_changed_year($mode);
break;
default:
return "view is not supported";
}
return $day->get_date_str();
}
/**
* Function to get activities
* @param array $current_user - user data
* @param string $free_busy -
*/
function add_Activities($current_user,$free_busy='')
{
if(isset($current_user->start_hour) && $current_user->start_hour !='')
{
list($sthour,$stmin)= explode(":",$current_user->start_hour);
$hr = $sthour+0;
$this->day_start_hour=$hr;
}
else
{
$this->day_start_hour=8;
}
if(isset($current_user->end_hour) && $current_user->end_hour !='')
{
list($endhour,$endmin)=explode(":",$current_user->end_hour);
$endhour = $endhour+0;
$this->day_end_hour=$endhour;
}
else
{
$this->day_end_hour=23;
}
if ( $this->view == 'week')
{
$start_datetime = $this->date_time->getThisweekDaysbyIndex(0);
$end_datetime = $this->date_time->getThisweekDaysbyIndex(6);
} elseif($this->view == 'month') {
$start_datetime = $this->date_time->getThismonthDaysbyIndex(0);
$end_datetime = $this->date_time->getThismonthDaysbyIndex($this->date_time->daysinmonth-1);
} elseif($this->view == 'year'){
$start_datetime = $this->date_time->getThisyearMonthsbyIndex(0);
$end_datetime = $this->date_time->get_first_day_of_changed_year('increment');
}else {
$start_datetime = $this->date_time;
$end_datetime = $this->date_time->getTodayDatetimebyIndex(23);
}
$activities = Array();
$activities = Appointment::readAppointment($current_user->id,$start_datetime,$end_datetime,$this->view);
if(!empty($activities))
{
foreach($activities as $key=>$value)
{
if($this->view == 'day')
{
array_push($this->day_slice[$value->formatted_datetime]->activities, $value);
}
elseif($this->view == 'week')
{
array_push($this->week_slice[$value->formatted_datetime]->activities, $value);
}
elseif($this->view == 'month')
{
array_push($this->month_array[$value->formatted_datetime]->activities,$value);
}
elseif($this->view == 'year')
{
array_push($this->year_array[$value->formatted_datetime]->activities,$value);
}
else
die("view:".$this->view." is not defined");
}
}
}
}
class Layout
{
var $view = 'day';
var $start_time;
var $end_time;
var $activities = Array();
/**
* Constructor for Layout class
* @param string $view - calendarview
* @param string $time - time string
*/
function Layout($view,$time)
{
$this->view = $view;
$this->start_time = $time;
if ( $view == 'month')
$this->end_time = $this->start_time->getMonthendtime();
if ( $view == 'day')
$this->end_time = $this->start_time->getDayendtime();
if ( $view == 'hour')
$this->end_time = $this->start_time->getHourendtime();
}
/**
* Function to get view
* return currentview
*/
function getView()
{
return $this->view;
}
}
/**
* this function returns the days in a month in an array format
* @param object $date_time - the date time object for the current month
* @return array $result - the array containing current months days information
*/
function getCalendarDaysInMonth($date_time){
global $current_user;
$month_array = array();
$slices = array();
$monthview_days = $date_time->daysinmonth;
$firstday_of_month = $date_time->getThisMonthsDayByIndex(0);
$fdom = $firstday_of_month;
$num_of_prev_days = ($fdom->dayofweek+1)%7-1;
for($i=-$num_of_prev_days;$i<42;$i++){
$pd = $date_time->getThisMonthsDayByIndex($i);
$layout = new Layout('day', $pd);
$month_array[$layout->start_time->get_formatted_date()] = $layout;
array_push($slices, $layout->start_time->get_formatted_date());
}
$result = array("month_array"=>$month_array, "slices"=>$slices, "date_time"=>$date_time);
return $result;
}
?>
@@ -0,0 +1,13 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/Ajax/CommonAjax.php');
?>
@@ -0,0 +1,617 @@
<?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.
*
********************************************************************************/
//Code Added by Minnie -Starts
/**
* To get the lists of sharedids
* @param $id -- The user id :: Type integer
* @returns $sharedids -- The shared vtiger_users id :: Type Array
*/
if(isset($_REQUEST['fieldval']))
{
$currtime = date("Y:m:d:H:i:s");
list($y,$m,$d,$h,$min,$sec) = split(':',$currtime);
echo "[{YEAR:'".$y."',MONTH:'".$m."',DAY:'".$d."',HOUR:'".$h."',MINUTE:'".$min."'}]";
die;
}
function getSharedUserId($id)
{
global $adb;
$sharedid = Array();
$query = "SELECT vtiger_users.user_name,vtiger_sharedcalendar.* from vtiger_sharedcalendar left join vtiger_users on vtiger_sharedcalendar.sharedid=vtiger_users.id where userid=?";
$result = $adb->pquery($query, array($id));
$rows = $adb->num_rows($result);
for($j=0;$j<$rows;$j++)
{
$id = $adb->query_result($result,$j,'sharedid');
$sharedname = $adb->query_result($result,$j,'user_name');
$sharedid[$id]=$sharedname;
}
return $sharedid;
}
/**
* To get the lists of vtiger_users id who shared their calendar with specified user
* @param $sharedid -- The shared user id :: Type integer
* @returns $shared_ids -- a comma seperated vtiger_users id :: Type string
*/
function getSharedCalendarId($sharedid)
{
global $adb;
$query = "SELECT * from vtiger_sharedcalendar where sharedid=?";
$result = $adb->pquery($query, array($sharedid));
if($adb->num_rows($result)!=0)
{
for($j=0;$j<$adb->num_rows($result);$j++)
$userid[] = $adb->query_result($result,$j,'userid');
$shared_ids = implode (",",$userid);
}
return $shared_ids;
}
/**
* To get userid and username of all vtiger_users except the current user
* @param $id -- The user id :: Type integer
* @returns $user_details -- Array in the following format:
* $user_details=Array($userid1=>$username, $userid2=>$username,............,$useridn=>$username);
*/
function getOtherUserName($id)
{
global $adb;
$user_details=Array();
$query="select * from vtiger_users where deleted=0 and status='Active' and id!=?";
$result = $adb->pquery($query, array($id));
$num_rows=$adb->num_rows($result);
for($i=0;$i<$num_rows;$i++)
{
$userid=$adb->query_result($result,$i,'id');
$username=$adb->query_result($result,$i,'user_name');
$user_details[$userid]=$username;
}
return $user_details;
}
/**
* To get userid and username of vtiger_users in hierarchy level
* @param $id -- The user id :: Type integer
* @returns $user_details -- Array in the following format:
* $user_details=Array($userid1=>$username, $userid2=>$username,............,$useridn=>$username);
*/
function getSharingUserName($id)
{
global $adb,$current_user;
$user_details=Array();
$assigned_user_id = $current_user->id;
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
require('user_privileges/user_privileges_'.$current_user->id.'.php');
if($is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid('Calendar')] == 3 or $defaultOrgSharingPermission[getTabid('Calendar')] == 0))
{
$role_seq = implode($parent_roles, "::");
$query = "select id as id,user_name as user_name from vtiger_users where id=? and status='Active' union select vtiger_user2role.userid as id,vtiger_users.user_name as user_name from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like ? and status='Active' union select shareduserid as id,vtiger_users.user_name as user_name from vtiger_tmp_write_user_sharing_per inner join vtiger_users on vtiger_users.id=vtiger_tmp_write_user_sharing_per.shareduserid where status='Active' and vtiger_tmp_write_user_sharing_per.userid=? and vtiger_tmp_write_user_sharing_per.tabid=9";
$params = array($current_user->id, $role_seq."::%", $current_user->id);
if (!empty($assigned_user_id)) {
$query .= " OR id=?";
array_push($params, $assigned_user_id);
}
$query .= " order by user_name ASC";
$result = $adb->pquery($query, $params, true, "Error filling in user array: ");
while($row = $adb->fetchByAssoc($result))
{
$temp_result[$row['id']] = $row['user_name'];
}
$user_details = &$temp_result;
unset($user_details[$id]);
}
else
{
$user_details = get_user_array(FALSE, "Active", $id);
unset($user_details[$id]);
}
return $user_details;
}
/**
* To get hour,minute and format
* @param $starttime -- The date&time :: Type string
* @param $endtime -- The date&time :: Type string
* @param $format -- The format :: Type string
* @returns $timearr :: Type Array
*/
function getaddEventPopupTime($starttime,$endtime,$format)
{
$timearr = Array();
list($sthr,$stmin) = explode(":",$starttime);
list($edhr,$edmin) = explode(":",$endtime);
if($format == 'am/pm')
{
$hr = $sthr+0;
$timearr['startfmt'] = ($hr >= 12) ? "pm" : "am";
if($hr == 0) $hr = 12;
$timearr['starthour'] = twoDigit(($hr>12)?($hr-12):$hr);
$timearr['startmin'] = $stmin;
$edhr = $edhr+0;
$timearr['endfmt'] = ($edhr >= 12) ? "pm" : "am";
if($edhr == 0) $edhr = 12;
$timearr['endhour'] = twoDigit(($edhr>12)?($edhr-12):$edhr);
$timearr['endmin'] = $edmin;
return $timearr;
}
if($format == '24')
{
$timearr['starthour'] = twoDigit($sthr);
$timearr['startmin'] = $stmin;
$timearr['startfmt'] = '';
$timearr['endhour'] = twoDigit($edhr);
$timearr['endmin'] = $edmin;
$timearr['endfmt'] = '';
return $timearr;
}
}
/**
*To construct time select combo box
*@param $format -- the format :: Type string
*@param $bimode -- The mode :: Type string
*constructs html select combo box for time selection
*and returns it in string format.
*/
function getTimeCombo($format,$bimode,$hour='',$min='',$fmt='',$todocheck=false)
{
global $mod_strings;
$combo = '';
$min = $min - ($min%5);
if($bimode == 'start' && !$todocheck)
$jsfn = 'onChange="changeEndtime_StartTime(document.EditView.activitytype.value);"';
else
$jsfn = null;
if($format == 'am/pm')
{
$combo .= '<select class=small name="'.$bimode.'hr" id="'.$bimode.'hr" '.$jsfn.'>';
for($i=0;$i<12;$i++)
{
if($i == 0)
{
$hrtext= 12;
$hrvalue = 12;
}
else
$hrvalue = $hrtext = twoDigit($i);
$hrsel = ($hour == $hrvalue)?'selected':'';
$combo .= '<option value="'.$hrvalue.'" '.$hrsel.'>'.$hrtext.'</option>';
}
$combo .= '</select>&nbsp;';
$combo .= '<select name="'.$bimode.'min" id="'.$bimode.'min" class=small '.$jsfn.'>';
for($i=0;$i<12;$i++)
{
$value = $i*5;
$value = twoDigit($value);
$minsel = ($min == $value)?'selected':'';
$combo .= '<option value="'.$value.'" '.$minsel.'>'.$value.'</option>';
}
$combo .= '</select>&nbsp;';
$combo .= '<select name="'.$bimode.'fmt" id="'.$bimode.'fmt" class=small '.$jsfn.'>';
$amselected = ($fmt == 'am')?'selected':'';
$pmselected = ($fmt == 'pm')?'selected':'';
$combo .= '<option value="am" '.$amselected.'>AM</option>';
$combo .= '<option value="pm" '.$pmselected.'>PM</option>';
$combo .= '</select>';
}
else
{
$combo .= '<select name="'.$bimode.'hr" id="'.$bimode.'hr" class=small '.$jsfn.'>';
for($i=0;$i<=23;$i++)
{
$hrvalue = twoDigit($i);
$hrsel = ($hour == $hrvalue)?'selected':'';
$combo .= '<option value="'.$hrvalue.'" '.$hrsel.'>'.$hrvalue.'</option>';
}
$combo .= '</select>'.$mod_strings[LBL_HR].'&nbsp;';
$combo .= '<select name="'.$bimode.'min" id="'.$bimode.'min" class=small '.$jsfn.'>';
for($i=0;$i<12;$i++)
{
$value = $i*5;
$value= twoDigit($value);
$minsel = ($min == $value)?'selected':'';
$combo .= '<option value="'.$value.'" '.$minsel.'>'.$value.'</option>';
}
$combo .= '</select>&nbsp;'.$mod_strings[LBL_MIN].'<input type="hidden" name="'.$bimode.'fmt" id="'.$bimode.'fmt">';
}
return $combo;
}
/**
*Function to construct HTML select combo box
*@param $fieldname -- the field name :: Type string
*@param $tablename -- The table name :: Type string
*constructs html select combo box for combo field
*and returns it in string format.
*/
function getActFieldCombo($fieldname,$tablename)
{
global $adb, $mod_strings,$current_user;
require('user_privileges/user_privileges_'.$current_user->id.'.php');
$combo = '';
$js_fn = '';
if($fieldname == 'eventstatus')
$js_fn = 'onChange = "getSelectedStatus();"';
$combo .= '<select name="'.$fieldname.'" id="'.$fieldname.'" class=small '.$js_fn.'>';
if($is_admin)
$q = "select * from ".$tablename;
else
{
$roleid=$current_user->roleid;
$subrole = getRoleSubordinates($roleid);
if(count($subrole)> 0)
{
$roleids = $subrole;
array_push($roleids, $roleid);
}
else
{
$roleids = $roleid;
}
if (count($roleids) > 1) {
$q="select distinct $fieldname from $tablename inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = $tablename.picklist_valueid where roleid in (\"". implode($roleids,"\",\"") ."\") and picklistid in (select picklistid from $tablename) order by sortid asc";
} else {
$q="select distinct $fieldname from $tablename inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = $tablename.picklist_valueid where roleid ='".$roleid."' and picklistid in (select picklistid from $tablename) order by sortid asc";
}
}
$Res = $adb->query($q);
$noofrows = $adb->num_rows($Res);
for($i = 0; $i < $noofrows; $i++)
{
$value = $adb->query_result($Res,$i,$fieldname);
$combo .= '<option value="'.$value.'">'.getTranslatedString($value).'</option>';
}
$combo .= '</select>';
return $combo;
}
/*Fuction to get value for Assigned To field
*returns values of Assigned To field in array format
*/
function getAssignedTo($tabid)
{
global $current_user,$noof_group_rows,$adb;
$assigned_user_id = $current_user->id;
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
require('user_privileges/user_privileges_'.$current_user->id.'.php');
if($is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$tabid] == 3 or $defaultOrgSharingPermission[$tabid] == 0))
{
$result=get_current_user_access_groups('Calendar');
}
else
{
$result = get_group_options();
}
if($result) $nameArray = $adb->fetch_array($result);
if($is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$tabid] == 3 or $defaultOrgSharingPermission[$tabid] == 0))
{
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id,'private'), $assigned_user_id);
}
else
{
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
}
if($noof_group_rows!=0)
{
do
{
$groupname=$nameArray["groupname"];
$group_option[] = array($groupname=>$selected);
}while($nameArray = $adb->fetch_array($result));
}
$fieldvalue[]=$users_combo;
$fieldvalue[] = $group_option;
return $fieldvalue;
}
//Code Added by Minnie -Ends
/**
* Function to get the vtiger_activity details for mail body
* @param string $description - activity description
* @param string $from - to differenciate from notification to invitation.
* return string $list - HTML in string format
*/
function getActivityDetails($description,$user_id,$from='')
{
global $log,$current_user;
global $adb,$mod_strings;
$log->debug("Entering getActivityDetails(".$description.") method ...");
$updated = $mod_strings['LBL_UPDATED'];
$created = $mod_strings['LBL_CREATED'];
$reply = (($description['mode'] == 'edit')?"$updated":"$created");
if($description['activity_mode'] == "Events")
{
$end_date_lable=$mod_strings['End date and time'];
}
else
{
$end_date_lable=$mod_strings['Due Date'];
}
$name = getUserName($user_id);
if($from == "invite")
$msg = getTranslatedString($mod_strings['LBL_ACTIVITY_INVITATION']);
else
$msg = getTranslatedString($mod_strings['LBL_ACTIVITY_NOTIFICATION']);
$current_username = getUserName($current_user->id);
$status = getTranslatedString($description['status']);
$list = $name.',';
$list .= '<br><br>'.$msg.' '.$reply.'.<br> '.$mod_strings['LBL_DETAILS_STRING'].':<br>';
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["LBL_SUBJECT"].' '.$description['subject'];
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["Start date and time"].' : '.$description['st_date_time'];
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$end_date_lable.' : '.$description['end_date_time'];
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["LBL_STATUS"].': '.$status;
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["Priority"].': '.getTranslatedString($description['taskpriority']);
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["Related To"].': '.getTranslatedString($description['relatedto']);
if(!empty($description['contact_name']))
{
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["LBL_CONTACT_LIST"].' '.$description['contact_name'];
}
else
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["Location"].' : '.$description['location'];
$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description['description'];
$list .= '<br><br>'.$mod_strings["LBL_REGARDS_STRING"].' ,';
$list .= '<br>'.$current_username.'.';
$log->debug("Exiting getActivityDetails method ...");
return $list;
}
function twoDigit( $no ){
if($no < 10 && strlen(trim($no)) < 2) return "0".$no;
else return "".$no;
}
function timeString($datetime,$fmt){
if(is_object($datetime)){
$hr = $datetime->hour;
$min = $datetime->minute;
} else {
$hr = $datetime['hour'];
$min = $datetime['minute'];
}
$timeStr = "";
if($fmt != 'am/pm'){
$timeStr .= twoDigit($hr).":".twoDigit($min);
}else{
$am = ($hr >= 12) ? "pm" : "am";
if($hr == 0) $hr = 12;
$timeStr .= ($hr>12)?($hr-12):$hr;
$timeStr .= ":".twoDigit($min);
$timeStr .= $am;
}
return $timeStr;
}
//added to fix Ticket#3068
function getEventNotification($mode,$subject,$desc)
{
global $current_user,$adb;
require_once("modules/Emails/mail.php");
$subject = $mode.' : '.$subject;
$crmentity = new CRMEntity();
if($desc['assingn_type'] == "U")
{
$to_email = getUserEmailId('id',$desc['user_id']);
$description = getActivityDetails($desc,$desc['user_id']);
send_mail('Calendar',$to_email,$current_user->user_name,'',$subject,$description);
}
if($desc['assingn_type'] == "T")
{
$groupid = '';
$groupname=$desc['group_name'];
// getGroupName API was changed to return array of two elements!
if(is_array($groupname) && !empty($groupname)) {
$groupid = $groupname[1];
$groupname = $groupname[0];
} else {
$resultqry=$adb->pquery("select groupid from vtiger_groups where groupname=?", array($groupname));
$groupid=$adb->query_result($resultqry,0,"groupid");
}
require_once('include/utils/GetGroupUsers.php');
$getGroupObj=new GetGroupUsers();
$getGroupObj->getAllUsersInGroup($groupid);
$userIds=$getGroupObj->group_users;
if (count($userIds) > 0) {
$groupqry="select email1,id from vtiger_users where id in(".generateQuestionMarks($userIds).")";
$groupqry_res=$adb->pquery($groupqry, array($userIds));
$noOfRows = $adb->num_rows($groupqry_res);
for($z=0;$z < $noOfRows;$z++)
{
$emailadd = $adb->query_result($groupqry_res,$z,'email1');
$curr_userid = $adb->query_result($groupqry_res,$z,'id');
$description = getActivityDetails($desc,$curr_userid);
$mail_status = send_mail('Calendar',$emailadd,getUserName($curr_userid),'',$subject,$description);
}
}
}
}
function sendInvitation($inviteesid,$mode,$subject,$desc)
{
global $current_user,$mod_strings;
require_once("modules/Emails/mail.php");
$invites=$mod_strings['INVITATION'];
$invitees_array = explode(';',$inviteesid);
$subject = $invites.' : '.$subject;
$record = $focus->id;
foreach($invitees_array as $inviteeid)
{
if($inviteeid != '')
{
$description=getActivityDetails($desc,$inviteeid,"invite");
$to_email = getUserEmailId('id',$inviteeid);
send_mail('Calendar',$to_email,$current_user->user_name,'',$subject,$description);
}
}
}
function getActivityMailInfo($return_id,$status,$activity_type)
{
$mail_data = Array();
global $adb;
$qry = "select * from vtiger_activity where activityid=?";
$ary_res = $adb->pquery($qry, array($return_id));
$send_notification = $adb->query_result($ary_res,0,"sendnotification");
$subject = $adb->query_result($ary_res,0,"subject");
$priority = $adb->query_result($ary_res,0,"priority");
$st_date = $adb->query_result($ary_res,0,"date_start");
$st_time = $adb->query_result($ary_res,0,"time_start");
$end_date = $adb->query_result($ary_res,0,"due_date");
$end_time = $adb->query_result($ary_res,0,"time_end");
$location = $adb->query_result($ary_res,0,"location");
$owner_qry = "select smownerid from vtiger_crmentity where crmid=?";
$res = $adb->pquery($owner_qry, array($return_id));
$owner_id = $adb->query_result($res,0,"smownerid");
$usr_res = $adb->pquery("select count(*) as count from vtiger_users where id=?",array($owner_id));
if($adb->query_result($usr_res, 0, 'count')>0) {
$assignType = "U";
$usr_id = $owner_id;
}
else {
$assignType = "T";
$group_qry = "select groupname from vtiger_groups where groupid=?";
$grp_res = $adb->pquery($group_qry, array($owner_id));
$grp_name = $adb->query_result($grp_res,0,"groupname");
}
$desc_qry = "select description from vtiger_crmentity where crmid=?";
$des_res = $adb->pquery($desc_qry, array($return_id));
$description = $adb->query_result($des_res,0,"description");
$rel_qry = "select case vtiger_crmentity.setype when 'Leads' then vtiger_leaddetails.lastname when 'Accounts' then vtiger_account.accountname when 'Potentials' then vtiger_potential.potentialname when 'Quotes' then vtiger_quotes.subject when 'PurchaseOrder' then vtiger_purchaseorder.subject when 'SalesOrder' then vtiger_salesorder.subject when 'Invoice' then vtiger_invoice.subject when 'Campaigns' then vtiger_campaign.campaignname when 'HelpDesk' then vtiger_troubletickets.title end as relname from vtiger_seactivityrel inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_seactivityrel.crmid left join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seactivityrel.crmid left join vtiger_account on vtiger_account.accountid=vtiger_seactivityrel.crmid left join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_quotes on vtiger_quotes.quoteid= vtiger_seactivityrel.crmid left join vtiger_purchaseorder on vtiger_purchaseorder.purchaseorderid = vtiger_seactivityrel.crmid left join vtiger_salesorder on vtiger_salesorder.salesorderid = vtiger_seactivityrel.crmid left join vtiger_invoice on vtiger_invoice.invoiceid = vtiger_seactivityrel.crmid left join vtiger_campaign on vtiger_campaign.campaignid = vtiger_seactivityrel.crmid left join vtiger_troubletickets on vtiger_troubletickets.ticketid = vtiger_seactivityrel.crmid where vtiger_seactivityrel.activityid=?";
$rel_res = $adb->pquery($rel_qry, array($return_id));
$rel_name = $adb->query_result($rel_res,0,"relname");
$cont_qry = "select * from vtiger_cntactivityrel where activityid=?";
$cont_res = $adb->pquery($cont_qry, array($return_id));
$cont_id = $adb->query_result($cont_res,0,"contactid");
$cont_name = '';
if($cont_id != '')
{
$cont_name = getContactName($cont_id);
}
$mail_data['mode'] = "edit";
$mail_data['activity_mode'] = $activity_type;
$mail_data['sendnotification'] = $send_notification;
$mail_data['user_id'] = $usr_id;
$mail_data['subject'] = $subject;
$mail_data['status'] = $status;
$mail_data['taskpriority'] = $priority;
$mail_data['relatedto'] = $rel_name;
$mail_data['contact_name'] = $cont_name;
$mail_data['description'] = $description;
$mail_data['assingn_type'] = $assignType;
$mail_data['group_name'] = $grp_name;
$value = getaddEventPopupTime($st_time,$end_time,'24');
$start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt'];
if($activity_type != 'Task' )
$end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt'];
$mail_data['st_date_time']=getDisplayDate($st_date)." ".$start_hour;
$mail_data['end_date_time']=getDisplayDate($end_date)." ".$end_hour;
$mail_data['location']=$location;
return $mail_data;
}
// User Select Customization
/**
* Function returns the id of the User selected by current user in the picklist of the ListView or Calendar view of Current User
* return String - Id of the user that the current user has selected
*/
function calendarview_getSelectedUserId() {
global $current_user, $default_charset;
$only_for_user = htmlspecialchars(strip_tags($_REQUEST['onlyforuser']),ENT_QUOTES,$default_charset);
if($only_for_user == '') $only_for_user = $current_user->id;
return $only_for_user;
}
function calendarview_getSelectedUserFilterQuerySuffix() {
global $current_user, $adb;
$only_for_user = calendarview_getSelectedUserId();
$qcondition = '';
if(!empty($only_for_user)) {
if($only_for_user != 'ALL') {
// For logged in user include the group records also.
if($only_for_user == $current_user->id) {
$user_group_ids = fetchUserGroupids($current_user->id);
// User does not belong to any group? Let us reset to non-existent group
if(!empty($user_group_ids)) $user_group_ids .= ',';
else $user_group_ids = '';
$user_group_ids .= $current_user->id;
$qcondition = " AND vtiger_crmentity.smownerid IN (" . $user_group_ids .")";
} else {
$qcondition = " AND vtiger_crmentity.smownerid = " . $adb->sql_escape_string($only_for_user);
}
}
}
return $qcondition;
}
/**
* Function returns the data of the user selected by current user in the picklist of the ListView or Calendar view of Current User
* @param $useridInUse - The Id of the user that the Current User has selected in dropdown picklist in Calendar modules listview or Calendar View
* return string - The array of the events for the user that the current user has selected
*/
function calendarview_getUserSelectOptions($useridInUse) {
global $adb, $app_strings, $current_user, $mod_strings;
$users = $adb->query("SELECT id,user_name FROM vtiger_users WHERE status = 'Active' and deleted = 0");
$userscount = $adb->num_rows($users);
$userSelectdata = "<span style='padding-left: 10px; padding-right: 10px;'><b>" . $app_strings['LBL_LIST_OF'] . " : </b>";
$userSelectdata .="<select class='small' onchange='fnRedirect();' name='onlyforuser'>";
// Providing All option for administrators only
if(is_admin($current_user)) {
$userSelectdata .= "<option value='ALL'>" . $app_strings['COMBO_ALL'] . "</option>";
}
$userSelectdata .= "<option value='$current_user->id'".(($current_user->id == $useridInUse)? "selected='true'":"").">".$mod_strings['LBL_MINE']."</option>";
for($index = 0; $index < $userscount; ++$index) {
$userid = $adb->query_result($users, $index, 'id');
if($userid == $current_user->id) {
continue; // We have already taken care of listing at first.
}
$username = $adb->query_result($users, $index, 'user_name');
$userselect = '';
if($userid == $useridInUse) $userselect = "selected='true'";
$userSelectdata .= "<option value='$userid' $userselect>$username</option>";
}
$userSelectdata .= "</select></span>";
return $userSelectdata;
}
// END
?>
@@ -0,0 +1,14 @@
<?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');
?>
+511
View File
@@ -0,0 +1,511 @@
<?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.
*
********************************************************************************/
class vt_DateTime
{
var $second = 0;
var $minute = 0;
var $hour = 0;
var $z_hour = '00';
var $day;
var $z_day;
var $week;
var $month;
var $z_month;
var $year;
var $dayofweek;
var $dayofyear;
var $daysinmonth;
var $daysinyear;
var $dayofweek_inshort;
var $dayofweek_inlong;
var $month_inshort;
var $month_inlong;
var $ts;
var $offset;
var $format;
var $tz;
var $ts_def;
/**
* Constructor for vt_DateTime class
* @param array $timearr - collection of string
* @param string $check - check string
*/
function vt_DateTime(&$timearr,$check)
{
if (! isset( $timearr) || count($timearr) == 0 )
{
$this->setDateTime(null);
}
else if ( isset( $timearr['ts']))
{
$this->setDateTime($time['ts']);
}
else
{
if(isset($timearr['hour']) && $timearr['hour'] !== '')
{
$this->hour = $timearr['hour'];
}
if(isset($timearr['min']) && $timearr['min'] !== '')
{
$this->minute = $timearr['min'];
}
if(isset($timearr['sec']) && $timearr['sec'] !== '')
{
$this->second = $timearr['sec'];
}
if(isset($timearr['day']) && $timearr['day'] !== '')
{
$this->day = $timearr['day'];
}
if(isset($timearr['week']) && $timearr['week'] !== '')
{
$this->week = $timearr['week'];
}
if(isset($timearr['month']) && $timearr['month'] !== '')
{
$this->month = $timearr['month'];
}
if(isset($timearr['year']) && $timearr['year'] >= 1970)
{
$this->year = $timearr['year'];
}
else
{
return null;
}
}
if ($check)
{
$this->getDateTime();
}
}
/**
* function to get date and time using index
* @param integer $index - number between 0 to 23
* @param string $day - date
* @param string $month - month
* @param string $year - year
* return vt_DateTime obj $datetimevalue
*/
function getTodayDatetimebyIndex($index,$day='', $month='', $year=''){
if($day === '')
$day = $this->day;
if($month === '')
$month = $this->month;
if($year === '')
$year = $this->year;
$day_array = array();
if($index < 0 || $index > 23){
die("hour is invalid");
}
$day_array['hour'] = $index;
$day_array['min'] = 0;
$day_array['day'] = $day;
$day_array['month'] = $month;
$day_array['year'] = $year;
$datetimevalue = new vt_DateTime($day_array,true);
return $datetimevalue;
}
/**
* function to get days in week using index
* @param integer $index - number between 0 to 6
* return vt_DateTime obj $datetimevalue
*/
function getThisweekDaysbyIndex($index){
$week_array = array();
if($index < 0 || $index > 6){
die("day is invalid");
}
$week_array['day'] = $this->day + ($index - $this->dayofweek);
$week_array['month'] = $this->month;
$week_array['year'] = $this->year;
$datetimevalue = new vt_DateTime($week_array,true);
return $datetimevalue;
}
/**
* function to get days in month using index
*
* This function will be deprecated.
* The newer version is getThisMonthsDayByIndex() and should be used wherever possible
*
* @param integer $index - number between 0 to 42
* @param string $day - date
* @param string $month - month
* @param string $year - year
* return vt_DateTime obj $datetimevalue
*/
function getThismonthDaysbyIndex($index,$day='', $month='', $year='')
{
if($day == '')
$day = $index+1;
if($month == '')
$month = $this->month;
if($year == '')
$year = $this->year;
$month_array = array();
$month_array['day'] = $day;
$month_array['month'] = $month;
$month_array['year'] = $year;
$datetimevalue = new vt_DateTime($month_array,true);
return $datetimevalue;
}
/**
* function to get months in year using index
* @param integer $index - number between 0 to 11
* return vt_DateTime obj $datetimevalue
*/
function getThisyearMonthsbyIndex($index)
{
$year_array = array();
$year_array['day'] = 1;
if($index < 0 || $index > 11)
{
die("month is invalid");
}
$year_array['month'] = $index+1;
$year_array['year'] = $this->year;
$datetimevalue = new vt_DateTime($year_array,true);
return $datetimevalue;
}
/**
* function to get hour end time
* return vt_DateTime obj $datetimevalue
*/
function getHourendtime()
{
$date_array = array();
$date_array['hour'] = $this->hour;
$date_array['min'] = 59;
$date_array['day'] = $this->day;
$date_array['sec'] = 59;
$date_array['month'] = $this->month;
$date_array['year'] = $this->year;
$datetimevalue = new vt_DateTime($date_array,true);
return $datetimevalue;
}
/**
* function to get day end time
* return vt_DateTime obj $datetimevalue
*/
function getDayendtime()
{
$date_array = array();
$date_array['hour'] = 23;
$date_array['min'] = 59;
$date_array['sec'] = 59;
$date_array['day'] = $this->day;
$date_array['month'] = $this->month;
$date_array['year'] = $this->year;
$datetimevalue = new vt_DateTime($date_array,true);
return $datetimevalue;
}
/**
* function to get month end time
* return vt_DateTime obj $datetimevalue
*/
function getMonthendtime()
{
$date_array = array();
$date_array['hour'] = 23;
$date_array['min'] = 59;
$date_array['sec'] = 59;
$date_array['day'] = $this->daysinmonth;
$date_array['month'] = $this->month;
$date_array['year'] = $this->year;
$datetimevalue = new vt_DateTime($date_array,true);
return $datetimevalue;
}
/**
* function to get day of week
* return string $this->day - day (eg: Monday)
*/
function get_Date()
{
return $this->day;
}
/**
* function to get month name in short
* return string $this->month_inshort - month name (eg: Jan)
*/
function getmonthName_inshort(){
return $this->month_inshort;
}
/**
* function to get month name
* return string $this->month - month name
*/
function getMonth(){
return $this->month;
}
/**
* function to get month name
* return string $this->month_inlong - month name
*/
function getmonthName(){
return $this->month_inlong;
}
/**
* function to get day of week
* return string $this->dayofweek_inlong - day of week
*/
function getdayofWeek(){
return $this->dayofweek_inlong;
}
/**
* function to get day of week in short
* return string $this->dayofweek_inshort - day of week (eg: Mon)
*/
function getdayofWeek_inshort(){
return $this->dayofweek_inshort;
}
/**
* function to set values for vt_DateTime object
* @param integer $ts - Time stamp
*/
function setDateTime($ts){
global $mod_strings;
if (empty($ts)){
$ts = time();
}
$this->ts = $ts;
$this->ts_def = $this->ts;
$date_string = date('i::G::H::j::d::t::w::z::L::W::n::m::Y::Z::T::s',$ts);
list($this->minute,$this->hour,$this->z_hour,$this->day,$this->z_day,$this->daysinmonth,$this->dayofweek,$this->dayofyear,$is_leap,$this->week,$this->month,$this->z_month,$this->year,$this->offset,$this->tz,$this->second) = split('::',$date_string);
$this->dayofweek_inshort =$mod_strings['cal_weekdays_short'][$this->dayofweek];
$this->dayofweek_inlong=$mod_strings['cal_weekdays_long'][$this->dayofweek];
$this->month_inshort=$mod_strings['cal_month_short'][$this->month];
$this->month_inlong=$mod_strings['cal_month_long'][$this->month];
$this->daysinyear = 365;
if ($is_leap == 1){
$this->daysinyear += 1;
}
}
/**
* function to get values from vt_DateTime object
*/
function getDateTime()
{
global $mod_strings;
$hour = 0;
$minute = 0;
$second = 0;
$day = 1;
$month = 1;
$year = 1970;
if ( isset($this->second) && $this->second !== ''){
$second = $this->second;
}
if ( isset($this->minute) && $this->minute !== ''){
$minute = $this->minute;
}
if ( isset($this->hour) && $this->hour !== '')
{
$hour = $this->hour;
}
if ( isset($this->day) && $this->day !== ''){
$day= $this->day;
}
if ( isset($this->month) && $this->month !== ''){
$month = $this->month;
}
if ( isset($this->year) && $this->year !== ''){
$year = $this->year;
}else{
die("year was not set");
}
if(empty($hour) && $hour !== 0) $hour = 0;
$this->ts = mktime($hour,$minute,$second,$month,$day,$year);
$this->setDateTime($this->ts);
}
/**
* function to get mysql formatted date
* return formatted date in string format
*/
function get_formatted_date(){
return $this->year."-".$this->z_month."-".$this->z_day;
}
/**
* function to get mysql formatted time
* return formatted time in string format
*/
function get_formatted_time(){
return $this->z_hour.":".$this->min;
}
/**
* function to get date depends on mode value
* @param string $mode - 'increment' or 'decrement'
* return vt_DateTime obj
*/
function get_changed_day($mode){
if($mode == 'increment')
$day = $this->day + 1;
else
$day = $this->day - 1;
$date_data = array('day'=>$day,
'month'=>$this->month,
'year'=>$this->year
);
return new vt_DateTime($date_data,true);
}
/**
* function to get changed week depends on mode value
* @param string $mode - 'increment' or 'decrement'
* return vt_DateTime obj
*/
function get_first_day_of_changed_week($mode){
$first_day = $this->getThisweekDaysbyIndex(0);
if($mode == 'increment')
$day = $first_day->day + 7;
else
$day = $first_day->day - 7;
$date_data = array('day'=>$day,
'month'=>$first_day->month,
'year'=>$first_day->year
);
return new vt_DateTime($date_data,true);
}
/**
* function to get month depends on mode value
* @param string $mode - 'increment' or 'decrement'
* return vt_DateTime obj
*/
function get_first_day_of_changed_month($mode){
$tmpDate['day'] = $this->day;
$tmpDate['month'] = $this->month;
$tmpDate['year'] = $this->year;
if(is_array($arr) && !empty($arr)){
$tmpDate['year'] = $arr[0];
$tmpDate['month'] = $arr[1];
$tmpDate['day'] = $arr[2];
}
if($mode == 'increment'){
$month = $tmpDate['month'] + 1;
$year = $tmpDate['year'] ;
}else{
if($tmpDate['month'] == 1){
$month = 12;
$year = $tmpDate['year'] - 1;
}else{
$month = $tmpDate['month'] - 1;
$year = $tmpDate['year'] ;
}
}
$date_data = array(
'day'=>1,
'month'=>$month,
'year'=>$year
);
return new vt_DateTime($date_data,true);
}
/**
* function to get year depends on mode value
* @param string $mode - 'increment' or 'decrement'
* return vt_DateTime obj
*/
function get_first_day_of_changed_year($mode){
if($mode == 'increment'){
$year = $this->year + 1;
}else{
$year = $this->year - 1;
}
$date_data = array('day'=>1,
'month'=>1,
'year'=>$year
);
return new vt_DateTime($date_data,true);
}
/**
* function to get date string
* return date string
*/
function get_date_str(){
$array = Array();
if ( isset( $this->hour) && $this->hour != '')
{
array_push( $array, "hour=".$this->hour);
}
if ( isset( $this->day) && $this->day != '')
{
array_push( $array, "day=".$this->day);
}
if ( isset( $this->month) && $this->month)
{
array_push( $array, "month=".$this->month);
}
if ( isset( $this->year) && $this->year != '')
{
array_push( $array, "year=".$this->year);
}
return ("&".implode('&',$array));
}
/**
* function to get days in month using index
*
* This is the newer version of the function getThismonthDaysbyIndex().
* This should be used whereever possible
*
* @param integer $index - number between 0 to 42
* @param string $day - date
* @param string $month - month
* @param string $year - year
* return vt_DateTime obj $datetimevalue
*/
function getThisMonthsDayByIndex($index){
$day = $index;
$month = $this->month;
$year = $this->year;
$month_array = array();
$month_array['day'] = $day;
$month_array['month'] = $month;
$month_array['year'] = $year;
$datetimevalue = new vt_DateTime($month_array,true);
return $datetimevalue;
}
}
?>
@@ -0,0 +1,36 @@
<?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.mozilla.org/MPL
* 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/Activities/Delete.php,v 1.11 2005/04/18 10:37:49 samk Exp $
* Description: TODO: To be written.
********************************************************************************/
global $currentModule;
$focus = CRMEntity::getInstance($currentModule);
require_once('include/logging.php');
$log = LoggerManager::getLogger('task_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);
?>
@@ -0,0 +1,358 @@
<?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/Activities/DetailView.php,v 1.12 2005/03/17 11:26:49 ray 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('modules/Calendar/calendarLayout.php');
include_once 'modules/Calendar/header.php';
require_once 'modules/CustomView/CustomView.php';
global $mod_strings, $currentModule,$adb, $current_user;
if( $_SESSION['mail_send_error']!="")
{
echo '<b><font color=red>'. $mod_strings{"LBL_NOTIFICATION_ERROR"}.'</font></b><br>';
}
session_unregister('mail_send_error');
$focus = CRMEntity::getInstance($currentModule);
$smarty = new vtigerCRM_Smarty();
$activity_mode = vtlib_purify($_REQUEST['activity_mode']);
//If activity_mode == null
if($activity_mode =='' || strlen($activity_mode) < 1)
{
$query = "select activitytype from vtiger_activity where activityid=?";
$result = $adb->pquery($query, array($_REQUEST['record']));
$actType = $adb->query_result($result,0,'activitytype');
if( $actType == 'Task')
{
$activity_mode = $actType;
}
elseif($actType != 'Emails')
{
$activity_mode = 'Events';
}
}
if($activity_mode == 'Task')
{
$tab_type = 'Calendar';
$smarty->assign("SINGLE_MOD",$mod_strings['LBL_TODO']);
}
elseif($activity_mode == 'Events')
{
$tab_type = 'Events';
$smarty->assign("SINGLE_MOD",$mod_strings['LBL_EVENT']);
}
$tab_id=getTabid($tab_type);
if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
$focus->retrieve_entity_info($_REQUEST['record'],$tab_type);
$focus->id = $_REQUEST['record'];
$focus->name=$focus->column_fields['subject'];
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
//needed when creating a new task with default values passed in
if (isset($_REQUEST['contactname']) && is_null($focus->contactname)) {
$focus->contactname = $_REQUEST['contactname'];
}
if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) {
$focus->contact_id = $_REQUEST['contact_id'];
}
if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) {
$focus->parent_name = $_REQUEST['opportunity_name'];
}
if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) {
$focus->parent_id = $_REQUEST['opportunity_id'];
}
if (isset($_REQUEST['accountname']) && is_null($focus->parent_name)) {
$focus->parent_name = $_REQUEST['accountname'];
}
if (isset($_REQUEST['accountid']) && is_null($focus->parent_id)) {
$focus->parent_id = $_REQUEST['accountid'];
}
$act_data = getBlocks($tab_type,"detail_view",'',$focus->column_fields);
foreach($act_data as $block=>$entry)
{
foreach($entry as $key=>$value)
{
foreach($value as $label=>$field)
{
$fldlabel[$field['fldname']] = $label;
if($field['ui'] == 15 || $field['ui'] == 16)
{
foreach($field['options'] as $index=>$arr_val)
{
if($arr_val[2] == "selected")
$finaldata[$field['fldname']] = $arr_val[0];
}
}
else
{
$fldvalue = $field['value'];
if($field['fldname'] == 'description') { $fldvalue = nl2br($fldvalue); }
$finaldata[$field['fldname']] = $fldvalue;
}
$finaldata[$field['fldname'].'link'] = $field['link'];
}
}
}
//Start
//To set user selected hour format
if($current_user->hour_format == '')
$format = 'am/pm';
else
$format = $current_user->hour_format;
list($stdate,$sttime) = split(' ',$finaldata['date_start']);
list($enddate,$endtime) = split(' ',$finaldata['due_date']);
$time_arr = getaddEventPopupTime($sttime,$endtime,$format);
$data['starthr'] = $time_arr['starthour'];
$data['startmin'] = $time_arr['startmin'];
$data['startfmt'] = $time_arr['startfmt'];
$data['endhr'] = $time_arr['endhour'];
$data['endmin'] = $time_arr['endmin'];
$data['endfmt'] = $time_arr['endfmt'];
$data['record'] = $focus->id;
if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes')
$data['sendnotification'] = $mod_strings['LBL_YES'];
else
$data['sendnotification'] = $mod_strings['LBL_NO'];
$data['subject'] = $finaldata['subject'];
$data['date_start'] = $stdate;
$data['due_date'] = $enddate;
$data['assigned_user_id'] = $finaldata['assigned_user_id'];
if($mod_strings[$finaldata['taskpriority']] != '')
$data['taskpriority'] = $mod_strings[$finaldata['taskpriority']];
else
$data['taskpriority'] = $finaldata['taskpriority'];
$data['modifiedtime'] = $finaldata['modifiedtime'];
$data['createdtime'] = $finaldata['createdtime'];
$data['parent_name'] = $finaldata['parent_id'];
$data['description'] = $finaldata['description'];
if($activity_mode == 'Task')
{
if($mod_strings[$finaldata['taskstatus']] != '')
$data['taskstatus'] = $mod_strings[$finaldata['taskstatus']];
else
$data['taskstatus'] = $finaldata['taskstatus'];
$data['activitytype'] = $activity_mode;
$data['contact_id'] = $finaldata['contact_id'];
$data['contact_idlink'] = $finaldata['contact_idlink'];
}
elseif($activity_mode == 'Events')
{
$data['visibility'] = $finaldata['visibility'];
if($mod_strings[$finaldata['eventstatus']] != '')
$data['eventstatus'] = $mod_strings[$finaldata['eventstatus']];
else
$data['eventstatus'] = $finaldata['eventstatus'];
$data['activitytype'] = $finaldata['activitytype'];
$data['location'] = $finaldata['location'];
//Calculating reminder time
$rem_days = 0;
$rem_hrs = 0;
$rem_min = 0;
if(!empty($focus->column_fields['reminder_time']))
{
$data['set_reminder'] = $mod_strings['LBL_YES'];
$data['reminder_str'] = $finaldata['reminder_time'];
}
else
$data['set_reminder'] = $mod_strings['LBL_NO'];
//To set recurring details
$query = 'select vtiger_recurringevents.recurringfreq,vtiger_recurringevents.recurringinfo from vtiger_recurringevents where vtiger_recurringevents.activityid = ?';
$res = $adb->pquery($query, array($focus->id));
$rows = $adb->num_rows($res);
if($rows != 0)
{
$data['recurringcheck'] = $mod_strings['LBL_YES'];
$data['repeat_frequency'] = $adb->query_result($res,0,'recurringfreq');
$recurringinfo = explode("::",$adb->query_result($res,0,'recurringinfo'));
$data['recurringtype'] = $recurringinfo[0];
if($recurringinfo[0] == 'Weekly')
{
$weekrpt_str = '';
if(count($recurringinfo) > 1)
{
$weekrpt_str .= 'on ';
for($i=1;$i<count($recurringinfo);$i++)
{
$label = 'LBL_DAY'.$recurringinfo[$i];
if($i != 1)
$weekrpt_str .= ', ';
$weekrpt_str .= $mod_strings[$label];
}
}
$data['repeat_str'] = $weekrpt_str;
}
elseif($recurringinfo[0] == 'Monthly')
{
$monthrpt_str = '';
$data['repeatMonth'] = $recurringinfo[1];
if($recurringinfo[1] == 'date')
{
$data['repeatMonth_date'] = $recurringinfo[2];
$monthrpt_str .= $mod_strings['on'].'&nbsp;'.$recurringinfo[2].'&nbsp;'.$mod_strings['day of the month'];
}
else
{
$data['repeatMonth_daytype'] = $recurringinfo[2];
$data['repeatMonth_day'] = $recurringinfo[3];
switch($data['repeatMonth_day'])
{
case 0 :
$day = $mod_strings['LBL_DAY0'];
break;
case 1 :
$day = $mod_strings['LBL_DAY1'];
break;
case 2 :
$day = $mod_strings['LBL_DAY2'];
break;
case 3 :
$day = $mod_strings['LBL_DAY3'];
break;
case 4 :
$day = $mod_strings['LBL_DAY4'];
break;
case 5 :
$day = $mod_strings['LBL_DAY5'];
break;
case 6 :
$day = $mod_strings['LBL_DAY6'];
break;
}
$monthrpt_str .= 'on '.$mod_strings[$recurringinfo[2]].' '.$day;
}
$data['repeat_str'] = $monthrpt_str;
}
}
else
{
$data['recurringcheck'] = $mod_strings['LBL_NO'];
$data['repeat_month_str'] = '';
}
$sql = 'select vtiger_users.user_name,vtiger_invitees.* from vtiger_invitees left join vtiger_users on vtiger_invitees.inviteeid=vtiger_users.id where activityid=?';
$result = $adb->pquery($sql, array($focus->id));
$num_rows=$adb->num_rows($result);
$invited_users=Array();
for($i=0;$i<$num_rows;$i++)
{
$userid=$adb->query_result($result,$i,'inviteeid');
$username=$adb->query_result($result,$i,'user_name');
$invited_users[$userid]=$username;
}
$smarty->assign("INVITEDUSERS",$invited_users);
$related_array = getRelatedLists("Calendar", $focus);
$smarty->assign("CONTACTS",$related_array['Contacts']['entries']);
$is_fname_permitted = getFieldVisibilityPermission("Contacts", $current_user->id, 'firstname');
$smarty->assign("IS_PERMITTED_CNT_FNAME",$is_fname_permitted);
}
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$log->info("Calendar-Activities detail view");
$category = getParentTab();
$smarty->assign("CATEGORY",$category);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("ACTIVITY_MODE", $activity_mode);
if (isset($focus->name))
$smarty->assign("NAME", $focus->name);
else
$smarty->assign("NAME", "");
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
if (isset($_REQUEST['return_module']))
$smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module']));
if (isset($_REQUEST['return_action']))
$smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action']));
if (isset($_REQUEST['return_id']))
$smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id']));
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string'].'&activity_mode='.$activity_mode);
$smarty->assign("ID", $focus->id);
$smarty->assign("NAME", $focus->name);
$smarty->assign("BLOCKS", $act_data);
$smarty->assign("LABEL", $fldlabel);
$smarty->assign("VIEWTYPE", vtlib_purify($_REQUEST['viewtype']));
$smarty->assign("CUSTOMFIELD", $cust_fld);
$smarty->assign("ACTIVITYDATA", $data);
$smarty->assign("ID", vtlib_purify($_REQUEST['record']));
//get Description Information
if(isPermitted("Calendar","EditView",$_REQUEST['record']) == 'yes')
$smarty->assign("EDIT_DUPLICATE","permitted");
if(isPermitted("Calendar","Delete",$_REQUEST['record']) == 'yes')
$smarty->assign("DELETE","permitted");
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$tabid = getTabid($tab_type);
$validationData = getDBValidationData($focus->tab_name,$tabid);
$data2 = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME",$data2['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data2['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data2['fieldlabel']);
$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);
}
// Gather the custom link information to display
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'RECORD'=>$focus->id, 'ACTION'=>vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), 'DETAILVIEW', $customlink_params));
// END
$custom_fields_data = getCalendarCustomFields($tabid,'detail_view',$focus->column_fields);
$smarty->assign("CUSTOM_FIELDS_DATA", $custom_fields_data);
$smarty->display("ActivityDetailView.tpl");
?>
@@ -0,0 +1,297 @@
<?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/Activities/EditView.php,v 1.11 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');
require_once('include/FormValidationUtil.php');
require_once('modules/Calendar/calendarLayout.php');
require_once("modules/Emails/mail.php");
include_once 'modules/Calendar/header.php';
global $app_strings;
global $mod_strings,$current_user;
// Unimplemented until jscalendar language vtiger_files are fixed
$focus = CRMEntity::getInstance($currentModule);
$smarty = new vtigerCRM_Smarty();
//added to fix the issue4600
$searchurl = getBasic_Advance_SearchURL();
$smarty->assign("SEARCH", $searchurl);
//4600 ends
$activity_mode = vtlib_purify($_REQUEST['activity_mode']);
if($activity_mode == 'Task')
{
$tab_type = 'Calendar';
$taskcheck = true;
$smarty->assign("SINGLE_MOD",$mod_strings['LBL_TODO']);
}
elseif($activity_mode == 'Events')
{
$tab_type = 'Events';
$taskcheck = false;
$smarty->assign("SINGLE_MOD",$mod_strings['LBL_EVENT']);
}
if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {
$focus->id = $_REQUEST['record'];
$focus->mode = 'edit';
$focus->retrieve_entity_info($_REQUEST['record'],$tab_type);
$focus->name=$focus->column_fields['subject'];
$sql = 'select vtiger_users.user_name,vtiger_invitees.* from vtiger_invitees left join vtiger_users on vtiger_invitees.inviteeid=vtiger_users.id where activityid=?';
$result = $adb->pquery($sql, array($focus->id));
$num_rows=$adb->num_rows($result);
$invited_users=Array();
for($i=0;$i<$num_rows;$i++)
{
$userid=$adb->query_result($result,$i,'inviteeid');
$username=$adb->query_result($result,$i,'user_name');
$invited_users[$userid]=$username;
}
$smarty->assign("INVITEDUSERS",$invited_users);
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
$related_array = getRelatedLists("Calendar", $focus);
$cntlist = $related_array['Contacts']['entries'];
$is_fname_permitted = getFieldVisibilityPermission("Contacts", $current_user->id, 'firstname');
$cnt_idlist = '';
$cnt_namelist = '';
if($cntlist != '')
{
$i = 0;
foreach($cntlist as $key=>$cntvalue)
{
if($i != 0)
{
$cnt_idlist .= ';';
$cnt_namelist .= "\n";
}
$cnt_idlist .= $key;
$contName = eregi_replace("(<a[^>]*>)(.*)(</a>)", "\\2", $cntvalue[0]);
if ($is_fname_permitted == '0') $contName .= ' '.eregi_replace("(<a[^>]*>)(.*)(</a>)", "\\2", $cntvalue[1]);
$cnt_namelist .= '<option value="'.$key.'">'.$contName.'</option>';
$i++;
}
}
$smarty->assign("CONTACTSID",$cnt_idlist);
$smarty->assign("CONTACTSNAME",$cnt_namelist);
$query = 'select vtiger_recurringevents.recurringfreq,vtiger_recurringevents.recurringinfo from vtiger_recurringevents where vtiger_recurringevents.activityid = ?';
$res = $adb->pquery($query, array($focus->id));
$rows = $adb->num_rows($res);
if($rows != 0)
{
$value['recurringcheck'] = 'Yes';
$value['repeat_frequency'] = $adb->query_result($res,0,'recurringfreq');
$recurringinfo = explode("::",$adb->query_result($res,0,'recurringinfo'));
$value['eventrecurringtype'] = $recurringinfo[0];
if($recurringinfo[0] == 'Weekly')
{
for($i=0;$i<6;$i++)
{
$label = 'week'.$recurringinfo[$i+1];
$value[$label] = 'checked';
}
}
elseif($recurringinfo[0] == 'Monthly')
{
$value['repeatMonth'] = $recurringinfo[1];
if($recurringinfo[1] == 'date')
{
$value['repeatMonth_date'] = $recurringinfo[2];
}
else
{
$value['repeatMonth_daytype'] = $recurringinfo[2];
$value['repeatMonth_day'] = $recurringinfo[3];
}
}
}
else
{
$value['recurringcheck'] = 'No';
}
}else
{
if(isset($_REQUEST['contact_id']) && $_REQUEST['contact_id']!=''){
$smarty->assign("CONTACTSID",$_REQUEST['contact_id']);
$contact_name = "<option value=".$_REQUEST['contact_id'].">".getContactName($_REQUEST['contact_id'])."</option>";
$smarty->assign("CONTACTSNAME",$contact_name);
$account_id = $_REQUEST['account_id'];
$account_name = getAccountName($account_id);
}
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
$focus->mode = '';
}
if(empty($_REQUEST['record']) && $focus->mode != 'edit'){
setObjectValuesFromRequest($focus);
}
$userDetails=getOtherUserName($current_user->id);
$to_email = getUserEmailId('id',$current_user->id);
$smarty->assign("CURRENTUSERID",$current_user->id);
$disp_view = getView($focus->mode);
if($disp_view == 'edit_view')
{
$act_data = getBlocks($tab_type,$disp_view,$mode,$focus->column_fields);
}
else
{
$act_data = getBlocks($tab_type,$disp_view,$mode,$focus->column_fields,'BAS');
}
$smarty->assign("BLOCKS",$act_data);
foreach($act_data as $header=>$blockitem)
{
foreach($blockitem as $row=>$data)
{
foreach($data as $key=>$maindata)
{
$uitype[$maindata[2][0]] = $maindata[0][0];
$fldlabel[$maindata[2][0]] = $maindata[1][0];
$fldlabel_sel[$maindata[2][0]] = $maindata[1][1];
$fldlabel_combo[$maindata[2][0]] = $maindata[1][2];
$value[$maindata[2][0]] = $maindata[3][0];
$secondvalue[$maindata[2][0]] = $maindata[3][1];
$thirdvalue[$maindata[2][0]] = $maindata[3][2];
}
}
}
// jread.topik. patch account_id for create contact
if (strlen($account_name) > 0)
{
$fldlabel_sel['parent_id'][1]='selected';
$secondvalue['parent_id'] = $account_id;
$value['parent_id'] = $account_name;
}
$format = ($current_user->hour_format == '')?'am/pm':$current_user->hour_format;
$stdate = key($value['date_start']);
$enddate = key($value['due_date']);
$sttime = $value['date_start'][$stdate];
$endtime = $value['due_date'][$enddate];
$time_arr = getaddEventPopupTime($sttime,$endtime,$format);
$value['starthr'] = $time_arr['starthour'];
$value['startmin'] = $time_arr['startmin'];
$value['startfmt'] = $time_arr['startfmt'];
$value['endhr'] = $time_arr['endhour'];
$value['endmin'] = $time_arr['endmin'];
$value['endfmt'] = $time_arr['endfmt'];
$smarty->assign("STARTHOUR",getTimeCombo($format,'start',$time_arr['starthour'],$time_arr['startmin'],$time_arr['startfmt'],$taskcheck));
$smarty->assign("ENDHOUR",getTimeCombo($format,'end',$time_arr['endhour'],$time_arr['endmin'],$time_arr['endfmt']));
$smarty->assign("FOLLOWUP",getTimeCombo($format,'followup_start',$time_arr['endhour'],$time_arr['endmin'],$time_arr['endfmt']));
$smarty->assign("ACTIVITYDATA",$value);
$smarty->assign("LABEL",$fldlabel);
$smarty->assign("secondvalue",$secondvalue);
$smarty->assign("thirdvalue",$thirdvalue);
$smarty->assign("fldlabel_combo",$fldlabel_combo);
$smarty->assign("fldlabel_sel",$fldlabel_sel);
$smarty->assign("OP_MODE",$disp_view);
$smarty->assign("ACTIVITY_MODE",$activity_mode);
$smarty->assign("HOURFORMAT",$format);
$smarty->assign("USERSLIST",$userDetails);
$smarty->assign("USEREMAILID",$to_email);
$smarty->assign("MODULE",$currentModule);
$smarty->assign("DATEFORMAT",parse_calendardate($app_strings['NTC_DATE_FORMAT']));
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$log->info("Activity edit 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($focus->mode == 'edit')
{
$smarty->assign("MODE", $focus->mode);
}
$category = getParentTab();
$smarty->assign("CATEGORY",$category);
// Unimplemented until jscalendar language vtiger_files are fixed
$smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
$smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
if (isset($_REQUEST['return_module']))
$smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module']));
if (isset($_REQUEST['return_action']))
$smarty->assign("RETURN_ACTION",vtlib_purify( $_REQUEST['return_action']));
if (isset($_REQUEST['return_id']))
$smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id']));
if (isset($_REQUEST['ticket_id']))
$smarty->assign("TICKETID", $_REQUEST['ticket_id']);
if (isset($_REQUEST['product_id']))
$smarty->assign("PRODUCTID", $_REQUEST['product_id']);
if (isset($_REQUEST['return_viewname']))
$smarty->assign("RETURN_VIEWNAME", vtlib_purify($_REQUEST['return_viewname']));
if(isset($_REQUEST['view']) && $_REQUEST['view']!='')
$smarty->assign("view",vtlib_purify($_REQUEST['view']));
if(isset($_REQUEST['hour']) && $_REQUEST['hour']!='')
$smarty->assign("hour",vtlib_purify($_REQUEST['hour']));
if(isset($_REQUEST['day']) && $_REQUEST['day']!='')
$smarty->assign("day",vtlib_purify($_REQUEST['day']));
if(isset($_REQUEST['month']) && $_REQUEST['month']!='')
$smarty->assign("month",vtlib_purify($_REQUEST['month']));
if(isset($_REQUEST['year']) && $_REQUEST['year']!='')
$smarty->assign("year",vtlib_purify($_REQUEST['year']));
if(isset($_REQUEST['viewOption']) && $_REQUEST['viewOption']!='')
$smarty->assign("viewOption",vtlib_purify($_REQUEST['viewOption']));
if(isset($_REQUEST['subtab']) && $_REQUEST['subtab']!='')
$smarty->assign("subtab",vtlib_purify($_REQUEST['subtab']));
if(isset($_REQUEST['maintab']) && $_REQUEST['maintab']!='')
$smarty->assign("maintab",vtlib_purify($_REQUEST['maintab']));
$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);
$tabid = getTabid($tab_type);
$validationData = getDBValidationData($focus->tab_name,$tabid);
$data = split_validationdataArray($validationData);
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$smarty->assign("DUPLICATE",vtlib_purify($_REQUEST['isDuplicate']));
if ($activity_mode == 'Task') {
$custom_fields_data = getCalendarCustomFields(getTabid('Calendar'),'edit',$focus->column_fields);
} else {
$custom_fields_data = getCalendarCustomFields(getTabid('Events'),'edit',$focus->column_fields);
}
$smarty->assign("CUSTOM_FIELDS_DATA", $custom_fields_data);
$smarty->assign("REPEAT_LIMIT_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
$smarty->display("ActivityEditView.tpl");
?>
@@ -0,0 +1,276 @@
<?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/Activities/ListView.php,v 1.14 2005/03/26 09:45:00 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('modules/Calendar/Activity.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('modules/Calendar/CalendarCommon.php');
global $app_strings;
global $list_max_entries_per_page;
$log = LoggerManager::getLogger('task_list');
global $currentModule,$image_path,$theme,$adb;
if (isset($_REQUEST['current_user_only'])) $current_user_only = vtlib_purify($_REQUEST['current_user_only']);
$focus = new Activity();
// Initialize sort by fields
$focus->initSortbyField('Calendar');
// 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",$mod_strings["SHARED_EVENT_DEL_MSG"]);
}else
{
$smarty->assign("ERROR","");
}
//<<<<<<< sort ordering >>>>>>>>>>>>>
$sorder = $focus->getSortOrder();
$order_by = $focus->getOrderBy();
$_SESSION['ACTIVITIES_ORDER_BY'] = $order_by;
$_SESSION['ACTIVITIES_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>>>>>
if($viewid == 0 )
{
echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>
<table border='0' cellpadding='5' cellspacing='0' width='98%'>
<tbody><tr>
<td rowspan='2' width='11%'><img src='<?php echo vtiger_imageurl('close.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;
}
$changeOwner = getAssignedTo(16);
$userList = $changeOwner[0];
$groupList = $changeOwner[1];
$smarty->assign("CHANGE_USER",$userList);
$smarty->assign("CHANGE_GROUP",$groupList);
$smarty->assign("CHANGE_OWNER",getUserslist());
$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
$where = "";
$url_string = ''; // assigning http url string
if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
{
list($where, $ustring) = split("#@@#",getWhereCondition($currentModule));
// we have a query
$url_string .="&query=true".$ustring;
$log->info("Here is the where clause for the list view: $where");
$smarty->assign("SEARCH_URL",$url_string);
}
if($viewnamedesc['viewname'] == 'All')
{
$smarty->assign("ALL", 'All');
}
if(isPermitted("Calendar","Delete",$_REQUEST['record']) == 'yes')
{
$other_text['del'] = $app_strings[LBL_MASS_DELETE];
}
if(isPermitted('Calendar','EditView','') == 'yes')
{
$other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
global $task_title;
$title_display = $current_module_strings['LBL_LIST_FORM_TITLE'];
if ($task_title) $title_display= $task_title;
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if($viewid != "0")
{
$listquery = getListQuery("Calendar");
$list_query = $oCustomView->getModifiedCvListQuery($viewid,$listquery,"Calendar");
}else
{
$list_query = getListQuery("Calendar");
}
//<<<<<<<<customview>>>>>>>>>
if(isset($where) && $where != '')
{
if(isset($_REQUEST['from_homepagedb']) && $_REQUEST['from_homepagedb'] == 'true')
$list_query .= " and ((vtiger_activity.status!='Completed' and vtiger_activity.status!='Deferred') or vtiger_activity.status is null) and ((vtiger_activity.eventstatus!='Held' and vtiger_activity.eventstatus!='Not Held') or vtiger_activity.eventstatus is null) AND ".$where;
else
$list_query .= " AND " .$where;
}
if (isset($_REQUEST['from_homepage'])) {
$today = date("Y-m-d", time());
if ($_REQUEST['from_homepage'] == 'upcoming_activities')
$list_query .= " AND (vtiger_activity.status is NULL OR vtiger_activity.status not in ('Completed','Deferred')) and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus not in ('Held','Not Held')) AND (date_start >= '$today' OR vtiger_recurringevents.recurringdate >= '$today')";
elseif ($_REQUEST['from_homepage'] == 'pending_activities')
$list_query .= " AND (vtiger_activity.status is NULL OR vtiger_activity.status not in ('Completed','Deferred')) and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus not in ('Held','Not Held')) AND (due_date <= '$today' OR vtiger_recurringevents.recurringdate <= '$today')";
}
if(isset($order_by) && $order_by != '') {
if($order_by == 'smownerid') {
$list_query .= ' ORDER BY user_name '.$sorder;
} else {
$tablename = getTableNameForField('Calendar',$order_by);
$tablename = (($tablename != '')?($tablename."."):'');
if($order_by == 'lastname')
$list_query .= ' ORDER BY vtiger_contactdetails.lastname '.$sorder;
else
$list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder;
}
}
//Constructing the list view
$smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("MODULE",$currentModule);
$smarty->assign("SINGLE_MOD",'Activity');
$smarty->assign("BUTTONS",$other_text);
$smarty->assign("NEW_EVENT",$app_strings['LNK_NEW_EVENT']);
$smarty->assign("NEW_TASK",$app_strings['LNK_NEW_TASK']);
//Postgres 8 fixes
if( $adb->dbType == "pgsql")
$list_query = fixPostgresQuery( $list_query, $log, 0);
if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){
$count_result = $adb->query( mkCountQuery( $list_query));
$noofrows = $adb->query_result($count_result,0,"count");
}else{
$noofrows = null;
}
$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true');
$start = ListViewSession::getRequestCurrentPage($currentModule, $list_query, $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start,$list_max_entries_per_page,$noofrows);
$limit_start_rec = ($start-1) * $list_max_entries_per_page;
if( $adb->dbType == "pgsql")
$list_result = $adb->pquery($list_query. " OFFSET $limit_start_rec LIMIT $list_max_entries_per_page", array());
else
$list_result = $adb->pquery($list_query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array());
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec);
$smarty->assign('recordListRange',$recordListRangeMsg);
//Retreive the List View Table Header
if($viewid !='')
$url_string .="&viewname=".$viewid;
//Cambiado code to add close button in custom vtiger_field
if (($viewid!=0)&&($viewid!="")){
if (!isset($oCustomView->list_fields['Close'])) $oCustomView->list_fields['Close']=array ( 'vtiger_activity' => 'eventstatus' );
if (!isset($oCustomView->list_fields_name['Close'])) $oCustomView->list_fields_name['Close']='eventstatus';
}
$listview_header = getListViewHeader($focus,"Calendar",$url_string,$sorder,$order_by,"",$oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search=getSearchListHeaderValues($focus,"Calendar",$url_string,$sorder,$order_by,"",$oCustomView);
$smarty->assign("SEARCHLISTHEADER", $listview_header_search);
$listview_entries = getListViewEntries($focus,"Calendar",$list_result,$navigation_array,"","","EditView","Delete",$oCustomView);
$smarty->assign("LISTENTITY", $listview_entries);
$smarty->assign("SELECT_SCRIPT", $view_script);
//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,"Calendar","ListView",$viewid);
$alphabetical = AlphabeticalSearch($currentModule,'ListView','subject','true','basic',"","","","",$viewid);
$fieldnames = getAdvSearchfields($module);
$criteria = getcriteria_options();
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("NAVIGATION", $navigationOutput);
$category = getParentTab();
$smarty->assign("CATEGORY",$category);
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$_SESSION[$currentModule.'_listquery'] = $list_query;
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("ListViewEntries.tpl");
else
$smarty->display("ActivityListView.tpl");
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*********************************************************************************/
require_once 'include/ListView/ListViewPagging.php';
?>
@@ -0,0 +1,201 @@
<?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/Activities/OpenListView.php,v 1.22 2005/04/19 17:00:30 ray Exp $
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
/**
* Function to get Pending/Upcoming activities
* @param integer $mode - number to differentiate upcoming and pending activities
* return array $values - activities record in array format
*/
function getPendingActivities($mode,$view=''){
global $log;
$log->debug("Entering getPendingActivities() method ...");
require_once('data/Tracker.php');
require_once('include/utils/utils.php');
require_once('user_privileges/default_module_view.php');
global $currentModule;
global $singlepane_view;
global $theme;
global $focus;
global $action;
global $adb;
global $app_strings;
global $current_language;
global $current_user;
$current_module_strings = return_module_language($current_language, 'Calendar');
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
if($_REQUEST['activity_view']==''){
$activity_view='today';
}else{
$activity_view=vtlib_purify($_REQUEST['activity_view']);
}
$today = date("Y-m-d", time());
if($view == 'today'){
$upcoming_condition = " AND (date_start = '$today' OR vtiger_recurringevents.recurringdate = '$today')";
$pending_condition = " AND (due_date = '$today' OR vtiger_recurringevents.recurringdate = '$today')";
}else if($view == 'all'){
$upcoming_condition = " AND (date_start >= '$today' OR vtiger_recurringevents.recurringdate >= '$today')";
$pending_condition = " AND (due_date <= '$today' OR vtiger_recurringevents.recurringdate <= '$today')";
}
if($mode != 1){
$list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_recurringevents.recurringdate,
vtiger_activity.activityid, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.due_date,
from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and vtiger_activity.activitytype not in ('Emails') AND ( vtiger_activity.status is NULL OR vtiger_activity.status not in ('Completed','Deferred')) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus not in ('Held','Not Held') )".$upcoming_condition;
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3){
$sec_parameter=getListViewSecurityParameter('Calendar');
$list_query .= $sec_parameter;
}
}else{
$list_query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_recurringevents.recurringdate,
vtiger_activity.activityid, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.due_date,
from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype not in ('Emails')) AND (vtiger_activity.status is NULL OR vtiger_activity.status not in ('Completed','Deferred')) and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus not in ('Held','Not Held')) ".$pending_condition;
if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3){
$sec_parameter=getListViewSecurityParameter('Calendar');
$list_query .= $sec_parameter;
}
$list_query.= " GROUP BY vtiger_activity.activityid";
$list_query.= " ORDER BY date_start,time_start ASC";
$res = $adb->query($list_query);
$noofrecords = $adb->num_rows($res);
$open_activity_list = array();
$noofrows = $adb->num_rows($res);
if (count($res)>0){
for($i=0;$i<$noofrows;$i++){
$open_activity_list[] = Array('name' => $adb->query_result($res,$i,'subject'),
'id' => $adb->query_result($res,$i,'activityid'),
'type' => $adb->query_result($res,$i,'activitytype'),
'module' => $adb->query_result($res,$i,'setype'),
'date_start' => getDisplayDate($adb->query_result($res,$i,'date_start')),
'due_date' => getDisplayDate($adb->query_result($res,$i,'due_date')),
'recurringdate' => getDisplayDate($adb->query_result($res,$i,'recurringdate')),
'priority' => $adb->query_result($res,$i,'priority'), // Armando Lscher 04.07.2005 -> priority -> Desc: Get vtiger_priority from db
);
}
}
$title=array();
$title[]=$view;
$title[]='myUpcoPendAct.gif';
$title[]='home_myact';
$title[]='showActivityView';
$title[]='MyUpcumingFrm';
$title[]='activity_view';
$header=array();
$header[] =$current_module_strings['LBL_LIST_SUBJECT'];
$header[] ='Type';
$return_url="&return_module=$currentModule&return_action=DetailView&return_id=" . ((is_object($focus)) ? $focus->id : "");
$oddRow = true;
$entries=array();
foreach($open_activity_list as $event){
$recur_date=ereg_replace('--','',$event['recurringdate']);
if($recur_date!=""){
$event['date_start']=$event['recurringdate'];
}
$font_color_high = "color:#00DD00;";
$font_color_medium = "color:#DD00DD;";
switch ($event['priority']){
case 'High':
$font_color=$font_color_high;
break;
case 'Medium':
$font_color=$font_color_medium;
break;
default:
$font_color='';
}
if($event['type'] != 'Task' && $event['type'] != 'Emails' && $event['type'] != ''){
$activity_type = 'Events';
}else{
$activity_type = 'Task';
}
}
$entries[$event['id']] = array(
'0' => '<a href="index.php?action=DetailView&module='.$event["module"].'&activity_mode='.$activity_type.'&record='.$event["id"].''.$return_url.'" style="'.$font_color.';">'.$event["name"].'</a>',
'IMAGE' => '<IMG src="'.$image_path.$event["type"].'s.gif">',
);
}
$values=Array('noofactivities'=>$noofrecords,'Title'=>$title,'Header'=>$header,'Entries'=>$entries);
$log->debug("Exiting getPendingActivities method ...");
return $values;
}
/**
* Function creates HTML to display ActivityView selection box
* @param string $activity_view - activity view
* return string $ACTIVITY_VIEW_SELECT_OPTION - HTML selection box
*/
function getActivityview($activity_view)
{
global $log;
$log->debug("Entering getActivityview(".$activity_view.") method ...");
$today = date("Y-m-d", time());
if($activity_view == 'Today')
{
$selected1 = 'selected';
}
else if($activity_view == 'This Week')
{
$selected2 = 'selected';
}
else if($activity_view == 'This Month')
{
$selected3 = 'selected';
}
else if($activity_view == 'This Year')
{
$selected4 = 'selected';
}
//constructing the combo values for activities
$ACTIVITY_VIEW_SELECT_OPTION = '<select class=small name="activity_view" onchange="showActivityView(this)">';
$ACTIVITY_VIEW_SELECT_OPTION .= '<option value="Today" '.$selected1.'>';
$ACTIVITY_VIEW_SELECT_OPTION .= 'Today';
$ACTIVITY_VIEW_SELECT_OPTION .= '</option>';
$ACTIVITY_VIEW_SELECT_OPTION .= '<option value="This Week" '.$selected2.'>';
$ACTIVITY_VIEW_SELECT_OPTION .= 'This Week';
$ACTIVITY_VIEW_SELECT_OPTION .= '</option>';
$ACTIVITY_VIEW_SELECT_OPTION .= '<option value="This Month" '.$selected3.'>';
$ACTIVITY_VIEW_SELECT_OPTION .= 'This Month';
$ACTIVITY_VIEW_SELECT_OPTION .= '</option>';
$ACTIVITY_VIEW_SELECT_OPTION .= '<option value="This Year" '.$selected4.'>';
$ACTIVITY_VIEW_SELECT_OPTION .= 'This Year';
$ACTIVITY_VIEW_SELECT_OPTION .= '</option>';
$ACTIVITY_VIEW_SELECT_OPTION .= '</select>';
$log->debug("Exiting getActivityview method ...");
return $ACTIVITY_VIEW_SELECT_OPTION;
}
?>
@@ -0,0 +1,19 @@
<?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.
********************************************************************************/
$activity_mode = vtlib_purify($_REQUEST['activity_mode']);
if(isset($_REQUEST['activity_mode']) && $_REQUEST['activity_mode'] == 'Events')
{
$tab_type = 'Events';
$module = 'Events';
}
$tab_id=getTabid($tab_type);
require_once('include/quickcreate.php');
?>
@@ -0,0 +1,164 @@
<?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/RelatedListView.php');
require_once('modules/Contacts/Contacts.php');
require_once('modules/Products/Products.php');
require_once('include/utils/UserInfoUtil.php');
// functions added for group calendar -Jaguar
/**
* Function to get duration
* @param string $time_start - activity start time
* @param string $duration_hours - duration in hours
* @param string $duration_minutes - duration in minutes
* return string $end_time - time string
*/
function get_duration($time_start,$duration_hours,$duration_minutes)
{
global $log;
$log->debug("Entering get_duration(".$time_start.",".$duration_hours.",".$duration_minutes.") method ...");
$time=explode(":",$time_start);
$time_mins = $time[1];
$time_hrs = $time[0];
$mins = ($time_mins + $duration_minutes) % 60;
$hrs_min = floor(($time_mins + $duration_minutes) / 60);
if(!isset($hrs))
$hrs=0;
$hrs = $duration_hours + $hrs_min + $time_hrs;
if($hrs<10)
$hrs=$hrs;
if($mins<10)
$mins="0".$mins;
$end_time = $hrs .$mins;
$log->debug("Exiting get_duration method ...");
return $end_time;
}
/**
* Function to convert time to number
* @param string $time_start - activity start time
* return integer $start_time - time
*/
function time_to_number($time_start)
{
global $log;
$log->debug("Entering time_to_number(".$time_start.") method ...");
$start_time_array = explode(":",$time_start);
if(ereg("^[0]",$start_time_array[0]))
{
$time_start_hrs=str_replace('0',"",$start_time_array[0]);
}
else
{
$time_start_hrs=$start_time_array[0];
}
$start_time= $time_start_hrs .$start_time_array[1];
$log->debug("Exiting time_to_number method ...");
return $start_time;
}
/**
* Function to status availability of user
* @param string $owner - ownername
* @param integer $userid - userid
* @param integer $activity_id - activityid
* @param string $avail_date - date in string format
* @param string $activity_start_time - time string
* @param string $activity_end_time - time string
* return string $availability - html img tag in string
*/
function status_availability($owner,$userid,$activity_id,$avail_date,$activity_start_time,$activity_end_time)
{
global $adb,$image_path,$log,$theme;
$log->debug("Entering status_availability(".$owner,$userid.",".$activity_id.",".$avail_date.",".$activity_start_time.",".$activity_end_time.") method ...");
$avail_flag="false";
$avail_date=getDBInsertDateValue($avail_date);
if( $owner != $userid)
{
$usr_query="select activityid,vtiger_activity.date_start,vtiger_activity.due_date, vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes,vtiger_crmentity.smownerid from vtiger_activity,vtiger_crmentity where vtiger_crmentity.crmid=vtiger_activity.activityid and ('".$avail_date."' like date_start) and vtiger_crmentity.smownerid=? and vtiger_activity.activityid !=? and vtiger_crmentity.deleted=0";
}
else
{
$usr_query="select activityid,vtiger_activity.date_start,vtiger_activity.due_date, vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes,vtiger_crmentity.smownerid from vtiger_activity,vtiger_crmentity where vtiger_crmentity.crmid=vtiger_activity.activityid and ('".$avail_date."' like date_start) and vtiger_crmentity.smownerid=? and vtiger_activity.activityid !=? and vtiger_crmentity.deleted=0";
}
$result_cal=$adb->pquery($usr_query, array($userid, $activity_id));
$noofrows_cal = $adb->num_rows($result_cal);
$avail_flag="false";
if($noofrows_cal!=0)
{
while($row_cal = $adb->fetch_array($result_cal))
{
$usr_date_start=$row_cal['date_start'];
$usr_due_date=$row_cal['due_date'];
$usr_time_start=$row_cal['time_start'];
$usr_hour_dur=$row_cal['duration_hours'];
$usr_mins_dur=$row_cal['duration_minutes'];
$user_start_time=time_to_number($usr_time_start);
$user_end_time=get_duration($usr_time_start,$usr_hour_dur,$usr_mins_dur);
if( ( ($user_start_time > $activity_start_time) && ( $user_start_time < $activity_end_time) ) || ( ( $user_end_time > $activity_start_time) && ( $user_end_time < $activity_end_time) ) || ( ( $activity_start_time == $user_start_time ) || ($activity_end_time == $user_end_time) ) )
{
$availability= 'busy';
$avail_flag="true";
$log->info("user start time-- ".$user_start_time."user end time".$user_end_time);
$log->info("Availability ".$availability);
}
}
}
if($avail_flag!="true")
{
$recur_query="SELECT vtiger_activity.activityid, vtiger_activity.time_start, vtiger_activity.duration_hours, vtiger_activity.duration_minutes , vtiger_crmentity.smownerid, vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid where ('".$avail_date."' like vtiger_recurringevents.recurringdate) and vtiger_crmentity.smownerid=? and vtiger_activity.activityid !=? and vtiger_crmentity.deleted=0";
$result_cal=$adb->pquery($recur_query, array($userid, $activity_id));
$noofrows_cal = $adb->num_rows($result_cal);
$avail_flag="false";
if($noofrows_cal!=0)
{
while($row_cal = $adb->fetch_array($result_cal))
{
$usr_date_start=$row_cal['date_start'];
$usr_time_start=$row_cal['time_start'];
$usr_hour_dur=$row_cal['duration_hours'];
$usr_mins_dur=$row_cal['duration_minutes'];
$user_start_time=time_to_number($usr_time_start);
$user_end_time=get_duration($usr_time_start,$usr_hour_dur,$usr_mins_dur);
if( ( ($user_start_time > $activity_start_time) && ( $user_start_time < $activity_end_time) ) || ( ( $user_end_time > $activity_start_time) && ( $user_end_time < $activity_end_time) ) || ( ( $activity_start_time == $user_start_time ) || ($activity_end_time == $user_end_time) ) )
{
$availability= 'busy';
$avail_flag="true";
$log->info("Recurring Events:: user start time-- ".$user_start_time."user end time".$user_end_time);
$log->info("Recurring Events:: Availability ".$availability);
}
}
}
}
if($avail_flag == "true")
{
$availability=' <IMG SRC="' . vtiger_imageurl('busy.gif', $theme). '">';
}
else
{
$availability=' <IMG SRC="' . vtiger_imageurl('free.gif', $theme). '">';
}
$log->debug("Exiting status_availability method ...");
return $availability;
}
?>
@@ -0,0 +1,182 @@
<?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.
*
********************************************************************************/
/**
* Class to handle repeating events
*/
class Calendar_RepeatEvents {
/**
* Get timing using YYYY-MM-DD HH:MM:SS input string.
*/
static function mktime($fulldateString) {
$splitpart = self::splittime($fulldateString);
$datepart = split('-', $splitpart[0]);
$timepart = split(':', $splitpart[1]);
return mktime($timepart[0], $timepart[1], 0, $datepart[1], $datepart[2], $datepart[0]);
}
/**
* Increment the time by interval and return value in YYYY-MM-DD HH:MM format.
*/
static function nexttime($basetiming, $interval) {
return date('Y-m-d H:i', strtotime($interval, $basetiming));
}
/**
* Based on user time format convert the YYYY-MM-DD HH:MM value.
*/
static function formattime($timeInYMDHIS) {
global $current_user;
$format_string = 'Y-m-d H:i';
switch($current_user->date_format) {
case 'dd-mm-yyyy': $format_string = 'd-m-Y H:i'; break;
case 'mm-dd-yyyy': $format_string = 'm-d-Y H:i'; break;
case 'yyyy-mm-dd': $format_string = 'Y-m-d H:i'; break;
}
return date($format_string, self::mktime($timeInYMDHIS));
}
/**
* Split full timing into date and time part.
*/
static function splittime($fulltiming) {
return split(' ', $fulltiming);
}
/**
* Calculate the time interval to create repeated event entries.
*/
static function getRepeatInterval($type, $frequency, $recurringInfo, $start_date, $limit_date) {
$repeatInterval = Array();
$starting = self::mktime($start_date);
$limiting = self::mktime($limit_date);
if($type == 'Daily') {
$count = 0;
while(true) {
++$count;
$interval = ($count * $frequency);
if(self::mktime(self::nexttime($starting, "+$interval days")) > $limiting) {
break;
}
$repeatInterval[] = $interval;
}
} else if($type == 'Weekly') {
if($recurringInfo->dayofweek_to_rpt == null) {
$count = 0;
$weekcount = 7;
while(true) {
++$count;
$interval = $count * $weekcount;
if(self::mktime(self::nexttime($starting, "+$interval days")) > $limiting) {
break;
}
$repeatInterval[] = $interval;
}
} else {
$count = 0;
while(true) {
++$count;
$interval = $count;
$new_timing = self::mktime(self::nexttime($starting, "+$interval days"));
$new_timing_dayofweek = date('N', $new_timing);
if($new_timing > $limiting) {
break;
}
if(in_array($new_timing_dayofweek-1, $recurringInfo->dayofweek_to_rpt)) {
$repeatInterval[] = $interval;
}
}
}
} else if($type == 'Monthly') {
$count = 0;
$avg_monthcount = 30; // TODO: We need to handle month increments precisely!
while(true) {
++$count;
$interval = $count * $avg_monthcount;
if(self::mktime(self::nexttime($starting, "+$interval days")) > $limiting) {
break;
}
$repeatInterval[] = $interval;
}
} else if($type == 'Yearly') {
$count = 0;
$avg_monthcount = 30;
while(true) {
++$count;
$interval = $count * $avg_monthcount;
if(self::mktime(self::nexttime($starting, "+$interval days")) > $limiting) {
break;
}
$repeatInterval[] = $interval;
}
}
return $repeatInterval;
}
/**
* Repeat Activity instance till given limit.
*/
static function repeat($focus) {
global $log;
$repeat = getrecurringObjValue();
$frequency = $repeat->recur_freq;
$repeattype= $repeat->recur_type;
$base_focus = new Activity();
$base_focus->retrieve_entity_info($focus->id,'Events');
$base_focus->id = $_REQUEST['record'];
$base_focus_start = $base_focus->column_fields['date_start'].' '.$base_focus->column_fields['time_start'];
$base_focus_end = $base_focus->column_fields['due_date'].' '.$base_focus->column_fields['time_end'];
$repeat_limit = getDBInsertDateValue($_REQUEST['calendar_repeat_limit_date']).' '.$base_focus->column_fields['time_start'];
$repeatIntervals = self::getRepeatInterval($repeattype, $frequency, $repeat, $base_focus_start, $repeat_limit);
$base_focus_start = self::mktime($base_focus_start);
$base_focus_end = self::mktime($base_focus_end);
$skip_focus_fields = Array ('record_id', 'createdtime', 'modifiedtime', 'recurringtype');
/** Create instance before and reuse */
$new_focus = new Activity();
foreach($repeatIntervals as $interval) {
$new_focus_start_timing = self::nexttime($base_focus_start, "+$interval days");
$new_focus_start_timing = self::splittime(self::formattime($new_focus_start_timing));
$new_focus_end_timing = self::nexttime($base_focus_end, "+$interval days");
$new_focus_end_timing = self::splittime(self::formattime($new_focus_end_timing));
// Reset the new_focus and prepare for reuse
if(isset($new_focus->id)) unset($new_focus->id);
foreach($new_focus->column_fields as $key=>$value) $new_focus->column_fields[$key] = '';
foreach($base_focus->column_fields as $key=>$value) {
if(in_array($key, $skip_focus_fields)) {
// skip copying few fields
} else if($key == 'date_start') {
$new_focus->column_fields['date_start'] = $new_focus_start_timing[0];
} else if($key == 'time_start') {
$new_focus->column_fields['time_start'] = $new_focus_start_timing[1];
} else if($key == 'time_end') {
$new_focus->column_fields['time_end'] = $new_focus_end_timing[1];
} else if($key == 'due_date') {
$new_focus->column_fields['due_date'] = $new_focus_end_timing[0];
} else {
$new_focus->column_fields[$key] = $value;
}
}
$new_focus->save('Calendar');
}
}
}
?>
+306
View File
@@ -0,0 +1,306 @@
<?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/Activities/Save.php,v 1.11 2005/04/18 10:37:49 samk 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/Calendar/Activity.php');
require_once('include/logging.php');
require_once("config.php");
require_once('include/database/PearDatabase.php');
require_once('modules/Calendar/CalendarCommon.php');
global $adb,$theme;
$local_log =& LoggerManager::getLogger('index');
$focus = new Activity();
$activity_mode = vtlib_purify($_REQUEST['activity_mode']);
$tab_type = 'Calendar';
//added to fix 4600
$search=vtlib_purify($_REQUEST['search_url']);
$focus->column_fields["activitytype"] = 'Task';
if(isset($_REQUEST['record']))
{
$focus->id = $_REQUEST['record'];
$local_log->debug("id is ".$id);
}
if(isset($_REQUEST['mode']))
{
$focus->mode = $_REQUEST['mode'];
}
if((isset($_REQUEST['change_status']) && $_REQUEST['change_status']) && ($_REQUEST['status']!='' || $_REQUEST['eventstatus']!=''))
{
$status ='';
$activity_type='';
$return_id = $focus->id;
if(isset($_REQUEST['status']))
{
$status = $_REQUEST['status'];
$activity_type = "Task";
}
elseif(isset($_REQUEST['eventstatus']))
{
$status = $_REQUEST['eventstatus'];
$activity_type = "Events";
}
if(isPermitted("Calendar","EditView",$_REQUEST['record']) == 'yes')
{
ChangeStatus($status,$return_id,$activity_type);
}
else
{
echo "<link rel='stylesheet' type='text/css' href='themes/$theme/style.css'>";
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='<?php echo 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>";die;
}
$mail_data = getActivityMailInfo($return_id,$status,$activity_type);
if($mail_data['sendnotification'] == 1)
{
getEventNotification($activity_type,$mail_data['subject'],$mail_data);
}
$invitee_qry = "select * from vtiger_invitees where activityid=?";
$invitee_res = $adb->pquery($invitee_qry, array($return_id));
$count = $adb->num_rows($invitee_res);
if($count != 0)
{
for($j = 0; $j < $count; $j++)
{
$invitees_ids[]= $adb->query_result($invitee_res,$j,"inviteeid");
}
$invitees_ids_string = implode(';',$invitees_ids);
sendInvitation($invitees_ids_string,$activity_type,$mail_data['subject'],$mail_data);
}
}
else
{
foreach($focus->column_fields as $fieldname => $val)
{
if(isset($_REQUEST[$fieldname]))
{
if(is_array($_REQUEST[$fieldname]))
$value = $_REQUEST[$fieldname];
else
$value = trim($_REQUEST[$fieldname]);
$focus->column_fields[$fieldname] = $value;
if(($fieldname == 'notime') && ($focus->column_fields[$fieldname]))
{
$focus->column_fields['time_start'] = '';
$focus->column_fields['duration_hours'] = '';
$focus->column_fields['duration_minutes'] = '';
}
if(($fieldname == 'recurringtype') && ! isset($_REQUEST['recurringcheck']))
$focus->column_fields['recurringtype'] = '--None--';
}
}
if(isset($_REQUEST['visibility']) && $_REQUEST['visibility']!= '')
$focus->column_fields['visibility'] = $_REQUEST['visibility'];
else
$focus->column_fields['visibility'] = 'Private';
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'];
}
$focus->save($tab_type);
/* For Followup START -- by Minnie */
if(isset($_REQUEST['followup']) && $_REQUEST['followup'] == 'on' && $activity_mode == 'Events' && isset($_REQUEST['followup_time_start']) && $_REQUEST['followup_time_start'] != '')
{
$heldevent_id = $focus->id;
$focus->column_fields['subject'] = '[Followup] '.$focus->column_fields['subject'];
$focus->column_fields['date_start'] = $_REQUEST['followup_date'];
$focus->column_fields['due_date'] = $_REQUEST['followup_due_date'];
$focus->column_fields['time_start'] = $_REQUEST['followup_time_start'];
$focus->column_fields['time_end'] = $_REQUEST['followup_time_end'];
$focus->column_fields['eventstatus'] = 'Planned';
$focus->mode = 'create';
$focus->save($tab_type);
}
/* For Followup END -- by Minnie */
$return_id = $focus->id;
}
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "")
$return_module = vtlib_purify($_REQUEST['return_module']);
else
$return_module = "Calendar";
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']);
$activemode = "";
if($activity_mode != '')
$activemode = "&activity_mode=".$activity_mode;
function getRequestData($return_id)
{
global $adb;
$cont_qry = "select * from vtiger_cntactivityrel where activityid=?";
$cont_res = $adb->pquery($cont_qry, array($return_id));
$noofrows = $adb->num_rows($cont_res);
$cont_id = array();
if($noofrows > 0) {
for($i=0; $i<$noofrows; $i++) {
$cont_id[] = $adb->query_result($cont_res,$i,"contactid");
}
}
$cont_name = '';
foreach($cont_id as $key=>$id) {
if($id != '') {
$cont_name .= getContactName($id).', ';
}
}
$cont_name = trim($cont_name,', ');
$mail_data = Array();
$mail_data['user_id'] = $_REQUEST['assigned_user_id'];
$mail_data['subject'] = $_REQUEST['subject'];
$mail_data['status'] = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus']));
$mail_data['activity_mode'] = $_REQUEST['activity_mode'];
$mail_data['taskpriority'] = $_REQUEST['taskpriority'];
$mail_data['relatedto'] = $_REQUEST['parent_name'];
$mail_data['contact_name'] = $cont_name;
$mail_data['description'] = $_REQUEST['description'];
$mail_data['assingn_type'] = $_REQUEST['assigntype'];
$mail_data['group_name'] = getGroupName($_REQUEST['assigned_group_id']);
$mail_data['mode'] = $_REQUEST['mode'];
$value = getaddEventPopupTime($_REQUEST['time_start'],$_REQUEST['time_end'],'24');
$start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt'];
if($_REQUEST['activity_mode']!='Task')
$end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt'];
$mail_data['st_date_time'] = getDisplayDate($_REQUEST['date_start'])." ".$start_hour;
$mail_data['end_date_time']=getDisplayDate($_REQUEST['due_date'])." ".$end_hour;
$mail_data['location']=vtlib_purify($_REQUEST['location']);
return $mail_data;
}
if(isset($_REQUEST['contactidlist']) && $_REQUEST['contactidlist'] != '')
{
//split the string and store in an array
$storearray = explode (";",$_REQUEST['contactidlist']);
$del_sql = "delete from vtiger_cntactivityrel where activityid=?";
$adb->pquery($del_sql, array($record));
foreach($storearray as $id)
{
if($id != '')
{
$record = $focus->id;
$sql = "insert into vtiger_cntactivityrel values (?,?)";
$adb->pquery($sql, array($id, $record));
if(!empty($heldevent_id)) {
$sql = "insert into vtiger_cntactivityrel values (?,?)";
$adb->pquery($sql, array($id, $heldevent_id));
}
}
}
}
//Added code to send mail to the assigned to user about the details of the vtiger_activity if sendnotification = on and assigned to user
if($_REQUEST['sendnotification'] == 'on')
{
$mail_contents = getRequestData($return_id);
getEventNotification($_REQUEST['activity_mode'],$_REQUEST['subject'],$mail_contents);
}
//code added to send mail to the vtiger_invitees
if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='')
{
$mail_contents = getRequestData($return_id);
sendInvitation($_REQUEST['inviteesid'],$_REQUEST['activity_mode'],$_REQUEST['subject'],$mail_contents);
}
//to delete contact account relation while editing event
if(isset($_REQUEST['deletecntlist']) && $_REQUEST['deletecntlist'] != '' && $_REQUEST['mode'] == 'edit')
{
//split the string and store it in an array
$storearray = explode (";",$_REQUEST['deletecntlist']);
foreach($storearray as $id)
{
if($id != '')
{
$record = $focus->id;
$sql = "delete from vtiger_cntactivityrel where contactid=? and activityid=?";
$adb->pquery($sql, array($id, $record));
}
}
}
//to delete activity and its parent table relation
if(isset($_REQUEST['del_actparent_rel']) && $_REQUEST['del_actparent_rel'] != '' && $_REQUEST['mode'] == 'edit')
{
$parnt_id = $_REQUEST['del_actparent_rel'];
$sql= 'delete from vtiger_seactivityrel where crmid=? and activityid=?';
$adb->pquery($sql, array($parnt_id, $record));
}
if(isset($_REQUEST['view']) && $_REQUEST['view']!='')
$view=vtlib_purify($_REQUEST['view']);
if(isset($_REQUEST['hour']) && $_REQUEST['hour']!='')
$hour=vtlib_purify($_REQUEST['hour']);
if(isset($_REQUEST['day']) && $_REQUEST['day']!='')
$day=vtlib_purify($_REQUEST['day']);
if(isset($_REQUEST['month']) && $_REQUEST['month']!='')
$month=vtlib_purify($_REQUEST['month']);
if(isset($_REQUEST['year']) && $_REQUEST['year']!='')
$year=vtlib_purify($_REQUEST['year']);
if(isset($_REQUEST['viewOption']) && $_REQUEST['viewOption']!='')
$viewOption=vtlib_purify($_REQUEST['viewOption']);
if(isset($_REQUEST['subtab']) && $_REQUEST['subtab']!='')
$subtab=vtlib_purify($_REQUEST['subtab']);
if($_REQUEST['recurringcheck']) {
include_once dirname(__FILE__) . '/RepeatEvents.php';
Calendar_RepeatEvents::repeat($focus);
}
//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']);
$parenttab=getParentTab();
if($_REQUEST['start'] !='')
$page='&start='.vtlib_purify($_REQUEST['start']);
if($_REQUEST['maintab'] == 'Calendar')
header("Location: index.php?action=".$return_action."&module=".$return_module."&view=".$view."&hour=".$hour."&day=".$day."&month=".$month."&year=".$year."&record=".$return_id."&viewOption=".$viewOption."&subtab=".$subtab."&parenttab=$parenttab");
else
header("Location: index.php?action=$return_action&module=$return_module$view$hour$day$month$year&record=$return_id$activemode&viewname=$return_viewname$page&parenttab=$parenttab&start=".vtlib_purify($_REQUEST['pagenumber']).$search);
?>
@@ -0,0 +1,3 @@
@echo off
cd ..\..\
..\..\..\php\php.exe SendReminder.php
@@ -0,0 +1,42 @@
<?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');
global $mod_strings,$app_strings,$theme;
$smarty = new vtigerCRM_Smarty;
$module = vtlib_purify($_REQUEST['formodule']);
$menu_array = Array();
$menu_array['CustomFields']['location'] = 'index.php?module=Settings&action=CustomFieldList&parenttab=Settings&formodule='.$module;
$menu_array['CustomFields']['image_src'] = vtiger_imageurl('orgshar.gif', $theme);
$menu_array['CustomFields']['desc'] = getTranslatedString('LBL_CALENDER_CUSTOMFIELDS_DESCRIPTION');
$menu_array['CustomFields']['label'] = getTranslatedString('LBL_CALENDER_CUSTOMFIELDS');
//add blanks for 3-column layout
$count = count($menu_array)%3;
if($count>0) {
for($i=0;$i<3-$count;$i++) {
$menu_array[] = array();
}
}
$smarty->assign("MOD",$mod_strings);
$smarty->assign("APP",$app_strings);
$smarty->assign("IMAGE_PATH", "themes/$theme/images/");
$smarty->assign('MODULE',$module);
$smarty->assign('MODULE_LBL',getTranslatedString($module));
$smarty->assign('MENU_ARRAY', $menu_array);
$smarty->display(vtlib_getModuleTemplate('Vtiger','Settings.tpl'));
?>
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/Ajax/TagCloud.php')
?>
@@ -0,0 +1,88 @@
<?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/Calendar/Activity.php');
require_once('modules/Calendar/CalendarCommon.php');
require_once('include/logging.php');
require_once("config.php");
require_once('include/database/PearDatabase.php');
$local_log =& LoggerManager::getLogger('index');
$focus = new Activity();
$activity_mode = vtlib_purify($_REQUEST['activity_mode']);
if($activity_mode == 'Task')
{
$tab_type = 'Calendar';
$focus->column_fields["activitytype"] = 'Task';
}
if(isset($_REQUEST['record']))
{
$focus->id = $_REQUEST['record'];
}
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]);
$focus->column_fields[$fieldname] = $value;
}
}
$focus->column_fields["subject"] = $_REQUEST["task_subject"];
$focus->column_fields["time_start"] = $_REQUEST["task_time_start"];
$focus->column_fields["assigned_user_id"] = $_REQUEST["task_assigned_user_id"];
$_REQUEST["assigned_group_id"] = $_REQUEST['task_assigned_group_id'];
$_REQUEST['assigntype'] = $_REQUEST['task_assigntype'];
$focus->column_fields["taskstatus"] = $_REQUEST["taskstatus"];
$focus->column_fields["date_start"] = $_REQUEST["task_date_start"];
$focus->column_fields["due_date"] = $_REQUEST["task_due_date"];
$focus->column_fields["taskpriority"] = $_REQUEST["taskpriority"];
$focus->column_fields["parent_id"] = $_REQUEST["task_parent_id"];
$focus->column_fields["contact_id"] = $_REQUEST["task_contact_id"];
$focus->column_fields["description"] = $_REQUEST["task_description"];
if(isset($_REQUEST['task_sendnotification']) && $_REQUEST['task_sendnotification'] != null)
$focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"];
$focus->save($tab_type);
if($_REQUEST["task_sendnotification"]=='on')
{
$mail_contents = getRequestedToData();
getEventNotification($_REQUEST['activity_mode'],$_REQUEST['task_subject'],$mail_contents);
}
function getRequestedToData()
{
$mail_data = Array();
$mail_data['user_id'] = $_REQUEST["task_assigned_user_id"];
$mail_data['subject'] = $_REQUEST['task_subject'];
$mail_data['status'] = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus']));
$mail_data['activity_mode'] = $_REQUEST['activity_mode'];
$mail_data['taskpriority'] = $_REQUEST['taskpriority'];
$mail_data['relatedto'] = $_REQUEST['task_parent_name'];
$mail_data['contact_name'] = $_REQUEST['task_contact_name'];
$mail_data['description'] = $_REQUEST['task_description'];
$mail_data['assingn_type'] = $_REQUEST['task_assigntype'];
$mail_data['group_name'] = getGroupName($_REQUEST['task_assigned_group_id']);
$mail_data['mode'] = $_REQUEST['task_mode'];
$value = getaddEventPopupTime($_REQUEST['task_time_start'],$_REQUEST['task_time_end'],'24');
$start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt'];
$mail_data['st_date_time'] = getDisplayDate($_REQUEST['task_date_start'])." ".$start_hour;
$mail_data['end_date_time']=getDisplayDate($_REQUEST['task_due_date']);
return $mail_data;
}
header("Location: index.php?action=index&module=Calendar&view=".vtlib_purify($_REQUEST['view'])."&hour=".vtlib_purify($_REQUEST['hour'])."&day=".vtlib_purify($_REQUEST['day'])."&month=".vtlib_purify($_REQUEST['month'])."&year=".vtlib_purify($_REQUEST['year'])."&viewOption=".vtlib_purify($_REQUEST['viewOption'])."&subtab=todo&parenttab=".getParentTab());
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*********************************************************************************/
require_once 'modules/Home/UnifiedSearch.php';
?>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,169 @@
<?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 $current_user,$mod_strings,$app_strings;
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once('include/database/PearDatabase.php');
require_once('modules/Calendar/CalendarCommon.php');
$t=Date("Ymd");
$userDetails=getSharingUserName($current_user->id);
$shareduser_ids = getSharedUserId($current_user->id);
?>
<table border=0 cellspacing=0 cellpadding=5 width=100% class="layerHeadingULine">
<tr>
<td class="layerPopupHeading" align="left"><?php echo $mod_strings['LBL_CALSETTINGS']?></td>
<td align=right>
<a href="javascript:fninvsh('calSettings');"><img src="<?php echo vtiger_imageurl('close.gif', $theme) ?>" border="0" align="absmiddle" /></a>
</td>
</tr>
</table>
<form name="SharingForm" method="post" action="index.php" onsubmit="VtigerJS_DialogBox.block();">
<input type="hidden" name="module" value="Calendar">
<input type="hidden" name="action" value="updateCalendarSharing">
<input type="hidden" name="view" value="<?php echo vtlib_purify($_REQUEST['view']) ?>">
<input type="hidden" name="hour" value="<?php echo vtlib_purify($_REQUEST['hour']) ?>">
<input type="hidden" name="day" value="<?php echo vtlib_purify($_REQUEST['day']) ?>">
<input type="hidden" name="month" value="<?php echo vtlib_purify($_REQUEST['month']) ?>">
<input type="hidden" name="year" value="<?php echo vtlib_purify($_REQUEST['year']) ?>">
<input type="hidden" name="viewOption" value="<?php echo vtlib_purify($_REQUEST['viewOption']) ?>">
<input type="hidden" name="subtab" value="<?php echo vtlib_purify($_REQUEST['subtab']) ?>">
<input type="hidden" name="parenttab" value="<?php echo vtlib_purify($_REQUEST['parenttab']) ?>">
<input type="hidden" name="current_userid" value="<?php echo $current_user->id ?>" >
<input type="hidden" name="shar_userid" id="shar_userid" >
<table border=0 cellspacing=0 cellpadding=5 width=95% align=center>
<tr>
<td class=small >
<table border=0 celspacing=0 cellpadding=5 width=100% align=center bgcolor=white>
<tr>
<td align="right" width="10%" valign="top"><img src="<?php echo vtiger_imageurl('cal_clock.jpg', $theme) ?>" align="absmiddle"></td>
<td align="left" width="90%">
<b><?php echo $mod_strings['LBL_TIMESETTINGS']?></b><br>
<input type="checkbox" name="sttime_check" <?php if($current_user->start_hour != ''){?> checked <?php } ?> onClick="enableCalstarttime();">&nbsp;<?php echo $mod_strings['LBL_CALSTART']?>
<select name="start_hour" <?php if($current_user->start_hour == ''){?>disabled <?php } ?> >
<?php
for($i=0;$i<=23;$i++)
{
if($i == 0)
$hour = "12:00 am";
elseif($i >= 12)
{
if($i == 12)
$hour = $i;
else
$hour = $i - 12;
$hour = $hour.":00 pm";
}
else
{
$hour = $i.":00 am";
}
if($i <= 9 && strlen(trim($i)) < 2)
{
$value = '0'.$i.':00';
}
else
$value = $i.':00';
if($value === $current_user->start_hour)
$selected = 'selected';
else
$selected = '';
?>
<option <?php echo $selected?> value="<?php echo $value?>"><?php echo $hour?></option>
<?php
}
?>
</select><br>
<input type="checkbox" name="hour_format" <?php if($current_user->hour_format == '24'){?> checked <?php } ?> value="24">&nbsp;<?php echo $mod_strings['LBL_USE24']?>
</td>
</tr>
<tr><td colspan="2" style="border-bottom:1px dotted #CCCCCC;"></td></tr>
<tr>
<td align="right" valign="top"><img src="<?php echo vtiger_imageurl('cal_sharing.jpg', $theme) ?>" width="45" height="38" align="absmiddle"></td>
<td align="left">
<b><?php echo $mod_strings['LBL_CALSHARE']?></b><br>
<?php echo $mod_strings['LBL_CALSHAREMESSAGE']?><br><br>
<!-- Calendar sharing UI-->
<DIV id="cal_shar" style="display:block;width:100%;height:200px">
<table border=0 cellspacing=0 cellpadding=2 width=100% bgcolor="#FFFFFF">
<tr>
<td valign=top>
<table border=0 cellspacing=0 cellpadding=2 width=100%>
<tr>
<td colspan=3>
<ul style="padding-left:20px">
<li><?php echo $mod_strings['LBL_INVITE_SHARE']?>
<li><?php echo $mod_strings['LBL_INVITE_INST2']?>
</ul>
</td>
</tr>
<tr>
<td><b><?php echo $mod_strings['LBL_AVL_USERS']?></b></td>
<td>&nbsp;</td>
<td><b><?php echo $mod_strings['LBL_SEL_USERS']?></b></td>
</tr>
<tr>
<td width=40% align=center valign=top>
<select name="available_users" id="available_users" class=small size=5
multiple style="height:70px;width:100%">
<?php
foreach($userDetails as $id=>$name)
{
if($id != '')
echo "<option value=".$id.">".$name."</option>";
}
?>
</select>
</td>
<td width=20% align=center valign=top>
<input type=button value="<?php echo $mod_strings['LBL_ADD_BUTTON'] ?> >>" class="crm button small save" style="width:100%" onClick="incUser('available_users','selected_users')"><br>
<input type=button value="<< <?php echo $mod_strings['LBL_RMV_BUTTON'] ?> " class="crm button small cancel" style="width:100%" onClick="rmvUser('selected_users')">
</td>
<td>
<select name="selected_users" id="selected_users" class=small size=5 multiple style="height:70px;width:100%">
<?php
foreach($shareduser_ids as $shar_id=>$share_user)
{
if($shar_id != '')
echo "<option value=".$shar_id.">".$share_user."</option>";
}
?>
</select>
</select>
<td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=5 width=100% class="layerPopupTransport">
<tr>
<td align="center">
<input type="submit" name="save" value=" &nbsp;<?php echo $app_strings['LBL_SAVE_BUTTON_LABEL'] ?>&nbsp;" class="crmbutton small save" onClick = "userEventSharing('shar_userid','selected_users');"/>&nbsp;&nbsp;
<input type="button" name="cancel" value=" <?php echo $app_strings['LBL_CANCEL_BUTTON_LABEL'] ?> " class="crmbutton small cancel" onclick="fninvsh('calSettings');" />
</td>
</tr>
</table>
</form>
@@ -0,0 +1,22 @@
<?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');
$idlist = vtlib_purify($_POST['idlist']);
$returnmodule=vtlib_purify($_REQUEST['return_module']);
$returnaction=vtlib_purify($_REQUEST['return_action']);
//split the string and store in an array
$storearray = explode(";",$idlist);
foreach($storearray as $id)
{
$sql="delete from vtiger_sharedcalendar where sharedid=?";
$result = $adb->pquery($sql, array($id));
}
header("Location:index.php?module=".$returnmodule."&action=".$returnaction);
?>
@@ -0,0 +1,120 @@
<?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/CommonUtils.php');
$category = getParentTab();
global $theme,$app_strings,$mod_strings;
global $CALENDAR_DISPLAY, $WORLD_CLOCK_DISPLAY, $CALCULATOR_DISPLAY, $CHAT_DISPLAY;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$html_string = '<TABLE border=0 cellspacing=0 cellpadding=0 width=100% class=small>
<tr><td style="height:2px"></td></tr>
<tr>
<td width="10%" style="padding-left:10px;padding-right:30px" class="moduleName" nowrap>'.$app_strings[$category].' > <a class="hdrLink" href="index.php?action=index&module=Calendar&parenttab=My Home Page">'.$app_strings["Calendar"].'</a></td>
<td nowrap width="8%">
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td class="sep1" style="width:1px;"></td>
<td class=small>
<table border=0 cellspacing=0 cellpadding=5>
<tr>
<td style="padding-left:10px"><img src="'.vtiger_imageurl('btnL3Add-Faded.gif', $theme).'" border=0></td>
<td style="padding-right:10px"><img src="'.vtiger_imageurl('btnL3Search-Faded.gif', $theme).'" border=0></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="20">&nbsp;</td>
<td class="small" width="10%" align="left">
<table border=0 cellspacing=0 cellpadding=5>
<tr>';
if($CALENDAR_DISPLAY == 'true')
$html_string .= ' <td style="padding-right:0px;padding-left:10px;"><a href="javascript:;" onClick=\'fnvshobj(this,"miniCal");getMiniCal("parenttab='.$category.'");\'><img src="'.$image_path.'btnL3Calendar.gif" alt="'.$app_strings['LBL_CALENDAR_ALT'].'" title="'.$app_strings['LBL_CALENDAR_TITLE'].'" border=0></a></a></td>';
if($WORLD_CLOCK_DISPLAY == 'true')
$html_string .= ' <td style="padding-right:0px"><a href="javascript:;"><img src="'.$image_path.'btnL3Clock.gif" alt="'.$app_strings['LBL_CLOCK_ALT'].'" title="'.$app_strings['LBL_CLOCK_TITLE'].'" border=0 onClick="fnvshobj(this,\'wclock\');"></a></a></td>';
if($CALCULATOR_DISPLAY == 'true')
$html_string .= ' <td style="padding-right:0px"><a href="#"><img src="'.$image_path.'btnL3Calc.gif" alt="'.$app_strings['LBL_CALCULATOR_ALT'].'" title="'.$app_strings['LBL_CALCULATOR_TITLE'].'" border=0 onClick="fnvshobj(this,\'calculator_cont\');fetch_calc();"></a></td>';
if($CHAT_DISPLAY == 'true')
$html_string .= ' <td style="padding-right:10px"><a href="javascript:;" onClick=\'return window.open("index.php?module=Home&action=vtchat","Chat","width=600,height=450,resizable=1,scrollbars=1");\'><img src="'.$image_path.'tbarChat.gif" alt="'.$app_strings['LBL_CHAT_ALT'].'" title="'.$app_strings['LBL_CHAT_TITLE'].'" border=0></a></td>';
$html_string .= '
<td style="padding-right:10px"><img src="'.$image_path.'btnL3Tracker.gif" alt="'.$app_strings['LBL_LAST_VIEWED'].'" title="'.$app_strings['LBL_LAST_VIEWED'].'" border=0 onClick="fnvshobj(this,\'tracker\');"></td>
</tr>
</table>
</td>
<td width="20">&nbsp;</td>
<td class="small" align="left" width="5%">
<table border=0 cellspacing=0 cellpadding=5>
<tr>
<td style="padding-right:0px;padding-left:10px;"><img src="'.vtiger_imageurl('tbarImport-Faded.gif', $theme).'" border="0"></td>
<td style="padding-right:10px"><img src="'.vtiger_imageurl('tbarExport-Faded.gif', $theme).'" border="0"></td>
</tr>
</table>
</td>
<td width="20">&nbsp;</td>
<td class="small" align="left">
<table border=0 cellspacing=0 cellpadding=5>
<tr>
<td style="padding-left:10px;"><a href="javascript:;" onmouseout="fninvsh(\'allMenu\');" onclick="fnvshobj(this,\'allMenu\')"><img src="'.$image_path.'btnL3AllMenu.gif" alt="'.$app_strings['LBL_ALL_MENU_ALT'].'" title="'.$app_strings['LBL_ALL_MENU_TITLE'].'" border="0"></a></td>';
if((isPermitted('Settings','index') == 'yes'))
$html_string .= '<td style="padding-left:10px;"><a href="index.php?module=Settings&action=ModuleManager&module_settings=true&formodule=Calendar&parenttab=Settings"><img src="'.$image_path.'settingsBox.png" alt="'.$app_strings['LBL_SETTINGS'].'" title="'.$app_strings['LBL_SETTINGS'].'" border="0"></a></td>';
$html_string .= '</tr>
</table>
</td>
</tr>
</table></td>
</tr>
<tr><td style="height:2px"></td></tr>
</TABLE>
<table border=0 cellspacing=0 cellpadding=0 width=98% align=center>
<tr>
<td valign=top><img src="'.vtiger_imageurl('showPanelTopLeft.gif', $theme) .'"></td>
<td class="showPanelBg" valign="top" width=100% style="padding:10px;">
<!-- Calendar Tabs starts -->
<div class="small" style="padding: 10px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table class="small" border="0" cellpadding="3" cellspacing="0" width="100%">
<tr>
<td class="dvtTabCache" style="width: 10px;" nowrap="nowrap">&nbsp;</td>
<td class="dvtSelectedCell" align="center" nowrap="nowrap">'.$app_strings["Calendar"].'</td>
<td class="dvtTabCache" style="width: 10px;">&nbsp;</td>
<td class="dvtUnSelectedCell" align="center" nowrap="nowrap"><a href="index.php?action=ListView&module=Calendar&parenttab='.$category.'">'.$mod_strings["LBL_ALL_EVENTS_TODOS"].'</a></td>
<td class="dvtTabCache" style="width: 100%;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top">
<table class="dvtContentSpace" border="0" cellpadding="3" cellspacing="0" width="100%">
<tr>
<td align="left">
<!-- content cache -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="padding: 10px;">
';
echo $html_string;
?>
@@ -0,0 +1,32 @@
<?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 $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once('include/logging.php');
$cal_log =& LoggerManager::getLogger('calendar');
global $mod_strings;
include ('modules/Calendar/new_calendar.php');
?>
@@ -0,0 +1,442 @@
<?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 apmt_locationuage 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: Defines the English apmt_locationuage pack
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = Array(
'LBL_MODULE_NAME'=>'Calendar',
'LBL_MODULE_TITLE'=>'Calendar: Home',
'LBL_MODULE_APPOINTMENT'=>'Calendar: Appointment',
'LBL_MODULE_APPOINTMENT_DETAIL'=>'Calendar: Appointment Detail',
'LBL_SAVE'=>'Save',
'LBL_RESET'=>'Cancel',
'LBL_LIST_USER_NAME'=>'User Name',
'LBL_LIST_NAME'=>'Name',
'LBL_CALENDAR_SHARED'=>'Calendar currently shared with',
'LBL_CALENDAR_SHARING'=>'Share calendar with',
'LBL_SHARING_OPTION'=>'Can see my calendar?',
'LBL_LIST_TOOLS'=>'Tools',
'LBL_SETTINGS'=>'Settings',
'LBL_CALSETTINGS'=>'Calendar Settings',
'LBL_USE24'=>'Use 24 hours format',
'LBL_CALSTART'=>'Start my calendar time at',
'LBL_TIMESETTINGS'=>'Time Settings',
'LBL_HOLDFOLLOWUP'=>'Hold followup on',
'LBL_CALL' => 'Call',
'LBL_MEET' => 'Meeting',
'LBL_APPNT' => 'Appointment',
'LBL_NEW_APPNT' => 'New Appointment',
'LBL_NEW_APPNT_INFO' => 'Create a new appointment',
'LBL_VIEW_DAY_APPNT_INFO' => 'View appointment(s) for this day',
'LBL_CHANGE_APPNT' => 'see or change this appointment (%s - %s)',
'LBL_DAY' => 'Day',
'LBL_DAY_BUTTON_KEY' => 'D',
'LBL_DAY_BUTTON_TITLE' => 'Day [Alt+D]',
'LBL_DAY1' => 'Monday',
'LBL_DAY2' => 'Tuesday',
'LBL_DAY3' => 'Wednesday',
'LBL_DAY4' => 'Thursday',
'LBL_DAY5' => 'Friday',
'LBL_DAY6' => 'Saturday',
'LBL_DAY0' => 'Sunday',
'LBL_SM_MON' => 'Mon',
'LBL_SM_TUE' => 'Tue',
'LBL_SM_WED' => 'Wed',
'LBL_SM_THU' => 'Thu',
'LBL_SM_FRI' => 'Fri',
'LBL_SM_SAT' => 'Sat',
'LBL_SM_SUN' => 'Sun',
'LBL_DATE_TITLE' => 'Day %d, %A',
'LBL_WEEK' => 'Week',
'LBL_WEEK_BUTTON_KEY' => 'W',
'LBL_WEEK_BUTTON_TITLE' => 'Week [Alt+W]',
'LBL_WEEKS' => 'Weeks',
'LBL_NEXT_WEEK' => 'next week',
'LBL_LAST_WEEK' => 'last week',
'LBL_4WEEKS_BACK' => '4 weeks back',
'LBL_4WEEKS_PLUS' => '4 weeks plus',
'LBL_RELOAD' => 'Reload',
'LBL_APPCREATED_BY' => 'Created by',
'LBL_AT_DATE_TIME' => 'at',
'LBL_MON' => 'Month',
'LBL_MON_BUTTON_KEY' => 'M',
'LBL_MON_BUTTON_TITLE' => 'Month [Alt+M]',
'LBL_PREV_MON' => 'Previous Month',
'LBL_NEXT_MON' => 'Next Month',
'LBL_YEAR_BUTTON_KEY'=>'Y',
'LBL_PREV_YEAR'=>'Previous Year',
'LBL_NEXT_YEAR' => 'Next Year',
'LBL_APP_LOCATION' => 'Location',
'LBL_APP_IGNORE_TIME' => 'ignore above times',
'LBL_SUBJECT'=>'Subject:',
'LBL_APP_DESCRIPTION' => 'Description',
'LBL_CONTACT'=>'Contact:',
'LBL_CONTACT_LIST'=>'Contact List:',
'LBL_APP_IGNORE_TIME2' => '(i.e. the appointment takes place<br />at no particular time on these day(s) )',
'LBL_APP_ERR001' =>'Invalid Date in field %s!',
'LBL_APP_ERR002' =>'start after end !',
'LBL_APP_ERR003' =>'Missing Contact !',
'LBL_APP_ERR004' =>'Missing Subject !',
'ERR_DELETE_RECORD'=>"A record number must be specified to delete the appointment.",
'DELETE_CONFIRMATION'=>"Are you sure you want to delete this appointment?",
'AppLoc'=> Array('0' => 'Office'
, '1' => 'Out'
, '2' => 'Vacation'
, '3' => 'sick'
, '4' => 'Postponed'
, '5' => 'Option'
, '6' => 'Private'),
'cal_month_long'=>array(
"",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
),
'cal_weekdays_short'=>array(
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
),
'cal_weekdays_long'=>array(
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
),
'cal_month_short'=>array(
"",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
),
'LBL_TIME'=>'Time',
'LBL_START_TIME' => 'Start Time',
'LBL_END_TIME' => 'End Time',
'LBL_START_DATE'=>'Start Date',
'LBL_TIME_START'=>'Time Start',
'LBL_DUE_DATE'=>'Due Date',
'LBL_START_DATE_TIME'=>'Start Date & Time',
'LBL_END_DATE_TIME'=>'End Date & Time',
'LBL_TODO'=>'To Do',
'LBL_TODOS'=>'To Dos',
'LBL_EVENTS'=>'Events',
'LBL_TOTALEVENTS'=>'My Total Events :',
'LBL_TOTALTODOS'=>'My Total To Dos :',
'LBL_VIEW'=>'View',
'LBL_LISTVIEW'=>'List View',
'LBL_HRVIEW'=>'Hour View',
'LBL_WEEKVIEW'=>'Weekly Calendar View',
'LBL_MONTHVIEW'=>'Monthly Calendar View',
'LBL_YEARVIEW'=>'Yearly Calendar View',
'LBL_STATUS'=>'Status',
'LBL_ACTION'=>'Actions',
'LBL_ADD'=>'Add',
'LBL_OPENCAL'=>'Open Calendar',
'LBL_ADD_EVENT'=>'Add Event',
'LBL_ADDCALL'=>'Call',
'LBL_ADDMEETING'=>'Meeting',
'LBL_ADDTODO'=>'To Do',
'LBL_BEFOREEVENT'=>'before the event starts',
'LBL_BEFORETASK'=>'before the task starts',
'LBL_EVENTDETAILS'=>'Event Details',
'LBL_CURSTATUS'=>'Current Status',
'LBL_ASSINGEDTO'=>'Assigned To',
'LBL_RELATEDTO'=>'Related To',
'LBL_PENDING'=>'Pending',
'LBL_PUBLIC'=>'Mark Public',
'LBL_MORE'=>'More',
'LBL_EDIT'=>'Edit',
'LBL_EVERYDAY'=>'Every Day',
'LBL_EVERYWEEK'=>'Every Week',
'LBL_EVERYMON'=>'Every Month',
'LBL_WEEKS'=>'Week(s)',
'LBL_MONTHS'=>'Month(s)',
'LBL_YEAR'=>'Year',
'LBL_NONE_SCHEDULED'=>'None Scheduled',
'LBL_INVITE_INST1'=>'To invite, select the users from the "Available Users" list and click the "Add" button.',
'LBL_INVITE_SHARE'=>'To share, select the users from the "Available Users" list and click the "Add" button.',
'LBL_INVITE_INST2'=>'To remove, select the users from the "Selected Users" list and the click "Remove" button.',
'LBL_SELUSR_INFO'=>' Selected users will receive an email about the Event.',
'LBL_CALSHAREMESSAGE'=>'Share my calendar with the following selected users',
'LBL_CALSHARE'=>'Calendar Sharing',
'LBL_SEL_USERS'=>'Selected Users',
'LBL_AVL_USERS'=>'Available Users',
'LBL_ADD_BUTTON'=>'Add',
'LBL_USERS'=>'Users',
'LBL_RMV_BUTTON'=>'Remove',
'LBL_SDRMD'=>'Send Reminder to',
'LBL_ENABLE_REPEAT'=>'Enable Repeat',
'LBL_REPEAT_ONCE'=>'Repeat once in every',
'LBL_ADD_TODO'=>'Create To Do',
'LBL_TODONAME'=>'To Do',
'LBL_TODODATETIME'=>'Time & Date',
//DON'T CONVERT THESE THEY ARE MAPPINGS - STARTS
'db_last_name' => 'LBL_LIST_LAST_NAME',
'db_first_name' => 'LBL_LIST_FIRST_NAME',
'db_title' => 'LBL_LIST_TITLE',
'db_email1' => 'LBL_LIST_EMAIL_ADDRESS',
'db_email2' => 'LBL_LIST_EMAIL_ADDRESS',
//DON'T CONVERT THESE THEY ARE MAPPINGS -ENDS
'LBL_COMPLETED'=>'Mark Completed',
'LBL_DEFERRED'=>'Mark Deferred',
'LBL_HELD'=>'Mark Held',
'LBL_NOTHELD'=>'Mark Not Held',
'LBL_POSTPONE'=>'Postpone',
'LBL_CHANGEOWNER'=>'Change Owner',
'LBL_DEL'=>'Delete',
//Added for actvity merge with calendar
'LBL_SEARCH_FORM_TITLE'=>'Activity Search',
'LBL_LIST_FORM_TITLE'=>'Activity List',
'LBL_NEW_FORM_TITLE'=>'New Activity',
'LBL_TASK_INFORMATION'=>'Task Information',
'LBL_EVENT_INFORMATION'=>'Event Information',
'LBL_CALENDAR_INFORMATION'=>'Calendar Information',
'LBL_NAME'=>'Subject:',
'LBL_ACTIVITY_NOTIFICATION'=>'This is a notification that an activity is assigned to you that has been',
'LBL_ACTIVITY_INVITATION'=>'You have been invited for an activity that has been ',
'LBL_DETAILS_STRING'=>'The details are',
'LBL_REGARDS_STRING'=>'Thanks & Regards',
'LBL_CONTACT_NAME'=>'Contact Name',
'LBL_OPEN_ACTIVITIES'=>'Open Activities',
'LBL_ACTIVITY'=>'Activity:',
'LBL_HISTORY'=>'History',
'LBL_UPCOMING'=>"My Upcoming and Pending Activities",
'LBL_TODAY'=>'through ',
'LBL_NEW_TASK_BUTTON_TITLE'=>'New Task [Alt+N]',
'LBL_NEW_TASK_BUTTON_KEY'=>'N',
'LBL_NEW_TASK_BUTTON_LABEL'=>'New Task',
'LBL_SCHEDULE_MEETING_BUTTON_TITLE'=>'Schedule Meeting [Alt+M]',
'LBL_SCHEDULE_MEETING_BUTTON_KEY'=>'M',
'LBL_SCHEDULE_MEETING_BUTTON_LABEL'=>'Schedule Meeting',
'LBL_SCHEDULE_CALL_BUTTON_TITLE'=>'Schedule Call [Alt+C]',
'LBL_SCHEDULE_CALL_BUTTON_KEY'=>'C',
'LBL_SCHEDULE_CALL_BUTTON_LABEL'=>'Schedule Call',
'LBL_NEW_NOTE_BUTTON_TITLE'=>'New Document [Alt+T]',
'LBL_NEW_ATTACH_BUTTON_TITLE'=>'Attach File [Alt+F]',
'LBL_NEW_NOTE_BUTTON_KEY'=>'T',
'LBL_NEW_ATTACH_BUTTON_KEY'=>'F',
'LBL_NEW_NOTE_BUTTON_LABEL'=>'New Document',
'LBL_NEW_ATTACH_BUTTON_LABEL'=>'Attach File',
'LBL_TRACK_EMAIL_BUTTON_TITLE'=>'Track Email [Alt+K]',
'LBL_TRACK_EMAIL_BUTTON_KEY'=>'K',
'LBL_TRACK_EMAIL_BUTTON_LABEL'=>'Track Email',
'LBL_LIST_CLOSE'=>'Close',
'LBL_LIST_STATUS'=>'Status',
'LBL_LIST_CONTACT'=>'Contact',
//Added for 4.2 release for Account column support as shown by Fredy
'LBL_LIST_ACCOUNT'=>'Account',
'LBL_LIST_RELATED_TO'=>'Related to',
'LBL_LIST_DUE_DATE'=>'Due Date',
'LBL_LIST_DATE'=>'Date',
'LBL_LIST_SUBJECT'=>'Subject',
'LBL_LIST_LAST_MODIFIED'=>'Last Modified',
'LBL_LIST_RECURRING_TYPE'=>'Recurring Type',
'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.",
'NTC_NONE_SCHEDULED'=>'None scheduled.',
// Added vtiger_fields for Attachments in Activities/SubPanelView.php
'LBL_ATTACHMENTS'=>'Attachments',
'LBL_NEW_ATTACHMENT'=>'New Attachment',
//Added vtiger_fields after RC1 - Release
'LBL_ALL'=>'All',
'LBL_CALL'=>'Call',
'LBL_MEETING'=>'Meeting',
'LBL_TASK'=>'Task',
//Added for 4GA Release
'Subject'=>'Subject',
'Assigned To'=>'Assigned To',
'Start Date & Time'=>'Start Date & Time',
'Time Start'=>'Time Start',
'Due Date'=>'Due Date',
'Related To'=>'Related to',
'Contact Name'=>'Contact Name',
'Status'=>'Status',
'Priority'=>'Priority',
'Visibility'=>'Visibility',
'Send Notification'=>'Send Notification',
'Created Time'=>'Created Time',
'Modified Time'=>'Modified Time',
'Activity Type'=>'Activity Type',
'Description'=>'Description',
'Duration'=>'Duration',
'Duration Minutes'=>'Duration Minutes',
'Location'=>'Location',
'No Time'=>'No Time',
//Added for Send Reminder 4.2 release
'Send Reminder'=>'Send Reminder',
'LBL_YES'=>'Yes',
'LBL_NO'=>'No',
'LBL_DAYS'=>'day(s)',
'LBL_MINUTES'=>'minutes',
'LBL_HOURS'=>'hours',
'LBL_BEFORE_EVENT'=>'before event',
//Added for CustomView 4.2 Release
'Close'=>'Close',
'Start Date'=>'Start Date',
'Type'=>'Type',
'End Date'=>'End Date',
'Recurrence'=> 'Recurring Events',
'Recurring Type'=> 'Recurring Type',
//Activities - Notification Error
'LBL_NOTIFICATION_ERROR'=>'Mail Error : Please check your outgoing mail server configuration in Settings->Outgoing Mail Server Configuration OR MailId for the present user is not Configured',
// Mike Crowe Mod --------------------------------------------------------added for generic search
'LBL_GENERAL_INFORMATION'=>'General Information',
'LBL_EVENTTYPE'=>'Event Type',
'LBL_EVENTNAME'=>'Event Name',
'LBL_EVENTSTAT'=>'Event starts at',
'LBL_EVENTEDAT'=>'Event ends on',
'LBL_INVITE'=>'Invite',
'LBL_REPEAT'=>'Repeat',
'LBL_REMINDER'=>'Reminder',
'LBL_SENDREMINDER'=>'Send Reminder',
'LBL_NOTIFICATION'=>'Notification',
'LBL_SENDNOTIFICATION'=>'Send Notification',
'LBL_RMD_ON'=>'Remind on',
'LBL_REPEATEVENT'=>'Repeat once in every',
'LBL_TIMEDATE'=>'Time & Date',
'LBL_HR'=>'Hr',
'LBL_MIN'=>'min',
'LBL_EVENT'=>'Event',
'Daily'=>'Day(s)',
'Weekly'=>'Week(s)',
'Monthly'=>'Month(s)',
'Yearly'=>'Year',
'createdtime'=>'Created Time',
'modifiedtime'=>'Modified Time',
'first'=>'First',
'last'=>'Last',
'High'=>'High',
'Medium'=>'Medium',
'Low'=>'Low',
'LBL_SELECT'=>'Select',
'LBL_ALL_EVENTS_TODOS'=>'All Events & Todos',
'First'=>'First',
'Last'=>'Last',
'on'=>'on',
'day of the month'=>'day of the month',
'Private'=>'Private',
'Public'=>'Public',
//Added for existing Picklist entries
'Planned'=>'Planned',
'Held'=>'Held',
'Not Held'=>'Not Held',
'Completed'=>'Completed',
'Deferred'=>'Deferred',
'Not Started'=>'Not Started',
'In Progress'=>'In Progress',
'Pending Input'=>'Pending Input',
'LBL_REMAINDER_DAY'=>'days',
'LBL_REMAINDER_HRS'=>'hrs',
'Call'=>'Call',
'Meeting'=>'Meeting',
//added to send dates and time in calendar notification/invitation mail.
'Start date and time'=>'Start Date & Time',
'End date and time'=>'End Date & Time',
//this is for task
'End date'=>'End date',
'LBL_SET_DATE'=>'Set date..',
'Recurrence'=>'Recurrence',
//added to send invitation mail Subject.
'INVITATION'=>' Invitation ',
// Added/Updated for vtiger CRM 5.0.4
'LBL_YEAR_BUTTON_TITLE'=>'Year [Alt+Y]',
'LBL_SELECT_CONTACT'=>'Select Contacts',
'SHARED_EVENT_DEL_MSG'=>'The User does not have permission to Edit/Delete Shared Event.',
//added to fix ticket#4525
'LBL_CREATED'=>'created',
'LBL_UPDATED'=>'updated',
//Added after 5.0.4 GA
'LBL_BUSY' => 'Busy',
//Custom Fields support for Calendar
'LBL_CUSTOM_INFORMATION'=>'Custom Information',
// Repeat Event support for Calendar
'LBL_UNTIL' => 'Until',
'LBL_SET_DATE'=>'Set Date',
'LBL_MINE' =>'Mine',
);
?>
@@ -0,0 +1,441 @@
<?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 apmt_locationuage 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: Defines the English apmt_locationuage pack
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = Array(
'LBL_MODULE_NAME' => '计划任务',
'LBL_MODULE_TITLE' => '计划任务: 首页',
'LBL_MODULE_APPOINTMENT' => '计划任务: 行程',
'LBL_MODULE_APPOINTMENT_DETAIL' => '计划任务: 计划细节',
'LBL_SAVE' => '保存',
'LBL_RESET' => '取消',
'LBL_LIST_USER_NAME' => '账号',
'LBL_LIST_NAME' => '名称',
'LBL_CALENDAR_SHARED' => '计划目前分享给',
'LBL_CALENDAR_SHARING' => '分享计划给',
'LBL_SHARING_OPTION' => '可以检视我的计划?',
'LBL_LIST_TOOLS' => '工具',
'LBL_SETTINGS' => '设定',
'LBL_CALSETTINGS' => '计划任务设定',
'LBL_USE24' => '使用 24 小时制',
'LBL_CALSTART' => '计划任务开始时间',
'LBL_TIMESETTINGS' => '时间设定',
'LBL_OPENCAL' => '开放计划任务',
'LBL_CALL' => '电话记录',
'LBL_MEET' => '会议',
'LBL_APPNT' => '行程',
'LBL_NEW_APPNT' => '新增行程',
'LBL_NEW_APPNT_INFO' => '建立一笔新的行程',
'LBL_VIEW_DAY_APPNT_INFO' => '浏览今天的行程',
'LBL_CHANGE_APPNT' => '察看或变更这个行程 (%s - %s)',
'LBL_DAY' => '日',
'LBL_DAY_BUTTON_KEY' => 'D',
'LBL_DAY_BUTTON_TITLE' => '日 [Alt+D]',
'LBL_DAY1' => '周一',
'LBL_DAY2' => '周二',
'LBL_DAY3' => '周三',
'LBL_DAY4' => '周四',
'LBL_DAY5' => '周五',
'LBL_DAY6' => '周六',
'LBL_DAY0' => '周日',
'LBL_SM_MON' => '一',
'LBL_SM_TUE' => '二',
'LBL_SM_WED' => '三',
'LBL_SM_THU' => '四',
'LBL_SM_FRI' => '五',
'LBL_SM_SAT' => '六',
'LBL_SM_SUN' => '日',
'LBL_DATE_TITLE' => 'Day %d, %A',
'LBL_WEEK' => '周',
'LBL_WEEK_BUTTON_KEY' => 'W',
'LBL_WEEK_BUTTON_TITLE' => '周 [Alt+W]',
'LBL_WEEKS' => '周',
'LBL_NEXT_WEEK' => '下周',
'LBL_LAST_WEEK' => '上周',
'LBL_4WEEKS_BACK' => '四周前',
'LBL_4WEEKS_PLUS' => '四周后',
'LBL_RELOAD' => '重新加载',
'LBL_APPCREATED_BY' => '建立者:',
'LBL_AT_DATE_TIME' => '在',
'LBL_MON' => '月',
'LBL_MON_BUTTON_KEY' => 'M',
'LBL_MON_BUTTON_TITLE' => '月 [Alt+M]',
'LBL_PREV_MON' => '上个月',
'LBL_NEXT_MON' => '下个月',
'LBL_YEAR_BUTTON_KEY' => 'Y',
'LBL_PREV_YEAR' => '去年',
'LBL_NEXT_YEAR' => '明年',
'LBL_APP_LOCATION' => '所在地',
'LBL_APP_IGNORE_TIME' => '忽略',
'LBL_SUBJECT'=>'主题:',
'LBL_APP_DESCRIPTION' => '描述',
'LBL_CONTACT'=>'联系方式:',
'LBL_CONTACT_LIST'=>'联系人列表:',
'LBL_APP_IGNORE_TIME2' => '(注:这个行程在该期间没有特定的时间 )',
'LBL_APP_ERR001' =>'字段 %s产生错误!',
'LBL_APP_ERR002' => '开始日期在结束日期之后 !',
'LBL_APP_ERR003' => '漏填联系人 !',
'LBL_APP_ERR004' => '漏填标题 !',
'ERR_DELETE_RECORD' => '在删除行程前必须输入正确的记录编号.',
'DELETE_CONFIRMATION' => '您确定要删除这次的行程?',
'AppLoc'=> Array('0' => '办公室',
'1' => '户外',
'2' => '休假',
'3' => '病假',
'4' => '延期',
'5' => '随意',
'6' => '私人',),
'cal_month_long'=>array(
"",
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
),
'cal_weekdays_short'=>array(
"",
"",
"",
"",
"",
"",
"",
),
'cal_weekdays_long'=>array(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
),
'cal_month_short'=>array(
"",
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
),
'LBL_TIME'=>'时间',
'LBL_START_TIME' => '开始时间',
'LBL_END_TIME' => '结束时间',
'LBL_START_DATE'=>'开始日期',
'LBL_TIME_START'=>'时间开始',
'LBL_DUE_DATE'=>'到期日',
'LBL_START_DATE_TIME'=>'开始日期 & 时间',
'LBL_END_DATE_TIME'=>'结束日期 & 时间',
'LBL_TODO'=>'待办',
'LBL_TODOS'=>'待办事项',
'LBL_EVENTS'=>'事件',
'LBL_TOTALEVENTS'=>'我的全部事件 :',
'LBL_TOTALTODOS'=>'我的待办事项 :',
'LBL_VIEW'=>'查看',
'LBL_LISTVIEW'=>'查看列表',
'LBL_HRVIEW'=>'产看时间',
'LBL_WEEKVIEW'=>'查看周历',
'LBL_MONTHVIEW'=>'查看月历',
'LBL_YEARVIEW'=>'查看年历',
'LBL_STATUS'=>'状态',
'LBL_ACTION'=>'操作',
'LBL_ADD'=>'添加',
'LBL_OPENCAL'=>'打开日历',
'LBL_ADD_EVENT'=>'添加事件',
'LBL_ADDCALL'=>'呼叫',
'LBL_ADDMEETING'=>'会议',
'LBL_ADDTODO'=>'待办',
'LBL_BEFOREEVENT'=>'在事件开始之前',
'LBL_BEFORETASK'=>'在任务开始之前',
'LBL_EVENTDETAILS'=>'事件细节',
'LBL_CURSTATUS'=>'当前状态',
'LBL_ASSINGEDTO'=>'分配给',
'LBL_RELATEDTO'=>'关联于',
'LBL_PENDING'=>'即将发生',
'LBL_PUBLIC'=>'标记公共',
'LBL_MORE'=>'更多',
'LBL_EDIT'=>'编辑',
'LBL_EVERYDAY' => '每天',
'LBL_EVERYWEEK' => '每周',
'LBL_EVERYMON' => '每月',
'LBL_WEEKS'=>'周',
'LBL_MONTHS'=>'月',
'LBL_YEAR'=>'年',
'LBL_NONE_SCHEDULED'=>'没有行程',
'LBL_INVITE_INST1' => '邀请的方式可以从目前使用者列表选择并且点选新增按钮',
'LBL_INVITE_SHARE'=>'分享的方式可以从目前使用者列表选择并且点选新增按钮.',
'LBL_INVITE_INST2' => '移除邀请的人可以从选择的使用者列表选择并且点选移除按钮',
'LBL_SELUSR_INFO' => '选择的使用者会收到一封事件的通知。',
'LBL_CALSHAREMESSAGE'=>'开放我的行事历给下面选择的使用者',
'LBL_CALSHARE' => '开放行事历',
'LBL_SEL_USERS' => '选择的使用者',
'LBL_AVL_USERS' => '目前使用者',
'LBL_ADD_BUTTON' => '新增',
'LBL_USERS' => '使用者',
'LBL_RMV_BUTTON'=>'移除',
'LBL_SDRMD'=>'发送提醒讯息',
'LBL_ENABLE_REPEAT'=>'启用循环',
'LBL_REPEAT_ONCE'=>'循环频率',
'LBL_ADD_TODO'=>'建立待办事项',
'LBL_TODONAME'=>'待办事项',
'LBL_TODODATETIME'=>'时间与日期',
//DON'T CONVERT THESE THEY ARE MAPPINGS - STARTS
'db_last_name' => 'LBL_LIST_LAST_NAME',
'db_first_name' => 'LBL_LIST_FIRST_NAME',
'db_title' => 'LBL_LIST_TITLE',
'db_email1' => 'LBL_LIST_EMAIL_ADDRESS',
'db_email2' => 'LBL_LIST_EMAIL_ADDRESS',
//DON'T CONVERT THESE THEY ARE MAPPINGS -ENDS
'LBL_COMPLETED' => '标示为完成',
'LBL_DEFERRED' => '标示为延缓',
'LBL_HELD' => '标示为执行',
'LBL_NOTHELD' => '标示为不执行',
'LBL_POSTPONE' => '延期',
'LBL_CHANGEOWNER' => '修改负责人',
'LBL_DEL' => '删除',
//Added for actvity merge with calendar
'LBL_SEARCH_FORM_TITLE'=>'搜索待办事项',
'LBL_LIST_FORM_TITLE'=>'待办事项列表',
'LBL_NEW_FORM_TITLE'=>'新增待办事项',
'LBL_TASK_INFORMATION'=>'任务信息',
'LBL_EVENT_INFORMATION'=>'事件信息',
'LBL_CALENDAR_INFORMATION'=>'日历信息',
'LBL_NAME' => '主题:',
'LBL_ACTIVITY_NOTIFICATION'=>'这是通知活动分配给你',
'LBL_ACTIVITY_INVITATION'=>'你被邀请参与一个活动 ',
'LBL_DETAILS_STRING'=>'细节是',
'LBL_REGARDS_STRING'=>'感谢和问候',
'LBL_CONTACT_NAME' => '联系人',
'LBL_OPEN_ACTIVITIES' => '进行中事项',
'LBL_ACTIVITY' => '待办事项:',
'LBL_HISTORY' => '纪录',
'LBL_UPCOMING' => '即将到来与等待中待办事项',
'LBL_TODAY' => '到',
'LBL_NEW_TASK_BUTTON_TITLE' => '新增任务 [Alt+N]',
'LBL_NEW_TASK_BUTTON_KEY' => 'N',
'LBL_NEW_TASK_BUTTON_LABEL' => '新增任务',
'LBL_SCHEDULE_MEETING_BUTTON_TITLE' => '安排会议 [Alt+M]',
'LBL_SCHEDULE_MEETING_BUTTON_KEY' => 'M',
'LBL_SCHEDULE_MEETING_BUTTON_LABEL' => '安排会议',
'LBL_SCHEDULE_CALL_BUTTON_TITLE' => '安排电话 [Alt+C]',
'LBL_SCHEDULE_CALL_BUTTON_KEY' => 'C',
'LBL_SCHEDULE_CALL_BUTTON_LABEL' => '安排电话',
'LBL_NEW_NOTE_BUTTON_TITLE' => '新增记事 [Alt+T]',
'LBL_NEW_ATTACH_BUTTON_TITLE' => '附加档案 [Alt+F]',
'LBL_NEW_NOTE_BUTTON_KEY' => 'T',
'LBL_NEW_ATTACH_BUTTON_KEY' => 'F',
'LBL_NEW_NOTE_BUTTON_LABEL' => '新增记事',
'LBL_NEW_ATTACH_BUTTON_LABEL' => '附加档案',
'LBL_TRACK_EMAIL_BUTTON_TITLE' => '追踪邮件 [Alt+K]',
'LBL_TRACK_EMAIL_BUTTON_KEY' => 'K',
'LBL_TRACK_EMAIL_BUTTON_LABEL' => '追踪邮件',
'LBL_LIST_CLOSE' => '关闭',
'LBL_LIST_STATUS' => '状态',
'LBL_LIST_CONTACT' => '联系人',
//Added for 4.2 release for Account column support as shown by Fredy
'LBL_LIST_ACCOUNT' => '客户',
'LBL_LIST_RELATED_TO' => '相关于',
'LBL_LIST_DUE_DATE' => '结束日期',
'LBL_LIST_DATE' => '日期',
'LBL_LIST_SUBJECT' => '主旨1',
'LBL_LIST_LAST_MODIFIED' => '最后更新',
'LBL_LIST_RECURRING_TYPE' => '循环类型',
'ERR_DELETE_RECORD'=>"一个记录编号必须被指定删除vtiger_account.",
'NTC_NONE_SCHEDULED'=>'没有安排.',
// Added vtiger_fields for Attachments in Activities/SubPanelView.php
'LBL_ATTACHMENTS' => '附加档案',
'LBL_NEW_ATTACHMENT' => '新增附加档案',
//Added vtiger_fields after RC1 - Release
'LBL_ALL'=>'全部',
'LBL_CALL'=>'呼叫',
'LBL_MEETING'=>'会议',
'LBL_TASK'=>'任务',
//Added for 4GA Release
'Subject' => '主旨2',
'Assigned To' => '负责人',
'Start Date & Time' => '开始日期与时间',
'Time Start' => '开始时间',
'Due Date' => '到期日',
'Related To' => '相关于',
'Contact Name' => '联系人名称',
'Status' => '状态',
'Priority' => '优先级',
'Visibility' => '显示',
'Send Notification' => '寄送通知',
'Created Time' => '建立时间',
'Modified Time' => '修改时间',
'Activity Type' => '活动类型',
'Description' => '描述',
'Duration' => '期间',
'Duration Minutes' => '期间分钟',
'Location' => '位置',
'No Time' => '没有时间',
//Added for Send Reminder 4.2 release
'Send Reminder' => '提醒通知',
'LBL_YES'=>'是',
'LBL_NO'=>'否',
'LBL_DAYS'=>'日',
'LBL_MINUTES'=>'分',
'LBL_HOURS'=>'时',
'LBL_BEFORE_EVENT'=>'时间前',
//Added for CustomView 4.2 Release
'Close' => '关闭',
'Start Date' => '开始日期',
'Type' => '类型',
'End Date' => '结束日期',
'Recurrence' => '循环事件',
'Recurring Type' => '循环类型',
//Activities - Notification Error
'LBL_NOTIFICATION_ERROR' => '邮件错误:请检查您的外寄邮件服务器设定,在 设定->外寄邮件服务器设定 或是目前使用者的邮件没有设定好',
// Mike Crowe Mod --------------------------------------------------------added for generic search
'LBL_GENERAL_INFORMATION' => '一般信息',
'LBL_EVENTTYPE'=>'事件类型',
'LBL_EVENTNAME'=>'事件名称',
'LBL_EVENTSTAT'=>'事件开始于',
'LBL_EVENTEDAT'=>'事件结束于',
'LBL_INVITE'=>'邀请',
'LBL_REPEAT'=>'重复',
'LBL_REMINDER'=>'提示',
'LBL_SENDREMINDER'=>'发送提示',
'LBL_NOTIFICATION'=>'通知',
'LBL_SENDNOTIFICATION'=>'发送通知',
'LBL_RMD_ON'=>'提醒',
'LBL_REPEATEVENT'=>'每个都重复一次',
'LBL_TIMEDATE'=>'时间和日期',
'LBL_HR'=>'时',
'LBL_MIN'=>'分',
'LBL_EVENT'=>'事件',
'Daily'=>'天',
'Weekly'=>'周',
'Monthly'=>'月',
'Yearly'=>'年',
'createdtime'=>'建立时间',
'modifiedtime'=>'修改时间',
'first'=>'第一个',
'last'=>'最后一个',
'High'=>'高',
'Medium'=>'中',
'Low'=>'低',
'LBL_SELECT'=>'选择',
'LBL_ALL_EVENTS_TODOS' => '所有事件与工作',
'First' => '第一笔',
'Last' => '最后一笔',
'on' => '于',
'day of the month' => '日',
'Private'=>'私有',
'Public'=>'公共',
//Added for existing Picklist entries
'Planned' => '已规划',
'Held' => '保留',
'Not Held' => '不保留',
'Completed' => '完成',
'Deferred' => '延期',
'Not Started' => '未开始',
'In Progress' => '处理中',
'Pending Input' => '等待输入',
'LBL_REMAINDER_DAY' => '天',
'LBL_REMAINDER_HRS' => '小时',
'Call' => '电话',
'Meeting' => '会议',
//added to send dates and time in calendar notification/invitation mail.
'Start date and time'=>'开始日期和时间',
'End date and time'=>'结束日期和时间',
//this is for task
'End date'=>'结束日期',
'LBL_SET_DATE'=>'设置日期..',
'Recurrence'=>'再现',
'INVITATION'=>' 邀请 ',
'LBL_YEAR_BUTTON_TITLE'=>'Year [Alt+Y]',
'LBL_SELECT_CONTACT' => '选择联系人',
'SHARED_EVENT_DEL_MSG'=>'用户没有允许删除这个纪录.',
//added to fix ticket#4525
'LBL_CREATED'=>'created',
'LBL_UPDATED'=>'updated',
//Added after 5.0.4 GA
'LBL_BUSY' => '忙碌',
//Custom Fields support for Calendar
'LBL_CUSTOM_INFORMATION'=>'自定义信息',
// Repeat Event support for Calendar
'LBL_UNTIL' => '至',
'LBL_SET_DATE'=>'设置日期',
'LBL_MINE' =>'我的',
);
?>
@@ -0,0 +1,92 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
**********************************************************************************/
global $theme,$current_user,$app_strings;
$theme_path = "themes/".$theme."/";
$image_path = $theme_path."images/";
require_once("modules/Calendar/calendarLayout.php");
require_once("modules/Calendar/Calendar.php");
$mysel= vtlib_purify($_REQUEST['view']);
$subtab = vtlib_purify($_REQUEST['subtab']);
$viewBox = vtlib_purify($_REQUEST['viewOption']);
if(empty($viewBox))
{
$viewBox = 'listview';
}
if(empty($subtab))
{
$subtab = 'event';
}
$calendar_arr = Array();
$calendar_arr['IMAGE_PATH'] = $image_path;
/* fix (for Ticket ID:2259 GA Calendar Default View not working) given by dartagnanlaf START --integrated by Minnie */
if(empty($mysel)){
if($current_user->activity_view == "This Year"){
$mysel = 'year';
}else if($current_user->activity_view == "This Month"){
$mysel = 'month';
}else if($current_user->activity_view == "This Week"){
$mysel = 'week';
}else{
$mysel = 'day';
}
}
/* fix given by dartagnanlaf END --integrated by Minnie */
$date_data = array();
if ( isset($_REQUEST['day']))
{
$date_data['day'] = $_REQUEST['day'];
}
if ( isset($_REQUEST['month']))
{
$date_data['month'] = $_REQUEST['month'];
}
if ( isset($_REQUEST['week']))
{
$date_data['week'] = $_REQUEST['week'];
}
if ( isset($_REQUEST['year']))
{
if ($_REQUEST['year'] > 2037 || $_REQUEST['year'] < 1970)
{
print("<font color='red'>".$app_strings['LBL_CAL_LIMIT_MSG']."</font>");
exit;
}
$date_data['year'] = $_REQUEST['year'];
}
if(empty($date_data))
{
$data_value=date('Y-m-d H:i:s');
preg_match('/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/',$data_value,$value);
$date_data = Array(
'day'=>$value[3],
'month'=>$value[2],
'year'=>$value[1],
'hour'=>$value[4],
'min'=>$value[5],
);
}
$calendar_arr['calendar'] = new Calendar($mysel,$date_data);
if($current_user->hour_format != '')
$calendar_arr['calendar']->hour_format=$current_user->hour_format;
if ($viewBox == 'hourview' && ($mysel == 'day' || $mysel == 'week' || $mysel == 'month' || $mysel == 'year'))
{
$calendar_arr['calendar']->add_Activities($current_user);
}
$calendar_arr['view'] = $mysel;
calendar_layout($calendar_arr,$viewBox,$subtab);
?>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,45 @@
<?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');
global $adb;
if(isset($_REQUEST['hour_format']) && $_REQUEST['hour_format'] != '')
$hour_format = $_REQUEST['hour_format'];
else
$hour_format = 'am/pm';
$delquery = "delete from vtiger_sharedcalendar where userid=?";
$adb->pquery($delquery, array($_REQUEST["current_userid"]));
$selectedid = $_REQUEST['shar_userid'];
$sharedid = explode (";",$selectedid);
if(isset($sharedid) && $sharedid != null)
{
foreach($sharedid as $sid)
{
if($sid != '')
{
$sql = "insert into vtiger_sharedcalendar values (?,?)";
$adb->pquery($sql, array($_REQUEST["current_userid"], $sid));
}
}
}
if(isset($_REQUEST['start_hour']) && $_REQUEST['start_hour'] != '')
{
$sql = "update vtiger_users set start_hour=? where id=?";
$adb->pquery($sql, array($_REQUEST['start_hour'], $current_user->id));
}
$sql = "update vtiger_users set hour_format=? where id=?";
$adb->pquery($sql, array($hour_format, $current_user->id));
RecalculateSharingRules();
header("Location: index.php?action=index&module=Calendar&view=".vtlib_purify($_REQUEST['view'])."&hour=".vtlib_purify($_REQUEST['hour'])."&day=".vtlib_purify($_REQUEST['day'])."&month=".vtlib_purify($_REQUEST['month'])."&year=".vtlib_purify($_REQUEST['year'])."&viewOption=".vtlib_purify($_REQUEST['viewOption'])."&subtab=".vtlib_purify($_REQUEST['subtab'])."&parenttab=".getParentTab());
?>
@@ -0,0 +1,64 @@
<?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');
global $adb;
$idlist = $_REQUEST['idlist'];
if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '' && $_REQUEST['destination_module'] == 'Contacts')
{
//split the string and store in an array
$storearray = explode (";",trim($idlist,";"));
foreach($storearray as $id)
{
if($id != '')
{
$record = vtlib_purify($_REQUEST['parentid']);
$sql = "insert into vtiger_cntactivityrel values (?,?)";
$adb->pquery($sql, array($id, $_REQUEST["parentid"]));
}
}
header("Location: index.php?action=CallRelatedList&module=Calendar&activity_mode=Events&record=".$record);
}
elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '' && $_REQUEST['destination_module'] == 'Contacts')
{
$record = vtlib_purify($_REQUEST["parentid"]);
$sql = "insert into vtiger_cntactivityrel values (?,?)";
$adb->pquery($sql, array($_REQUEST["entityid"], $_REQUEST["parentid"]));
header("Location: index.php?action=DetailView&module=Calendar&activity_mode=Events&record=".$record);
}
//This if for adding the vtiger_users
if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '' && $_REQUEST['destination_module'] == 'Users')
{
//split the string and store in an array
$storearray = explode (";",$idlist);
foreach($storearray as $id)
{
if($id != '')
{
$record = vtlib_purify($_REQUEST['parentid']);
$sql = "insert into vtiger_salesmanactivityrel values (?,?)";
$adb->pquery($sql, array($id, $_REQUEST["parentid"]));
}
}
header("Location: index.php?action=DetailView&module=Calendar&activity_mode=Events&record=".$record);
}
elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '' && $_REQUEST['destination_module'] == 'Users')
{
$record = vtlib_purify($_REQUEST['parentid']);
$sql = "insert into vtiger_salesmanactivityrel values (?,?)";
$adb->pquery($sql, array($_REQUEST["entityid"], $_REQUEST["parentid"]));
header("Location: index.php?action=DetailView&module=Calendar&activity_mode=Events&record=".$record);
}
?>
@@ -0,0 +1,45 @@
<?php
$mod_strings = array (
'LBL_MODULE_NAME' => '电话',
'LBL_MODULE_TITLE' => '电话: 首页',
'LBL_SEARCH_FORM_TITLE' => '查找电话',
'LBL_LIST_FORM_TITLE' => '电话列表',
'LBL_NEW_FORM_TITLE' => '计划客户电话',
'LBL_LIST_CLOSE' => '完成',
'LBL_LIST_SUBJECT' => '主题',
'LBL_LIST_CONTACT' => '联系人',
'LBL_LIST_RELATED_TO' => '相关对象',
'LBL_LIST_DATE' => '开始日期',
'LBL_LIST_TIME' => '开始时间',
'LBL_LIST_DURATION' => '时间',
'LBL_SUBJECT' => '主题:',
'LBL_CONTACT_NAME' => '联系人:',
'LBL_DESCRIPTION_INFORMATION' => '描述信息:',
'LBL_DESCRIPTION' => '描述:',
'LBL_STATUS' => '状态:',
'LBL_DATE' => '开始日期:',
'LBL_DURATION' => '时间:',
'LBL_HOURS_MINUTES' => '(小时/分钟)',
'LBL_CALL' => '电话:',
'LBL_DATE_TIME' => '开始日期与时间:',
'LBL_TIME' => '开始时间:',
'LBL_HOURS_ABBREV' => '时',
'LBL_MINSS_ABBREV' => '分',
'LBL_COLON' => '',
'LBL_DEFAULT_STATUS' => '已计划',
'LNK_NEW_LEAD' => '新增线索',
'LNK_NEW_CONTACT' => '新增联系人',
'LNK_NEW_ACCOUNT' => '新增客户',
'LNK_NEW_OPPORTUNITY' => '新增商机',
'LNK_NEW_CASE' => '新增拜访',
'LNK_NEW_NOTE' => '新增备忘录',
'LNK_NEW_CALL' => '新增电话',
'LNK_NEW_EMAIL' => '新增Email',
'LNK_NEW_MEETING' => '新增会议',
'LNK_NEW_TASK' => '新增任务',
'ERR_DELETE_RECORD' => '必须指定纪录编号才能删除客户.',
'NTC_REMOVE_INVITEE' => '您确定要删除这个电话邀请吗?',
'LBL_INVITEE' => '*受邀者',
);
?>
@@ -0,0 +1,104 @@
<?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['campaignname'];
$log->debug("id is ".$focus->id);
$log->debug("name is ".$focus->name);
}
global $mod_strings;
global $app_strings,$adb;
global $theme;
global $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 (isset($focus->name)) $smarty->assign("NAME", $focus->name);
$related_array=getRelatedLists($currentModule,$focus);
// vtlib customization: Related module could be disabled, check it
if(isset($related_array)) {
foreach($related_array as $mod_key=>$mod_val) {
if($mod_key == "Contacts" || $mod_key == "Leads") {
$rel_checked=$_REQUEST[$mod_key.'_all'];
$rel_check_split=explode(";",$rel_checked);
if (is_array($mod_val)) {
$mod_val["checked"]=array();
if (isset($mod_val['entries'])) {
foreach($mod_val['entries'] as $key=>$val) {
if(in_array($key,$rel_check_split))
$related_array[$mod_key]["checked"][$key] = 'checked';
else
$related_array[$mod_key]["checked"][$key] = '';
}
}
}
}
}
}
// END
$smarty->assign("RELATEDLISTS", $related_array);
require_once('modules/CustomView/CustomView.php');
// 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));
$smarty->assign("ID",$focus->id);
$smarty->assign("MODULE",$currentmodule);
$smarty->assign("SINGLE_MOD",$app_strings['Campaign']);
$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);
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("RelatedListContents.tpl");
else
$smarty->display("RelatedLists.tpl");
}
?>
@@ -0,0 +1,42 @@
/*********************************************************************************
** 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.
********************************************************************************/
function set_return_specific_campaign(campaign_id, campaign_name) {
if(document.getElementById('from_link').value != '') {
window.opener.document.QcEditView.campaignname.value = campaign_name;
window.opener.document.QcEditView.campaignid.value = campaign_id;
} else {
window.opener.document.EditView.campaignname.value = campaign_name;
window.opener.document.EditView.campaignid.value = campaign_id;
}
}
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_todo(product_id, product_name) {
if(document.getElementById('from_link').value != '') {
window.opener.document.QcEditView.task_parent_name.value = product_name;
window.opener.document.QcEditView.task_parent_id.value = product_id;
} else {
window.opener.document.createTodo.task_parent_name.value = product_name;
window.opener.document.createTodo.task_parent_id.value = product_id;
}
}
@@ -0,0 +1,466 @@
<?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 txhe 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): ______________________________________.
********************************************************************************/
include_once('config.php');
require_once('include/logging.php');
require_once('data/SugarBean.php');
require_once('include/utils/utils.php');
require_once('modules/Contacts/Contacts.php');
require_once('modules/Leads/Leads.php');
require_once('user_privileges/default_module_view.php');
class Campaigns extends CRMEntity {
var $log;
var $db;
var $table_name = "vtiger_campaign";
var $table_index= 'campaignid';
var $tab_name = Array('vtiger_crmentity','vtiger_campaign','vtiger_campaignscf');
var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_campaign'=>'campaignid','vtiger_campaignscf'=>'campaignid');
/**
* Mandatory table for supporting custom fields.
*/
var $customFieldTable = Array('vtiger_campaignscf', 'campaignid');
var $column_fields = Array();
var $sortby_fields = Array('campaignname','smownerid','campaigntype','productname','expectedrevenue','closingdate','campaignstatus','expectedresponse','targetaudience','expectedcost');
var $list_fields = Array(
'Campaign Name'=>Array('campaign'=>'campaignname'),
'Campaign Type'=>Array('campaign'=>'campaigntype'),
'Campaign Status'=>Array('campaign'=>'campaignstatus'),
'Expected Revenue'=>Array('campaign'=>'expectedrevenue'),
'Expected Close Date'=>Array('campaign'=>'closingdate'),
'Assigned To' => Array('crmentity'=>'smownerid')
);
var $list_fields_name = Array(
'Campaign Name'=>'campaignname',
'Campaign Type'=>'campaigntype',
'Campaign Status'=>'campaignstatus',
'Expected Revenue'=>'expectedrevenue',
'Expected Close Date'=>'closingdate',
'Assigned To'=>'assigned_user_id'
);
var $list_link_field= 'campaignname';
//Added these variables which are used as default order by and sortorder in ListView
var $default_order_by = 'crmid';
var $default_sort_order = 'DESC';
//var $groupTable = Array('vtiger_campaigngrouprelation','campaignid');
var $search_fields = Array(
'Campaign Name'=>Array('vtiger_campaign'=>'campaignname'),
'Campaign Type'=>Array('vtiger_campaign'=>'campaigntype'),
);
var $search_fields_name = Array(
'Campaign Name'=>'campaignname',
'Campaign Type'=>'campaigntype',
);
// Used when enabling/disabling the mandatory fields for the module.
// Refers to vtiger_field.fieldname values.
var $mandatory_fields = Array('campaignname','createdtime' ,'modifiedtime','assigned_user_id');
function Campaigns()
{
$this->log =LoggerManager::getLogger('campaign');
$this->db = PearDatabase::getInstance();
$this->column_fields = getColumnFields('Campaigns');
}
/** Function to handle module specific operations when saving a entity
*/
function save_module($module)
{
}
// Mike Crowe Mod --------------------------------------------------------Default ordering for us
/**
* Function to get sort order
* return string $sorder - sortorder string either 'ASC' or 'DESC'
*/
function getSortOrder()
{
global $log;
$log->debug("Entering getSortOrder() method ...");
if(isset($_REQUEST['sorder']))
$sorder = $this->db->sql_escape_string($_REQUEST['sorder']);
else
$sorder = (($_SESSION['CAMPAIGN_SORT_ORDER'] != '')?($_SESSION['CAMPAIGN_SORT_ORDER']):($this->default_sort_order));
$log->debug("Exiting getSortOrder method ...");
return $sorder;
}
/**
* Function to get order by
* return string $order_by - fieldname(eg: 'campaignname')
*/
function getOrderBy()
{
global $log;
$log->debug("Entering getOrderBy() method ...");
$use_default_order_by = '';
if(PerformancePrefs::getBoolean('LISTVIEW_DEFAULT_SORTING', true)) {
$use_default_order_by = $this->default_order_by;
}
if (isset($_REQUEST['order_by']))
$order_by = $this->db->sql_escape_string($_REQUEST['order_by']);
else
$order_by = (($_SESSION['CAMPAIGN_ORDER_BY'] != '')?($_SESSION['CAMPAIGN_ORDER_BY']):($use_default_order_by));
$log->debug("Exiting getOrderBy method ...");
return $order_by;
}
// Mike Crowe Mod --------------------------------------------------------
/**
* Function to get Campaign related Contacts
* @param integer $id - campaignid
* returns related Contacts record in array format
*/
function get_contacts($id, $cur_tab_id, $rel_tab_id, $actions=false) {
global $log, $singlepane_view,$currentModule;
$log->debug("Entering get_contacts(".$id.") method ...");
$this_module = $currentModule;
$related_module = vtlib_getModuleNameById($rel_tab_id);
require_once("modules/$related_module/$related_module.php");
$other = new $related_module();
vtlib_setup_modulevars($related_module, $other);
$singular_modname = vtlib_toSingular($related_module);
$parenttab = getParentTab();
if($singlepane_view == 'true')
$returnset = '&return_module='.$this_module.'&return_action=DetailView&return_id='.$id;
else
$returnset = '&return_module='.$this_module.'&return_action=CallRelatedList&return_id='.$id;
$button = '';
// Send mail button for selected Leads
$button .= "<input title='".getTranslatedString('LBL_SEND_MAIL_BUTTON')."' class='crmbutton small edit' value='".getTranslatedString('LBL_SEND_MAIL_BUTTON')."' type='button' name='button' onclick='rel_eMail(\"$this_module\",this,\"$related_module\")'>";
$button .= '&nbsp;&nbsp;&nbsp;&nbsp';
/* To get Leads CustomView -START */
require_once('modules/CustomView/CustomView.php');
$lhtml = "<select id='cont_cv_list' class='small'><option value='None'>-- ".getTranslatedString('Select One')." --</option>";
$oCustomView = new CustomView($related_module);
$viewid = $oCustomView->getViewId($related_module);
$customviewcombo_html = $oCustomView->getCustomViewCombo($viewid, false);
$lhtml .= $customviewcombo_html;
$lhtml .= "</select>";
/* To get Leads CustomView -END */
$button .= $lhtml."<input title='".getTranslatedString('LBL_LOAD_LIST',$this_module)."' class='crmbutton small edit' value='".getTranslatedString('LBL_LOAD_LIST',$this_module)."' type='button' name='button' onclick='loadCvList(\"$related_module\",\"$id\")'>";
$button .= '&nbsp;&nbsp;&nbsp;&nbsp';
if($actions) {
if(is_string($actions)) $actions = explode(',', strtoupper($actions));
if(in_array('SELECT', $actions) && isPermitted($related_module,4, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_SELECT')." ". getTranslatedString($related_module). "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id&parenttab=$parenttab','test','width=640,height=602,resizable=0,scrollbars=0');\" value='". getTranslatedString('LBL_SELECT'). " " . getTranslatedString($related_module) ."'>&nbsp;";
}
if(in_array('ADD', $actions) && isPermitted($related_module,1, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_ADD_NEW'). " ". getTranslatedString($singular_modname) ."' class='crmbutton small create'" .
" onclick='this.form.action.value=\"EditView\";this.form.module.value=\"$related_module\"' type='submit' name='button'" .
" value='". getTranslatedString('LBL_ADD_NEW'). " " . getTranslatedString($singular_modname) ."'>&nbsp;";
}
}
$query = "SELECT vtiger_contactdetails.accountid, vtiger_account.accountname,
CASE when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name ,
vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.title,
vtiger_contactdetails.department, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid,
vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime
FROM vtiger_contactdetails
INNER JOIN vtiger_campaigncontrel ON vtiger_campaigncontrel.contactid = vtiger_contactdetails.contactid
INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid
LEFT JOIN vtiger_groups ON vtiger_groups.groupid=vtiger_crmentity.smownerid
LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id
LEFT JOIN vtiger_account ON vtiger_account.accountid = vtiger_contactdetails.accountid
WHERE vtiger_campaigncontrel.campaignid = ".$id." AND vtiger_crmentity.deleted=0";
$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
if($return_value == null) $return_value = Array();
$return_value['CUSTOM_BUTTON'] = $button;
$log->debug("Exiting get_contacts method ...");
return $return_value;
}
/**
* Function to get Campaign related Leads
* @param integer $id - campaignid
* returns related Leads record in array format
*/
function get_leads($id, $cur_tab_id, $rel_tab_id, $actions=false) {
global $log, $singlepane_view, $currentModule;
$log->debug("Entering get_leads(".$id.") method ...");
$this_module = $currentModule;
$related_module = vtlib_getModuleNameById($rel_tab_id);
require_once("modules/$related_module/$related_module.php");
$other = new $related_module();
vtlib_setup_modulevars($related_module, $other);
$singular_modname = vtlib_toSingular($related_module);
$parenttab = getParentTab();
if($singlepane_view == 'true')
$returnset = '&return_module='.$this_module.'&return_action=DetailView&return_id='.$id;
else
$returnset = '&return_module='.$this_module.'&return_action=CallRelatedList&return_id='.$id;
$button = '';
// Send mail button for selected Leads
$button .= "<input title='".getTranslatedString('LBL_SEND_MAIL_BUTTON')."' class='crmbutton small edit' value='".getTranslatedString('LBL_SEND_MAIL_BUTTON')."' type='button' name='button' onclick='rel_eMail(\"$this_module\",this,\"$related_module\")'>";
$button .= '&nbsp;&nbsp;&nbsp;&nbsp';
/* To get Leads CustomView -START */
require_once('modules/CustomView/CustomView.php');
$lhtml = "<select id='lead_cv_list' class='small'><option value='None'>-- ".getTranslatedString('Select One')." --</option>";
$oCustomView = new CustomView($related_module);
$viewid = $oCustomView->getViewId($related_module);
$customviewcombo_html = $oCustomView->getCustomViewCombo($viewid, false);
$lhtml .= $customviewcombo_html;
$lhtml .= "</select>";
/* To get Leads CustomView -END */
$button .= $lhtml."<input title='".getTranslatedString('LBL_LOAD_LIST',$this_module)."' class='crmbutton small edit' value='".getTranslatedString('LBL_LOAD_LIST',$this_module)."' type='button' name='button' onclick='loadCvList(\"$related_module\",\"$id\")'>";
$button .= '&nbsp;&nbsp;&nbsp;&nbsp';
if($actions) {
if(is_string($actions)) $actions = explode(',', strtoupper($actions));
if(in_array('SELECT', $actions) && isPermitted($related_module,4, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_SELECT')." ". getTranslatedString($related_module). "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id&parenttab=$parenttab','test','width=640,height=602,resizable=0,scrollbars=0');\" value='". getTranslatedString('LBL_SELECT'). " " . getTranslatedString($related_module) ."'>&nbsp;";
}
if(in_array('ADD', $actions) && isPermitted($related_module,1, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_ADD_NEW'). " ". getTranslatedString($singular_modname) ."' class='crmbutton small create'" .
" onclick='this.form.action.value=\"EditView\";this.form.module.value=\"$related_module\"' type='submit' name='button'" .
" value='". getTranslatedString('LBL_ADD_NEW'). " " . getTranslatedString($singular_modname) ."'>&nbsp;";
}
}
$query = "SELECT vtiger_leaddetails.*, vtiger_crmentity.crmid,vtiger_leadaddress.phone,vtiger_leadsubdetails.website,
CASE when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,
vtiger_crmentity.smownerid FROM vtiger_leaddetails
INNER JOIN vtiger_campaignleadrel ON vtiger_campaignleadrel.leadid=vtiger_leaddetails.leadid
INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_leaddetails.leadid
INNER JOIN vtiger_leadsubdetails ON vtiger_leadsubdetails.leadsubscriptionid = vtiger_leaddetails.leadid
INNER JOIN vtiger_leadaddress ON vtiger_leadaddress.leadaddressid = vtiger_leadsubdetails.leadsubscriptionid
LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id
LEFT JOIN vtiger_groups ON vtiger_groups.groupid=vtiger_crmentity.smownerid
WHERE vtiger_crmentity.deleted=0 AND vtiger_campaignleadrel.campaignid = ".$id;
$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
if($return_value == null) $return_value = Array();
$return_value['CUSTOM_BUTTON'] = $button;
$log->debug("Exiting get_leads method ...");
return $return_value;
}
/**
* Function to get Campaign related Potentials
* @param integer $id - campaignid
* returns related potentials record in array format
*/
function get_opportunities($id, $cur_tab_id, $rel_tab_id, $actions=false) {
global $log, $singlepane_view,$currentModule,$current_user;
$log->debug("Entering get_opportunities(".$id.") method ...");
$this_module = $currentModule;
$related_module = vtlib_getModuleNameById($rel_tab_id);
require_once("modules/$related_module/$related_module.php");
$other = new $related_module();
vtlib_setup_modulevars($related_module, $other);
$singular_modname = vtlib_toSingular($related_module);
$parenttab = getParentTab();
if($singlepane_view == 'true')
$returnset = '&return_module='.$this_module.'&return_action=DetailView&return_id='.$id;
else
$returnset = '&return_module='.$this_module.'&return_action=CallRelatedList&return_id='.$id;
$button = '';
if($actions && getFieldVisibilityPermission($related_module,$current_user->id,'campaignid') == '0') {
if(is_string($actions)) $actions = explode(',', strtoupper($actions));
if(in_array('SELECT', $actions) && isPermitted($related_module,4, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_SELECT')." ". getTranslatedString($related_module). "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id&parenttab=$parenttab','test','width=640,height=602,resizable=0,scrollbars=0');\" value='". getTranslatedString('LBL_SELECT'). " " . getTranslatedString($related_module) ."'>&nbsp;";
}
if(in_array('ADD', $actions) && isPermitted($related_module,1, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_ADD_NEW'). " ". getTranslatedString($singular_modname) ."' class='crmbutton small create'" .
" onclick='this.form.action.value=\"EditView\";this.form.module.value=\"$related_module\"' type='submit' name='button'" .
" value='". getTranslatedString('LBL_ADD_NEW'). " " . getTranslatedString($singular_modname) ."'>&nbsp;";
}
}
$query = "SELECT CASE when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,
vtiger_potential.related_to, vtiger_account.accountname, vtiger_potential.potentialid, vtiger_potential.potentialname,
vtiger_potential.potentialtype, vtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.closingdate,
vtiger_crmentity.crmid, vtiger_crmentity.smownerid FROM vtiger_campaign
INNER JOIN vtiger_potential ON vtiger_campaign.campaignid = vtiger_potential.campaignid
INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_potential.potentialid
LEFT JOIN vtiger_groups ON vtiger_groups.groupid=vtiger_crmentity.smownerid
LEFT JOIN vtiger_users ON vtiger_users.id=vtiger_crmentity.smownerid
LEFT JOIN vtiger_account ON vtiger_account.accountid = vtiger_potential.related_to
WHERE vtiger_campaign.campaignid = ".$id." AND vtiger_crmentity.deleted=0";
$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
if($return_value == null) $return_value = Array();
$return_value['CUSTOM_BUTTON'] = $button;
$log->debug("Exiting get_opportunities method ...");
return $return_value;
}
/**
* Function to get Campaign related Activities
* @param integer $id - campaignid
* returns related activities record in array format
*/
function get_activities($id, $cur_tab_id, $rel_tab_id, $actions=false) {
global $log, $singlepane_view,$currentModule,$current_user;
$log->debug("Entering get_activities(".$id.") method ...");
$this_module = $currentModule;
$related_module = vtlib_getModuleNameById($rel_tab_id);
require_once("modules/$related_module/Activity.php");
$other = new Activity();
vtlib_setup_modulevars($related_module, $other);
$singular_modname = vtlib_toSingular($related_module);
$parenttab = getParentTab();
if($singlepane_view == 'true')
$returnset = '&return_module='.$this_module.'&return_action=DetailView&return_id='.$id;
else
$returnset = '&return_module='.$this_module.'&return_action=CallRelatedList&return_id='.$id;
$button = '';
$button .= '<input type="hidden" name="activity_mode">';
if($actions) {
if(is_string($actions)) $actions = explode(',', strtoupper($actions));
if(in_array('ADD', $actions) && isPermitted($related_module,1, '') == 'yes') {
$button .= "<input title='".getTranslatedString('LBL_NEW'). " ". getTranslatedString('LBL_TODO', $related_module) ."' class='crmbutton small create'" .
" onclick='this.form.action.value=\"EditView\";this.form.module.value=\"$related_module\";this.form.return_module.value=\"$this_module\";this.form.activity_mode.value=\"Task\";' type='submit' name='button'" .
" value='". getTranslatedString('LBL_ADD_NEW'). " " . getTranslatedString('LBL_TODO', $related_module) ."'>&nbsp;";
}
}
$query = "SELECT vtiger_contactdetails.lastname,
vtiger_contactdetails.firstname,
vtiger_contactdetails.contactid,
vtiger_activity.*,
vtiger_seactivityrel.*,
vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
vtiger_crmentity.modifiedtime,
CASE when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,
vtiger_recurringevents.recurringtype
FROM vtiger_activity
INNER JOIN vtiger_seactivityrel
ON vtiger_seactivityrel.activityid = vtiger_activity.activityid
INNER JOIN vtiger_crmentity
ON vtiger_crmentity.crmid=vtiger_activity.activityid
LEFT JOIN vtiger_cntactivityrel
ON vtiger_cntactivityrel.activityid = vtiger_activity.activityid
LEFT JOIN vtiger_contactdetails
ON vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid
LEFT JOIN vtiger_users
ON vtiger_users.id = vtiger_crmentity.smownerid
LEFT OUTER JOIN vtiger_recurringevents
ON vtiger_recurringevents.activityid = vtiger_activity.activityid
LEFT JOIN vtiger_groups
ON vtiger_groups.groupid = vtiger_crmentity.smownerid
WHERE vtiger_seactivityrel.crmid=".$id."
AND vtiger_crmentity.deleted = 0
AND (activitytype = 'Task'
OR activitytype !='Emails')";
$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
if($return_value == null) $return_value = Array();
$return_value['CUSTOM_BUTTON'] = $button;
$log->debug("Exiting get_activities method ...");
return $return_value;
}
/*
* Function to get the secondary query part of a report
* @param - $module primary module name
* @param - $secmodule secondary module name
* returns the query string formed on fetching the related data for report for secondary module
*/
function generateReportsSecQuery($module,$secmodule){
$query = $this->getRelationQuery($module,$secmodule,"vtiger_campaign","campaignid");
$query .=" left join vtiger_crmentity as vtiger_crmentityCampaigns on vtiger_crmentityCampaigns.crmid=vtiger_campaign.campaignid and vtiger_crmentityCampaigns.deleted=0
left join vtiger_products as vtiger_productsCampaigns on vtiger_campaign.product_id = vtiger_productsCampaigns.productid
left join vtiger_campaignscf on vtiger_campaignscf.campaignid = vtiger_crmentityCampaigns.crmid
left join vtiger_groups as vtiger_groupsCampaigns on vtiger_groupsCampaigns.groupid = vtiger_crmentityCampaigns.smownerid
left join vtiger_users as vtiger_usersCampaigns on vtiger_usersCampaigns.id = vtiger_crmentityCampaigns.smownerid";
return $query;
}
/*
* Function to get the relation tables for related modules
* @param - $secmodule secondary module name
* returns the array with table names and fieldnames storing relations between module and this module
*/
function setRelationTables($secmodule){
$rel_tables = array (
"Contacts" => array("vtiger_campaigncontrel"=>array("campaignid","contactid"),"vtiger_campaign"=>"campaignid"),
"Leads" => array("vtiger_campaignleadrel"=>array("campaignid","leadid"),"vtiger_campaign"=>"campaignid"),
"Potentials" => array("vtiger_potential"=>array("campaignid","potentialid"),"vtiger_campaign"=>"campaignid"),
"Calendar" => array("vtiger_seactivityrel"=>array("crmid","activityid"),"vtiger_campaign"=>"campaignid"),
"Products" => array("vtiger_campaign"=>array("campaignid","product_id")),
);
return $rel_tables[$secmodule];
}
// Function to unlink an entity with given Id from another entity
function unlinkRelationship($id, $return_module, $return_id) {
global $log;
if(empty($return_module) || empty($return_id)) return;
if($return_module == 'Leads') {
$sql = 'DELETE FROM vtiger_campaignleadrel WHERE campaignid=? AND leadid=?';
$this->db->pquery($sql, array($id, $return_id));
} elseif($return_module == 'Contacts') {
$sql = 'DELETE FROM vtiger_campaigncontrel WHERE campaignid=? AND contactid=?';
$this->db->pquery($sql, array($id, $return_id));
} else {
$sql = 'DELETE FROM vtiger_crmentityrel WHERE (crmid=? AND relmodule=? AND relcrmid=?) OR (relcrmid=? AND module=? AND crmid=?)';
$params = array($id, $return_module, $return_id, $id, $return_module, $return_id);
$this->db->pquery($sql, $params);
}
}
}
?>
@@ -0,0 +1,13 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/Ajax/CommonAjax.php');
?>
@@ -0,0 +1,14 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
include('modules/CustomView/index.php');
?>
@@ -0,0 +1,39 @@
<?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: 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('ticket_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']);
header("Location: index.php?module=".vtlib_purify($_REQUEST['return_module'])."&action=".vtlib_purify($_REQUEST['return_action'])."&record=".vtlib_purify($_REQUEST['return_id'])."&relmodule=".vtlib_purify($_REQUEST['module'])."&parenttab=".getParentTab().$url);
?>
@@ -0,0 +1,107 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require_once('Smarty_setup.php');
require_once('include/utils/utils.php');
require_once('user_privileges/default_module_view.php');
$focus = CRMEntity::getInstance($currentModule);
if(isset($_REQUEST['record']) && $_REQUEST['record']!= null )
{
$focus->retrieve_entity_info($_REQUEST['record'],"Campaigns");
$focus->name=$focus->column_fields['campaignname'];
$focus->id = $_REQUEST['record'];
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true')
{
$focus->id = "";
}
global $app_strings,$mod_strings,$theme,$currentModule,$default_module_view,$adb;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$smarty = new vtigerCRM_Smarty;
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
else $smarty->assign("NAME", "");
$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields));
$smarty->assign("CUSTOMFIELD", $cust_fld);
$smarty->assign("SINGLE_MOD",'Campaign');
$category = getParentTab();
$smarty->assign("CATEGORY",$category);
if(isPermitted("Campaigns","EditView",$_REQUEST['record']) == 'yes')
$smarty->assign("EDIT_DUPLICATE","permitted");
if(isPermitted("Campaigns","Delete",$_REQUEST['record']) == 'yes')
$smarty->assign("DELETE","permitted");
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
$smarty->assign("ID", vtlib_purify($_REQUEST['record']));
// 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
$tabid = getTabid("Campaigns");
$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("IS_REL_LIST",isPresentRelatedLists($currentModule));
if($singlepane_view == 'true')
{
$related_array = getRelatedLists($currentModule,$focus);
$smarty->assign("RELATEDLISTS", $related_array);
}
$smarty->assign("SinglePane_View", $singlepane_view);
$smarty->assign("TODO_PERMISSION",CheckFieldPermission('parent_id','Calendar'));
$smarty->assign("EVENT_PERMISSION",CheckFieldPermission('parent_id','Events'));
$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);
}
// Record Change Notification
$focus->markAsViewed($current_user->id);
// END
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display("DetailView.tpl");
$focus->id = $_REQUEST['record'];
?>
@@ -0,0 +1,45 @@
<?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;
$local_log =& LoggerManager::getLogger('CampaignsAjax');
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,"Campaigns");
$modObj->column_fields[$fieldname] = $fieldvalue;
$modObj->id = $crmid;
$modObj->mode = "edit";
$modObj->save("Campaigns");
if($modObj->id != "")
{
echo ":#:SUCCESS";
}else
{
echo ":#:FAILURE";
}
}else
{
echo ":#:FAILURE";
}
}
?>
@@ -0,0 +1,131 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require_once('Smarty_setup.php');
require_once('include/utils/utils.php');require_once('modules/Campaigns/Campaigns.php');
global $app_strings,$mod_strings,$currentModule,$theme;
$focus = CRMEntity::getInstance($currentModule);
$smarty = new vtigerCRM_Smarty();
//added to fix the issue4600
$searchurl = getBasic_Advance_SearchURL();
$smarty->assign("SEARCH", $searchurl);
//4600 ends
if(isset($_REQUEST['record']) && $_REQUEST['record'] !='')
{
$focus->id = $_REQUEST['record'];
$focus->mode = 'edit';
$focus->retrieve_entity_info($_REQUEST['record'],"Campaigns");
$focus->name=$focus->column_fields['campaignname'];
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true')
{
$focus->id = "";
$focus->mode = '';
}
if(empty($_REQUEST['record']) && $focus->mode != 'edit'){
setObjectValuesFromRequest($focus);
}
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$disp_view = getView($focus->mode);
if($disp_view == 'edit_view')
$smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));
else
{
$smarty->assign("BASBLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields,'BAS'));
}
$smarty->assign("OP_MODE",$disp_view);
$smarty->assign("MODULE",$currentModule);
$smarty->assign("SINGLE_MOD",'Campaign');
$category = getParentTab();
$smarty->assign("CATEGORY",$category);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
if (isset($focus->name))
$smarty->assign("NAME", $focus->name);
else
$smarty->assign("NAME", "");
if(isset($cust_fld))
{
$smarty->assign("CUSTOMFIELD", $cust_fld);
}
$smarty->assign("ID", $focus->id);
if($focus->mode == 'edit')
{
$smarty->assign("MODE", $focus->mode);
$smarty->assign("OLDSMOWNERID", $focus->column_fields['assigned_user_id']);
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
}
if(isset($_REQUEST['return_module']))
$smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module']));
if(isset($_REQUEST['return_action']))
$smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action']));
if(isset($_REQUEST['return_id']))
$smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id']));
if(isset($_REQUEST['product_id']))
$smarty->assign("PRODUCTID", vtlib_purify($_REQUEST['product_id']));
if (isset($_REQUEST['return_viewname']))
$smarty->assign("RETURN_VIEWNAME", vtlib_purify($_REQUEST['return_viewname']));
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
$tabid = getTabid("Campaigns");
$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");
?>
@@ -0,0 +1,262 @@
<?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/Campaigns/Campaigns.php');
require_once('Smarty_setup.php');
require_once("data/Tracker.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,$mod_strings,$current_language;
$current_module_strings = return_module_language($current_language, 'Campaigns');
global $currentModule,$theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$focus = new Campaigns();
// Initialize sort by fields
$focus->initSortbyField('Campaigns');
// END
$category = getParentTab();
$smarty = new vtigerCRM_Smarty;
$other_text = Array();
$url_string = ''; // assigning http url string
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","");
}
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
$sorder = $focus->getSortOrder();
$order_by = $focus->getOrderBy();
$_SESSION['CAMPAIGN_ORDER_BY'] = $order_by;
$_SESSION['CAMPAIGN_SORT_ORDER'] = $sorder;
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
{
list($where, $ustring) = split("#@@#",getWhereCondition($currentModule));
// we have a query
$url_string .="&query=true".$ustring;
$log->info("Here is the where clause for the list view: $where");
$smarty->assign("SEARCH_URL",$url_string);
}
//<<<<cutomview>>>>>>>
$oCustomView = new CustomView("Campaigns");
$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);
$smarty->assign("CHANGE_OWNER",getUserslist());
$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
//<<<<<customview>>>>>
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;
}
// Buttons and View options
if(isPermitted('Campaigns','Delete','') == 'yes')
{
$other_text ['del']=$app_strings[LBL_MASS_DELETE];
}
if(isPermitted('Campaigns','EditView','') == 'yes')
{
$other_text['mass_edit'] = $app_strings[LBL_MASS_EDIT];
$other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
if($viewnamedesc['viewname'] == 'All')
{
$smarty->assign("ALL", 'All');
}
$smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("MODULE",$currentModule);
$smarty->assign("BUTTONS",$other_text);
$smarty->assign("CATEGORY",$category);
$smarty->assign("SINGLE_MOD",'Campaign');
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if($viewid != "0")
{
$listquery = getListQuery("Campaigns");
$list_query = $oCustomView->getModifiedCvListQuery($viewid,$listquery,"Campaigns");
}
else
{
$list_query = getListQuery("Campaigns");
}
//<<<<<<<<customview>>>>>>>>>
if(isset($where) && $where != '')
{
$list_query .= ' and '.$where;
}
//sort by "assignedto" and default sort by "ticketid"(DESC)
if(isset($order_by) && $order_by != '')
{
if($order_by == 'smownerid')
{
if( $adb->dbType == "pgsql")
$list_query .= ' GROUP BY user_name';
$list_query .= ' ORDER BY user_name '.$sorder;
}
else
{
$tablename = getTableNameForField('Campaigns',$order_by);
$tablename = (($tablename != '')?($tablename."."):'');
if( $adb->dbType == "pgsql")
$list_query .= ' GROUP BY '.$tablename.$order_by;
$list_query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder;
}
}
else
{
if( $adb->dbType == "pgsql")
$list_query .= ' GROUP BY vtiger_campaign.campaignid';
$list_query .= ' ORDER BY vtiger_campaign.campaignid DESC';
}
//Postgres 8 fixes
if( $adb->dbType == "pgsql")
$list_query = fixPostgresQuery( $list_query, $log, 0);
if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){
$count_result = $adb->query( mkCountQuery( $list_query));
$noofrows = $adb->query_result($count_result,0,"count");
}else{
$noofrows = null;
}
$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true');
$start = ListViewSession::getRequestCurrentPage($currentModule, $list_query, $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start,$list_max_entries_per_page,$noofrows);
$limit_start_rec = ($start-1) * $list_max_entries_per_page;
if( $adb->dbType == "pgsql")
$list_result = $adb->pquery($list_query. " OFFSET $limit_start_rec LIMIT $list_max_entries_per_page", array());
else
$list_result = $adb->pquery($list_query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array());
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec);
$smarty->assign('recordListRange',$recordListRangeMsg);
//mass merge for word templates -- *Raj*17/11
while($row = $adb->fetch_array($list_result))
{
$ids[] = $row["crmid"];
}
if(isset($ids))
{
$smarty->assign("ALLIDS", implode($ids,";"));
}
//Retreive the List View Table Header
if($viewid !='')
$url_string .="&viewname=".$viewid;
$listview_header = getListViewHeader($focus,"Campaigns",$url_string,$sorder,$order_by,"",$oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search = getSearchListHeaderValues($focus,"Campaigns",$url_string,$sorder,$order_by,"",$oCustomView);
$smarty->assign("SEARCHLISTHEADER",$listview_header_search);
$listview_entries = getListViewEntries($focus,"Campaigns",$list_result,$navigation_array,"","","EditView","Delete",$oCustomView);
$smarty->assign("LISTENTITY", $listview_entries);
$smarty->assign("SELECT_SCRIPT", $view_script);
//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,"Campaigns","index",$viewid);
$alphabetical = AlphabeticalSearch($currentModule,'index','campaignname','true','basic',"","","","",$viewid);
$fieldnames = getAdvSearchfields($module);
$criteria = getcriteria_options();
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("NAVIGATION", $navigationOutput);
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$_SESSION[$currentModule.'_listquery'] = $list_query;
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("ListViewEntries.tpl");
else
$smarty->display("ListView.tpl");
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*********************************************************************************/
require_once 'include/ListView/ListViewPagging.php';
?>
@@ -0,0 +1,38 @@
<?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.
* Contributor(s): mmbrich
********************************************************************************/
require_once('modules/CustomView/CustomView.php');
require_once('user_privileges/default_module_view.php');
global $singlepane_view;
$cvObj = new CustomView(vtlib_purify($_REQUEST["list_type"]));
$listquery = getListQuery(vtlib_purify($_REQUEST["list_type"]));
$rs = $adb->query($cvObj->getModifiedCvListQuery(vtlib_purify($_REQUEST["cvid"]),$listquery,vtlib_purify($_REQUEST["list_type"])));
if($_REQUEST["list_type"] == "Leads"){
$reltable = "vtiger_campaignleadrel";
$relid = "leadid";
}
elseif($_REQUEST["list_type"] == "Contacts"){
$reltable = "vtiger_campaigncontrel";
$relid = "contactid";
}
while($row=$adb->fetch_array($rs)) {
$sql = "delete from $reltable where $relid = ? and campaignid = ?";
$adb->pquery($sql, array($row["crmid"], $_REQUEST['return_id']));
$adb->pquery("INSERT INTO ".$reltable." VALUES(?,?)", array($_REQUEST["return_id"], $row["crmid"]));
}
header("Location: index.php?module=Campaigns&action=CampaignsAjax&file=CallRelatedList&ajax=true&record=".vtlib_purify($_REQUEST['return_id']));
?>
@@ -0,0 +1,45 @@
<?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');
?>
@@ -0,0 +1,67 @@
<?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");
?>
@@ -0,0 +1,23 @@
<?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/Contacts/Popup.php,v 1.15 2005/04/19 15:33:44 rank Exp $
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('Popup.php');
?>
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/quickcreate.php');
?>
@@ -0,0 +1,80 @@
<?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: 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/Campaigns/Campaigns.php');
require_once('include/logging.php');
require_once('include/database/PearDatabase.php');
$focus = new Campaigns();
global $current_user;
$currencyid=fetchCurrency($current_user->id);
$rate_symbol = getCurrencySymbolandCRate($currencyid);
$rate = $rate_symbol['rate'];
//added to fix 4600
$search=vtlib_purify($_REQUEST['search_url']);
setObjectValuesFromRequest($focus);
if(isset($_REQUEST['expectedrevenue']))
{
$value = convertToDollar($_REQUEST['expectedrevenue'],$rate);
$focus->column_fields['expectedrevenue'] = $value;
}
if(isset($_REQUEST['budgetcost']))
{
$value = convertToDollar($_REQUEST['budgetcost'],$rate);
$focus->column_fields['budgetcost'] = $value;
}
if(isset($_REQUEST['actualcost']))
{
$value = convertToDollar($_REQUEST['actualcost'],$rate);
$focus->column_fields['actualcost'] = $value;
}
if(isset($_REQUEST['actualroi']))
{
$value = convertToDollar($_REQUEST['actualroi'],$rate);
$focus->column_fields['actualroi'] = $value;
}
if(isset($_REQUEST['expectedroi']))
{
$value = convertToDollar($_REQUEST['expectedroi'],$rate);
$focus->column_fields['expectedroi'] = $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'];
}
$focus->save("Campaigns");
$return_id = $focus->id;
$parenttab = getParentTab();
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = vtlib_purify($_REQUEST['return_module']);
else $return_module = "Campaigns";
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']);
header("Location: index.php?action=$return_action&module=$return_module&record=$return_id&parenttab=$parenttab&start=".vtlib_purify($_REQUEST['pagenumber']).$search);
?>
@@ -0,0 +1,13 @@
<?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');
?>
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once('include/Ajax/TagCloud.php')
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*********************************************************************************/
require_once 'modules/Home/UnifiedSearch.php';
?>
@@ -0,0 +1,17 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
include ('modules/Campaigns/ListView.php');
?>
@@ -0,0 +1,91 @@
<?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: Defines the English language pack
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = Array(
// Added in release 5.0
'LBL_CAMPAIGN_INFORMATION'=>'Campaign Information',
'LBL_CUSTOM_INFORMATION'=>'Custom Information',
'LBL_DESCRIPTION_INFORMATION'=>'Description Information',
'LBL_EXPECTATIONS_AND_ACTUALS'=>'Expectations & Actuals',
'Campaign Name'=>'Campaign Name',
'Campaign Type'=>'Campaign Type',
'Campaign Status'=>'Campaign Status',
'Campaign ID'=>'Campaign ID',
'Expected Close Date'=>'Expected Close Date',
'Expected Revenue'=>'Expected Revenue',
'Budget Cost'=>'Budget Cost',
'Actual Cost'=>'Actual Cost',
'Expected Response'=>'Expected Response',
'Assigned To'=>'Assigned To',
'Num Sent'=>'Num Sent',
'Created Time'=>'Created Time',
'Modified Time'=>'Modified Time',
'Description'=>'Description',
'Product'=>'Product',
'Target Audience'=>'Target Audience',
'TargetSize'=>'Target Size',
'Sponsor'=>'Sponsor',
'Expected Sales Count'=>'Expected Sales Count',
'Expected Response Count'=>'Expected Response Count',
'Expected ROI'=>'Expected ROI',
'Actual Sales Count'=>'Actual Sales Count',
'Actual Response Count'=>'Actual Response Count',
'Actual ROI'=>'Actual ROI',
'Select One'=>'Select One',
'LBL_LOAD_LIST'=>'Load List',
//Added for existing Picklist Entries
'Conference'=>'Conference',
'Webinar'=>'Webinar',
'Trade Show'=>'Trade Show',
'Public Relations'=>'Public Relations',
'Partners'=>'Partners',
'Referral Program'=>'Referral Program',
'Advertisement'=>'Advertisement',
'Banner Ads'=>'Banner Ads',
'Direct Mail'=>'Direct Mail',
'Email'=>'Email',
'Telemarketing'=>'Telemarketing',
'Others'=>'Others',
'Planning'=>'Planning',
'Active'=>'Active',
'Inactive'=>'Inactive',
'Complete'=>'Complete',
'Cancelled'=>'Cancelled',
'Excellent'=>'Excellent',
'Good'=>'Good',
'Average'=>'Average',
'Poor'=>'Poor',
//Module Sequence Numbering
'Campaign No'=>'Campaign No',
// END
);
?>

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