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

[email protected]


git-svn-id: https://svn.code.sf.net/p/hawebs/svn@608 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-11-16 07:34:20 +00:00
parent 54732e27b7
commit d4658ab2b0
25 changed files with 3677 additions and 0 deletions
@@ -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,70 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $mod_strings;
global $app_strings;
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once('include/home.php');
require_once('Smarty_setup.php');
require_once('include/freetag/freetag.class.php');
$homeObj=new Homestuff;
$smarty=new vtigerCRM_Smarty;
$smarty->assign("MOD",$mod_strings);
$smarty->assign("APP",$app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH",$image_path);
if(!empty($_REQUEST['homestuffid'])){
$stuffid = $_REQUEST['homestuffid'];
}
if(!empty($_REQUEST['blockstufftype'])){
$stufftype = $_REQUEST['blockstufftype'];
}
if($stufftype=='Tag Cloud'){
$freetag = new freetag();
$smarty->assign("ALL_TAG",$freetag->get_tag_cloud_html("",$current_user->id));
$smarty->display("Home/TagCloud.tpl");
}elseif($stufftype == 'Notebook'){
$contents = $homeObj->getNoteBookContents($stuffid);
$smarty->assign("NOTEBOOK_CONTENTS",$contents);
$smarty->assign("NOTEBOOKID", $stuffid);
$smarty->display("Home/notebook.tpl");
}elseif($stufftype == 'URL'){
$url = $homeObj->getWidgetURL($stuffid);
if(strpos($url, "://") === false){
$url = "http://".trim($url);
}
$smarty->assign("URL",$url);
$smarty->assign("WIDGETID", $stuffid);
$smarty->display("Home/HomeWidgetURL.tpl");
}else{
$homestuff_values=$homeObj->getHomePageStuff($stuffid,$stufftype);
if($stufftype=="DashBoard"){
$homeObj->getDashDetails($stuffid,'type');
$dashdet=$homeObj->dashdetails;
}
}
$smarty->assign("DASHDETAILS",$dashdet);
$smarty->assign("HOME_STUFFTYPE",$stufftype);
$smarty->assign("HOME_STUFFID",$stuffid);
$smarty->assign("HOME_STUFF",$homestuff_values);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->display("Home/HomeBlock.tpl");
?>
@@ -0,0 +1,32 @@
<?php
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
include_once('vtlib/Vtiger/Feed/Parser.php');
global $app_strings, $mod_strings, $theme, $currentModule;
$ftimeout = 60;
$fparser = new Vtiger_Feed_Parser();
$fparser->vt_dofetch('http://www.vtiger.com/products/crm/newsfeed.php', $ftimeout);
$items = $fparser->get_items();
$NEWSLIST = Array();
foreach($items as $item) {
$NEWSLIST[] = $item;
}
require_once('Smarty_setup.php');
$smarty = new vtigerCRM_Smarty;
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", "themes/$theme/images/");
$smarty->assign('NEWSLIST', $NEWSLIST);
$smarty->display("HomeNews.tpl");
?>
+208
View File
@@ -0,0 +1,208 @@
<?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.
*******************************************************************************/
/**
* this file will contain the utility functions for Home module
*/
/**
* function to get upcoming activities for today
* @param integer $maxval - the maximum number of records to display
* @param integer $calCnt - returns the count query if this is set
* return array $values - activities record in array format
*/
function homepage_getUpcomingActivities($maxval,$calCnt){
require_once("data/Tracker.php");
require_once('include/utils/utils.php');
global $adb;
global $current_user;
$today = date("Y-m-d", time());
$upcoming_condition = " AND (date_start = '$today' OR vtiger_recurringevents.recurringdate = '$today')";
$list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,".
"vtiger_crmentity.setype, vtiger_recurringevents.recurringdate, vtiger_activity.* ".
"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";
$list_query .= getNonAdminAccessControlQuery('Calendar',$current_user);
$list_query .= "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;
$list_query.= " GROUP BY vtiger_activity.activityid";
$list_query.= " ORDER BY date_start,time_start ASC";
$list_query.= " limit $maxval";
$res = $adb->query($list_query);
$noofrecords = $adb->num_rows($res);
if($calCnt == 'calculateCnt'){
return $noofrecords;
}
$open_activity_list = array();
if ($noofrecords>0){
for($i=0;$i<$noofrecords;$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'),
);
}
}
$values = getActivityEntries($open_activity_list);
$values['ModuleName'] = 'Calendar';
$values['search_qry'] = "&action=ListView&from_homepage=upcoming_activities";
return $values;
}
/**
* this function returns the activity entries in array format
* it takes in an array containing activity details as a parameter
* @param array $open_activity_list - the array containing activity details
* return array $values - activities record in array format
*/
function getActivityEntries($open_activity_list){
global $current_language, $app_strings;
$current_module_strings = return_module_language($current_language, 'Calendar');
if(!empty($open_activity_list)){
$header=array();
$header[] =$current_module_strings['LBL_LIST_SUBJECT'];
$header[] =$current_module_strings['Type'];
$entries = array();
foreach($open_activity_list as $event){
$recur_date=preg_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"].'" style="'.$font_color.';">'.$event["name"].'</a>',
'1' => $event["type"],
);
}
$values = array('noofactivities'=>count($open_activity_list),'Header'=>$header,'Entries'=>$entries);
}else{
$values = array('noofactivities'=>count($open_activity_list), 'Entries'=>
'<div class="componentName">'.$app_strings['LBL_NO_DATA'].'</div>');
}
return $values;
}
/**
* function to get pending activities for today
* @param integer $maxval - the maximum number of records to display
* @param integer $calCnt - returns the count query if this is set
* return array $values - activities record in array format
*/
function homepage_getPendingActivities($maxval,$calCnt){
require_once("data/Tracker.php");
require_once("include/utils/utils.php");
require_once('include/utils/CommonUtils.php');
global $adb;
global $current_user;
$today = date("Y-m-d", time());
$pending_condition = " AND (due_date = '$today' OR vtiger_recurringevents.recurringdate = '$today')";
$list_query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.".
"setype, vtiger_recurringevents.recurringdate, vtiger_activity.* 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".
$list_query .= getNonAdminAccessControlQuery('Calendar',$current_user);
$list_query .= "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;
$list_query.= " GROUP BY vtiger_activity.activityid";
$list_query.= " ORDER BY date_start,time_start ASC";
$list_query.= " limit $maxval";
$res = $adb->query($list_query);
$noofrecords = $adb->num_rows($res);
if($calCnt == 'calculateCnt'){
return $noofrecords;
}
$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'),
);
}
}
$values = getActivityEntries($open_activity_list);
$values['ModuleName'] = 'Calendar';
$values['search_qry'] = "&action=ListView&from_homepage=pending_activities";
return $values;
}
/**
* this function returns the number of columns in the home page for the current user.
* if nothing is found in the database it returns 4 by default
* return integer $data - the number of columns
*/
function getNumberOfColumns(){
global $current_user, $adb;
$sql = "select * from vtiger_home_layout where userid=?";
$result = $adb->pquery($sql, array($current_user->id));
if($adb->num_rows($result)>0){
$data = $adb->query_result($result,0,"layout");
}else{
$data = 4; //default is 4 column layout for now
}
return $data;
}
?>
@@ -0,0 +1,77 @@
<?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.
*
*********************************************************************************/
/**
* @author MAK
*/
global $mod_strings;
global $app_strings;
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once('include/home.php');
require_once('Smarty_setup.php');
require_once('include/freetag/freetag.class.php');
$homeObj=new Homestuff;
Zend_Json::$useBuiltinEncoderDecoder = true;
$widgetInfoList = Zend_Json::decode($_REQUEST['widgetInfoList']);
$widgetInfoList = Zend_Json::decode($_REQUEST['widgetInfoList']);
$widgetHTML = array();
$smarty=new vtigerCRM_Smarty;
$smarty->assign("MOD",$mod_strings);
$smarty->assign("APP",$app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH",$image_path);
foreach ($widgetInfoList as $widgetInfo) {
$widgetType = $widgetInfo['widgetType'];
$widgetId = $widgetInfo['widgetId'];
if($widgetType=='Tag Cloud'){
$freetag = new freetag();
$smarty->assign("ALL_TAG",$freetag->get_tag_cloud_html("",$current_user->id));
$html = $smarty->fetch("Home/TagCloud.tpl");
}elseif($widgetType == 'Notebook'){
$contents = $homeObj->getNoteBookContents($widgetId);
$smarty->assign("NOTEBOOK_CONTENTS",$contents);
$smarty->assign("NOTEBOOKID", $widgetId);
$html = $smarty->fetch("Home/notebook.tpl");
}elseif($widgetType == 'URL'){
$url = $homeObj->getWidgetURL($widgetId);
if(strpos($url, "://") === false){
$url = "http://".trim($url);
}
$smarty->assign("URL",$url);
$smarty->assign("WIDGETID", $widgetId);
$html = $smarty->fetch("Home/HomeWidgetURL.tpl");
}else{
$homestuff_values=$homeObj->getHomePageStuff($widgetId,$widgetType);
$html = '';
if($widgetType == "DashBoard"){
$homeObj->getDashDetails($widgetId,'type');
$dashdet=$homeObj->dashdetails;
$smarty->assign("DASHDETAILS",$dashdet);
}
}
$smarty->assign("HOME_STUFFTYPE",$widgetType);
$smarty->assign("HOME_STUFFID",$widgetId);
$smarty->assign("HOME_STUFF",$homestuff_values);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$html .= $smarty->fetch("Home/HomeBlock.tpl");
$widgetHTML[$widgetId] = $html;
}
echo Zend_JSON::encode($widgetHTML);
?>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,77 @@
<?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/home.php');
require_once('modules/Rss/Rss.php');
$oHomestuff=new Homestuff();
if(!empty($_REQUEST['stufftype'])){
$oHomestuff->stufftype=$_REQUEST['stufftype'];
}
if(!empty($_REQUEST['stufftitle'])){
if(strlen($_REQUEST['stufftitle'])>100){
$temp_str = substr($_REQUEST['stufftitle'],0,97)."...";
$oHomestuff->stufftitle= $temp_str;
}else{
$oHomestuff->stufftitle=$_REQUEST['stufftitle'];
}
// Remove HTML/PHP tags from the input
if(isset($oHomestuff->stufftitle)) {
$oHomestuff->stufftitle = strip_tags($oHomestuff->stufftitle);
}
}
if(!empty($_REQUEST['selmodule'])){
$oHomestuff->selmodule=$_REQUEST['selmodule'];
}
if(!empty($_REQUEST['maxentries'])){
$oHomestuff->maxentries=$_REQUEST['maxentries'];
}
if(!empty($_REQUEST['selFiltername'])){
$oHomestuff->selFiltername=$_REQUEST['selFiltername'];
}
if(!empty($_REQUEST['fldname'])){
$oHomestuff->fieldvalue=$_REQUEST['fldname'];
}
if(!empty($_REQUEST['txtRss'])){
$ooRss=new vtigerRSS();
if($ooRss->setRSSUrl($_REQUEST['txtRss'])){
$oHomestuff->txtRss=$_REQUEST['txtRss'];
}else{
return false;
}
}
if(!empty($_REQUEST['txtURL'])){
$oHomestuff->txtURL = $_REQUEST['txtURL'];
}
if(isset($_REQUEST['seldashbd']) && $_REQUEST['seldashbd']!=""){
$oHomestuff->seldashbd=$_REQUEST['seldashbd'];
}
if(isset($_REQUEST['seldashtype']) && $_REQUEST['seldashtype']!=""){
$oHomestuff->seldashtype=$_REQUEST['seldashtype'];
}
if(isset($_REQUEST['seldeftype']) && $_REQUEST['seldeftype']!=""){
$seldeftype=$_REQUEST['seldeftype'];
$defarr=explode(",",$seldeftype);
$oHomestuff->defaultvalue=$defarr[0];
$deftitlehash=$defarr[1];
$oHomestuff->defaulttitle=str_replace("#"," ",$deftitlehash);
}
$loaddetail=$oHomestuff->addStuff();
echo $loaddetail;
?>
@@ -0,0 +1,192 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
global $adb,$current_user, $mod_strings;
require('user_privileges/user_privileges_'.$current_user->id.'.php');
$modval=trim($_REQUEST['modname']);
$dash=trim($_REQUEST['dash']);
if(!empty($modval)){
$tabid = getTabId($modval);
$ssql = "select vtiger_customview.*, vtiger_users.user_name from vtiger_customview inner join vtiger_tab on vtiger_tab.name = vtiger_customview.entitytype
left join vtiger_users on vtiger_customview.userid = vtiger_users.id ";
$ssql .= " where vtiger_tab.tabid=?";
$sparams = array($tabid);
if($is_admin == false){
$ssql .= " and (vtiger_customview.status=0 or vtiger_customview.userid = ? or vtiger_customview.status = 3 or vtiger_customview.userid in(select vtiger_user2role.userid 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 '".$current_user_parent_role_seq."::%'))";
array_push($sparams, $current_user->id);
}
$result = $adb->pquery($ssql, $sparams);
if($adb->num_rows($result)==0){
echo $mod_strings['MSG_NO_FILTERS'];
die;
}else{
$html = '<select id=selFilterid name=selFiltername onchange=setPrimaryFld(this) class="detailedViewTextBox" onfocus="this.className=\'detailedViewTextBoxOn\'" onblur="this.className=\'detailedViewTextBox\'" style="width:60%">';
for($i=0;$i<$adb->num_rows($result);$i++){
if($adb->query_result($result,$i,'userid')==$current_user->id || $adb->query_result($result,$i,"viewname")=='All'){
$html .= "<option value='".$adb->query_result($result,$i,'cvid')."'>".$adb->query_result($result,$i,"viewname")."</option>";
}else{
$html .= "<option value='".$adb->query_result($result,$i,'cvid')."'>".$adb->query_result($result,$i,"viewname")."[".$adb->query_result($result,$i,'user_name')."]</option>";
}
}
$html .= '</select>';
}
echo $html;
}
if(!empty($dash)){
global $current_language;
$dashbd_strings = return_module_language($current_language, "Dashboard");
$graph_array = array("leadsource" => $dashbd_strings['leadsource'],
"leadstatus" => $dashbd_strings['leadstatus'],
"leadindustry" => $dashbd_strings['leadindustry'],
"salesbyleadsource" => $dashbd_strings['salesbyleadsource'],
"salesbyaccount" => $dashbd_strings['salesbyaccount'],
"salesbyuser" => $dashbd_strings['salesbyuser'],
"salesbyteam" => $dashbd_strings['salesbyteam'],
"accountindustry" => $dashbd_strings['accountindustry'],
"productcategory" => $dashbd_strings['productcategory'],
"productbyqtyinstock" => $dashbd_strings['productbyqtyinstock'],
"productbypo" => $dashbd_strings['productbypo'],
"productbyquotes" => $dashbd_strings['productbyquotes'],
"productbyinvoice" => $dashbd_strings['productbyinvoice'],
"sobyaccounts" => $dashbd_strings['sobyaccounts'],
"sobystatus" => $dashbd_strings['sobystatus'],
"pobystatus" => $dashbd_strings['pobystatus'],
"quotesbyaccounts" => $dashbd_strings['quotesbyaccounts'],
"quotesbystage" => $dashbd_strings['quotesbystage'],
"invoicebyacnts" => $dashbd_strings['invoicebyacnts'],
"invoicebystatus" => $dashbd_strings['invoicebystatus'],
"ticketsbystatus" => $dashbd_strings['ticketsbystatus'],
"ticketsbypriority" => $dashbd_strings['ticketsbypriority'],
"ticketsbycategory" => $dashbd_strings['ticketsbycategory'],
"ticketsbyuser" => $dashbd_strings['ticketsbyuser'],
"ticketsbyteam" => $dashbd_strings['ticketsbyteam'],
"ticketsbyproduct"=> $dashbd_strings['ticketsbyproduct'],
"contactbycampaign"=> $dashbd_strings['contactbycampaign'],
"ticketsbyaccount"=> $dashbd_strings['ticketsbyaccount'],
"ticketsbycontact"=> $dashbd_strings['ticketsbycontact'],);
$html='<select name=seldashbd id=seldashbd_id class="detailedViewTextBox" onfocus="this.className=\'detailedViewTextBoxOn\'" onblur="this.className=\'detailedViewTextBox\'" style="width:60%">';
foreach($graph_array as $key=>$value){
$html .='<option value="'.$key.'">'.$value.'</option>';
}
$html .= '</select>';
echo $html;
}
if(!empty($_REQUEST['primecvid'])){
$cvid=$_REQUEST['primecvid'];
$fieldmodule = vtlib_purify($_REQUEST['fieldmodname']);
$queryprime="select cvid,columnname from vtiger_cvcolumnlist where columnname not like '%::%' and cvid=?";
$result=$adb->pquery($queryprime,array($cvid));
global $current_language,$app_strings;
$fieldmod_strings = return_module_language($current_language, $fieldmodule);
if($adb->num_rows($result)==0){
echo $mod_strings['MSG_NO_FIELDS'];
die;
}else{
$html = '<select id=selPrimeFldid name=PrimeFld multiple class="detailedViewTextBox" onfocus="this.className=\'detailedViewTextBoxOn\'" onblur="this.className=\'detailedViewTextBox\'" style="width:60%">';
for($i=0;$i<$adb->num_rows($result);$i++){
$columnname=$adb->query_result($result,$i,"columnname");
if($columnname != ''){
$prifldarr=explode(":",$columnname);
$fieldname = $prifldarr[2];
$priarr=explode("_",$prifldarr[3],2); //getting field label
$prifld = str_replace("_"," ",$priarr[1]);
if($is_admin == false){
$fld_permission = getFieldVisibilityPermission($fieldmodule,$current_user->id,$fieldname);
}
if($fld_permission == 0){
$field_query = $adb->pquery("SELECT fieldlabel FROM vtiger_field WHERE fieldname = ? AND tablename = ? and vtiger_field.presence in (0,2)", array($fieldname,$prifldarr[0]));
$field_label = $adb->query_result($field_query,0,'fieldlabel');
if(trim($field_label) != '')
$html .= "<option value='".$columnname."'>".getTranslatedString($field_label, $fieldmodule)."</option>";
}
}
}
$html .= '</select>';
}
echo $html;
}
if(!empty($_REQUEST['showmaxval']) && !empty($_REQUEST['sid'])){
$sid=$_REQUEST['sid'];
$maxval=$_REQUEST['showmaxval'];
global $adb;
$query="select stufftype from vtiger_homestuff where stuffid=?";
$res=$adb->pquery($query, array($sid));
$stufftypename=$adb->query_result($res,0,"stufftype");
if($stufftypename=="Module"){
$qry="update vtiger_homemodule set maxentries=? where stuffid=?";
$result=$adb->pquery($qry, array($maxval, $sid));
}else if($stufftypename=="RSS"){
$qry="update vtiger_homerss set maxentries=? where stuffid=?";
$result=$adb->pquery($qry, array($maxval, $sid));
}else if($stufftypename=="Default"){
$qry="update vtiger_homedefault set maxentries=? where stuffid=?";
$result=$adb->pquery($qry, array($maxval, $sid));
}
echo "loadStuff(".$sid.",'".$stufftypename."')";
}
if(!empty($_REQUEST['dashVal'])){
$did=$_REQUEST['did'];
global $adb;
$qry="update vtiger_homedashbd set dashbdtype=? where stuffid=?";
$res=$adb->pquery($qry, array($_REQUEST['dashVal'], $did));
echo "loadStuff(".$did.",'DashBoard')";
}
if(!empty($_REQUEST['homestuffid'])){
$sid=$_REQUEST['homestuffid'];
global $adb;
$query="delete from vtiger_homestuff where stuffid=?";
$result=$adb->pquery($query, array($sid));
echo "SUCCESS";
}
//Sequencing of blocks starts
if(!empty($_REQUEST['matrixsequence'])){
global $adb;
$sequence = explode('_',$_REQUEST['matrixsequence']);
for($i=count($sequence)-1, $seq=0;$i>=0;$i--, $seq++){
$query = 'update vtiger_homestuff set stuffsequence=? where stuffid=?';
$result = $adb->pquery($query, array($seq, $sequence[$i]));
}
echo "<table cellpadding='10' cellspacing='0' border='0' width='100%' class='vtResultPop small'><tr><td align='center'>Layout Saved</td></tr></table>";
}
//Sequencing of blocks ends
if(isset($_REQUEST['act']) && $_REQUEST['act'] =="hide"){
$stuffid=$_REQUEST['stuffid'];
global $adb,$current_user;
$qry="update vtiger_homestuff set visible=1 where stuffid=?";
$res=$adb->pquery($qry, array($stuffid));
echo "SUCCESS";
}
//saving layout here
if(!empty($_REQUEST['layout'])){
global $adb, $current_user;
$sql = "delete from vtiger_home_layout where userid=?";
$result = $adb->pquery($sql, array($current_user->id));
$sql = "insert into vtiger_home_layout values (?, ?)";
$result = $adb->pquery($sql, array($current_user->id, $_REQUEST['layout']));
if(!$result){
echo "SUCCESS";
}
}
//layout save ends here
?>
@@ -0,0 +1,46 @@
<?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/Home/LastViewed.php,v 1.1 2004/08/17 15:05:06 gjayakrishnan Exp $
* Description: TODO: To be written.
********************************************************************************/
require_once("data/Tracker.php");
global $theme;
global $current_user;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
// Create the head of the vtiger_table.
?>
<table cellpadding="2" cellspacing="0" border="0">
<tbody>
<?php
$current_row=1;
$tracker = new Tracker();
$history = $tracker->get_recently_viewed($current_user->id);
foreach($history as $row)
{
echo <<< EOQ
<tr>
<td vAlign="top"><IMG width="20" alt="{$row['module_name']}" src="$image_path{$row['module_name']}.gif" border="0"></td>
<td noWrap><A title="[Alt+$current_row]" accessKey="$current_row" href="index.php?module=$row[module_name]&action=DetailView&record=$row[item_id]">$row[item_summary]</A></td>
</tr>
EOQ;
}
?>
</tbody></table>
@@ -0,0 +1,30 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
global $mod_strings;
global $app_strings;
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once('include/home.php');
require_once('Smarty_setup.php');
$homeObj=new Homestuff();
$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("HOME_STUFF",$homestuff_values);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->display("Home/MainHomeBlock.tpl");
?>
@@ -0,0 +1,44 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
/*********************************************************************************
* $Header: /var/cvs/vtigercrm_aegon/modules/Home/NewBlock.php,v 1.2 2007/03/01 17:47:16 jerrydgeorge Exp $
* Description: Main file for the Home module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings;
global $app_strings;
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once('include/home.php');
require_once('Smarty_setup.php');
$stuffid = $_REQUEST[stuffid];
$stufftype = $_REQUEST[stufftype];
$homeObj=new Homestuff();
$smarty=new vtigerCRM_Smarty;
$smarty->assign("MOD",$mod_strings);
$smarty->assign("APP",$app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH",$image_path);
$homeselectedframe = $homeObj->getSelectedStuff($stuffid,$stufftype);
$smarty->assign("tablestuff",$homeselectedframe);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->display("Home/MainHomeBlock.tpl");
?>
@@ -0,0 +1,31 @@
<?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.
********************************************************************************/
/**
* Created on 10-Oct-08
* this file saves the notebook contents to database
*/
echo SaveNotebookContents();
function SaveNotebookContents(){
if(empty($_REQUEST['notebookid'])){
return false;
}else{
$notebookid = $_REQUEST['notebookid'];
}
global $adb,$current_user;
$contents = $_REQUEST['contents'];
$sql = "update vtiger_notebook_contents set contents=? where userid=? and notebookid=?";
$adb->pquery($sql, array($contents, $current_user->id, $notebookid));
return true;
}
?>
File diff suppressed because it is too large Load Diff
@@ -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.
************************************************************************************/
global $app_strings, $mod_strings, $current_language, $currentModule, $current_user, $theme, $adb;
$selected_modules = array();
if(!empty($_SESSION['__UnifiedSearch_SelectedModules__']) && is_array($_SESSION['__UnifiedSearch_SelectedModules__'])) {
$selected_modules = $_SESSION['__UnifiedSearch_SelectedModules__'];
}
$allowed_modules = array();
$sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29) and vtiger_tab.presence != 1 and vtiger_field.presence in (0,2)';
$moduleres = $adb->query($sql);
while($modulerow = $adb->fetch_array($moduleres)) {
if(is_admin($current_user) || isPermitted($modulerow['name'], 'DetailView') == 'yes') {
$modulename = $modulerow['name'];
$allowed_modules[$modulename] = array(
'label' => getTranslatedString($modulename, $modulename),
'selected' => in_array($modulename, $selected_modules)
);
}
}
ksort($allowed_modules);
require_once('Smarty_setup.php');
$smarty = new vtigerCRM_Smarty();
$smarty->assign('MOD', $mod_strings);
$smarty->assign('APP', $app_strings);
$smarty->assign('THEME', $theme);
$smarty->assign('IMAGE_PATH', "themes/$theme/images/");
$smarty->assign('ALLOWED_MODULES', $allowed_modules);
$smarty->display('UnifiedSearchModules.tpl');
?>
+232
View File
@@ -0,0 +1,232 @@
/*
Copyright 2005 Rolando Gonzalez ([email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
table.chat // don't set width or height
thead.chat
tfoot.chat
tbody.chat
tr.chathea
tr.chatfoot
tr.chatbody
td.chathead
td.chathead1
td.chathead2
td.chatfoot
td.chatfoot1
td.chatfoot2
td.chatbody
td.chatbody1 // don't set width or height
td.chatbody2
td.chatbox // don't set width or height or overflow
td.chaticon
td.chattopic
td.chathide
td.chatclose
div.cumsg
div.csmsg
span.cunick
*/
*{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
}
table.chat,table.pchat{
empty-cells:show;
}
table.chat{
position:absolute;
}
thead.chat{
cursor:move;
}
td.chathead,td.chathead2,td.pchathead,td.pchathead2{
width:5px;
height:38px;
padding:0px 5px 0px 0px;
}
td.chathead1,td.pchathead1{
background-image:url(imgs/box_T.gif);
width:100%;
}
td.chathead,td.pchathead{
background-image:url(imgs/box_TL.gif);
}
td.chathead2,td.pchathead2{
background-image:url(imgs/box_TR.gif);
}
td.chaticon{
background-image:url(imgs/2tbarPrivateChat.gif);
}
td.chattopic{
background-image:url(imgs/2tbarPublicChat.gif);
background-repeat:no-repeat;
background-position:center left;
padding:0px 10px 0px 30px;
width:100%;
}
td.chattopic1{
padding:0px 10px 0px 5px;
width:100%;
text-align:left;
}
span.chatTopicNick{ font-weight:900; }
td.chathide,td.chatclose{
cursor:pointer;
}
td.chathide{
background-image:url(imgs/btn_hide.gif);
}
td.chatclose{
background-image:url(imgs/btn_close.gif);
}
td.chaticon,td.chathide,td.chatclose{
height:36px;
width:36px;
padding:31px 31px 5px 0px;
background-repeat:no-repeat;
background-position:center center;
}
td.chatbody,td.chatbody2,td.pchatbody,td.pchatbody2{
width:5px;
padding:0px 5px 0px 0px;
}
td.chatbody,td.pchatbody{
background-image:url(imgs/box_ML.gif);
}
td.chatbody1,td.pchatbody1{
background-image:url(imgs/box_M.gif);
padding:5px 5px 5px 5px;
vertical-align:top;
}
td.chatbody2,td.pchatbody2{
background-image:url(imgs/box_MR.gif);
}
td.chatfoot,td.chatfoot2,td.pchatfoot,td.pchatfoot2{
width:5px;
height:60px;
padding:60px 5px 0px 0px;
}
td.chatfoot1,td.pchatfoot1{
background-image:url(imgs/bx_B.gif);
}
td.chatfoot,td.pchatfoot{
background-image:url(imgs/box_BL.gif);
}
td.chatfoot2,td.pchatfoot2{
background-image:url(imgs/box_BR.gif);
}
div.chatbox{
background-color: #FFFFFF;
border: 1px solid #938F86;
color:#000000;
vertical-align:top;
}
/* UList */
span.cunick{
color:green;
}
div.cumsg,div.csmsg{
color:#0000ff;
margin:2px 2px 4px 2px;
}
div.csmsg{
color:#FF0000;
}
a.chat{
background-image:url(themes/images/user_icon.gif);
background-position:center left;
background-repeat:no-repeat;
color:#000000;
text-decoration:none;
display:block;
width:100px;
height:20px;
background-color:#FFFFFF;
padding:10px 5px 5px 30px;
vertical-align:middle;
}
a.chat:hover{
background-color:#DFD9CD;
}
span{
padding:0px;
margin:0px;
}
/* input */
form.cinput{
display:inline;
}
input.cinput{
background-color: #FFFFFF;
border: 1px solid #938F86;
width: 100%;
height:20px;
font-size:12px;
padding:2px 2px 2px 2px;
font-weight:bold;
color:#333333;
}
table.cinput{
width:100%;
}
tr.cinput{
}
td.cinput{
width:100%;
}
td.ckeyb{
width:32px;
height:29px;
padding:29px 32px 5px 5px;
background-repeat:no-repeat;
background-position:center center;
}
td.csubmit{
cursor:pointer;
background-image:url(imgs/btn_send.gif);
width:63px;
height:32px;
padding:32px 63px 5px 5px;
background-repeat:no-repeat;
background-position:center center;
}
span.sysb{font-weight:900;}
.chatuserlist{
font-size:14px;
text-align:left;
color:white;
background-color:#898475;
}
File diff suppressed because it is too large Load Diff
+128
View File
@@ -0,0 +1,128 @@
<?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('config.php');
require_once('include/utils/utils.php');
global $current_user;
global $adb;
$db = PearDatabase::getInstance();
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')){
header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0');
}else{
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Type: text/xml');
echo ("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n");
echo (" <rss version=\"2.0\">\n");
echo (" <channel>\n");
echo (" <title>vtigerCRM Tickets</title>\n");
echo (" <link>".$site_URL."/index.php?module=Home&action=home_rss</link>\n");
echo (" <description>test</description>\n");
echo (" <managingEditor></managingEditor>\n");
echo (" <webMaster>".$current_user->user_name."</webMaster>\n");
echo (" <lastBuildDate>" . gmdate('D, d M Y H:i:s', time()) . " GMT</lastBuildDate>\n");
echo (" <generator>vtigerCRM</generator>\n");
//retrieving notifications******************************
//<<<<<<<<<<<<<<<< start of owner notify>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$query = "select vtiger_crmentity.setype,vtiger_crmentity.crmid,vtiger_crmentity.smcreatorid,vtiger_crmentity.modifiedtime from vtiger_crmentity inner join vtiger_ownernotify on vtiger_crmentity.crmid=vtiger_ownernotify.crmid";
$result = $adb->pquery($query, array());
for($i=0;$i<$adb->num_rows($result);$i++){
$mod_notify[$i] = $adb->fetch_array($result);
if($mod_notify[$i]['setype']=='Accounts'){
$tempquery='select vtiger_accountname from vtiger_account where vtiger_accountid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$account_name=$adb->fetch_array($tempresult);
$notify_values[$i]=$account_name['accountname'];
}else if($mod_notify[$i]['setype']=='Potentials'){
$tempquery='select vtiger_potentialname from vtiger_potential where vtiger_potentialid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$potential_name=$adb->fetch_array($tempresult);
$notify_values[$i]=$potential_name['potentialname'];
}else if($mod_notify[$i]['setype']=='Contacts'){
$tempquery='select lastname from vtiger_contactdetails where contactid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$contact_name=$adb->fetch_array($tempresult);
$notify_values[$i]=$contact_name['lastname'];
}else if($mod_notify[$i]['setype']=='Leads'){
$tempquery='select lastname from vtiger_leaddetails where leadid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$lead_name=$adb->fetch_array($tempresult);
$notify_values[$i]=$lead_name['lastname'];
}else if($mod_notify[$i]['setype']=='SalesOrder'){
$tempquery='select subject from vtiger_salesorder where vtiger_salesorderid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$sales_subject=$adb->fetch_array($tempresult);
$notify_values[$i]=$sales_subject['subject'];
}else if($mod_notify[$i]['setype']=='Orders'){
$tempquery='select subject from vtiger_purchaseorder where vtiger_purchaseorderid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$purchase_subject=$adb->fetch_array($tempresult);
$notify_values[$i]=$purchase_subject['subject'];
}else if($mod_notify[$i]['setype']=='Products'){
$tempquery='select productname from vtiger_products where productid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$product_name=$adb->fetch_array($tempresult);
$notify_values[$i]=$product_name['productname'];
}else if($mod_notify[$i]['setype']=='Emails'){
$tempquery='select subject from vtiger_activity where vtiger_activityid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$email_subject=$adb->fetch_array($tempresult);
$notify_values[$i]=$email_subject['subject'];
}else if($mod_notify[$i]['setype']=='HelpDesk'){
$tempquery='select title from vtiger_troubletickets where ticketid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$HelpDesk_title=$adb->fetch_array($tempresult);
$notify_values[$i]=$HelpDesk_title['title'];
}else if($mod_notify[$i]['setype']=='Calendar'){
$tempquery='select subject from vtiger_activity where vtiger_activityid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$Activity_subject=$adb->fetch_array($tempresult);
$notify_values[$i]=$Activity_subject['subject'];
}else if($mod_notify[$i]['setype']=='Quotes'){
$tempquery='select subject from vtiger_quotes where quoteid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$quote_subject=$adb->fetch_array($tempresult);
$notify_values[$i]=$quote_subject['subject'];
}else if($mod_notify[$i]['setype']=='Invoice'){
$tempquery='select subject from vtiger_invoice where vtiger_invoiceid=?';
$tempresult=$adb->pquery($tempquery, array($mod_notify[$i]['crmid']));
$invoice_subject=$adb->fetch_array($tempresult);
$notify_values[$i]=$invoice_subject['subject'];
}
//<<<<<<<<<<<<<<<< end of owner notify>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// Variable reassignment and reformatting for author
$author_id = $db->query_result($result,$i,'smcreatorid');
$entry_author = getUserName($author_id);
$entry_author = htmlspecialchars ($entry_author);
$entry_link = $site_URL."/index.php?modules=".$mod_notify[$i]['setype']."&amp;action=DetailView&amp;record=".$mod_notify[$i]['crmid'];
$entry_link = htmlspecialchars($entry_link);
$entry_time = $db->query_result($result,$i,'modifiedtime');
echo (" <item>\n");
echo (" <title>".$mod_notify[$i]['setype']."</title>\n");
echo (" <link>".$entry_link."</link>\n");
echo (" <description>".$notify_values[$i]."</description>\n");
echo (" <author>".$entry_author."</author>\n");
echo (" <pubDate>".$entry_time."</pubDate>\n");
echo (" </item>\n");
}
echo (" </channel>\n");
echo (" </rss>\n");
?>
+106
View File
@@ -0,0 +1,106 @@
<?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/Home/index.php,v 1.28 2005/04/20 06:57:47 samk Exp $
* Description: Main file for the Home module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/home.php');
require_once('Smarty_setup.php');
require_once('modules/Home/HomeBlock.php');
require_once('include/database/PearDatabase.php');
require_once('include/utils/UserInfoUtil.php');
require_once('include/utils/CommonUtils.php');
require_once('include/freetag/freetag.class.php');
require_once 'modules/Home/HomeUtils.php';
global $app_strings, $app_list_strings, $mod_strings;
global $adb, $current_user;
global $theme;
global $current_language;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$smarty = new vtigerCRM_Smarty;
$homeObj=new Homestuff;
// Performance Optimization
$tabrows = vtlib_prefetchModuleActiveInfo();
// END
//$query="select name,tabid from vtiger_tab where tabid in (select distinct(tabid) from vtiger_field where tabid <> 29 and tabid <> 16 and tabid <>10) order by name";
// Performance Optimization: Re-written to ignore extension and inactive modules
$modulenamearr = Array();
foreach($tabrows as $resultrow) {
if($resultrow['isentitytype'] != '0') {
// Eliminate: Events, Emails
if($resultrow['tabid'] == '16' || $resultrow['tabid'] == '10' || $resultrow['name'] == 'Webmails') {
continue;
}
$modName=$resultrow['name'];
if(isPermitted($modName,'DetailView') == 'yes' && vtlib_isModuleActive($modName)){
$modulenamearr[$modName]=array($resultrow['tabid'],$modName);
}
}
}
ksort($modulenamearr); // We avoided ORDER BY in Query (vtlib_prefetchModuleActiveInfo)!
// END
//Security Check done for RSS and Dashboards
$allow_rss='no';
$allow_dashbd='no';
if(isPermitted('Rss','DetailView') == 'yes' && vtlib_isModuleActive('Rss')){
$allow_rss='yes';
}
if(isPermitted('Dashboard','DetailView') == 'yes' && vtlib_isModuleActive('Dashboard')){
$allow_dashbd='yes';
}
$homedetails = $homeObj->getHomePageFrame();
$maxdiv = sizeof($homedetails)-1;
$user_name = $current_user->column_fields['user_name'];
$buttoncheck['Calendar'] = isPermitted('Calendar','index');
$freetag = new freetag();
$numberofcols = getNumberOfColumns();
$smarty->assign("CHECK",$buttoncheck);
if(vtlib_isModuleActive('Calendar')){
$smarty->assign("CALENDAR_ACTIVE","yes");
}
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("MODULE",'Home');
$smarty->assign("CATEGORY",getParenttab('Home'));
$smarty->assign("CURRENTUSER",$user_name);
$smarty->assign("ALL_TAG",$freetag->get_tag_cloud_html("",$current_user->id));
$smarty->assign("MAXLEN",$maxdiv);
$smarty->assign("ALLOW_RSS",$allow_rss);
$smarty->assign("ALLOW_DASH",$allow_dashbd);
$smarty->assign("HOMEFRAME",$homedetails);
$smarty->assign("MODULE_NAME",$modulenamearr);
$smarty->assign("MOD",$mod_strings);
$smarty->assign("APP",$app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("LAYOUT", $numberofcols);
$widgetBlockSize = PerformancePrefs::getBoolean('HOME_PAGE_WIDGET_GROUP_SIZE', 12);
$smarty->assign('widgetBlockSize', $widgetBlockSize);
$smarty->display("Home/Homestuff.tpl");
?>
+92
View File
@@ -0,0 +1,92 @@
/*
Copyright 2005 Rolando Gonzalez ([email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
function getRequester()
{
try
{
if(window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
catch (e)
{
alert("You need a browser which supports an XMLHttpRequest Object.\nMozilla build 0.9.5 has this Object and IE5 and above.");
}
};
/*
onreadystatechange Event handler for an event that fires at every state change
readyState Object status integer:
0 = uninitialized
1 = loading
2 = loaded
3 = interactive
4 = complete
responseText String version of data returned from server process
responseXML DOM-compatible document object of data returned from server process
status Numeric code returned by server, such as 404 for "Not Found" or 200 for "OK"
statusText String message accompanying the status code
*/
function Ajax(cb)
{
var me = this;
this.requester = getRequester();
if(cb)
this.callback = cb;
else
this.callback = function(req)
{
return eval(req.responseText);
};
this.requester.onreadystatechange = function(){
switch(me.requester.readyState)
{
case 1:
case 2:
case 3:
break;
case 4:
var response = me.callback(me.requester);
break;
default:
alert("Error");
break;
}
};
this.state = function()
{
return me.requester.readyState;
};
this.process = function(url, parameters){
me.requester.open("POST", url, true);
me.requester.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
me.requester.setRequestHeader("Content-length", parameters.length);
//me.requester.setRequestHeader("Connection", "close");
me.requester.send(parameters);
};
};
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,124 @@
<?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/Home/language/en_us.lang.php,v 1.5 2005/03/04 15:18:47 jack Exp $
* Description: Defines the English language pack
********************************************************************************/
$mod_strings = Array(
'LBL_NEW_FORM_TITLE'=>'New Contact',
'LBL_FIRST_NAME'=>'First Name:',
'LBL_LAST_NAME'=>'Last Name:',
'LBL_LIST_LAST_NAME'=>'Last Name',
'LBL_ACCOUNT_NAME'=>'Account Name:',
'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
'LBL_PHONE'=>'Phone:',
'LBL_EMAIL_ADDRESS'=>'Email:',
'LBL_TOTAL'=>'Total : ',
'LBL_MY_HOME'=>'My Home',
'LBL_MODIFIED_TIME'=>'Modified Time',
'LBL_LOGIN_ID'=>'ID',
'LBL_MODIFIED_BY'=>'Modified By',
'LBL_TYPE'=>'Type',
'LBL_PIPELINE_FORM_TITLE'=>'My Pipeline',
'ERR_ONE_CHAR'=>'Please enter at least one letter or number for your search ...',
'LBL_OPEN_TASKS'=>'My Open Tasks',
'LBL_LEADS_BY_SOURCE'=>'Leads By Source',
'LBL_LEADS_BY_STATUS'=>'Leads By Status',
'LBL_UPCOMING_EVENTS'=>'Upcoming Activities',
'LBL_PENDING_EVENTS'=>'Pending Activities',
'LBL_SINGLE_PENDING_EVENT'=>'Event for Last Ten Days',
'LBL_MULTIPLE_PENDING_EVENTS'=>'Events for Last Ten Days',
'recordsforuser'=>'Records for',
'Today'=>'Today',
'This Week'=>'This Week',
'This Month'=>'This Month',
'This Year'=>'This Year',
'Last Week'=>'Last Week',
'Last 2 Days'=>'Last 2 Days',
'Last Ten Days'=>'Last Ten Days',
// Added/Updated for vtiger CRM 5.0.4
'TITLE_AJAX_CSS_POPUP_CHAT'=>'Ajax Css-Popup chat',
'User List'=>'User List',
// Added after 5.0.4 GA
//ADDED for Home Page Customization
'LBL_HOME_MODULE' => 'Module',
'LBL_HOME_RSS' => 'RSS',
'LBL_HOME_DASHBOARD' => 'Dashboard',
'LBL_HOME_STUFFTITLE'=>'Window Title',
'LBL_HOME_SHOW'=>'Show',
'LBL_HOME_FILTERBY'=>'Filter By',
'LBL_HOME_Fields'=>'Fields To Show <br>(select any two)',
'LBL_HOME_PRESSCTRL'=>'(Press "Ctrl" <br> for multiple selection)',
'LBL_HOME_RSSURL'=>'RSS URL',
'LBL_HOME_DASHBOARD_NAME'=>'DashBoard Name',
'LBL_HOME_DASHBOARD_TYPE'=>'DashBoard Type',
'LBL_HOME_HORIZONTAL_BARCHART'=>'Horizontal Bar Chart',
'LBL_HOME_VERTICAL_BARCHART'=>'Vertical Bar Chart',
'LBL_HOME_PIE_CHART'=>'Pie Chart',
'LBL_HOME_ITEMS'=>'item(s)',
'LBL_MORE'=>'More',
'LBL_SCROLL'=>'Scroll',
// vtiger CRM News
'LBL_NEWS_NO'=>'No news',
//added for home page changes
'LBL_NOTEBOOK'=>'Notebook',
'LBL_NOTEBOOK_TITLE'=>'Double-click to edit.',
'LBL_NOTEBOOK_SAVE_TITLE'=>'Click anywhere else on the page to save.',
'LBL_URL'=>'Website',
'LBL_HOME_LAYOUT'=>'Change layout',
'LBL_NUMBER_OF_COLUMNS'=>'Number of columns',
'LBL_TWO_COLUMN'=>'Two Columns',
'LBL_THREE_COLUMN'=>'Three Columns',
'LBL_FOUR_COLUMN'=>'Four Columns',
// END
// Default home page widget's title
'Top Accounts'=>'Top Accounts',
'Top Potentials'=>'Top Potentials',
'Top Quotes'=>'Top Quotes',
'Top Trouble Tickets'=>'Top Trouble Tickets',
'Top Invoices'=>'Top Invoices',
'Top Sales Orders'=>'Top Sales Orders',
'Top Purchase Orders'=>'Top Purchase Orders',
'My New Leads'=>'My New Leads',
'Key Metrics'=>'Key Metrics',
'My Group Allocation'=>'My Group Allocation',
'My Recent FAQs'=>'My Recent FAQs',
'Upcoming Activities'=>'Upcoming Activities',
'Pending Activities'=>'Pending Activities',
'Home Page Dashboard'=>'Home Page Dashboard',
'Tag Cloud'=>'Tag Cloud',
'MSG_NO_FILTERS' => 'No Filters Available',
'MSG_NO_FIELDS' => 'No Fields Available',
);
?>
@@ -0,0 +1,127 @@
<?php
/**
* Copyright (C) 2006-2010 YUCHENG HU
*
* ---------------------------------------------
* HA WEBSYSTEMS
* http://www.hawebs.net
* https://www.hawebs.org/forums/computer/
*
* CONTACT
* [email protected] / [email protected]
*
* ---------------------------------------------
* [A] GNU GENERAL PUBLIC LICENSE GNU/LGPL
* [B] Apache License, Version 2.0
*
* ---------------------------------------------
* NOTE
* 1. 所有的语言配置文件请采用 UTF-8 编码
*
* ---------------------------------------------
*/
$mod_strings = Array(
'LBL_NEW_FORM_TITLE'=>'新增联系人',
'LBL_FIRST_NAME'=>'姓名:',
'LBL_LAST_NAME'=>'姓氏:',
'LBL_LIST_LAST_NAME'=>'姓氏:',
'LBL_ACCOUNT_NAME'=>'客户名称:',
'LBL_LIST_ACCOUNT_NAME'=>'客户名称',
'LBL_PHONE'=>'电话:',
'LBL_EMAIL_ADDRESS'=>'电子邮件:',
'LBL_TOTAL'=>'总计:',
'LBL_MY_HOME'=>'我的首页',
'LBL_MODIFIED_TIME'=>'异动时间',
'LBL_LOGIN_ID'=>'代号',
'LBL_MODIFIED_BY'=>'修改者',
'LBL_TYPE'=>'类型',
'LBL_PIPELINE_FORM_TITLE'=>'我的统计图表',
'ERR_ONE_CHAR'=>'请至少输入1个字符以上的号码,以供搜寻 ...',
'LBL_OPEN_TASKS'=>'我的进行中任务',
'LBL_LEADS_BY_SOURCE'=>'准客户来源',
'LBL_LEADS_BY_STATUS'=>'准客户状态',
'LBL_UPCOMING_EVENTS'=>'未来事件',
'LBL_PENDING_EVENTS'=>'暂停事件',
'LBL_SINGLE_PENDING_EVENT'=>'最近十天事件',
'LBL_MULTIPLE_PENDING_EVENTS'=>'最近十天事件',
'recordsforuser'=>'资料于',
'Today'=>'今天',
'This Week'=>'这个星期',
'This Month'=>'这个月',
'This Year'=>'今年',
'Last Week'=>'上星期',
'Last 2 Days'=>'过去两天',
'Last Ten Days'=>'过去十天',
// Added/Updated for vtiger CRM 5.0.4
'TITLE_AJAX_CSS_POPUP_CHAT'=>'员工聊天室',
'User List'=>'使用者列表',
// Added after 5.0.4 GA
//ADDED for Home Page Customization
'LBL_HOME_MODULE'=>'模块',
'LBL_HOME_RSS'=>'RSS',
'LBL_HOME_DASHBOARD'=>'图表',
'LBL_HOME_STUFFTITLE'=>'窗口标题',
'LBL_HOME_SHOW'=>'显示',
'LBL_HOME_FILTERBY'=>'过滤',
'LBL_HOME_Fields'=>'要显示的字段<br> (选择任何两个)',
'LBL_HOME_PRESSCTRL'=>'(如需多个选择请按“ Ctrl ” 键)',
'LBL_HOME_RSSURL'=>'RSS URL',
'LBL_HOME_DASHBOARD_NAME'=>'图表名称',
'LBL_HOME_DASHBOARD_TYPE'=>'图表类型',
'LBL_HOME_HORIZONTAL_BARCHART'=>'横向柱状图',
'LBL_HOME_VERTICAL_BARCHART'=>'垂直柱状图',
'LBL_HOME_PIE_CHART'=>'饼图',
'LBL_HOME_ITEMS'=>'项目',
'LBL_MORE'=>'更多',
'LBL_SCROLL'=>'滚动',
// vtiger CRM News
'LBL_NEWS_NO'=>'没有新闻',
//added for home page changes
'LBL_NOTEBOOK'=>'笔记本',
'LBL_NOTEBOOK_TITLE'=>'双击进入编加状态.',
'LBL_NOTEBOOK_SAVE_TITLE'=>'点击页面其他部分进行保存.',
'LBL_URL'=>'网站',
'LBL_HOME_LAYOUT'=>'变更版面',
'LBL_NUMBER_OF_COLUMNS'=>'列数',
'LBL_TWO_COLUMN'=>'两列',
'LBL_THREE_COLUMN'=>'三列',
'LBL_FOUR_COLUMN'=>'四列',
// END
// Default home page widget's title
'Top Accounts'=>'最新客户',
'Top Potentials'=>'最新潜在机会',
'Top Quotes'=>'最新报价单',
'Top Trouble Tickets'=>'最新报修记录',
'Top Invoices'=>'最新发票',
'Top Sales Orders'=>'最新订单',
'Top Purchase Orders'=>'最新采购订单',
'My New Leads'=>'最新潜在客户',
'Key Metrics'=>'关键指标',
'My Group Allocation'=>'我的群组分配',
'My Recent FAQs'=>'最新常见问题',
'Upcoming Activities'=>'近期活动',
'Pending Activities'=>'即将进行的活动',
'Home Page Dashboard'=>'首页图表',
'Tag Cloud'=>'常用标签',
'MSG_NO_FILTERS'=>'无过滤器可用',
'MSG_NO_FIELDS'=>'无可用字段',
);
?>
+124
View File
@@ -0,0 +1,124 @@
<?php
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
global $mod_strings;
global $app_strings;
global $theme;
$charset = $app_strings['LBL_CHARSET'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=<?php echo $charset;?>" http-equiv="content-type"/>
<meta name="author" content="[email protected]"/>
<meta http-equiv="expires" content="-1"/>
<meta http-equiv="pragma" content="no-cache"/>
<title><?php echo $mod_strings['TITLE_AJAX_CSS_POPUP_CHAT'];?></title>
<!-- NEEDED SCRIPTS -->
<script type="text/javascript" charset="<?php echo $charset?>" src="include/js/general.js"></script>
<script type="text/javascript" charset="<?php echo $charset?>" src="modules/Home/js/ajax.js"></script>
<script type="text/javascript" charset="ISO-8859-1" src="modules/Home/js/dom-drag_p.js"></script>
<script type="text/javascript" charset="ISO-8859-1" src="modules/Home/js/css-window_p.js"></script>
<script type="text/javascript" charset="<?php echo $charset?>" src="modules/Home/js/chat.js"></script>
<!-- /NEEDED SCRIPTS -->
<script type="text/javascript">
<!--
function showPopup()
{
var conf = new Array();
conf["dt"] = 1000;
conf["width"] = "400px";
conf["height"] = "300px";
conf["ulid"] = "uli";
conf["pchatid"] = "chat";
// USED TO INITIALIZE THE SESSION, I SUGGEST CALLING THIS ON BODY onload
// Chat(<conf array>);
// NOTICE THE ChatStuff IS THE NAME OF THE ABOVE FUNCTION!!!
var mychat = new Chat(conf);
}
-->
</script>
<!-- CSS classes for the popups -->
<link rel="stylesheet" type="text/css" href="themes/<?php echo $theme;?>/chat.css"/>
</head>
<body onload="showPopup();" style="background-image:url(themes/<?php echo $theme;?>/images/site_bg.gif);color:#ffffff;">
<!-- THIS IS NEEDED FOR THE USERS LIST TO APPEAR, -->
<!-- THE id CAN BE CHANGED, BUT HAS TO BE PASSED TO UList() -->
<!-- <table>
<tr>
<td rowspan="2">
<div id="chat"></div>
</td>
<td class="chatuserlist">User List</td>
</tr>
<tr>
<td valign="top">
<ul id="uli"></ul>
</td>
</tr>
</table> -->
<!-- THIS IS NEEDED FOR DEBUG MSG'S TO APPEAR -->
<table width="550" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table width="150" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="pchathead"></td>
<td class="pchathead1"><b><?php echo $mod_strings['User List']; ?></b></td>
<td class="pchathead2"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="pchatbody"></td>
<td class="pchatbody1" style="height: 300px;text-align:left;vertical-align:top;">
<div class="chatbox" style="overflow-y:auto;overflow-x:hidden; width: 100%; height: 100%;">
<span id="uli"></span>
</div>
</td>
<td class="pchatbody2"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="pchatfoot"></td>
<td class="pchatfoot1"></td>
<td class="pchatfoot2"></td>
<td>&nbsp;</td>
</tr>
</table>
</td>
<td width="400" valign="top">
<div id="chat"></div>
</td>
</tr>
</table>
<div id="debug"></div>
</body>
</html>