This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

View File

@@ -0,0 +1,205 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
class DashletsDialog {
var $dashlets = array();
function getDashlets($category='') {
global $app_strings, $current_language, $mod_strings;
//echo $GLOBALS['sugar_config']['cache_dir'].'dashlets/dashlets.php';
require_once($GLOBALS['sugar_config']['cache_dir'].'dashlets/dashlets.php');
$categories = array( 'module' => 'Module Views',
'portal' => 'Portal',
'charts' => 'Charts',
'tools' => 'Tools',
'misc' => 'Miscellaneous',
'web' => 'Web');
$dashletStrings = array();
$dashletsList = array();
if (!empty($category)){
$dashletsList[$categories[$category]] = array();
}
else{
$dashletsList['Module Views'] = array();
$dashletsList['Charts'] = array();
$dashletsList['Tools'] = array();
$dashletsList['Web'] = array();
}
asort($dashletsFiles);
foreach($dashletsFiles as $className => $files) {
if(!empty($files['meta']) && is_file($files['meta'])) {
require_once($files['meta']); // get meta file
$directory = substr($files['meta'], 0, strrpos($files['meta'], '/') + 1);
if(is_file($directory . $files['class'] . '.' . $current_language . '.lang.php'))
require_once($directory . $files['class'] . '.' . $current_language . '.lang.php');
elseif(is_file($directory . $files['class'] . '.en_us.lang.php'))
require_once($directory . $files['class'] . '.en_us.lang.php');
// try to translate the string
if(empty($dashletStrings[$files['class']][$dashletMeta[$files['class']]['title']]))
$title = $dashletMeta[$files['class']]['title'];
else
$title = $dashletStrings[$files['class']][$dashletMeta[$files['class']]['title']];
// try to translate the string
if(empty($dashletStrings[$files['class']][$dashletMeta[$files['class']]['description']]))
$description = $dashletMeta[$files['class']]['description'];
else
$description = $dashletStrings[$files['class']][$dashletMeta[$files['class']]['description']];
// generate icon
if (!empty($dashletMeta[$files['class']]['icon'])) {
// here we'll support image inheritance if the supplied image has a path in it
// i.e. $dashletMeta[$files['class']]['icon'] = 'themes/default/images/dog.gif'
// in this case, we'll strip off the path information to check for the image existing
// in the current theme.
$imageName = SugarThemeRegistry::current()->getImageURL(basename($dashletMeta[$files['class']]['icon']), false);
if ( !empty($imageName) ) {
if (sugar_is_file($imageName))
$icon = '<img src="' . $imageName .'" border="0" align="absmiddle" />';
else
$icon = '';
}
}
else{
if (empty($dashletMeta[$files['class']]['module'])){
$icon = get_dashlets_dialog_icon('default');
}
else{
if((!in_array($dashletMeta[$files['class']]['module'], $GLOBALS['moduleList']) && !in_array($dashletMeta[$files['class']]['module'], $GLOBALS['modInvisList'])) && (!in_array('Activities', $GLOBALS['moduleList']) || !in_array($dashletMeta[$files['class']]['module'], $GLOBALS['modInvisListActivities']))){
unset($dashletMeta[$files['class']]);
continue;
}else{
$icon = get_dashlets_dialog_icon($dashletMeta[$files['class']]['module']);
}
}
}
// determine whether to display
if (!empty($dashletMeta[$files['class']]['hidden']) && $dashletMeta[$files['class']]['hidden'] === true){
//$displayDashlet = false;
}
//co: fixes 20398 to respect ACL permissions
elseif(!empty($dashletMeta[$files['class']]['module']) && (!in_array($dashletMeta[$files['class']]['module'], $GLOBALS['moduleList']) && !in_array($dashletMeta[$files['class']]['module'], $GLOBALS['modInvisList'])) && (!in_array('Activities', $GLOBALS['moduleList']) || !in_array($dashletMeta[$files['class']]['module'], $GLOBALS['modInvisListActivities']))){
$displayDashlet = false;
}
else{
$displayDashlet = true;
//check ACL ACCESS
if(!empty($dashletMeta[$files['class']]['module']) && ACLController::moduleSupportsACL($dashletMeta[$files['class']]['module'])){
$type = 'module';
if($dashletMeta[$files['class']]['module'] == 'Trackers')
$type = 'Tracker';
if(!ACLController::checkAccess($dashletMeta[$files['class']]['module'], 'view', true, $type)){
$displayDashlet = false;
}
if(!ACLController::checkAccess($dashletMeta[$files['class']]['module'], 'list', true, $type)){
$displayDashlet = false;
}
}
}
if ($dashletMeta[$files['class']]['category'] == 'Charts'){
$type = 'predefined_chart';
}
else{
$type = 'module';
}
if ($displayDashlet && isset($dashletMeta[$files['class']]['dynamic_hide']) && $dashletMeta[$files['class']]['dynamic_hide']){
if ( file_exists($files['file']) ) {
require_once($files['file']);
if ( class_exists($files['class']) ) {
$dashletClassName = $files['class'];
$displayDashlet = call_user_func(array($files['class'],'shouldDisplay'));
}
}
}
if ($displayDashlet){
$cell = array( 'title' => $title,
'description' => $description,
'onclick' => 'return SUGAR.mySugar.addDashlet(\'' . $className . '\', \'' . $type . '\', \''.(!empty($dashletMeta[$files['class']]['module']) ? $dashletMeta[$files['class']]['module'] : '' ) .'\');',
'icon' => $icon, );
if (!empty($category) && $dashletMeta[$files['class']]['category'] == $categories[$category]){
array_push($dashletsList[$categories[$category]], $cell);
}
else if (empty($category)){
array_push($dashletsList[$dashletMeta[$files['class']]['category']], $cell);
}
}
}
}
if (!empty($category)){
asort($dashletsList[$categories[$category]]);
}
else{
foreach($dashletsList as $key=>$value){
asort($dashletsList[$key]);
}
}
$this->dashlets = $dashletsList;
}
}
?>

402
include/MySugar/MySugar.php Executable file
View File

@@ -0,0 +1,402 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
class MySugar{
var $type;
function MySugar($type){
$this->type = $type;
}
function checkDashletDisplay () {
if((!in_array($this->type, $GLOBALS['moduleList'])
&& !in_array($this->type, $GLOBALS['modInvisList']))
&& (!in_array('Activities', $GLOBALS['moduleList']) || !in_array($this->type, $GLOBALS['modInvisListActivities']))){
$displayDashlet = false;
}
elseif (ACLController::moduleSupportsACL($this->type) && !ACLController::checkAccess($this->type,'list',true)) {
$displayDashlet = false;
}
else{
$displayDashlet = true;
}
return $displayDashlet;
}
function addDashlet(){
if(!is_file($GLOBALS['sugar_config']['cache_dir'].'dashlets/dashlets.php')) {
require_once('include/Dashlets/DashletCacheBuilder.php');
$dc = new DashletCacheBuilder();
$dc->buildCache();
}
require_once($GLOBALS['sugar_config']['cache_dir'].'dashlets/dashlets.php');
global $current_user;
if(isset($_REQUEST['id'])){
$pages = $current_user->getPreference('pages', $this->type);
$dashlets = $current_user->getPreference('dashlets', $this->type);
$guid = create_guid();
$options = array();
if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'web') {
$dashlet_module = 'Home';
$options['url'] = $_REQUEST['type_module'];
$fp = @fopen($options['url'],'r');
if ( $fp ) {
$page = fread($fp,8192);
$matches = array();
preg_match("/<title>(.*)<\/title>/i",$page,$matches);
if ( isset($matches[1]) )
$options['title'] = str_replace('<![CDATA[','',str_replace(']]>','',$matches[1]));
fclose($fp);
}
}
elseif (isset($_REQUEST['type_module'])) {
$dashlet_module = $_REQUEST['type_module'];
}
elseif (isset($dashletsFiles[$_REQUEST['id']]['module'])) {
$dashlet_module = $dashletsFiles[$_REQUEST['id']]['module'];
}
else {
$dashlet_module = 'Home';
}
$dashlets[$guid] = array('className' => $dashletsFiles[$_REQUEST['id']]['class'],
'module' => $dashlet_module,
'options' => $options,
'fileLocation' => $dashletsFiles[$_REQUEST['id']]['file']);
// add to beginning of the array
array_unshift($pages[$_REQUEST['activeTab']]['columns'][0]['dashlets'], $guid);
$current_user->setPreference('dashlets', $dashlets, 0, $this->type);
echo $guid;
}
else {
echo 'ofdaops';
}
}
function displayDashlet(){
global $current_user, $mod_strings;
if(!empty($_REQUEST['id'])) {
$id = $_REQUEST['id'];
$dashlets = $current_user->getPreference('dashlets', $this->type);
require_once($dashlets[$id]['fileLocation']);
$dashlet = new $dashlets[$id]['className']($id, (isset($dashlets[$id]['options']) ? $dashlets[$id]['options'] : array()));
if(!empty($_REQUEST['configure']) && $_REQUEST['configure']) { // save settings
$dashletDefs[$id]['options'] = $dashlet->saveOptions($_REQUEST);
$current_user->setPreference('dashlets', $dashletDefs, 0, $this->type);
}
if(!empty($_REQUEST['dynamic']) && $_REQUEST['dynamic'] == 'true' && $dashlet->hasScript) {
$dashlet->isConfigurable = false;
echo $dashlet->getTitle('') . $mod_strings['LBL_RELOAD_PAGE'];
}
else {
$dashlet->process();
$contents = $dashlet->display();
// Many dashlets expect to be able to initialize in the display() function, so we have to create the header second
echo $dashlet->getHeader();
echo $contents;
echo $dashlet->getFooter();
}
}
else {
header("Location: index.php?action=index&module=". $this->type);
}
}
function getPredefinedChartScript(){
global $current_user, $mod_strings;
if(!empty($_REQUEST['id'])) {
$id = $_REQUEST['id'];
$dashlets = $current_user->getPreference('dashlets', $this->type);
require_once($dashlets[$id]['fileLocation']);
$dashlet = new $dashlets[$id]['className']($id, (isset($dashlets[$id]['options']) ? $dashlets[$id]['options'] : array()));
$dashlet->process();
echo $dashlet->displayScript();
}
else {
header("Location: index.php?action=index&module=". $this->type);
}
}
function deleteDashlet(){
global $current_user;
if(!empty($_REQUEST['id'])) {
$pages = $current_user->getPreference('pages', $this->type);
$dashlets = $current_user->getPreference('dashlets', $this->type);
$activePage = '0';
foreach($pages[$activePage]['columns'] as $colNum => $column) {
foreach($column['dashlets'] as $num => $dashletId) {
if($dashletId == $_REQUEST['id']) {
unset($pages[$activePage]['columns'][$colNum]['dashlets'][$num]);
}
}
}
foreach($dashlets as $dashletId => $data) {
if($dashletId == $_REQUEST['id']) {
unset($dashlets[$dashletId]);
}
}
$current_user->setPreference('dashlets', $dashlets, 0, $this->type);
$current_user->setPreference('pages', $pages, 0, $this->type);
echo '1';
}
else {
echo 'oops';
}
}
function dashletsDialog(){
require_once('include/MySugar/DashletsDialog/DashletsDialog.php');
global $current_language, $app_strings;
$chartsList = array();
$DashletsDialog = new DashletsDialog();
// echo 'test';
$DashletsDialog->getDashlets();
// echo 'test2';
$allDashlets = $DashletsDialog->dashlets;
$dashletsList = $allDashlets['Module Views'];
$chartsList = $allDashlets['Charts'];
$toolsList = $allDashlets['Tools'];
$sugar_smarty = new Sugar_Smarty();
$mod_strings = return_module_language($current_language, 'Home');
$sugar_smarty->assign('LBL_CLOSE_DASHLETS', $mod_strings['LBL_CLOSE_DASHLETS']);
$sugar_smarty->assign('LBL_ADD_DASHLETS', $mod_strings['LBL_ADD_DASHLETS']);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('moduleName', $this->type);
if ($this->type == 'Home'){
$sugar_smarty->assign('modules', $dashletsList);
$sugar_smarty->assign('tools', $toolsList);
}
$sugar_smarty->assign('charts', $chartsList);
$html = $sugar_smarty->fetch('include/MySugar/tpls/addDashletsDialog.tpl');
// Bug 34451 - Added hack to make the "Add Dashlet" dialog window not look weird in IE6.
$script = <<<EOJS
if (YAHOO.env.ua.ie > 5 && YAHOO.env.ua.ie < 7) {
document.getElementById('dashletsList').style.width = '430px';
document.getElementById('dashletsList').style.overflow = 'hidden';
}
EOJS;
$json = getJSONobj();
echo 'response = ' . $json->encode(array('html' => $html, 'script' => $script));
}
function searchModuleToolsDashlets($searchStr, $category){
require_once('include/MySugar/DashletsDialog/DashletsDialog.php');
global $app_strings;
$DashletsDialog = new DashletsDialog();
switch($category){
case 'module':
$DashletsDialog->getDashlets('module');
$dashletIndex = 'Module Views';
$searchCategoryString = $app_strings['LBL_SEARCH_MODULES'];
break;
case 'tools':
$DashletsDialog->getDashlets('tools');
$dashletIndex = 'Tools';
$searchCategoryString = $app_strings['LBL_SEARCH_TOOLS'];
default:
break;
}
$allDashlets = $DashletsDialog->dashlets;
$searchResult = array();
$searchResult[$dashletIndex] = array();
foreach($allDashlets[$dashletIndex] as $dashlet){
if (stripos($dashlet['title'], $searchStr) !== false){
array_push($searchResult[$dashletIndex], $dashlet);
}
}
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('lblSearchResults', $app_strings['LBL_SEARCH_RESULTS']);
$sugar_smarty->assign('lblSearchCategory', $searchCategoryString);
$sugar_smarty->assign('moduleName', $this->type);
$sugar_smarty->assign('searchString', $searchStr);
$sugar_smarty->assign('dashlets', $searchResult[$dashletIndex]);
return $sugar_smarty->fetch('include/MySugar/tpls/dashletsSearchResults.tpl');
}
function searchChartsDashlets($searchStr){
require_once('include/MySugar/DashletsDialog/DashletsDialog.php');
global $current_language, $app_strings;
$chartsList = array();
$DashletsDialog = new DashletsDialog();
$DashletsDialog->getDashlets('charts');
$allDashlets = $DashletsDialog->dashlets;
foreach($allDashlets as $category=>$dashlets){
$searchResult[$category] = array();
foreach($dashlets as $dashlet){
if (stripos($dashlet['title'], $searchStr) !== false){
array_push($searchResult[$category],$dashlet);
}
}
}
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('lblSearchResults', $app_strings['LBL_SEARCH_RESULTS']);
$sugar_smarty->assign('searchString', $searchStr);
$sugar_smarty->assign('charts', $searchResult['Charts']);
return $sugar_smarty->fetch('include/MySugar/tpls/chartDashletsSearchResults.tpl');
}
function searchDashlets(){
$searchStr = $_REQUEST['search'];
$category = $_REQUEST['category'];
if ($category == 'module' || $category == 'tools'){
$html = $this->searchModuleToolsDashlets($searchStr, $category);
}
else if ($category == 'chart'){
$html = $this->searchChartsDashlets($searchStr);
}
$json = getJSONobj();
echo 'response = ' . $json->encode(array('html' => $html, 'script' => ''));
}
function configureDashlet(){
global $current_user, $app_strings, $mod_strings;
if(!empty($_REQUEST['id'])) {
$id = $_REQUEST['id'];
$dashletDefs = $current_user->getPreference('dashlets', $this->type); // load user's dashlets config
$dashletLocation = $dashletDefs[$id]['fileLocation'];
require_once($dashletDefs[$id]['fileLocation']);
$dashlet = new $dashletDefs[$id]['className']($id, (isset($dashletDefs[$id]['options']) ? $dashletDefs[$id]['options'] : array()));
if(!empty($_REQUEST['configure']) && $_REQUEST['configure']) { // save settings
$dashletDefs[$id]['options'] = $dashlet->saveOptions($_REQUEST);
$current_user->setPreference('dashlets', $dashletDefs, 0, $this->type);
}
else { // display options
$json = getJSONobj();
return 'result = ' . $json->encode((array('header' => $dashlet->title . ' : ' . $app_strings['LBL_OPTIONS'],
'body' => $dashlet->displayOptions())));
}
}
else {
return '0';
}
}
function saveLayout(){
global $current_user;
if(!empty($_REQUEST['layout'])) {
$newColumns = array();
$newLayout = explode('|', $_REQUEST['layout']);
$pages = $current_user->getPreference('pages', $this->type);
$newColumns = $pages[$_REQUEST['selectedPage']]['columns'];
foreach($newLayout as $col => $ids) {
$newColumns[$col]['dashlets'] = explode(',', $ids);
}
$pages[$_REQUEST['selectedPage']]['columns'] = $newColumns;
$current_user->setPreference('pages', $pages, 0, $this->type);
return '1';
}
else {
return '0';
}
}
}
?>

View File

@@ -0,0 +1,75 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
SUGAR.mySugar=function(){var originalLayout=null;var configureDashletId=null;var currentDashlet=null;var leftColumnInnerHTML=null;var leftColObj=null;var maxCount;var warningLang;var activeTab=activePage;var current_user=current_user_id;var module=moduleName;var charts=new Object();if(module=='Dashboard'){cookiePageIndex=current_user+"_activeDashboardPage";}
else{cookiePageIndex=current_user+"_activePage";}
var homepage_dd;return{clearChartsArray:function(){charts[activeTab]=new Object();},addToChartsArray:function(name,xmlFile,width,height,styleSheet,colorScheme,langFile){if(charts[activeTab]==null){charts[activeTab]=new Object();}
charts[activeTab][name]=new Object();charts[activeTab][name]['name']=name;charts[activeTab][name]['xmlFile']=xmlFile;charts[activeTab][name]['width']=width;charts[activeTab][name]['height']=height;charts[activeTab][name]['styleSheet']=styleSheet;charts[activeTab][name]['colorScheme']=colorScheme;charts[activeTab][name]['langFile']=langFile;},loadSugarChart:function(name,xmlFile,width,height,styleSheet,colorScheme,langFile){loadChartSWF(name,xmlFile,width,height,styleSheet,colorScheme,langFile);},loadSugarCharts:function(){for(id in charts[activeTab]){if(id!='undefined'){SUGAR.mySugar.loadSugarChart(charts[activeTab][id]['name'],charts[activeTab][id]['xmlFile'],charts[activeTab][id]['width'],charts[activeTab][id]['height'],charts[activeTab][id]['styleSheet'],charts[activeTab][id]['colorScheme'],charts[activeTab][id]['langFile']);}}},getLayout:function(asString){columns=new Array();for(je=0;je<3;je++){dashlets=document.getElementById('col_'+activeTab+'_'+je);if(dashlets!=null){dashletIds=new Array();for(wp=0;wp<dashlets.childNodes.length;wp++){if(typeof dashlets.childNodes[wp].id!='undefined'&&dashlets.childNodes[wp].id.match(/dashlet_[\w-]*/)){dashletIds.push(dashlets.childNodes[wp].id.replace(/dashlet_/,''));}}
if(asString)
columns[je]=dashletIds.join(',');else
columns[je]=dashletIds;}}
if(asString)return columns.join('|');else return columns;},onDrag:function(e,id){originalLayout=SUGAR.mySugar.getLayout(true);},onDrop:function(e,id){newLayout=SUGAR.mySugar.getLayout(true);if(originalLayout!=newLayout){SUGAR.mySugar.saveLayout(newLayout);SUGAR.mySugar.loadSugarCharts();}},saveLayout:function(order){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING_LAYOUT'));var success=function(data){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVED_LAYOUT'));window.setTimeout('ajaxStatus.hideStatus()',2000);}
url='index.php?to_pdf=1&module='+module+'&action=DynamicAction&DynamicAction=saveLayout&layout='+order+'&selectedPage='+activeTab;var cObj=YAHOO.util.Connect.asyncRequest('GET',url,{success:success,failure:success});},uncoverPage:function(id){if(!SUGAR.isIE){document.getElementById('dlg_c').style.display='none';}
configureDlg.hide();if(document.getElementById('dashletType')==null){dashletType='';}else{dashletType=document.getElementById('dashletType').value;}
SUGAR.mySugar.retrieveDashlet(SUGAR.mySugar.configureDashletId,dashletType);},configureDashlet:function(id){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_LOADING'));configureDlg=new YAHOO.widget.SimpleDialog("dlg",{visible:false,width:"510",effect:[{effect:YAHOO.widget.ContainerEffect.SLIDE,duration:0.5},{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5}],fixedcenter:true,modal:true,draggable:false});fillInConfigureDiv=function(data){ajaxStatus.hideStatus();try{eval(data.responseText);}
catch(e){result=new Array();result['header']='error';result['body']='There was an error handling this request.';}
configureDlg.setHeader(result['header']);configureDlg.setBody(result['body']);var listeners=new YAHOO.util.KeyListener(document,{keys:27},{fn:function(){this.hide();},scope:configureDlg,correctScope:true});configureDlg.cfg.queueProperty("keylisteners",listeners);configureDlg.render(document.body);configureDlg.show();configureDlg.configFixedCenter(null,false);SUGAR.util.evalScript(result['body']);}
SUGAR.mySugar.configureDashletId=id;var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=1&module='+module+'&action=DynamicAction&DynamicAction=configureDashlet&id='+id,{success:fillInConfigureDiv,failure:fillInConfigureDiv},null);},retrieveDashlet:function(id,url,callback,dynamic){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_LOADING'));if(!url){url='index.php?action=DynamicAction&DynamicAction=displayDashlet&module='+module+'&to_pdf=1&id='+id;is_chart_dashlet=false;}
else if(url=='predefined_chart'){url='index.php?action=DynamicAction&DynamicAction=displayDashlet&module='+module+'&to_pdf=1&id='+id;scriptUrl='index.php?action=DynamicAction&DynamicAction=getPredefinedChartScript&module='+module+'&to_pdf=1&id='+id;is_chart_dashlet=true;}
if(dynamic){url+='&dynamic=true';}
var fillInDashlet=function(data){ajaxStatus.hideStatus();if(data){SUGAR.mySugar.currentDashlet.innerHTML=data.responseText;}
SUGAR.util.evalScript(data.responseText);if(callback)callback();var processChartScript=function(scriptData){SUGAR.util.evalScript(scriptData.responseText);SUGAR.mySugar.loadSugarChart(charts[activeTab][id]['name'],charts[activeTab][id]['xmlFile'],charts[activeTab][id]['width'],charts[activeTab][id]['height'],charts[activeTab][id]['styleSheet'],charts[activeTab][id]['colorScheme'],charts[activeTab][id]['langFile']);}
if(typeof(is_chart_dashlet)=='undefined'){is_chart_dashlet=false;}
if(is_chart_dashlet){var chartScriptObj=YAHOO.util.Connect.asyncRequest('GET',scriptUrl,{success:processChartScript,failure:processChartScript},null);}}
SUGAR.mySugar.currentDashlet=document.getElementById('dashlet_entire_'+id);var cObj=YAHOO.util.Connect.asyncRequest('GET',url,{success:fillInDashlet,failure:fillInDashlet},null);return false;},setChooser:function(){var displayColumnsDef=new Array();var hideTabsDef=new Array();var left_td=document.getElementById('display_tabs_td');var right_td=document.getElementById('hide_tabs_td');var displayTabs=left_td.getElementsByTagName('select')[0];var hideTabs=right_td.getElementsByTagName('select')[0];for(i=0;i<displayTabs.options.length;i++){displayColumnsDef.push(displayTabs.options[i].value);}
if(typeof hideTabs!='undefined'){for(i=0;i<hideTabs.options.length;i++){hideTabsDef.push(hideTabs.options[i].value);}}
document.getElementById('displayColumnsDef').value=displayColumnsDef.join('|');document.getElementById('hideTabsDef').value=hideTabsDef.join('|');},deleteDashlet:function(id){if(confirm(SUGAR.language.get('app_strings','LBL_REMOVE_DASHLET_CONFIRM'))){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_REMOVING_DASHLET'));del=function(){var success=function(data){dashlet=document.getElementById('dashlet_'+id);dashlet.parentNode.removeChild(dashlet);ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_REMOVED_DASHLET'));window.setTimeout('ajaxStatus.hideStatus()',2000);}
var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=1&module='+module+'&action=DynamicAction&DynamicAction=deleteDashlet&activePage='+activeTab+'&id='+id,{success:success,failure:success},null);}
var anim=new YAHOO.util.Anim('dashlet_entire_'+id,{height:{to:1}},.5);anim.onComplete.subscribe(del);document.getElementById('dashlet_entire_'+id).style.overflow='hidden';anim.animate();return false;}
return false;},addDashlet:function(id,type,type_module){ajaxStatus.hideStatus();columns=SUGAR.mySugar.getLayout();var num_dashlets=columns[0].length;if(typeof columns[1]==undefined){num_dashlets=num_dashlets+columns[1].length;}
if((num_dashlets)>=SUGAR.mySugar.maxCount){alert(SUGAR.language.get('app_strings','LBL_MAX_DASHLETS_REACHED'));return;}
ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_ADDING_DASHLET'));var success=function(data){colZero=document.getElementById('col_'+activeTab+'_0');newDashlet=document.createElement('li');newDashlet.id='dashlet_'+data.responseText;newDashlet.className='noBullet active';newDashlet.innerHTML='<div style="position: absolute; top: -1000px; overflow: hidden;" id="dashlet_entire_'+data.responseText+'"></div>';colZero.insertBefore(newDashlet,colZero.firstChild);var finishRetrieve=function(){dashletEntire=document.getElementById('dashlet_entire_'+data.responseText);dd=new ygDDList('dashlet_'+data.responseText);dd.setHandleElId('dashlet_header_'+data.responseText);dd.onMouseDown=SUGAR.mySugar.onDrag;dd.onDragDrop=SUGAR.mySugar.onDrop;ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_ADDED_DASHLET'));dashletRegion=YAHOO.util.Dom.getRegion(dashletEntire);dashletEntire.style.position='relative';dashletEntire.style.height='1px';dashletEntire.style.top='0px';dashletEntire.className='dashletPanel';var anim=new YAHOO.util.Anim('dashlet_entire_'+data.responseText,{height:{to:dashletRegion.bottom-dashletRegion.top}},.5);anim.onComplete.subscribe(function(){document.getElementById('dashlet_entire_'+data.responseText).style.height='100%';});anim.animate();window.setTimeout('ajaxStatus.hideStatus()',2000);}
if(type=='module'||type=='web'){url=null;type='module';}
else if(type=='predefined_chart'){url='predefined_chart';type='predefined_chart';}
else if(type=='chart'){url='chart';type='chart';}
SUGAR.mySugar.retrieveDashlet(data.responseText,url,finishRetrieve,true);newLayout=SUGAR.mySugar.getLayout(true);SUGAR.mySugar.saveLayout(newLayout);}
var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=1&module='+module+'&action=DynamicAction&DynamicAction=addDashlet&activeTab='+activeTab+'&id='+id+'&type='+type+'&type_module='+type_module,{success:success,failure:success},null);return false;},showDashletsDialog:function(){columns=SUGAR.mySugar.getLayout();var num_dashlets=0;var i=0;for(i=0;i<3;i++){if(typeof columns[i]!="undefined"){num_dashlets=num_dashlets+columns[i].length;}}
if((num_dashlets)>=SUGAR.mySugar.maxCount){alert(SUGAR.language.get('app_strings','LBL_MAX_DASHLETS_REACHED'));return;}
ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_LOADING'));var success=function(data){eval(data.responseText);dashletsListDiv=document.getElementById('dashletsList');dashletsListDiv.innerHTML=response['html'];document.getElementById('dashletsDialog_c').style.display='';SUGAR.mySugar.dashletsDialog.show();eval(response['script']);ajaxStatus.hideStatus();}
var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=true&module='+module+'&action=DynamicAction&DynamicAction=dashletsDialog',{success:success,failure:success});return false;},closeDashletsDialog:function(){SUGAR.mySugar.dashletsDialog.hide();window.setTimeout("document.getElementById('dashletsDialog_c').style.display = 'none';",2000);},toggleDashletCategories:function(category){document.getElementById('search_string').value='';document.getElementById('searchResults').innerHTML='';var moduleTab=document.getElementById('moduleCategory');var moduleTabAnchor=document.getElementById('moduleCategoryAnchor');var moduleListDiv=document.getElementById('moduleDashlets');var chartTab=document.getElementById('chartCategory');var chartTabAnchor=document.getElementById('chartCategoryAnchor');var chartListDiv=document.getElementById('chartDashlets');var toolsTab=document.getElementById('toolsCategory');var toolsTabAnchor=document.getElementById('toolsCategoryAnchor');var toolsListDiv=document.getElementById('toolsDashlets');var webTab=document.getElementById('webCategory');var webTabAnchor=document.getElementById('webCategoryAnchor');var webListDiv=document.getElementById('webDashlets');switch(category){case'module':moduleTab.className='active';moduleTabAnchor.className='current';moduleListDiv.style.display='';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'chart':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='active';chartTabAnchor.className='current';chartListDiv.style.display='';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'tools':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='active';toolsTabAnchor.className='current';toolsListDiv.style.display='';webTab.className='';webTabAnchor.className='';webListDiv.style.display='none';break;case'web':moduleTab.className='';moduleTabAnchor.className='';moduleListDiv.style.display='none';chartTab.className='';chartTabAnchor.className='';chartListDiv.style.display='none';toolsTab.className='';toolsTabAnchor.className='';toolsListDiv.style.display='none';webTab.className='active';webTabAnchor.className='current';webListDiv.style.display='';break;default:break;}
document.getElementById('search_category').value=category;},searchDashlets:function(searchStr,searchCategory){var moduleTab=document.getElementById('moduleCategory');var moduleTabAnchor=document.getElementById('moduleCategoryAnchor');var moduleListDiv=document.getElementById('moduleDashlets');var chartTab=document.getElementById('chartCategory');var chartTabAnchor=document.getElementById('chartCategoryAnchor');var chartListDiv=document.getElementById('chartDashlets');var toolsTab=document.getElementById('toolsCategory');var toolsTabAnchor=document.getElementById('toolsCategoryAnchor');var toolsListDiv=document.getElementById('toolsDashlets');if(moduleTab!=null&&chartTab!=null&&toolsTab!=null){moduleListDiv.style.display='none';chartListDiv.style.display='none';toolsListDiv.style.display='none';}
else{chartListDiv.style.display='none';}
var searchResultsDiv=document.getElementById('searchResults');searchResultsDiv.style.display='';var success=function(data){eval(data.responseText);searchResultsDiv.innerHTML=response['html'];}
var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=true&module='+module+'&action=DynamicAction&DynamicAction=searchDashlets&search='+searchStr+'&category='+searchCategory,{success:success,failure:success});return false;},collapseList:function(chartList){document.getElementById(chartList+'List').style.display='none';document.getElementById(chartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.expandList(\''+chartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=advanced_search.gif" align="absmiddle" />';},expandList:function(chartList){document.getElementById(chartList+'List').style.display='';document.getElementById(chartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.collapseList(\''+chartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=basic_search.gif" align="absmiddle" />';},collapseReportList:function(reportChartList){document.getElementById(reportChartList+'ReportsChartDashletsList').style.display='none';document.getElementById(reportChartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.expandReportList(\''+reportChartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=ProjectPlus.gif" align="absmiddle" />';},expandReportList:function(reportChartList){document.getElementById(reportChartList+'ReportsChartDashletsList').style.display='';document.getElementById(reportChartList+'ExpCol').innerHTML='<a href="#" onClick="javascript:SUGAR.mySugar.collapseReportList(\''+reportChartList+'\');"><img border="0" src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=ProjectMinus.gif" align="absmiddle" />';},clearSearch:function(){document.getElementById('search_string').value='';var moduleTab=document.getElementById('moduleCategory');var moduleTabAnchor=document.getElementById('moduleCategoryAnchor');var moduleListDiv=document.getElementById('moduleDashlets');document.getElementById('searchResults').innerHTML='';if(moduleTab!=null){SUGAR.mySugar.toggleDashletCategories('module');}
else{document.getElementById('searchResults').style.display='none';document.getElementById('chartDashlets').style.display='';}},doneAddDashlets:function(){SUGAR.mySugar.dashletsDialog.hide();return false;},renderDashletsDialog:function(){SUGAR.mySugar.dashletsDialog=new YAHOO.widget.Dialog("dashletsDialog",{width:"480px",height:"520px",fixedcenter:true,draggable:false,visible:false,modal:true,close:false});var listeners=new YAHOO.util.KeyListener(document,{keys:27},{fn:function(){SUGAR.mySugar.closeDashletsDialog();}});SUGAR.mySugar.dashletsDialog.cfg.queueProperty("keylisteners",listeners);document.getElementById('dashletsDialog').style.display='';SUGAR.mySugar.dashletsDialog.render();document.getElementById('dashletsDialog_c').style.display='none';}};}();

178
include/MySugar/tpls/MySugar.tpl Executable file
View File

@@ -0,0 +1,178 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
{literal}
<style>
.menu{
z-index:100;
}
.subDmenu{
z-index:100;
}
li.active a img.deletePageImg {
display: inline !important;
margin-bottom: 2px;
}
</style>
{/literal}
<!-- begin includes for overlib -->
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_overlib.js'}"></script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000"></div>
<!-- end includes for overlib -->
<script type="text/javascript">
var activePage = {$activePage};
var theme = '{$theme}';
current_user_id = '{$current_user}';
jsChartsArray = new Array();
var moduleName = '{$module}';
document.body.setAttribute("class", "yui-skin-sam");
</script>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/dashlets.js'}"></script>
<script type="text/javascript" src='{sugar_getjspath file='include/JSON.js'}'></script>
<script type='text/javascript' src='{sugar_getjspath file='include/MySugar/javascript/MySugar.js'}'></script>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/swfobject.js'}"></script>
<link rel='stylesheet' href='{sugar_getjspath file='include/ytree/TreeView/css/folders/tree.css'}'>
<div class="clear"></div>
<div id="pageContainer" class="yui-skin-sam">
<div id="pageNum_{$activePage}_div">
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 5px;">
<tr>
<td>
</td>
<td rowspan="3">
<img src='{sugar_getimagepath file='blank.gif'}' width='40' height='1' border='0'>
</td>
<td align='right'>
{if !$lock_homepage}<input id="add_dashlets" class="button" type="button" value="{$lblAddDashlets}" onclick="return SUGAR.mySugar.showDashletsDialog();"/>{/if}
</td>
</tr>
<tr>
{counter assign=hiddenCounter start=0 print=false}
{foreach from=$columns key=colNum item=data}
<td valign='top' width='{$data.width}'>
<ul class='noBullet' id='col_{$activePage}_{$colNum}'>
<li id='page_{$activePage}_hidden{$hiddenCounter}b' style='height: 5px; margin-top: 12px\9;' class='noBullet'>&nbsp;&nbsp;&nbsp;</li>
{foreach from=$data.dashlets key=id item=dashlet}
<li class='noBullet' id='dashlet_{$id}'>
<div id='dashlet_entire_{$id}' class='dashletPanel'>
{$dashlet.script}
{$dashlet.displayHeader}
{$dashlet.display}
{$dashlet.displayFooter}
</div>
</li>
{/foreach}
<li id='page_{$activePage}_hidden{$hiddenCounter}' style='height: 5px' class='noBullet'>&nbsp;&nbsp;&nbsp;</li>
</ul>
</td>
{counter}
{/foreach}
</tr>
</table>
</div>
{foreach from=$divPages key=divPageIndex item=divPageNum}
<div id="pageNum_{$divPageNum}_div" style="display:none;">
</div>
{/foreach}
<div id="dashletsDialog" style="display:none;">
<div class="hd" id="dashletsDialogHeader"><a href="#" onClick="javascript:SUGAR.mySugar.closeDashletsDialog();">
<div class="container-close">&nbsp;</div></a>{$lblAdd}
</div>
<div class="bd" id="dashletsList">
<form></form>
</div>
</div>
</div>
{literal}
<script type="text/javascript">
SUGAR.mySugar.maxCount = {/literal}{$maxCount}{literal};
SUGAR.mySugar.homepage_dd = new Array();
SUGAR.mySugar.init = function () {
j = 0;
{/literal}
dashletIds = {$dashletIds};
{if !$lock_homepage}
{literal}
for(i in dashletIds) {
SUGAR.mySugar.homepage_dd[j] = new ygDDList('dashlet_' + dashletIds[i]);
SUGAR.mySugar.homepage_dd[j].setHandleElId('dashlet_header_' + dashletIds[i]);
SUGAR.mySugar.homepage_dd[j].onMouseDown = SUGAR.mySugar.onDrag;
SUGAR.mySugar.homepage_dd[j].afterEndDrag = SUGAR.mySugar.onDrop;
j++;
}
for(var wp = 0; wp <= {/literal}{$hiddenCounter}{literal}; wp++) {
SUGAR.mySugar.homepage_dd[j++] = new ygDDListBoundary('page_'+activePage+'_hidden' + wp);
}
YAHOO.util.DDM.mode = 1;
{/literal}
{/if}
{literal}
SUGAR.mySugar.renderDashletsDialog();
SUGAR.mySugar.loadSugarCharts();
}
</script>
{/literal}
<script type="text/javascript">
YAHOO.util.Event.addListener(window, 'load', SUGAR.mySugar.init);
</script>

View File

@@ -0,0 +1,163 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
{literal}
<style type="text/css">
#chartDashlets {
background-image: url('themes/Sugar5/images/charts_background.png');
background-repeat: no-repeat;
background-position: -100px 100px;
}
</style>
{/literal}
<div align="right" id="dashletSearch">
<table>
<tr>
<td>{sugar_translate label='LBL_DASHLET_SEARCH' module='Home'}: <input id="search_string" type="text" length="15" onKeyPress="javascript:if(event.keyCode==13)SUGAR.mySugar.searchDashlets(this.value,document.getElementById('search_category').value);" />
<input type="button" class="button" value="{sugar_translate label='LBL_SEARCH' module='Home'}" onClick="javascript:SUGAR.mySugar.searchDashlets(document.getElementById('search_string').value,document.getElementById('search_category').value);" />
<input type="button" class="button" value="{sugar_translate label='LBL_CLEAR' module='Home'}" onClick="javascript:SUGAR.mySugar.clearSearch();" />
{if $moduleName == 'Home'}
<input type="hidden" id="search_category" value="module" />
{else}
<input type="hidden" id="search_category" value="chart" />
{/if}
</td>
</tr>
</table>
<br>
</div>
{if $moduleName == 'Home'}
<ul class="subpanelTablist" id="dashletCategories">
<li id="moduleCategory" class="active"><a href="javascript:SUGAR.mySugar.toggleDashletCategories('module');" class="current" id="moduleCategoryAnchor">{sugar_translate label='LBL_MODULES' module='Home'}</a></li>
<li id="chartCategory" class=""><a href="javascript:SUGAR.mySugar.toggleDashletCategories('chart');" class="" id="chartCategoryAnchor">{sugar_translate label='LBL_CHARTS' module='Home'}</a></li>
<li id="toolsCategory" class=""><a href="javascript:SUGAR.mySugar.toggleDashletCategories('tools');" class="" id="toolsCategoryAnchor">{sugar_translate label='LBL_TOOLS' module='Home'}</a></li>
<li id="webCategory" class=""><a href="javascript:SUGAR.mySugar.toggleDashletCategories('web');" class="" id="webCategoryAnchor">{sugar_translate label='LBL_WEB' module='Home'}</a></li>
</ul>
{/if}
{if $moduleName == 'Home'}
<div id="moduleDashlets" style="height:400px;display:;">
<h3>{sugar_translate label='LBL_MODULES' module='Home'}</h3>
<div id="moduleDashletsList">
<table width="95%">
{counter assign=rowCounter start=0 print=false}
{foreach from=$modules item=module}
{if $rowCounter % 2 == 0}
<tr>
{/if}
<td width="50%" align="left"><a href="#" onclick="{$module.onclick}">{$module.icon}</a>&nbsp;<a class="mbLBLL" href="#" onclick="{$module.onclick}">{$module.title}</a><br /></td>
{if $rowCounter % 2 == 1}
</tr>
{/if}
{counter}
{/foreach}
</table>
</div>
</div>
{/if}
<div id="chartDashlets" style="{if $moduleName == 'Home'}height:400px;display:none;{else}height:425px;display:;{/if}">
{if $charts != false}
<h3><span id="basicChartDashletsExpCol"><a href="#" onClick="javascript:SUGAR.mySugar.collapseList('basicChartDashlets');"><img border="0" src="{sugar_getimagepath file='basic_search.gif'}" align="absmiddle" /></span></a>&nbsp;{sugar_translate label='LBL_BASIC_CHARTS' module='Home'}</h3>
<div id="basicChartDashletsList">
<table width="100%">
{foreach from=$charts item=chart}
<tr>
<td align="left"><a href="#" onclick="{$chart.onclick}">{$chart.icon}</a>&nbsp;<a class="mbLBLL" href="#" onclick="{$chart.onclick}">{$chart.title}</a><br /></td>
</tr>
{/foreach}
</table>
</div>
{/if}
</div>
{if $moduleName == 'Home'}
<div id="toolsDashlets" style="height:400px;display:none;">
<h3>{sugar_translate label='LBL_TOOLS' module='Home'}</h3>
<div id="toolsDashletsList">
<table width="95%">
{counter assign=rowCounter start=0 print=false}
{foreach from=$tools item=tool}
{if $rowCounter % 2 == 0}
<tr>
{/if}
<td align="left"><a href="#" onclick="{$tool.onclick}">{$tool.icon}</a>&nbsp;<a class="mbLBLL" href="#" onclick="{$tool.onclick}">{$tool.title}</a><br /></td>
{if $rowCounter % 2 == 1}
</tr>
{/if}
{counter}
{/foreach}
</table>
</div>
</div>
{/if}
{if $moduleName == 'Home'}
<div id="webDashlets" style="height:400px;display:none;">
<h3>{sugar_translate label='LBL_WEBSITE_TITLE' module='Home'}</h3>
<div id="webDashletsList">
<table width="95%">
<tr>
<td scope="row"></td>
<td><input type="text" id="web_address" value="http://" style="width: 400px" /></td>
</tr>
<tr>
<td colspan="2">
<input type="button" name="create" value="{$APP.LBL_ADD_BUTTON}"
onclick="return SUGAR.mySugar.addDashlet('iFrameDashlet', 'web', document.getElementById('web_address').value);" />
</td>
</tr>
</table>
<h3>{sugar_translate label='LBL_RSS_TITLE' module='Home'}</h3>
<table width="95%">
<tr>
<td scope="row"></td>
<td><input type="text" id="rss_address" value="http://" style="width: 400px" /></td>
</tr>
<tr>
<td colspan="2">
<input type="button" name="create" value="{$APP.LBL_ADD_BUTTON}"
onclick="return SUGAR.mySugar.addDashlet('RSSDashlet', 'web', document.getElementById('rss_address').value);" />
</td>
</tr>
</table>
</div>
</div>
{/if}
<div id="searchResults" style="display:none;{if $moduleName == 'Home'}height:400px;{else}height:425px;{/if}">
</div>

View File

@@ -0,0 +1,48 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
<h4>{$lblSearchResults} - <i>{$searchString}</i>:</h4>
<hr>
{if count($charts)}
<h3>{sugar_translate label='LBL_BASIC_CHARTS' module='Home'}</h3>
<table width="100%">
{foreach from=$charts item=chart}
<tr>
<td width="100%" align="left"><a href="#" onclick="{$chart.onclick}">{$chart.icon}</a>&nbsp;<a class="mbLBLL" href="#" onclick="{$chart.onclick}">{$chart.title}</a><br /></td>
</tr>
{/foreach}
</table>
{/if}

View File

@@ -0,0 +1,54 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
<h4>{$lblSearchResults} - <i>{$searchString}</i>:</h4>
<hr>
{if count($dashlets)}
<h3>{$searchCategoryString}</h3>
<table width="95%">
{counter assign=rowCounter start=0 print=false}
{foreach from=$dashlets item=module}
{if $rowCounter % 2 == 0}
<tr>
{/if}
<td width="50%" align="left"><a href="#" onclick="{$module.onclick}">{$module.icon}</a>&nbsp;<a class="mbLBLL" href="#" onclick="{$module.onclick}">{$module.title}</a><br /></td>
{if $rowCounter % 2 == 1}
</tr>
{/if}
{counter}
{/foreach}
</table>
{/if}

View File

@@ -0,0 +1,91 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="border-top: 0px none; margin-bottom: 4px;">
<tr>
<td>
<!-- BEGIN PAGE RENDERING -->
<table cellspacing='5' cellpadding='0' border='0' valign='top' width='100%'>
{if $numCols > 1}
<tr>
{if $numCols > 2}
<td>
</td>
<td rowspan="3">
<img src='{sugar_getimagepath file='blank.gif'}' width='15' height='1' border='0'>
</td>
{/if}
{if $numCols > 1}
<td>
</td>
<td rowspan="3">
<img src='{sugar_getimagepath file='blank.gif'}' width='15' height='1' border='0'>
</td>
{/if}
</tr>
{/if}
<tr>
{counter assign=hiddenCounter start=0 print=false}
{foreach from=$columns key=colNum item=data}
<td valign='top' width={$data.width}>
<ul class='noBullet' id='col_{$selectedPage}_{$colNum}'>
<li id='page_{$selectedPage}_hidden{$hiddenCounter}b' style='height: 5px' class='noBullet'>&nbsp;&nbsp;&nbsp;</li>
{foreach from=$data.dashlets key=id item=dashlet}
<li class='noBullet' id='dashlet_{$id}'>
<div id='dashlet_entire_{$id}' class='dashletPanel'>
{$dashlet.script}
{$dashlet.displayHeader}
{$dashlet.display}
{$dashlet.displayFooter}
</div>
</li>
{/foreach}
<li id='page_{$selectedPage}_hidden{$hiddenCounter}' style='height: 5px' class='noBullet'>&nbsp;&nbsp;&nbsp;</li>
</ul>
</td>
{counter}
{/foreach}
</tr>
</table>
<!-- END PAGE RENDERING -->
</td>
</tr>
</table>

View File

@@ -0,0 +1,43 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
<table width="100%">
{foreach from=$reportCharts item=chart}
<tr>
<td align="left"><a class="mbLBLL" href="#" onclick="{$chart.onclick}">{$chart.title}</a><br /></td>
</tr>
{/foreach}
</table>