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

189
modules/Home/About.php Executable file
View File

@@ -0,0 +1,189 @@
<?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".
********************************************************************************/
//NOTE: Under the License referenced above, you are required to leave in all copyright statements in both
//the code and end-user application.
global $sugar_config, $mod_strings;
?>
<script language="javascript" src="modules/Home/about.js"></script>
<span>
<div class="about" style="padding: 10px 15px 20px 15px;">
<p>
<IMG src="include/images/sugar_md_open.png" alt="SugarCRM" width="425" height="30" ondblclick='abouter.display();'>
<br>
<b><?php echo $mod_strings['LBL_VERSION']." ".$sugar_version." (".$mod_strings['LBL_BUILD']." ".$sugar_build.")";
if( is_file( "custom_version.php" ) ){
include( "custom_version.php" );
print( "&nbsp;&nbsp;&nbsp;" . $custom_version );
}
?>
</b></p>
<?php
echo "<P>Copyright ".$app_strings['LBL_SUGAR_COPYRIGHT']."</P>";
// This version of viewLicenseText is for Community Edition only.
$viewLicenseText = $mod_strings['LBL_VIEWLICENSE_COM'];
echo $viewLicenseText;
$imgTagString = '<img style="margin-top: 2px" border="0" width="106" height="23" src="include/images/poweredby_sugarcrm.png" alt="Powered By SugarCRM">';
echo $imgTagString;
?>
<?php
$additionalTerm = $mod_strings['LBL_ADD_TERM_COM'];
echo $additionalTerm;
?>
<P> SugarCRM &reg;,
<?php
// Product Name for Community Edition.
$theProductName = 'Sugar Community Edition';
echo $theProductName."&#8482; ".$mod_strings['LBL_AND']." Sugar&#8482; ".$mod_strings['LBL_ARE'];
?>
<a href="http://www.sugarcrm.com/crm/open-source/trademark-information.html"
target="_blank">
<?php echo $mod_strings['LBL_TRADEMARKS']."</a> ".$mod_strings['LBL_OF']; ?> SugarCRM Inc.</p>
<p ><table width="100%" border="0" cellspacing="0" cellpadding="0" class="contentBox">
<tr>
<td style="padding-right: 10px;" valign="top" rowspan="2" width="300" >
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="300" height="300" id="SugarPlanet" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="include/images/SugarPlanet.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="opaque" />
<embed src="include/images/SugarPlanet.swf" wmode="opaque" quality="high" bgcolor="#ffffff" width="300" height="300" name="SugarPlanet" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<br>
<h3><?php echo $mod_strings['LBL_GET_SUGARCRM_RSS']; ?></h3>
<ul class="noBullet">
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarcrm.com/crm/index2.php?no_html=1&stype=rss20&task=returnRSS&option=com_rss_feed_manager&channel=Corporate" target="_blank"><img src="include/images/rss_xml.gif" border="0" alt="XML" align="top"></a>&nbsp;<a href="http://www.sugarcrm.com/crm/index2.php?no_html=1&stype=rss20&task=returnRSS&option=com_rss_feed_manager&channel=Corporate" target="_blank"><?php echo $mod_strings['LBL_SUGARCRM_NEWS']; ?></a></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarcrm.com/forums/external.php?type=rss" target="_blank"><img src="include/images/rss_xml.gif" border="0" alt="XML" align="top"></a>&nbsp;<a href="http://www.sugarcrm.com/forums/external.php?type=rss" target="_blank"><?php echo $mod_strings['LBL_SUGARCRM_FORUMS']; ?></a></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarforge.org/export/rss_sfnews.php" target="_blank"><img src="include/images/rss_xml.gif" border="0" alt="XML" align="top"></a>&nbsp;<a href="http://www.sugarforge.org/export/rss_sfnews.php" target="_blank"><?php echo $mod_strings['LBL_SUGARFORGE_NEWS']; ?></a></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarcrm.com/crm/index2.php?no_html=1&stype=rss20&task=returnRSS&option=com_rss_feed_manager&channel=all" target="_blank"><img src="include/images/rss_xml.gif" border="0" alt="XML" align="top"></a>&nbsp;<a href="http://www.sugarcrm.com/crm/index2.php?no_html=1&stype=rss20&task=returnRSS&option=com_rss_feed_manager&channel=all" target="_blank"><?php echo $mod_strings['LBL_ALL_NEWS']; ?></a></li>
</ul>
<br>
<h3><?php echo $mod_strings['LBL_JOIN_SUGAR_COMMUNITY']; ?></h3>
<ul class="noBullet">
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarforge.org/" target="_blank">SugarForge</a>: <?php echo $mod_strings['LBL_DETAILS_SUGARFORGE']; ?><br></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarexchange.com/" target="_blank">SugarExchange</a>: <?php echo $mod_strings['LBL_DETAILS_SUGAREXCHANGE']; ?><br></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarcrm.com/crm/university" target="_blank"><?php echo $mod_strings['LBL_TRAINING']; ?></a>: <?php echo $mod_strings['LBL_DETAILS_TRAINING']; ?><br></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarcrm.com/forums/" target="_blank"><?php echo $mod_strings['LBL_FORUMS']; ?></a>: <?php echo $mod_strings['LBL_DETAILS_FORUMS']; ?><br></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://www.sugarcrm.com/wiki/" target="_blank"><?php echo $mod_strings['LBL_WIKI']; ?></a>: <?php echo $mod_strings['LBL_DETAILS_WIKI']; ?></li>
<li class="noBullet" style="margin-bottom: 6px;"><a href="http://developer.sugarcrm.com/" target="_blank"><?php echo $mod_strings['LBL_DEVSITE']; ?></a>: <?php echo $mod_strings['LBL_DETAILS_DEVSITE']; ?></li>
</ul>
</td>
<td colspan="2" valign="top" style="padding: 15px 10px 0px 10px;"><h3>SugarCRM Inc.</h3>
10050 North Wolfe Road, Suite SW2-130, Cupertino, CA, 95014 USA,&nbsp;
+1 (408) 454-6940,&nbsp;
<a href="http://www.sugarcrm.com" target="_blank">http://www.sugarcrm.com</a>
<iframe id='abouterdiv' border=0 width=500 style='overflow:hidden;display:none' frameborder="0" marginwidth="0" marginheight="0">
</iframe>
</td>
</tr>
<tr>
<td valign="top" style="padding: 15px 10px 15px 10px;">
<p><B><a href="http://www.sugarforge.org/content/community/community-spotlight/contributions.php" target="_blank"><?php echo $mod_strings['LBL_LINK_CURRENT_CONTRIBUTORS']; ?></a></b></p>
<P>&nbsp;</p>
<P><h3><?php echo $mod_strings['LBL_SOURCE_CODE']; ?></h3></p>
<LI><?php echo $mod_strings['LBL_SOURCE_SUGAR']; ?> (<A href="http://www.sugarcrm.com" target="_blank">http://www.sugarcrm.com</A>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_XTEMPLATE']; ?> (<A href="http://sourceforge.net/projects/xtpl" target="_blank">http://sourceforge.net/projects/xtpl</A>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_NUSOAP']; ?> (<a href="http://dietrich.ganx4.com/nusoap" target="_blank">http://dietrich.ganx4.com/nusoap</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_JSCALENDAR']; ?> (<a href="http://www.dynarch.com/mishoo/calendar.epl" target="_blank">http://www.dynarch.com/mishoo/calendar.epl</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_PHPPDF']; ?> (<a href="http://ros.co.nz/pdf/" target="_blank">http://ros.co.nz/pdf/</a>)
<LI><?php echo $mod_strings['LBL_SOURCE_PNGBEHAVIOR']; ?> (<a href="http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html" target="_blank">http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_JSONPHP']; ?> (<a href="http://mike.teczno.com/json.html" target="_blank">http://mike.teczno.com/json.html</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_JSON']; ?> (<a href="http://www.json.org/js.html" target="_blank">http://www.json.org/js.html</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_HTTP_WEBDAV_SERVER']; ?> (<a href="http://pear.php.net/package/HTTP_WebDAV_Server" target="_blank">http://pear.php.net/package/HTTP_WebDAV_Server</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_JS_O_LAIT']; ?> (<a href="http://jsolait.net/" target="_blank">http://jsolait.net/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_PCLZIP']; ?> (<a href="http://www.phpconcept.net/pclzip/index.en.php" target="_blank">http://www.phpconcept.net/pclzip/index.en.php/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_SMARTY']; ?> (<a href="http://smarty.php.net/" target="_blank">http://smarty.php.net/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_OVERLIBMWS']; ?> (<a href="http://www.macridesweb.com/oltest/" target="_blank">http://www.macridesweb.com/oltest/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_YAHOO_UI_LIB']; ?> (<a href="http://developer.yahoo.net/yui/" target="_blank">http://developer.yahoo.net/yui/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_PHPMAILER']; ?> (<a href="http://phpmailer.sourceforge.net/" target="_blank">http://phpmailer.sourceforge.net/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_CRYPT_BLOWFISH']; ?> (<a href="http://pear.php.net/package/Crypt_Blowfish/" target="_blank">http://pear.php.net/package/Crypt_Blowfish/</a>) </LI>
<LI><?php echo $mod_strings['LBL_SOURCE_HTML_SAFE']; ?> (<a href="http://pear.php.net/package/HTML_Safe/" target="_blank">http://pear.php.net/package/HTML_Safe/</a>) </LI>
<LI><?php echo $mod_strings['LBL_SOURCE_XML_HTMLSAX3']; ?> (<a href="http://pear.php.net/package/XML_HTMLSax3/" target="_blank">http://pear.php.net/package/XML_HTMLSax3/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_YAHOO_UI_LIB_EXT']; ?> (<a href="http://www.jackslocum.com/blog/" target="_blank">http://www.jackslocum.com/blog/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_JSMIN']; ?> (<a href="http://www.crockford.com/javascript/jsmin.html" target="_blank">http://www.crockford.com/javascript/jsmin.html</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_SWFOBJECT']; ?> (<a href="http://blog.deconcept.com/swfobject/" target="_blank">http://blog.deconcept.com/swfobject</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_TINYMCE']; ?> (<a href="http://wiki.moxiecode.com/index.php/TinyMCE:Index" target="_blank">http://wiki.moxiecode.com/index.php/TinyMCE:Index</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_TCPDF']; ?> (<a href="http://www.tcpdf.org/" target="_blank">http://www.tcpdf.org/</a>)</LI>
<LI><?php echo $mod_strings['LBL_SOURCE_RECAPTCHA']; ?> (<a href="http://recaptcha.net/" target="_blank">http://recaptcha.net/</a>)</LI>
</ul>
</td>
</tr>
</table>
</span>
<br>
</div>

52
modules/Home/AddToFavorites.php Executable file
View File

@@ -0,0 +1,52 @@
<?php
/*********************************************************************************
* 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".
********************************************************************************/
global $current_user;
if(!empty($_REQUEST['target_module']) && !empty($_REQUEST['target_id'])) {
$objects = $current_user->getPreference('objects', 'favorites');
if(!is_array($objects)) $objects = array();
if(empty($objects[$_REQUEST['target_module']])) $objects[$_REQUEST['target_module']] = array();
$objects[$_REQUEST['target_module']][$_REQUEST['target_id']] = true;
$current_user->setPreference('objects', $objects, 0, 'favorites');
echo 1;
}
else {
echo 0;
}
?>

View File

@@ -0,0 +1,80 @@
<?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".
********************************************************************************/
/*********************************************************************************
* Description: Target for ajax calls to retrieve AdditionalDetails
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $beanList, $beanFiles, $current_user;
$moduleDir = empty($_REQUEST['bean']) ? '' : $_REQUEST['bean'];
$beanName = empty($beanList[$moduleDir]) ? '' : $beanList[$moduleDir];
$id = empty($_REQUEST['id']) ? '' : $_REQUEST['id'];
if(empty($beanFiles[$beanName]) ||
empty($id) || !is_file(substr($beanFiles[$beanName], 0, strrpos($beanFiles[$beanName], '/')) . '/metadata/additionalDetails.php')) {
echo 'bad data';
die();
}
require_once($beanFiles[$beanName]);
require_once(substr($beanFiles[$beanName], 0, strrpos($beanFiles[$beanName], '/')) . '/metadata/additionalDetails.php');
$adFunction = 'additionalDetails' . $beanName;
if(function_exists($adFunction)) { // does the additional details function exist
global $theme;
$json = getJSONobj();
$bean = new $beanName();
$bean->retrieve($id);
$arr = array_change_key_case($bean->toArray(), CASE_UPPER);
$results = $adFunction($arr);
$retArray['body'] = str_replace(array("\rn", "\r", "\n"), array('','','<br />'), $results['string']);
if(!$bean->ACLAccess('EditView')) $results['editLink'] = '';
$retArray['caption'] = "<div style='float:left'>{$app_strings['LBL_ADDITIONAL_DETAILS']}</div><div style='float: right'>" . (!empty($results['editLink']) ? "<a title='{$app_strings['LBL_EDIT_BUTTON']}' href={$results['editLink']}><img border=0 src=".SugarThemeRegistry::current()->getImageURL('edit_inline.gif')."></a>" : '');
$retArray['caption'] .= (!empty($results['viewLink']) ? "<a title='{$app_strings['LBL_VIEW_BUTTON']}' href={$results['viewLink']}><img style='margin-left: 2px;' border=0 src=".SugarThemeRegistry::current()->getImageURL('view_inline.gif')."></a>" : '') . "";
$retArray['width'] = (empty($results['width']) ? '300' : $results['width']);
$retArray['theme'] = $theme;
echo 'result = ' . $json->encode($retArray);
}
?>

View File

@@ -0,0 +1,44 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$dashletStrings['ChartsDashlet'] = array('LBL_TITLE' => 'Charts',
'LBL_DESCRIPTION' => 'A dashlet to display charts',
'LBL_CONFIGURE_TITLE' => 'Title', );
?>

View File

@@ -0,0 +1,44 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$dashletStrings['ChartsDashlet'] = array('LBL_TITLE' => 'Diagramme',
'LBL_DESCRIPTION' => 'Ein Dashlet um Diagramme anzuzeigen',
'LBL_CONFIGURE_TITLE' => 'Titel', );
?>

View File

@@ -0,0 +1,47 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
global $app_strings, $current_language;
$dashletMeta['ChartsDashlet'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'category' => 'Charts',
'hidden' => true,
);
?>

View File

@@ -0,0 +1,187 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
require_once('include/Sugar_Smarty.php');
class ChartsDashlet extends Dashlet {
var $width = '400';
var $height = '480';
var $report_id;
/**
* Constructor
*
* @global string current language
* @param guid $id id for the current dashlet (assigned from Home module)
* @param report_id $report_id id of the saved report
* @param array $def options saved for this dashlet
*/
function ChartsDashlet($id, $report_id, $def) {
$this->report_id = $report_id;
$this->loadLanguage('ChartsDashlet'); // load the language strings here
parent::Dashlet($id); // call parent constructor
$this->searchFields = array();
$this->isConfigurable = true; // dashlet is configurable
$this->hasScript = true; // dashlet has javascript attached to it
}
/**
* Displays the dashlet
*
* @return string html to display dashlet
*/
function display() {
require_once("modules/Reports/Report.php");
require_once("modules/Reports/SavedReport.php");
ajaxInit();
$chartReport = new SavedReport();
$chartExists = $chartReport->retrieve($this->report_id, false);
if (!is_null($chartExists)){
$this->title = $chartReport->name;
$reporter = new Report($chartReport->content);
$reporter->is_saved_report = true;
$reporter->saved_report_id = $chartReport->id;
$reporter->run_chart_queries();
require_once("modules/Reports/templates/templates_chart.php");
ob_start();
template_chart($reporter, true, true, $this->id);
$str = ob_get_contents();
ob_end_clean();
$xmlFile = get_cache_file_name($reporter);
$html = parent::display() . "<div align='center'>" . $str . "</div>" . "<br />"; // return parent::display for title and such
$ss = new Sugar_Smarty();
$ss->assign('chartName', $this->id);
$ss->assign('chartXMLFile', $xmlFile);
$script = $ss->fetch('modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl');
$json = getJSONobj();
return parent::display() . "<div align='center'>" . $str . "</div>" . "<br />"; // return parent::display for title and such
}
}
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
function displayScript() {
require_once("modules/Reports/Report.php");
require_once("modules/Reports/SavedReport.php");
$chartReport = new SavedReport();
$chartExists = $chartReport->retrieve($this->report_id, false);
if (!is_null($chartExists)){
$this->title = $chartReport->name;
require_once("modules/Reports/templates/templates_chart.php");
$reporter = new Report($chartReport->content);
$reporter->is_saved_report = true;
$reporter->saved_report_id = $chartReport->id;
$xmlFile = get_cache_file_name($reporter);
$ss = new Sugar_Smarty();
$ss->assign('chartName', $this->id);
$ss->assign('chartXMLFile', $xmlFile);
$ss->assign('chartStyleCSS', chartStyle());
$ss->assign('chartColorsXML', chartColors());
$ss->assign('chartLangFile', $GLOBALS['sugar_config']['tmp_dir'].'chart_strings.' . $GLOBALS['current_language'] .'.lang.xml');
$str = $ss->fetch('modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl');
return $str;
}
}
/**
* Displays the configuration form for the dashlet
*
* @return string html to display form
*/
function displayOptions() {
}
/**
* called to filter out $_REQUEST object when the user submits the configure dropdown
*
* @param array $req $_REQUEST
* @return array filtered options to save
*/
function saveOptions($req) {
}
function setConfigureIcon(){
global $image_path;
if($this->isConfigurable)
$additionalTitle = '<td nowrap width="1%"><div style="width: 100%;text-align:right"><a href="index.php?module=Reports&record=' . $this->report_id . '&action=ReportCriteriaResults&page=report" class="chartToolsLink">'
. get_image($image_path.'edit','title="' . translate('LBL_DASHLET_EDIT', 'Home') . '" alt="' . translate('LBL_DASHLET_EDIT', 'Home') . '" border="0" align="absmiddle"').'</a> '
. '';
else
$additionalTitle = '<td nowrap width="1%"><div style="width: 100%;text-align:right">';
return $additionalTitle;
}
function setRefreshIcon(){
global $image_path;
$additionalTitle = '';
if($this->isRefreshable)
$additionalTitle .= '<a href="#" onclick="SUGAR.mySugar.retrieveDashlet(\''
. $this->id . '\', \'chart\'); return false;"><img width="13" height="13" border="0" align="absmiddle" title="' . translate('LBL_DASHLET_REFRESH', 'Home') . '" alt="' . translate('LBL_DASHLET_REFRESH', 'Home') . '" src="'
. $image_path . 'refresh.gif"/></a> ';
return $additionalTitle;
}
}
?>

View File

@@ -0,0 +1,36 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* The contents of this file are subject to the SugarCRM Professional Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
* By installing or using this file, You have unconditionally agreed to the
* terms and conditions of the License, and You may not use this file except in
* compliance with the License. Under the terms of the license, You shall not,
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
* or otherwise transfer Your rights to the Software, and 2) use the Software
* for timesharing or service bureau purposes such as hosting the Software for
* commercial gain and/or for the benefit of a third party. Use of the Software
* may be subject to applicable fees and any use of the Software without first
* paying applicable fees is strictly prohibited. You do not have the right to
* remove SugarCRM copyrights from the source code or user interface.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2004-2007 SugarCRM, Inc.; All Rights Reserved.
*/
$dashletStrings['ChartsDashlet'] = array('LBL_TITLE' => 'Wykresy',
'LBL_DESCRIPTION' => 'Zakładka Wyświetlająca Wykresy',
'LBL_CONFIGURE_TITLE' => 'Tytuł', );
?>

View File

@@ -0,0 +1,44 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
// $Id$
*}
<script>
SUGAR.mySugar.addToChartsArray('{$chartName}', '{$chartXMLFile}', '100%', '480', '{$chartStyleCSS}', '{$chartColorsXML}', '{$chartLangFile}');
</script>

View File

@@ -0,0 +1,46 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$dashletStrings['InvadersDashlet'] = array('LBL_TITLE' => 'Invaders!',
'LBL_DESCRIPTION' => 'A little way to pass the time',
'LBL_DBLCLICK_HELP' => 'Use A and D to move, S to fire.',
);
?>

View File

@@ -0,0 +1,46 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$dashletStrings['InvadersDashlet'] = array('LBL_TITLE' => 'Invaders!',
'LBL_DESCRIPTION' => 'Ein bisschen was zum Spielen',
'LBL_DBLCLICK_HELP' => 'A und D um zu bewegen, S um zu feuern.',
);
?>

View File

@@ -0,0 +1,47 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
global $app_strings, $current_language;
$dashletMeta['InvadersDashlet'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'icon' => 'themes/default/images/icon_Invaders_32.gif',
'category' => 'Tools',
'hidden' => true);
?>

View File

@@ -0,0 +1,157 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
require_once('include/Sugar_Smarty.php');
class InvadersDashlet extends Dashlet {
var $savedText; // users's saved text
var $height = '100'; // height of the pad
/**
* Constructor
*
* @global string current language
* @param guid $id id for the current dashlet (assigned from Home module)
* @param array $def options saved for this dashlet
*/
function InvadersDashlet($id, $def) {
$this->loadLanguage('InvadersDashlet'); // load the language strings here
if(!empty($def['height'])) // set a default height if none is set
$this->height = $def['height'];
parent::Dashlet($id); // call parent constructor
$this->isConfigurable = false; // dashlet is configurable
$this->hasScript = true; // dashlet has javascript attached to it
// if no custom title, use default
if(empty($def['title'])) $this->title = $this->dashletStrings['LBL_TITLE'];
else $this->title = $def['title'];
}
/**
* Displays the dashlet
*
* @return string html to display dashlet
*/
function display() {
$ss = new Sugar_Smarty();
$ss->assign('id', $this->id);
$ss->assign('height', $this->height);
$str = $ss->fetch('modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.tpl');
return parent::display($this->dashletStrings['LBL_DBLCLICK_HELP']) . $str . '<br />'; // return parent::display for title and such
}
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
function displayScript() {
$ss = new Sugar_Smarty();
$ss->assign('id', $this->id);
$str = $ss->fetch('modules/Home/Dashlets/InvadersDashlet/InvadersDashletScript.tpl');
return $str; // return parent::display for title and such
}
/**
* Displays the configuration form for the dashlet
*
* @return string html to display form
*/
function displayOptions() {
global $app_strings;
$ss = new Sugar_Smarty();
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
$ss->assign('heightLbl', $this->dashletStrings['LBL_CONFIGURE_HEIGHT']);
$ss->assign('saveLbl', $app_strings['LBL_SAVE_BUTTON_LABEL']);
$ss->assign('title', $this->title);
$ss->assign('height', $this->height);
$ss->assign('id', $this->id);
return parent::displayOptions() . $ss->fetch('modules/Home/Dashlets/InvadersDashlet/InvadersOptions.tpl');
}
/**
* called to filter out $_REQUEST object when the user submits the configure dropdown
*
* @param array $req $_REQUEST
* @return array filtered options to save
*/
function saveOptions($req) {
global $sugar_config, $timedate, $current_user, $theme;
$options = array();
$options['title'] = $_REQUEST['title'];
if(is_numeric($_REQUEST['height'])) {
if($_REQUEST['height'] > 0 && $_REQUEST['height'] <= 300) $options['height'] = $_REQUEST['height'];
elseif($_REQUEST['height'] > 300) $options['height'] = '300';
else $options['height'] = '100';
}
// $options['savedText'] = br2nl($this->savedText);
$options['savedText'] = $this->savedText;
return $options;
}
/**
* Used to save text on textarea blur. Accessed via Home/CallMethodDashlet.php
* This is an example of how to to call a custom method via ajax
*/
function saveText() {
if(isset($_REQUEST['savedText'])) {
$optionsArray = $this->loadOptions();
// _pp($_REQUEST['savedText']);
$optionsArray['savedText'] = nl2br($_REQUEST['savedText']);
$this->storeOptions($optionsArray);
}
else {
$optionsArray['savedText'] = '';
}
$json = getJSONobj();
echo 'result = ' . $json->encode(array('id' => $_REQUEST['id'],
'savedText' => $optionsArray['savedText']));
}
}
?>

View File

@@ -0,0 +1,38 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* The contents of this file are subject to the SugarCRM Professional Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
* By installing or using this file, You have unconditionally agreed to the
* terms and conditions of the License, and You may not use this file except in
* compliance with the License. Under the terms of the license, You shall not,
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
* or otherwise transfer Your rights to the Software, and 2) use the Software
* for timesharing or service bureau purposes such as hosting the Software for
* commercial gain and/or for the benefit of a third party. Use of the Software
* may be subject to applicable fees and any use of the Software without first
* paying applicable fees is strictly prohibited. You do not have the right to
* remove SugarCRM copyrights from the source code or user interface.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2004-2007 SugarCRM, Inc.; All Rights Reserved.
*/
$dashletStrings['InvadersDashlet'] = array('LBL_TITLE' => 'Najeźdźcy!',
'LBL_DESCRIPTION' => 'Ciekawy sposób spędzania czasu :)',
'LBL_DBLCLICK_HELP' => 'Użyj A i D, do poruszania się i S aby strzelać.',
);
?>

View File

@@ -0,0 +1,80 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div align="center">
<table cellpadding="0" cellspacing="0" class="playArea" style="overflow: hidden; background-color: black; background-image: url('modules/Home/Dashlets/InvadersDashlet/sprites/bg.png'); width: 400px; height:300px">
<tr height="16"><td><img id="shot" style="position: relative; top:245px; display: none" src="modules/Home/Dashlets/InvadersDashlet/sprites/cube.png" width="16" height="16"/></td></tr>
<tr height="32"><td><img id="player" style="position: relative; top:252px; left:134" src="modules/Home/Dashlets/InvadersDashlet/sprites/player.png" width="32" height="32"/></td></tr>
<tr><td><div id="aliens" style="position: relative; left:0px; width:172px;">
<table cellpadding="0" cellspacing="2"><tbody>
<tr>
<td id="a00" width="32" height="14">&nbsp;</td>
<td id="a10" width="32" height="14">&nbsp;</td>
<td id="a20" width="32" height="14">&nbsp;</td>
<td id="a30" width="32" height="14">&nbsp;</td>
<td id="a40" width="32" height="14">&nbsp;</td>
</tr>
<tr>
<td id="a01" width="32" height="14">&nbsp;</td>
<td id="a11" width="32" height="14">&nbsp;</td>
<td id="a21" width="32" height="14">&nbsp;</td>
<td id="a31" width="32" height="14">&nbsp;</td>
<td id="a41" width="32" height="14">&nbsp;</td>
</tr>
<tr>
<td id="a02" width="32" height="14">&nbsp;</td>
<td id="a12" width="32" height="14">&nbsp;</td>
<td id="a22" width="32" height="14">&nbsp;</td>
<td id="a32" width="32" height="14">&nbsp;</td>
<td id="a42" width="32" height="14">&nbsp;</td>
</tr>
<tr>
<td id="a03" width="32" height="14">&nbsp;</td>
<td id="a13" width="32" height="14">&nbsp;</td>
<td id="a23" width="32" height="14">&nbsp;</td>
<td id="a33" width="32" height="14">&nbsp;</td>
<td id="a43" width="32" height="14">&nbsp;</td>
</tr>
</tbody></table></div>
</td></tr>
</tr>
</table>
</div>
<div align="center" id="startScreen" style="position: relative; top: -125;" onclick="InvadersGame.reset()">
<a href="javascript:void(0);" class="otherTabLink"><h1 style="color: #FFF; " id="messageText">Click Here to Start!</h1></a>
</div>

View File

@@ -0,0 +1,261 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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}<script>
if(typeof InvadersGame == 'undefined') {
InvadersGame = function() {
var playerX, move, timer, rate, shotX, shotY, started, shotFired, alienX, alienY, aMove;
var rightRowsCleared, leftRowsCleared, bottomRow;
return {
init: function() {
//alert("initilized");
InvadersGame.rate = 30;
document.onkeydown = InvadersGame.keyDown;
document.onkeyup = InvadersGame.keyUp;
clearTimeout(InvadersGame.timer);
InvadersGame.timer = setTimeout("InvadersGame.update()",InvadersGame.rate);
InvadersGame.started = false;
InvadersGame.shotFired = false;
InvadersGame.level = 1;
},
moveLeft: function(frameTime) {
InvadersGame.playerX = InvadersGame.playerX + (5 * frameTime);
},
moveRight: function(frameTime) {
InvadersGame.playerX = InvadersGame.playerX - (5 * frameTime);
},
checkLoss: function() {
if (InvadersGame.alienY + (InvadersGame.bottomRow * 16) >= 110) {
InvadersGame.init();
//InvadersGame.alienY += 32;
var startScreen = document.getElementById("startScreen");
startScreen.style.display = "block";
var messageText = document.getElementById("messageText");
messageText.innerHTML = "Game Over";
}
},
keyDown: function(keyEvents) {
var key = (window.event) ? event.keyCode : keyEvents.keyCode;
if (InvadersGame.started) {
if (key == 65){ //'a' key
InvadersGame.move = -1;
}
if (key == 68){ //'d' key
InvadersGame.move = 1;
}
if (key == 83){ //'s' key
InvadersGame.shoot();
}
if (key == 82){ //'s' key
InvadersGame.reset();
}
}
},
keyUp: function(keyEvents) {
var key = (window.event) ? event.keyCode : keyEvents.keyCode;
if (key == 65 || key == 68){
InvadersGame.move = 0;
}
},
reset: function() {
InvadersGame.started = true;
InvadersGame.lastFrame = new Date().getTime();
var startScreen = document.getElementById("startScreen");
startScreen.style.display = "none";
var aliensTable = document.getElementById("aliens");
var aliens = aliensTable.getElementsByTagName("td");
var shot = document.getElementById("shot");
shot.style.display = "none";
var i=0;
for(i=0; i < aliens.length; i++) {
aliens[i].style.backgroundImage = "url('modules/Home/Dashlets/InvadersDashlet/sprites/alien.png')"
}
InvadersGame.playerX = 134;
InvadersGame.move = 0;
InvadersGame.aMove = (3 + InvadersGame.level) / 4;
InvadersGame.alienX = 0;
InvadersGame.alienY = -140;
InvadersGame.shoty = 250;
InvadersGame.shotFired = false;
InvadersGame.rightRowsCleared = 0;
InvadersGame.leftRowsCleared = 0;
InvadersGame.bottomRow = 3;
aliensTable.style.left = InvadersGame.alienX;
aliensTable.style.top = InvadersGame.alienY;
clearTimeout(InvadersGame.timer);
InvadersGame.timer = setTimeout("InvadersGame.update()",InvadersGame.rate);
},
shoot: function() {
if (!InvadersGame.shotFired) {
InvadersGame.shotX = InvadersGame.playerX;
InvadersGame.shotY = 250;
InvadersGame.shotFired = true;
var shot = document.getElementById("shot");
shot.style.left = InvadersGame.playerX + 8;
shot.style.top = 250;
shot.style.display = "inline";
}
},
update: function() {
var time = new Date().getTime();
var frameTime = (time - InvadersGame.lastFrame) / InvadersGame.rate;
if (frameTime == 0) frameTime = 1;
InvadersGame.lastFrame = time;
if (InvadersGame.started) {
if (InvadersGame.move < 0 && InvadersGame.playerX > 0) {
InvadersGame.moveRight(frameTime);
}
if (InvadersGame.move > 0 && InvadersGame.playerX < 368) {
InvadersGame.moveLeft(frameTime);
}
InvadersGame.alienX += InvadersGame.aMove * frameTime;
if (InvadersGame.aMove > 0 && InvadersGame.alienX > (225 + InvadersGame.rightRowsCleared)) {
InvadersGame.aMove = -(3 + InvadersGame.level) / (4);
InvadersGame.alienY += 16;
InvadersGame.checkLoss();
}
else if (InvadersGame.alienX < (0 - InvadersGame.leftRowsCleared)) {
InvadersGame.aMove = (3 + InvadersGame.level) / (4);
InvadersGame.alienY += 16;
InvadersGame.checkLoss();
}
var player = document.getElementById("player");
var shot = document.getElementById("shot");
var aliens = document.getElementById("aliens");
if (InvadersGame.shotY < 8){
InvadersGame.shotY = 235;
InvadersGame.shotFired = false;
shot.style.display = "none";
}
if (InvadersGame.shotFired) {
InvadersGame.shotY -= 5;
shot.style.top = InvadersGame.shotY;
}
player.style.left = InvadersGame.playerX;
aliens.style.left = InvadersGame.alienX;
aliens.style.top = InvadersGame.alienY;
if(InvadersGame.shotFired) {
InvadersGame.checkCollide(shot, aliens);
}
}
InvadersGame.timer = setTimeout("InvadersGame.update()",InvadersGame.rate);
},
nextLevel: function() {
InvadersGame.started = false;
var startScreen = document.getElementById("startScreen");
startScreen.style.display = "block";
InvadersGame.level++;
var messageText = document.getElementById("messageText");
messageText.innerHTML = "Level " + InvadersGame.level;
clearTimeout(InvadersGame.timer);
InvadersGame.timer = setTimeout("InvadersGame.reset()",5000);
},
checkCollide: function(shot, aliens) {
var sx = InvadersGame.shotX + 8;
var sy = InvadersGame.shotY;
var ax = InvadersGame.alienX;
var ay = InvadersGame.alienY + 140;
var cx = Math.floor((sx - ax) / 34);
var cy = Math.floor((sy - ay) / 16);
if (cx > -1 && cx < 5 && cy > -1 && cy < 4) {
var dAlien = document.getElementById("a" + cx + cy);
if (!(dAlien.style.backgroundImage == "none")) {
//Collision occured
dAlien.style.backgroundImage = "none";
InvadersGame.shotFired = false;
shot.style.display = "none";
var aliens = document.getElementById("aliens").getElementsByTagName("td");
var i = 0;
var col = 0;
var row = 0;
var count = new Array(5);
var rows = new Array(5);
for (i = 0; i < count.length; i++) {
count[i] = 0;
rows[i] = 0;
}
for (i = 0; i < aliens.length; i++) {
col = i % 5;
row = Math.floor(i / 5);
if (aliens[i].style.backgroundImage != "none") {
count[col]++;
rows[row]++;
}
}
if (count[0] == 0) {
if (count[1] == 0) {
if (count[2] == 0) {
if (count[3] == 0) {
if (count[4] == 0) { InvadersGame.nextLevel();}
else {InvadersGame.leftRowsCleared = 32 * 4;}
} else {InvadersGame.leftRowsCleared = 32 * 3;}
} else {InvadersGame.leftRowsCleared = 32 * 2;}
} else {InvadersGame.leftRowsCleared = 32;}
} else {InvadersGame.leftRowsCleared = 0;}
if (count[4] == 0) {
if (count[3] == 0) {
if (count[2] == 0) {
if (count[1] == 0) {
if (count[0] == 0) {InvadersGame.rightRowsCleared = 32 * 5;
} else {InvadersGame.rightRowsCleared = 32 * 4;}
} else {InvadersGame.rightRowsCleared = 32 * 3; }
} else {InvadersGame.rightRowsCleared = 32 * 2;}
} else { InvadersGame.rightRowsCleared = 32;}
} else {InvadersGame.rightRowsCleared = 0;}
for (i = 0; i < 4 ; i++) {
if (rows[i] > 0) {
InvadersGame.bottomRow = i;
}
}
}
}
}
};
}();
}
InvadersGame.init();
</script>{/literal}

View File

@@ -0,0 +1,70 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div style='width: 500px'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.sugarHome.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="400" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>{$titleLbl}</td>
<td valign='top' class='dataField'>
<input class="text" name="title" size='20' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$heightLbl}</td>
<td valign='top' class='dataField'>
<input class="text" name="height" size='3' value='{$height}'>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLbl}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,64 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$defaultText = "";
$dashletStrings['JotPadDashlet'] = array('LBL_TITLE' => 'JotPad',
'LBL_DESCRIPTION' => 'A dashlet to keep your notes',
'LBL_SAVING' => 'Saving JotPad ...',
'LBL_SAVED' => 'Saved',
'LBL_CONFIGURE_TITLE' => 'Title',
'LBL_CONFIGURE_HEIGHT' => 'Height (1 - 300)',
'LBL_DBLCLICK_HELP' => 'Double click below to Edit.',
'LBL_DEFAULT_TEXT' => $defaultText,
);
?>

View File

@@ -0,0 +1,87 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$defaultText =
<<<EOQ
<b>Wilkommen bei Sugar 5.2!</b><br /><br />
Klicken Sie auf <b>Mein Konto</b> um Ihre persönlichen Einstellungen zu verändern.<br>
Klicken Sie auf das <b>Fragezeichen</b> Icon um die Hilfeseiten für jedes Modul aufzurufen (tlw. Englisch).<br><br>
Bei Fragen bitte info@iscongroup.net oder +43 720 504177 bzw. +49 1801 995500 6042</b>.<br />
EOQ
;
$dashletStrings['JotPadDashlet'] = array('LBL_TITLE' => 'JotPad',
'LBL_DESCRIPTION' => 'Ein Dashlet für Ihre Notizen',
'LBL_SAVING' => 'Speichere JotPad ...',
'LBL_SAVED' => 'Gespeichert.',
'LBL_CONFIGURE_TITLE' => 'Titel',
'LBL_CONFIGURE_HEIGHT' => 'Höhe (1 - 300)',
'LBL_DBLCLICK_HELP' => 'Doppelklicken Sie unten um zu bearbeiten.',
'LBL_DEFAULT_TEXT' => $defaultText,
);
?>

View File

@@ -0,0 +1,47 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
global $app_strings, $current_language;
$dashletMeta['JotPadDashlet'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'icon' => 'themes/default/images/icon_JotPad_32.gif',
'category' => 'Tools',
'hidden' => true);
?>

View File

@@ -0,0 +1,176 @@
<?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 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
require_once('include/Sugar_Smarty.php');
class JotPadDashlet extends Dashlet {
var $savedText; // users's saved text
var $height = '200'; // height of the pad
/**
* Constructor
*
* @global string current language
* @param guid $id id for the current dashlet (assigned from Home module)
* @param array $def options saved for this dashlet
*/
function JotPadDashlet($id, $def) {
$this->loadLanguage('JotPadDashlet'); // load the language strings here
if(!empty($def['savedText'])) // load default text is none is defined
$this->savedText = $def['savedText'];
else
$this->savedText = $this->dashletStrings['LBL_DEFAULT_TEXT'];
if(!empty($def['height'])) // set a default height if none is set
$this->height = $def['height'];
parent::Dashlet($id); // call parent constructor
$this->isConfigurable = true; // dashlet is configurable
$this->hasScript = true; // dashlet has javascript attached to it
// if no custom title, use default
if(empty($def['title'])) $this->title = $this->dashletStrings['LBL_TITLE'];
else $this->title = $def['title'];
}
/**
* Displays the dashlet
*
* @return string html to display dashlet
*/
function display() {
$ss = new Sugar_Smarty();
$xss = clean_xss($this->savedText, false);
if(!empty($xss)) {
$this->savedText = str_replace($xss, "", $this->savedText);
}
$ss->assign('savedText', $this->savedText);
$ss->assign('saving', $this->dashletStrings['LBL_SAVING']);
$ss->assign('saved', $this->dashletStrings['LBL_SAVED']);
$ss->assign('id', $this->id);
$ss->assign('height', $this->height);
$str = $ss->fetch('modules/Home/Dashlets/JotPadDashlet/JotPadDashlet.tpl');
return parent::display($this->dashletStrings['LBL_DBLCLICK_HELP']) . $str . '<br />'; // return parent::display for title and such
}
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
function displayScript() {
$ss = new Sugar_Smarty();
$ss->assign('saving', $this->dashletStrings['LBL_SAVING']);
$ss->assign('saved', $this->dashletStrings['LBL_SAVED']);
$ss->assign('id', $this->id);
$str = $ss->fetch('modules/Home/Dashlets/JotPadDashlet/JotPadDashletScript.tpl');
return $str; // return parent::display for title and such
}
/**
* Displays the configuration form for the dashlet
*
* @return string html to display form
*/
function displayOptions() {
global $app_strings;
$ss = new Sugar_Smarty();
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
$ss->assign('heightLbl', $this->dashletStrings['LBL_CONFIGURE_HEIGHT']);
$ss->assign('saveLbl', $app_strings['LBL_SAVE_BUTTON_LABEL']);
$ss->assign('title', $this->title);
$ss->assign('height', $this->height);
$ss->assign('id', $this->id);
return parent::displayOptions() . $ss->fetch('modules/Home/Dashlets/JotPadDashlet/JotPadDashletOptions.tpl');
}
/**
* called to filter out $_REQUEST object when the user submits the configure dropdown
*
* @param array $req $_REQUEST
* @return array filtered options to save
*/
function saveOptions($req) {
global $sugar_config, $timedate, $current_user, $theme;
$options = array();
$options['title'] = $_REQUEST['title'];
if(is_numeric($_REQUEST['height'])) {
if($_REQUEST['height'] > 0 && $_REQUEST['height'] <= 300) $options['height'] = $_REQUEST['height'];
elseif($_REQUEST['height'] > 300) $options['height'] = '300';
else $options['height'] = '100';
}
// $options['savedText'] = br2nl($this->savedText);
$options['savedText'] = $this->savedText;
return $options;
}
/**
* Used to save text on textarea blur. Accessed via Home/CallMethodDashlet.php
* This is an example of how to to call a custom method via ajax
*/
function saveText() {
$json = getJSONobj();
if(isset($_REQUEST['savedText'])) {
$optionsArray = $this->loadOptions();
// _pp($_REQUEST['savedText']);
$optionsArray['savedText']=$json->decode(html_entity_decode($_REQUEST['savedText']));
$optionsArray['savedText']=nl2br($optionsArray['savedText']['jsonObject']);
$xss = clean_xss($optionsArray['savedText'], false);
if(!empty($xss)) {
$optionsArray['savedText'] = str_replace($xss, "", $optionsArray['savedText']);
}
$this->storeOptions($optionsArray);
}
else {
$optionsArray['savedText'] = '';
}
echo 'result = ' . $json->encode(array('id' => $_REQUEST['id'],
'savedText' => $optionsArray['savedText']));
}
}
?>

View File

@@ -0,0 +1,14 @@
<?php
$dashletStrings['JotPadDashlet'] = array('LBL_TITLE' => 'Pomocnik Edycji Widoku',
'LBL_DESCRIPTION' => 'Pasek Twoich Notatek',
'LBL_SAVING' => 'Zapisuję Twój Widok ...',
'LBL_SAVED' => 'Zapisano',
'LBL_CONFIGURE_TITLE' => 'Tytuł',
'LBL_CONFIGURE_HEIGHT' => 'Wysokość (1 - 300)',
'LBL_DBLCLICK_HELP' => 'Kliknij dwa razy poniżej, aby edytować.',
'LBL_DEFAULT_TEXT' => "Witaj w SugarCRM!\n\nMożesz dowolnie zmienić wygląd Twojej Strony Głównej, aby pasowała do Twoich Potrzeb.\n\n" .
"* Dodawaj nowe Belki, klikając na \"Dodaj Belkę\" w lewym górnym rogu ekranu.\n" .
"* Zmieniaj każdą z Belek, klikając na Ikonce Konfiguracji w prawym górnym rogu każdej z Belek\n" .
"* Usuń Belkę klikając na znaku X");
?>

View File

@@ -0,0 +1,44 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div id='jotpad_{$id}' ondblclick='JotPad.edit(this, "{$id}")' style='overflow: auto; width: 100%; height: {$height}px; border: 1px #ddd solid'>{$savedText}</div>
<textarea id='jotpad_textarea_{$id}' rows="5" onblur='JotPad.blur(this, "{$id}")' style='display: none; width: 100%; height: {$height}px; overflow: auto'></textarea>

View File

@@ -0,0 +1,70 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div style='width: 500px'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="400" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>{$titleLbl}</td>
<td valign='top' class='dataField'>
<input class="text" name="title" size='20' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$heightLbl}</td>
<td valign='top' class='dataField'>
<input class="text" name="height" size='3' value='{$height}'>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLbl}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,88 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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}<script>
if(typeof JotPad == 'undefined') { // since the dashlet can be included multiple times a page, don't redefine these functions
JotPad = function() {
return {
/**
* Called when the textarea is blurred
*/
blur: function(ta, id) {
ajaxStatus.showStatus('{/literal}{$saving}{literal}'); // show that AJAX call is happening
// what data to post to the dashlet
var va=JSON.stringify(ta.value);
postData = 'to_pdf=1&module=Home&action=CallMethodDashlet&method=saveText&id=' + id + '&savedText=' + va;
var cObj = YAHOO.util.Connect.asyncRequest('POST','index.php',
{success: JotPad.saved, failure: JotPad.saved}, postData);
},
/**
* Called when the textarea is double clicked on
*/
edit: function(divObj, id) {
ta = document.getElementById('jotpad_textarea_' + id);
if(isIE) ta.value = divObj.innerHTML.replace(/<br>/gi, "\n");
else ta.value = divObj.innerHTML.replace(/<br>/gi, '');
ta.value = ta.value.replace(/&amp;/, "&");
divObj.style.display = 'none';
ta.style.display = '';
ta.focus();
},
/**
* handle the response of the saveText method
*/
saved: function(data) {
eval(data.responseText);
ajaxStatus.showStatus('{/literal}{$saved}{literal}');
if(typeof result != 'undefined') {
ta = document.getElementById('jotpad_textarea_' + result['id']);
theDiv = document.getElementById('jotpad_' + result['id']);
theDiv.innerHTML = result['savedText'];
}
ta.style.display = 'none';
theDiv.style.display = '';
window.setTimeout('ajaxStatus.hideStatus()', 2000);
}
};
}();
}
</script>{/literal}

View File

@@ -0,0 +1,49 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$dashletStrings['MyEcmCalendarsDashlets'] = array('LBL_TITLE' => 'Calendar',
'LBL_DESCRIPTION' => 'A Calendar Dashlet',
'LBL_SAVING' => 'Saving Calendar ...',
'LBL_SAVED' => 'Saved',
'LBL_CONFIGURE_TITLE' => 'Title',
'LBL_CONFIGURE_STATUS' => 'Default status',
'LBL_CONFIGURE_USER' => 'Activity user',
'LBL_CONFIGURE_TYPE' => 'Activity type',
'LBL_DBLCLICK_HELP' => 'Double click below to Edit.',
'LBL_DEFAULT_TEXT' => '',
);
?>

View File

@@ -0,0 +1,47 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
global $app_strings, $current_language;
$dashletMeta['MyEcmCalendarsDashlets'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'icon' => 'themes/default/images/EcmCalendars.gif',
'category' => 'Tools',
'hidden' => true);
?>

View File

@@ -0,0 +1,237 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
require_once('include/Sugar_Smarty.php');
class MyEcmCalendarsDashlets extends Dashlet {
var $height = '200';
var $act_status;
var $act_user;
var $act_type;
function MyEcmCalendarsDashlets($id, $def) {
$this->loadLanguage('MyEcmCalendarsDashlets'); // load the language strings here
if(!empty($def['savedText'])) // load default text is none is defined
$this->savedText = $def['savedText'];
else
$this->savedText = $this->dashletStrings['LBL_DEFAULT_TEXT'];
if(!empty($def['height'])) // set a default height if none is set
$this->height = $def['height'];
$this->act_status = $def['act_status'];
$this->act_user = $def['act_user'];
$this->act_type = $def['act_type'];
parent::Dashlet($id); // call parent constructor
$this->isConfigurable = true; // dashlet is configurable
$this->hasScript = true; // dashlet has javascript attached to it
// if no custom title, use default
if(empty($def['title'])) $this->title = 'Mój Kalendarz';
else $this->title = $def['title'];
}
/**
* Displays the dashlet
*
* @return string html to display dashlet
*/
function display() {
$ss = new Sugar_Smarty();
$ss->assign('savedText', $this->savedText);
$ss->assign('saving', $this->dashletStrings['LBL_SAVING']);
$ss->assign('saved', $this->dashletStrings['LBL_SAVED']);
$ss->assign('id', $this->id);
$ss->assign('height', $this->height);
$str = $ss->fetch('modules/Home/Dashlets/MyEcmCalendarsDashlets/MyEcmCalendarsDashlets.tpl');
require_once("modules/EcmCalendars/Calendar.php");
require_once("modules/EcmCalendars/language/pl_pl.lang.php");
$cal=new Calendar();
if($_REQUEST['date'])
{
$exp=explode("-",$_REQUEST['date']);
$cal->year=$exp[0];
$cal->month=$exp[1];
}
else
{
$cal->year=date("Y");
$cal->month=date("m");
}
$cal->act_status=$this->act_status;
$cal->act_user=$this->act_user;
$cal->act_type=$this->act_type;
if(!$this->act_type)$cal->act_type="All";
$_SESSION['calendar_dashlet_id']=$this->id;
$str='
<link href="modules/EcmCalendars/style.css" rel="stylesheet" type="text/css">
<script src="modules/EcmCalendars/helper.js" language="javascript"></script>
<script src="modules/EcmCalendars/Calendar.js" language="javascript"></script>
<div id="calendar_dashlet">'.$cal->showTableDashlet($cal->month,$cal->year).'</div>
';
return parent::display("") . $str . '<br />'; // return parent::display for title and such
}
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
function displayScript() {
$ss = new Sugar_Smarty();
$ss->assign('saving', $this->dashletStrings['LBL_SAVING']);
$ss->assign('saved', $this->dashletStrings['LBL_SAVED']);
$ss->assign('id', $this->id);
$str = $ss->fetch('modules/Home/Dashlets/MyEcmCalendarsDashlets/MyEcmCalendarsDashletsScript.tpl');
return $str; // return parent::display for title and such
}
/**
* Displays the configuration form for the dashlet
*
* @return string html to display form
*/
function displayOptions() {
global $app_strings,$GLOBALS;
$ss = new Sugar_Smarty();
$arr=array("All","Planned","Held","Not Held");
$as='';
global $app_list_strings;
$as.='<option value="All"';
$as.='>Wszystkie</option>';
foreach ($app_list_strings['activity_status_dom'] as $k=>$v) {
$as.='<option value="'.$k.'"';
if($this->act_status==$k)$as.=" selected";
$as.='>'.$v.'</option>';
}
$ss->assign('act_status_options', $as);
$arr=array("All","Calls","Meetings","Tasks");
$at='';
$at.='<option value="All"';
if($this->act_type=="All")$at.=" selected";
$at.='>Wszystkie</option><option value="Calls"';
if($this->act_type=="Calls")$at.=" selected";
$at.='>Rozmowy</option><option value="Meetings"';
if($this->act_type=="Meetings")$at.=" selected";
$at.='>Spotkania</option><option value="Tasks"';
if($this->act_type=="Tasks")$at.=" selected";
$at.='>Zadania</option></select>';
$ss->assign('act_type_options', $at);
$ua='<option value="All"';
if($this->act_user=='All')$ua.=' selected';
$ua.='>Wszyscy</option>';
$w=mysql_query("select user_name,id from users where deleted='0' order by user_name asc");
while($r=mysql_fetch_array($w))
{
$ua.='<option value="'.$r['id'].'"';
if($r['id']==$this->act_user)$ua.=' selected';
$ua.='>'.$r['user_name'].'</option>';
}
$ss->assign('act_user_options', $ua);
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
$ss->assign('statusLbl', $this->dashletStrings['LBL_CONFIGURE_STATUS']);
$ss->assign('userLbl', $this->dashletStrings['LBL_CONFIGURE_USER']);
$ss->assign('typeLbl', $this->dashletStrings['LBL_CONFIGURE_TYPE']);
$ss->assign('saveLbl', $app_strings['LBL_SAVE_BUTTON_LABEL']);
$ss->assign('title', $this->title);
$ss->assign('height', $this->height);
$ss->assign('id', $this->id);
return parent::displayOptions() . $ss->fetch('modules/Home/Dashlets/MyEcmCalendarsDashlets/MyEcmCalendarsDashletsOptions.tpl');
}
/**
* called to filter out $_REQUEST object when the user submits the configure dropdown
*
* @param array $req $_REQUEST
* @return array filtered options to save
*/
function saveOptions($req) {
global $sugar_config, $timedate, $current_user, $theme;
$options = array();
$options['title'] = $_REQUEST['title'];
$options['act_status'] = $_REQUEST['act_status'];
$options['act_user'] = $_REQUEST['act_user'];
$options['act_type'] = $_REQUEST['act_type'];
if(is_numeric($_REQUEST['height'])) {
if($_REQUEST['height'] > 0 && $_REQUEST['height'] <= 300) $options['height'] = $_REQUEST['height'];
elseif($_REQUEST['height'] > 300) $options['height'] = '300';
else $options['height'] = '100';
}
// $options['savedText'] = br2nl($this->savedText);
$options['savedText'] = $this->savedText;
return $options;
}
/**
* Used to save text on textarea blur. Accessed via Home/CallMethodDashlet.php
* This is an example of how to to call a custom method via ajax
*/
function saveText() {
$json = getJSONobj();
if(isset($_REQUEST['savedText'])) {
$optionsArray = $this->loadOptions();
// _pp($_REQUEST['savedText']);
$optionsArray['savedText']=$json->decode(html_entity_decode($_REQUEST['savedText']));
$optionsArray['savedText']=nl2br($optionsArray['savedText']['jsonObject']);
$this->storeOptions($optionsArray);
}
else {
$optionsArray['savedText'] = '';
}
echo 'result = ' . $json->encode(array('id' => $_REQUEST['id'],
'savedText' => $optionsArray['savedText']));
}
}
?>

View File

@@ -0,0 +1,44 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div id='jotpad_{$id}' ondblclick='JotPad.edit(this, "{$id}")' style='overflow: auto; width: 100%; height: {$height}px; border: 1px #ddd solid'>{$savedText}lkjhlkjhlkjhlkjh</div>
<textarea id='jotpad_textarea_{$id}' rows="5" onblur='JotPad.blur(this, "{$id}")' style='display: none; width: 100%; height: {$height}px; overflow: auto'></textarea>

View File

@@ -0,0 +1,82 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div style='width: 500px'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="400" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>Tytuł</td>
<td valign='top' class='dataField'>
<input class="text" name="title" size='20' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Status</td>
<td valign='top' class='dataField'>
<select name='act_status'>{$act_status_options}</select>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Użytkownik</td>
<td valign='top' class='dataField'>
<select name='act_user'>{$act_user_options}</select>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Działania</td>
<td valign='top' class='dataField'>
<select name='act_type'>{$act_type_options}</select>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLbl}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,88 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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}<script>
if(typeof JotPad == 'undefined') { // since the dashlet can be included multiple times a page, don't redefine these functions
JotPad = function() {
return {
/**
* Called when the textarea is blurred
*/
blur: function(ta, id) {
ajaxStatus.showStatus('{/literal}{$saving}{literal}'); // show that AJAX call is happening
// what data to post to the dashlet
var va=JSON.stringify(ta.value);
postData = 'to_pdf=1&module=Home&action=CallMethodDashlet&method=saveText&id=' + id + '&savedText=' + va;
var cObj = YAHOO.util.Connect.asyncRequest('POST','index.php',
{success: JotPad.saved, failure: JotPad.saved}, postData);
},
/**
* Called when the textarea is double clicked on
*/
edit: function(divObj, id) {
ta = document.getElementById('jotpad_textarea_' + id);
if(isIE) ta.value = divObj.innerHTML.replace(/<br>/gi, "\n");
else ta.value = divObj.innerHTML.replace(/<br>/gi, '');
ta.value = ta.value.replace(/&amp;/, "&");
divObj.style.display = 'none';
ta.style.display = '';
ta.focus();
},
/**
* handle the response of the saveText method
*/
saved: function(data) {
eval(data.responseText);
ajaxStatus.showStatus('{/literal}{$saved}{literal}');
if(typeof result != 'undefined') {
ta = document.getElementById('jotpad_textarea_' + result['id']);
theDiv = document.getElementById('jotpad_' + result['id']);
theDiv.innerHTML = result['savedText'];
}
ta.style.display = 'none';
theDiv.style.display = '';
window.setTimeout('ajaxStatus.hideStatus()', 2000);
}
};
}();
}
</script>{/literal}

View File

@@ -0,0 +1,81 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div style='width: 100%'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="400" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>{$titleLbl}</td>
<td valign='top' class='dataField'>
<input class="text" name="title" size='20' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Date</td>
<td class="dataField" valign="top">
<input onblur="parseDate(this, '%d.%m.%Y');" class="text" name="date" size="12" maxlength="10" id="date" value="{$date}">
<img src="themes/default/images/jscalendar.gif" alt="" id="date_trigger" align="absmiddle">
<script type="text/javascript">
{literal}Calendar.setup ({inputField : "date", ifFormat : "%d.%m.%Y", showsTime : false, button : "date_trigger", singleClick : true, step : 1});{/literal}
</script>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$userLbl}</td>
<td valign='top' class='dataField'>
<select name='user[]' size="6" multiple="multiple">{$user_options}
</select>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLbl}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,81 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div style='width: 100%'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="400" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>{$titleLbl}</td>
<td valign='top' class='dataField'>
<input class="text" name="title" size='20' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Date</td>
<td class="dataField" valign="top">
<input onblur="parseDate(this, '%d.%m.%Y');" class="text" name="date" size="12" maxlength="10" id="date" value="{$date}">
<img src="themes/default/images/jscalendar.gif" alt="" id="date_trigger" align="absmiddle">
<script type="text/javascript">
{literal}Calendar.setup ({inputField : "date", ifFormat : "{/literal}{$format}{literal}", showsTime : false, button : "date_trigger", singleClick : true, step : 1});{/literal}
</script>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$userLbl}</td>
<td valign='top' class='dataField'>
<select name='user[]' size="6" multiple="multiple">{$user_options}
</select>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLbl}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,49 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$dashletStrings['MyEcmCallsMoreDashlets'] = array('LBL_TITLE' => 'Calls summary',
'LBL_DESCRIPTION' => 'A user calls summary dashlet',
'LBL_SAVING' => 'Saving calls summary ...',
'LBL_SAVED' => 'Saved',
'LBL_CONFIGURE_TITLE' => 'Title',
'LBL_CONFIGURE_STATUS' => 'Default status',
'LBL_CONFIGURE_USER' => 'User',
'LBL_CONFIGURE_TYPE' => 'Type',
'LBL_DBLCLICK_HELP' => 'Double click below to Edit.',
'LBL_DEFAULT_TEXT' => '',
);
?>

View File

@@ -0,0 +1,46 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
global $app_strings, $current_language;
$dashletMeta['MyEcmCallsMoreDashlets'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'icon' => 'themes/default/images/EcmCallsMore.gif',
'category' => 'Tools');
?>

View File

@@ -0,0 +1,458 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
require_once('include/Sugar_Smarty.php');
class MyEcmCallsMoreDashlets extends Dashlet {
var $height = '200';
var $user=array();
function MyEcmCallsMoreDashlets($id, $def) {
$this->loadLanguage('MyEcmCallsMoreDashlets');
if(!empty($def['height']))
$this->height = $def['height'];
$this->user = $def['user'];
if($def['date'])$this->date = $GLOBALS['timedate']->to_display_date($def['date']);
else $this->date=$GLOBALS['timedate']->to_display_date(date("Y-m-d"));
if(count($this->user)==0){
$w=$GLOBALS['db']->query("select id from users where deleted='0' and status='Active' and phone_work!=''");
while($r=$GLOBALS['db']->fetchByAssoc($w)){
$this->user[]=$r['id'];
}
}
parent::Dashlet($id); // call parent constructor
$this->isConfigurable = true; // dashlet is configurable
$this->hasScript = true; // dashlet has javascript attached to it
// if no custom title, use default
if(empty($def['title'])) $this->title = $this->dashletStrings['LBL_TITLE'];
else $this->title = $def['title'];
}
function display() {
$ss = new Sugar_Smarty();
$ss->assign('savedText', $this->savedText);
$ss->assign('saving', $this->dashletStrings['LBL_SAVING']);
$ss->assign('saved', $this->dashletStrings['LBL_SAVED']);
$ss->assign('id', $this->id);
$ss->assign('height', $this->height);
$str='';
//echo $this->date;
$exp=explode("-",$GLOBALS['timedate']->to_db_date($this->date));
//echo $GLOBALS['timedate']->to_db_date($this->date)."mm";
$dm=$exp[1];
$dd=$exp[2];
$dy=$exp[0];
$trd=array(
6=>0,
0=>1,
1=>2,
2=>3,
3=>4,
4=>5,
5=>6,
);
//echo "<br>".$dy." ".$dm." ".$dd;
$no_actual_day=date("w",mktime(0,0,0,$dm,$dd,$dy));
//echo $no_actual_day;
$date_first=date("Y-m-d",mktime(0,0,0,$dm,$dd,$dy)-($no_actual_day)*(3600*24)+3600*24);
//echo $date_first;
$expl=explode("-",$date_first);
$ds=array(0,1,2,3,4);
$m=0;
foreach($ds as $dss){
$days[$m]=date("Y-m-d",mktime(0,0,0,$expl[1],$expl[2],$expl[0])+$m*3600*24);
$m++;
}
//print_r($days);
/*
$days[$no_actual_day]=$GLOBALS['timedate']->to_db_date($this->date);
//echo $this->date;die();
if($no_actual_day>0){
for($i=0;$i<$no_actual_day;$i++){
$days[$i]=date("Y-m-d",mktime(0,0,0,$dm,$dd,$dy)-($i+1)*(3600*24));
}
}
for($i=$no_actual_day+1;$i<=6;$i++){
$days[$i]=date("Y-m-d",mktime(0,0,0,$dm,$dd,$dy)+($i-$no_actual_day)*(3600*24));
}*/
//$this->user=array("178770a9-cd31-9f5e-6ee4-4acb40f6381c","dbf183f4-70da-2e17-1745-4acb40d0294b");
if(count($this->user)>0){
foreach($this->user as $u){
foreach($days as $ddd){
$w=$GLOBALS['db']->query("select * from ecmcallsphones where bean_id='".$u."'");
while($r=$GLOBALS['db']->fetchByAssoc($w)){
/*$p[$r['bean_id'][$ddd]]['busy']=mysql_num_rows($GLOBALS['db']->query("select id from cdr where disposition='BUSY' and src='".$r['phone']."' and (calldate like '".$ddd."%')"));
$ww=$GLOBALS['db']->query("select duration from cdr where disposition='BUSY' and src='".$r['phone']."' and (calldate like '".$ddd."%')");
while($rr=$GLOBALS['db']->fetchByAssoc($ww)){
$p[$r['bean_id']][$ddd]['busy_duration']+=$rr['duration'];
}*/
$p[$r['bean_id']][$ddd]['answered_up_60']=mysql_num_rows($GLOBALS['db']->query("select id from cdr where disposition like 'ANSWERED' and deleted='0' and duration>60 and src='".$r['phone']."' and (calldate like '".$ddd."%')"));
$ww=$GLOBALS['db']->query("select duration,dst from cdr where disposition='ANSWERED' and deleted='0' and duration>60 and src='".$r['phone']."' and (calldate like '".$ddd."%')");
$temp=array();
$dttt=0;
while($rr=$GLOBALS['db']->fetchByAssoc($ww)){
$p[$r['bean_id']][$ddd]['answered_up_60_duration']+=$rr['duration'];
$temp[$rr['dst']]+=$rr['duration'];
}
$p[$r['bean_id']][$ddd]['answered_up_60_distinct']=count($temp);
foreach($temp as $tte)$dttt+=$tte;
$p[$r['bean_id']][$ddd]['answered_up_60_distinct_duration']=$dttt;
$temp_cnt=0;
$dur_tt=0;
if(count($temp)>0){
foreach($temp as $temp_key=>$temp_value){
$www=$GLOBALS['db']->query("select dst,duration from cdr where disposition='ANSWERED' and deleted='0' and duration>60 and src='".$r['phone']."' and dst='".$temp_key."' and calldate like '".$ddd."%'");
if(mysql_num_rows($GLOBALS['db']->query("select dst,duration from cdr where disposition='ANSWERED' and deleted='0' and duration>60 and src='".$r['phone']."' and dst='".$temp_key."' and calldate<'".$ddd."'"))==0){
$temp_cnt++;
}
while($rrr=$GLOBALS['db']->fetchByAssoc($www))$dur_tt+=$rrr['duration'];
}
}
$p[$r['bean_id']][$ddd]['answered_up_60_new']=$temp_cnt;
$p[$r['bean_id']][$ddd]['answered_up_60_new_duration']=$dur_tt;
$p[$r['bean_id']][$ddd]['failed']=mysql_num_rows($GLOBALS['db']->query("select id from cdr where disposition like 'ANSWERED' and deleted='0' and duration<=60 and src='".$r['phone']."' and (calldate like '".$ddd."%')"));
$ww=$GLOBALS['db']->query("select duration,dst from cdr where disposition like 'ANSWERED' and deleted='0' and duration<=60 and src='".$r['phone']."' and (calldate like '".$ddd."%')");
$temp=array();
$dttt=0;
while($rr=$GLOBALS['db']->fetchByAssoc($ww)){
$p[$r['bean_id']][$ddd]['failed_duration']+=$rr['duration'];
$temp[$rr['dst']]+=$rr['duration'];
}
$p[$r['bean_id']][$ddd]['failed_distinct']=count($temp);
foreach($temp as $tte)$dttt+=$tte;
$p[$r['bean_id']][$ddd]['failed_distinct_duration']=$dttt;
$temp_cnt=0;
$dur_tt=0;
if(count($temp)>0){
foreach($temp as $temp_key=>$temp_value){
$www=$GLOBALS['db']->query("select dst,duration from cdr where disposition like 'ANSWERED' and deleted='0' and duration<=60 and src='".$r['phone']."' and dst='".$temp_key."' and calldate like '".$ddd."%'");
if(mysql_num_rows($GLOBALS['db']->query("select dst,duration from cdr where disposition like 'ANSWERED' and deleted='0' and duration<=60 and src='".$r['phone']."' and dst='".$temp_key."' and calldate<'".$ddd."'"))==0){
$temp_cnt++;
}
while($rrr=$GLOBALS['db']->fetchByAssoc($www))$dur_tt+=$rrr['duration'];
}
}
$p[$r['bean_id']][$ddd]['failed_new']=$temp_cnt;
$p[$r['bean_id']][$ddd]['failed_new_duration']=$dur_tt;
/*echo '<pre>';
print_r($p[$r['bean_id']]);
echo '</pre>';
$p[$r['bean_id']][$ddd]['failed']=mysql_num_rows($GLOBALS['db']->query("select id from cdr where disposition='FAILED' and src='".$r['phone']."' and (calldate like '".$ddd."%')"));
$ww=$GLOBALS['db']->query("select duration from cdr where disposition='FAILED' and src='".$r['phone']."' and (calldate like '".$ddd."%')");
while($rr=$GLOBALS['db']->fetchByAssoc($ww)){
$p[$r['bean_id']][$ddd]['failed_duration']+=$rr['duration'];
}
$p[$r['bean_id']][$ddd]['no_answer']=mysql_num_rows($GLOBALS['db']->query("select id from cdr where disposition='NO ANSWER' and src='".$r['phone']."' and (calldate like '".$ddd."%')"));
$ww=$GLOBALS['db']->query("select duration from cdr where disposition='NO ANSWER' and src='".$r['phone']."' and (calldate like '".$ddd."%')");
while($rr=$GLOBALS['db']->fetchByAssoc($ww)){
$p[$r['bean_id']][$ddd]['no_answer_duration']+=$rr['duration'];
}*/
}
}
}
}
$days=$this->multisort($days,array(array('key'=>0,'sort'=>'asc')));
//echo '<pre>';
//print_r($p);
//echo '</pre>';
$str.='<div style="border: 1px solid #cccccc;min-width:500px;max-width:700px;overflow:auto">';
$str.='<table cellspacing="0" cellpadding="0" border="0" width="100%">';
$str.='<tr class="listViewThLinkS1" align="center" valign="top">';
$str.='<td>&nbsp;</td>';
for($i=0;$i<count($days);$i++){
$str.='<td colspan="3" style="border: 1px solid #cccccc"><b>'.$GLOBALS['timedate']->to_display_date($days[$i]).'</b></td>';
}
$str.='<td colspan="3" style="border: 1px solid #cccccc"><b>Summary</b></td>';
$str.'</tr>';
$str.='<tr class="listViewThLinkS1" align="center" valign="top">';
$str.='<td class="listViewThS1">&nbsp;</td>';
for($i=0;$i<=count($days);$i++){
$str.='<td colspan="2" align="center" style="text-align: center;" class="listViewThS1"><img src="modules/Home/Dashlets/MyEcmCallsMoreDashlets/blue.png" border="0" /></td>';
//$str.='<td class="listViewThS1">&gt;60 (h:m)</td>';
$str.='<td class="listViewThS1"><img src="modules/Home/Dashlets/MyEcmCallsMoreDashlets/red.png" border="0" /></td>';
}
$str.='</tr>';
$type_arr=array("answered_up_60","failed");
$type_arr_distinct=array("answered_up_60_distinct","failed_distinct");
if(count($p)>0){
foreach($p as $k=>$v){
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select first_name,last_name,phone_work from users where id='".$k."'"));
if($k){
$str.='<tr align="center" valign="top">';
$str.='<td style="width:60px;padding:2px;border-bottom: 1px solid #cccccc;">'.$r['first_name'].' '.$r['last_name'].' ('.$r['phone_work'].')</td>';
foreach($v as $kk=>$vv){
foreach($type_arr as $ta){
if($ta=="answered_up_60")$sty="border-left: 1px solid #cccccc";
else $sty="";
if($vv[$ta])$str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;">'.$vv[$ta].'<br><span alt="distinct" title="distinct">'.$vv[$ta.'_distinct'].'</span><br><span alt="new" title="new">'.$vv[$ta.'_new'].'</span></td>';
else $str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;">0<br><span alt="distinct" title="distinct">0</span><br><span alt="new" title="new">0</span></td>';
if($ta!="failed"){
if($vv[$ta.'_duration']){
$m=floor($vv[$ta.'_duration']/60);
$h=floor($vv[$ta.'_duration']/3600);
$m=$m-60*$h;
$m2=floor($vv[$ta.'_distinct_duration']/60);
$h2=floor($vv[$ta.'_distinct_duration']/3600);
$m2=$m2-60*$h2;
$m3=floor($vv[$ta.'_new_duration']/60);
$h3=floor($vv[$ta.'_new_duration']/3600);
$m3=$m3-60*$h3;
$str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;">'.$h.'h '.$m.'m</td>';
}
else $str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;">0h 0m</td>';
}
$all[$k][$ta]+=$vv[$ta];
$all[$k][$ta."_distinct"]+=$vv[$ta."_distinct"];
$all[$k][$ta."_new"]+=$vv[$ta."_new"];
if($ta!="failed")$all[$k][$ta.'_duration']+=$vv[$ta.'_duration'];
if($ta!="failed")$all[$k][$ta.'_distinct_duration']+=$vv[$ta.'_distinct_duration'];
if($ta!="failed")$all[$k][$ta.'_new_duration']+=$vv[$ta.'_new_duration'];
$alla[$kk][$ta]+=$vv[$ta];
$alla[$kk][$ta."_distinct"]+=$vv[$ta."_distinct"];
$alla[$kk][$ta."_new"]+=$vv[$ta."_new"];
if($ta!="failed")$alla[$kk][$ta.'_duration']+=$vv[$ta.'_duration'];
if($ta!="failed")$alla[$kk][$ta.'_distinct_duration']+=$vv[$ta.'_distinct_duration'];
if($ta!="failed")$alla[$kk][$ta.'_new_duration']+=$vv[$ta.'_new_duration'];
$allaa[$ta]+=$vv[$ta];
$allaa[$ta."_distinct"]+=$vv[$ta."_distinct"];
$allaa[$ta."_new"]+=$vv[$ta."_new"];
if($ta!="failed")$allaa[$ta.'_duration']+=$vv[$ta.'_duration'];
if($ta!="failed")$allaa[$ta.'_distinct_duration']+=$vv[$ta.'_distinct_duration'];
if($ta!="failed")$allaa[$ta.'_new_duration']+=$vv[$ta.'_new_duration'];
}
}
foreach($type_arr as $ta){
if($ta=="answered_up_60")$sty="border-left: 1px solid #cccccc";
else $sty="";
if($all[$k][$ta])$str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;"><b>'.$all[$k][$ta].'<br><span alt="distinct" title="distinct">'.$all[$k][$ta."_distinct"].'</span><br><span alt="new" title="new">'.$all[$k][$ta."_new"].'</span></b></td>';
else $str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;"><b>0<br><span alt="distinct" title="distinct">0</span><br><span alt="new" title="new">0</span></b></td>';
if($ta!="failed"){
if($all[$k][$ta.'_duration']){
$m=floor($all[$k][$ta.'_duration']/60);
$h=floor($all[$k][$ta.'_duration']/3600);
$m=$m-60*$h;
$m2=floor($all[$k][$ta.'_distinct_duration']/60);
$h2=floor($all[$k][$ta.'_distinct_duration']/3600);
$m2=$m2-60*$h2;
$m3=floor($all[$k][$ta.'_new_duration']/60);
$h3=floor($all[$k][$ta.'_new_duration']/3600);
$m3=$m3-60*$h3;
$str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;"><b>'.$h.'h '.$m.'m</b></td>';
}
else $str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;"><b>0h 0m</b></td>';
}
}
$str.='</tr>';
}
}
}
$str.='<tr align="center" valign="top"><td><b>Summary</b></td>';
if(count($alla)>0){
foreach($alla as $al){
foreach($type_arr as $ta){
if($ta=="answered_up_60")$sty="border-left: 1px solid #cccccc";
else $sty="";
if($al[$ta])$str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;"><b>'.$al[$ta].'<br><span alt="distinct" title="distinct">'.$al[$ta."_distinct"].'</span><br><span alt="new" title="new">'.$al[$ta."_new"].'</span></b></td>';
else $str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;"><b>0<br><span alt="distinct" title="distinct">0</span><br><span alt="new" title="new">0</span></b></td>';
if($ta=="failed")continue;
if($al[$ta.'_duration']){
$m=floor($al[$ta.'_duration']/60);
$h=floor($al[$ta.'_duration']/3600);
$m=$m-60*$h;
$m2=floor($al[$ta.'_distinct_duration']/60);
$h2=floor($al[$ta.'_distinct_duration']/3600);
$m2=$m2-60*$h2;
$m3=floor($al[$ta.'_new_duration']/60);
$h3=floor($al[$ta.'_new_duration']/3600);
$m3=$m3-60*$h3;
$str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;"><b>'.$h.'h '.$m.'m</b></td>';
}
else $str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;"><b>0h 0m</b></td>';
}
}
}
foreach($type_arr as $ta){
if($ta=="answered_up_60")$sty="border-left: 1px solid #cccccc";
else $sty="";
if($allaa[$ta])$str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;"><b>'.$allaa[$ta].'<br><span alt="distinct" title="distinct">'.$allaa[$ta."_distinct"].'</span><br><span alt="new" title="new">'.$allaa[$ta."_new"].'</span></b></td>';
else $str.='<td style="'.$sty.';padding:2px;border-bottom: 1px solid #cccccc;"><b>0<br><span alt="distinct" title="distinct">0</span><br><span alt="new" title="new">0</span></b></td>';
if($ta=="failed")continue;
if($allaa[$ta.'_duration']){
$m=floor($allaa[$ta.'_duration']/60);
$h=floor($allaa[$ta.'_duration']/3600);
$m=$m-60*$h;
$m2=floor($allaa[$ta.'_distinct_duration']/60);
$h2=floor($allaa[$ta.'_distinct_duration']/3600);
$m2=$m2-60*$h2;
$m3=floor($allaa[$ta.'_new_duration']/60);
$h3=floor($allaa[$ta.'_new_duration']/3600);
$m3=$m3-60*$h3;
$str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;"><b>'.$h.'h '.$m.'m</b></td>';
}
else $str.='<td style="padding:2px;border-bottom: 1px solid #cccccc;"><b>0h 0m</b></td>';
}
$str.='</tr>';
$str.='</table>';
$str.='</div>';
return parent::display("") . $str . '<br />'; // return parent::display for title and such
}
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
function multisort($data,$keys)
{
if(count($data)>0)
{
foreach($data as $key => $row)
{
foreach($keys as $k)
{
$cols[$k['key']][$key] = $row[$k['key']];
}
}
$idkeys=@array_keys($data);
$i=0;
foreach($keys as $k)
{
if($i>0)$sort.=',';
$sort.='$cols['.$k['key'].']';
if($k['sort'])$sort.=',SORT_'.strtoupper($k['sort']);
if($k['type'])$sort.=',SORT_'.strtoupper($k['type']);
$i++;
}
$sort.=',$idkeys';
$sort='@array_multisort('.$sort.');';
eval($sort);
foreach($idkeys as $idkey)
{
$result[$idkey]=$data[$idkey];
}
return $result;
}
}
function displayScript() {
$ss = new Sugar_Smarty();
$ss->assign('saving', $this->dashletStrings['LBL_SAVING']);
$ss->assign('saved', $this->dashletStrings['LBL_SAVED']);
$ss->assign('id', $this->id);
$str = $ss->fetch('modules/Home/Dashlets/MyEcmCallsMoreDashlets/MyEcmCallsMoreDashletsScript.tpl');
return $str; // return parent::display for title and such
}
/**
* Displays the configuration form for the dashlet
*
* @return string html to display form
*/
function displayOptions() {
global $app_strings;
$ss = new Sugar_Smarty();
$ua='<option value="All"';
if($this->user[0]=='All' || $this->user[0]=='')$ua.=' selected';
$ua.='>All</option>';
$w=$GLOBALS['db']->query("select first_name,last_name,id from users where deleted='0' and status='Active' and phone_work!='' order by user_name asc");
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$ua.='<option value="'.$r['id'].'"';
if(is_array($this->user)){
if(in_array($r['id'],$this->user)){
$ua.=' selected';
}
}
$ua.='>'.$r['first_name'].' '.$r['last_name'].'</option>';
}
$ss->assign('user_options', $ua);
$ss->assign('date', $this->date);
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
$ss->assign('statusLbl', $this->dashletStrings['LBL_CONFIGURE_STATUS']);
$ss->assign('userLbl', $this->dashletStrings['LBL_CONFIGURE_USER']);
$ss->assign('typeLbl', $this->dashletStrings['LBL_CONFIGURE_TYPE']);
$ss->assign('saveLbl', $app_strings['LBL_SAVE_BUTTON_LABEL']);
$ss->assign('title', $this->title);
$ss->assign('height', $this->height);
$arr=array("d","m","Y","y");
$arrp=array("%d","%m","%Y","%y");
$ss->assign('format', str_replace($arr,$arrp,$GLOBALS['timedate']->get_date_format()));
$ss->assign('id', $this->id);
return parent::displayOptions() . $ss->fetch('modules/Home/Dashlets/MyEcmCallsMoreDashlets/MyEcmCallsMoreDashleOptions.tpl');
}
function saveOptions($req) {
global $sugar_config, $timedate, $current_user, $theme;
$options = array();
$options['title'] = $_REQUEST['title'];
$options['user'] = $_REQUEST['user'];
$exp=explode("-",$GLOBALS['timedate']->to_db_date($_REQUEST['date']));
$options['date'] = date("Y-m-d",mktime(0,0,0,$exp[1],$exp[2],$exp[0])+3600*24);
if(is_numeric($_REQUEST['height'])) {
if($_REQUEST['height'] > 0 && $_REQUEST['height'] <= 300) $options['height'] = $_REQUEST['height'];
elseif($_REQUEST['height'] > 300) $options['height'] = '300';
else $options['height'] = '100';
}
return $options;
}
}
?>

View File

@@ -0,0 +1,44 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div id='jotpad_{$id}' ondblclick='JotPad.edit(this, "{$id}")' style='overflow: auto; width: 100%; height: {$height}px; border: 1px #ddd solid'>{$savedText}lkjhlkjhlkjhlkjh</div>
<textarea id='jotpad_textarea_{$id}' rows="5" onblur='JotPad.blur(this, "{$id}")' style='display: none; width: 100%; height: {$height}px; overflow: auto'></textarea>

View File

@@ -0,0 +1,88 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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}<script>
if(typeof JotPad == 'undefined') { // since the dashlet can be included multiple times a page, don't redefine these functions
JotPad = function() {
return {
/**
* Called when the textarea is blurred
*/
blur: function(ta, id) {
ajaxStatus.showStatus('{/literal}{$saving}{literal}'); // show that AJAX call is happening
// what data to post to the dashlet
var va=JSON.stringify(ta.value);
postData = 'to_pdf=1&module=Home&action=CallMethodDashlet&method=saveText&id=' + id + '&savedText=' + va;
var cObj = YAHOO.util.Connect.asyncRequest('POST','index.php',
{success: JotPad.saved, failure: JotPad.saved}, postData);
},
/**
* Called when the textarea is double clicked on
*/
edit: function(divObj, id) {
ta = document.getElementById('jotpad_textarea_' + id);
if(isIE) ta.value = divObj.innerHTML.replace(/<br>/gi, "\n");
else ta.value = divObj.innerHTML.replace(/<br>/gi, '');
ta.value = ta.value.replace(/&amp;/, "&");
divObj.style.display = 'none';
ta.style.display = '';
ta.focus();
},
/**
* handle the response of the saveText method
*/
saved: function(data) {
eval(data.responseText);
ajaxStatus.showStatus('{/literal}{$saved}{literal}');
if(typeof result != 'undefined') {
ta = document.getElementById('jotpad_textarea_' + result['id']);
theDiv = document.getElementById('jotpad_' + result['id']);
theDiv.innerHTML = result['savedText'];
}
ta.style.display = 'none';
theDiv.style.display = '';
window.setTimeout('ajaxStatus.hideStatus()', 2000);
}
};
}();
}
</script>{/literal}

View File

@@ -0,0 +1,128 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div style='width: 100%'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>Title</td>
<td colspan="4" valign='top' class='dataField'>
<input class="text" name="title" size='20' value='{$title}'> </td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Period</td>
<td valign='top' class='dataField'>{$date}</td>
<td valign='top' class='dataField'>&nbsp;</td>
<td valign='top' class='dataField'>&nbsp;</td>
</tr>
<tr>
<td width="20%" valign='top' nowrap class='dataLabel'>&nbsp;</td>
<td width="20%" valign='top' class='dataField'>Show</td>
<td width="20%" valign='top' class='dataField'>Title</td>
<td width="20%" valign='top' class='dataField'>Order</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Sales</td>
<td valign='top' class='dataField'>{$sales}</td>
<td valign='top' class='dataField'>{$sales_title}</td>
<td valign='top' class='dataField'>{$sales_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Sales in year</td>
<td valign='top' class='dataField'>{$sales_year}</td>
<td valign='top' class='dataField'>{$sales_year_title}</td>
<td valign='top' class='dataField'>{$sales_year_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Order fulfillment</td>
<td valign='top' class='dataField'>{$percent}</td>
<td valign='top' class='dataField'>{$percent_title}</td>
<td valign='top' class='dataField'>{$percent_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Quotes</td>
<td valign='top' class='dataField'>{$quotes}</td>
<td valign='top' class='dataField'>{$quotes_title}</td>
<td valign='top' class='dataField'>{$quotes_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Orders</td>
<td valign='top' class='dataField'>{$orders}</td>
<td valign='top' class='dataField'>{$orders_title}</td>
<td valign='top' class='dataField'>{$orders_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Stocks</td>
<td valign='top' class='dataField'>{$stocks}</td>
<td valign='top' class='dataField'>{$stocks_title}</td>
<td valign='top' class='dataField'>{$stocks_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Products</td>
<td valign='top' class='dataField'>{$products}</td>
<td valign='top' class='dataField'>{$products_title}</td>
<td valign='top' class='dataField'>{$products_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>New products</td>
<td valign='top' class='dataField'>{$new_products}</td>
<td valign='top' class='dataField'>{$new_products_title}</td>
<td valign='top' class='dataField'>{$new_products_no}</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>Payments</td>
<td valign='top' class='dataField'>{$payments}</td>
<td valign='top' class='dataField'>{$payments_title}</td>
<td valign='top' class='dataField'>{$payments_no}</td>
</tr>
<tr>
<td align="right" colspan="5">
<input type='submit' class='button' value='{$saveLbl}'> </td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,46 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
$dashletStrings['MyEcmReportDashlets'] = array('LBL_TITLE' => 'Reports summary',
'LBL_DESCRIPTION' => 'A reports summary dashlet',
'LBL_SAVING' => 'Saving calls summary ...',
'LBL_SAVED' => 'Saved',
'LBL_CONFIGURE_TITLE' => 'Title',
'LBL_CONFIGURE_SAVE' => 'Save',
'LBL_DEFAULT_TEXT' => '',
);
?>

View File

@@ -0,0 +1,47 @@
<?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 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
global $app_strings, $current_language;
$dashletMeta['MyEcmReportDashlets'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'icon' => 'themes/default/images/EcmReport.gif',
'category' => 'Tools',
'hidden' => true);
?>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,44 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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".
*/
*}
<div id='jotpad_{$id}' ondblclick='JotPad.edit(this, "{$id}")' style='overflow: auto; width: 100%; height: {$height}px; border: 1px #ddd solid'>{$savedText}lkjhlkjhlkjhlkjh</div>
<textarea id='jotpad_textarea_{$id}' rows="5" onblur='JotPad.blur(this, "{$id}")' style='display: none; width: 100%; height: {$height}px; overflow: auto'></textarea>

View File

@@ -0,0 +1,88 @@
{*
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU 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}<script>
if(typeof JotPad == 'undefined') { // since the dashlet can be included multiple times a page, don't redefine these functions
JotPad = function() {
return {
/**
* Called when the textarea is blurred
*/
blur: function(ta, id) {
ajaxStatus.showStatus('{/literal}{$saving}{literal}'); // show that AJAX call is happening
// what data to post to the dashlet
var va=JSON.stringify(ta.value);
postData = 'to_pdf=1&module=Home&action=CallMethodDashlet&method=saveText&id=' + id + '&savedText=' + va;
var cObj = YAHOO.util.Connect.asyncRequest('POST','index.php',
{success: JotPad.saved, failure: JotPad.saved}, postData);
},
/**
* Called when the textarea is double clicked on
*/
edit: function(divObj, id) {
ta = document.getElementById('jotpad_textarea_' + id);
if(isIE) ta.value = divObj.innerHTML.replace(/<br>/gi, "\n");
else ta.value = divObj.innerHTML.replace(/<br>/gi, '');
ta.value = ta.value.replace(/&amp;/, "&");
divObj.style.display = 'none';
ta.style.display = '';
ta.focus();
},
/**
* handle the response of the saveText method
*/
saved: function(data) {
eval(data.responseText);
ajaxStatus.showStatus('{/literal}{$saved}{literal}');
if(typeof result != 'undefined') {
ta = document.getElementById('jotpad_textarea_' + result['id']);
theDiv = document.getElementById('jotpad_' + result['id']);
theDiv.innerHTML = result['savedText'];
}
ta.style.display = 'none';
theDiv.style.display = '';
window.setTimeout('ajaxStatus.hideStatus()', 2000);
}
};
}();
}
</script>{/literal}

View File

@@ -0,0 +1,154 @@
<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
$startTime = microtime(true);
require_once('/var/www/html/e5crm/include/entryPoint.php');
ob_start();
require_once("/var/www/html/e5crm/config.php");
require_once('/var/www/html/e5crm/include/MVC/SugarApplication.php');
$mm = new MysqlManager();
$mm->connect();
/*$app = new SugarApplication();
$app->startSession();
$app->execute();
*/
include_once( '/var/www/html/e5crm/include/ECM/open_flash_chart/ofc-library/open-flash-chart.php' );
include_once("/var/www/html/e5crm/modules/EcmReports/cache.php");
include_once("/var/www/html/e5crm/modules/EcmReports/class.sales.php");
$mmm=(int)date("m")-1;
if($mmm==0)$mmm=12;
$year_month=$_SESSION['EcmReports_Dashlet_sales'];
$e=explode("-",$_SESSION['EcmReports_Dashlet_sales']);
$year=$e[0];
$month=$e[1];
$s=new Sales();
$s->date_from=$year."-".$month."-01";
$s->date_to=$year."-".$month."-31";
$sdata=$s->getSalesByCategory();
$pred=new Sales();
$pred->date_from=$year."-01-01";
$pred->date_to=$year."-12-31";
$pred=$pred->getSalesByCategory();
function repl($t){
$a1=array("ą","ś","ę","ż","ź","ć","ń","ó","ł","Ą","Ś","Ę","Ż","Ź","Ć","Ń","Ó","Ł");
$a2=array("a","s","e","z","z","c","n","o","l","A","S","E","Z","Z","C","N","O","L");
return str_replace($a1,$a2,$t);
}
function salesPercent($category_id,$date){
$w=$GLOBALS['db']->query("select value_wz as swz,value_sale as ssale from ecmproductcategories_realisation where product_category_id='".$category_id."' and date='".$date."'");
$r=$GLOBALS['db']->fetchByAssoc($w);
return @100*$r['swz']/$r['ssale'];
}
$year_month=$_SESSION['EcmReports_Dashlet_sales'];
$e=explode("-",$_SESSION['EcmReports_Dashlet_sales']);
$year=$e[0];
$month=$e[1];
$s=sum($year_month,"","","","");
$sy=sum($year,"","","","");
$w=$GLOBALS['db']->query("select id,name from ecmproductcategories where deleted='0' and name!='' order by name asc");
while($r=$GLOBALS['db']->fetchByAssoc($w)){
$ss=$sdata[$month][$r['id']];
$pp=$pred[$month][$r['id']];
$v_s=$ss['sales'];
if($v_s>$temp)$temp=$v_s;
$sum_s+=$v_s;
$v_p=$ss['purchase'];
if($v_p>$temp)$temp=$v_p;
$sum_p+=$v_p;
$v_l=$pp['sales']/$mmm;
if($v_l>$temp)$temp=$v_l;
$sum_l+=$v_l;
$v_r=salesPercent($r['id'],$year_month);
$arr_s[]=array(
"name"=>repl($r['name']),
"value"=>$v_s,
);
$arr_p[]=array(
"value"=>$v_p,
);
$arr_l[]=array(
"value"=>$v_l,
);
$arr_r[]=array(
"value"=>$v_r,
);
}
//$arr_s=multisort($arr_s,array(array('key'=>'value','sort'=>'desc')));
for($i=0;$i<count($arr_s);$i++){
$data_1[]=$arr_l[$i]['value'];
$data_2[]=$arr_s[$i]['value'];
$data_3[]=$arr_p[$i]['value'];
$data_4[]=$arr_r[$i]['value'];
$cats[]=$arr_s[$i]['name'];
}
$g = new graph();
//$g->title( 'Sales: '.$year_month, '{font-size:20px; color: #000000; margin: 5px; background-color: #ffffff; padding:5px; padding-left: 20px; padding-right: 20px;}' );
$g->bg_colour = '#ffffff';
$d1 = new bar( 75, '#999999' );
$d2 = new bar( 75, '#D54C78' );
$d3 = new bar( 75, '#3334AD' );
$d1->key( 'Forecast', 10 );
$d2->key( 'Sales', 10 );
$d3->key( 'Margin', 10 );
for($i=0;$i<count($data_1);$i++){
$d1->add_data_tip($data_1[$i],"Margin: ".round($data_3[$i],2)."\nSales: ".round($data_2[$i],2)."\nForecast: ".round($data_1[$i],2)."\nFullfillment: ".round($data_4[$i],2)."%");
$d2->add_data_tip($data_2[$i],"Margin: ".round($data_3[$i],2)."\nSales: ".round($data_2[$i],2)."\nForecast: ".round($data_1[$i],2)."\nFullfillment: ".round($data_4[$i],2)."%");
$d3->add_data_tip($data_3[$i],"Margin: ".round($data_3[$i],2)."\nSales: ".round($data_2[$i],2)."\nForecast: ".round($data_1[$i],2)."\nFullfillment: ".round($data_4[$i],2)."%");
}
$g->data_sets[]=$d1;
$g->data_sets[]=$d2;
$g->data_sets[]=$d3;
$g->set_tool_tip( '#x_label#<br>#tip#<br>' );
//$g->set_data($data_1);
//$g->bar( 75, '#D54C78', '', 10 );
//$g->set_data($data_2);
//$g->bar( 75, '#3334AD', '', 10 );
//$g->attach_to_y_right_axis(2);
$g->x_axis_colour( '#909090', '#ADB5C7' );
$g->y_axis_colour( '#909090', '#ADB5C7' );
$g->y_right_axis_colour( '#909090' );
$g->set_x_labels( $cats );
$g->set_x_label_style( 10, '#000000', 2 );
$g->set_y_max( $temp );
$g->set_y_right_max( $temp);
$g->y_label_steps( 20 );
//$g->y_right_label_steps( 5 );
$g->set_y_legend( '', 12, '#736AFF' );
$g->set_y_right_legend( 'Free Ram (MB)' ,12 , '#164166' );
echo $g->render();
$exit_on_cleanup = true;
sugar_cleanup($exit_on_cleanup);
?>

View File

@@ -0,0 +1,106 @@
<?php
session_start();
//error_reporting(0);
include_once( '/var/www/html/e5crm/config.php');
$sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']);
mysql_select_db($sugar_config['dbconfig']['db_name']);
mysql_query("set names utf8");
include_once( '/var/www/html/e5crm/include/ECM/open_flash_chart/ofc-library/open-flash-chart.php' );
include_once("/var/www/html/e5crm/modules/EcmReports/cache.php");
function repl($t){
$a1=array("ą","ś","ę","ż","ź","ć","ń","ó","ł","Ą","Ś","Ę","Ż","Ź","Ć","Ń","Ó","Ł");
$a2=array("a","s","e","z","z","c","n","o","l","A","S","E","Z","Z","C","N","O","L");
return str_replace($a1,$a2,$t);
}
function getSalesYear($year){
for($i=1;$i<=12;$i++){
if($i<10)$n="0".$i;
else $n=$i;
$r=mysql_fetch_array(mysql_query("select if(e.currency_value>0 and e.currency_value is not null,sum(i.quantity*i.price*e.currency_value),sum(i.quantity*i.price)) as s,sum(i.quantity*i.purchase_price) as p from ecminvoiceouts as e inner join ecminvoiceoutitems as i on e.id=i.ecminvoiceout_id inner join ecmproducts as p on p.id=i.ecmproduct_id inner join ecmstockdocouts as w on w.id=e.wz_id inner join ecmproductcategories as pc on pc.id=p.product_category_id where e.register_date like '".$year."-".$n."%' and e.type!='correct' and e.status='accepted' and i.deleted='0' and e.deleted='0'"));
$arr[$i]=$r;
$w=mysql_query("select i.price,i.quantity,i.ecminvoiceoutitem_id,e.currency_value from ecminvoiceouts as e inner join ecminvoiceoutitems as i on e.id=i.ecminvoiceout_id inner join ecmproducts as p on p.id=i.ecmproduct_id inner join ecmproductcategories as pc on pc.id=p.product_category_id where e.register_date like '".$year."-".$n."%' and e.type='correct' and e.status='accepted' and i.deleted='0' and e.deleted='0'");
while($r=mysql_fetch_array($w)){
if(!$r['currency_value'])$r['currency_value']=1;
$arr[$i]['s']+=$r['currency_value']*$r['price']*$r['quantity'];
$rr=mysql_fetch_array(mysql_query("select price,quantity,purchase_price from ecminvoiceoutitems where id='".$r['ecminvoiceoutitem_id']."'"));
$arr[$i]['s']-=$rr['price']*$rr['quantity'];
$arr[$i]['p']+=$rr['purchase_price']*$r['quantity'];
$arr[$i]['p']-=$rr['purchase_price']*$rr['quantity'];
}
}
return $arr;;
}
$year_month=$_SESSION['EcmReports_Dashlet_sales_year'];
$e=explode("-",$_SESSION['EcmReports_Dashlet_sales_year']);
$year=$e[0];
$month=$e[1];
$months=array("January","February","March","April","May","June","July","August","September","October","November","Dezember");
for($i=1;$i<=12;$i++){
$s=getSalesYear($year);
if($temp<$s[$i]['s'])$temp=$s[$i]['s'];
$arr_s[]=array(
"name"=>repl($months[$i-1]),
"value"=>$s[$i]['s'],
);
$arr_p[]=array(
"name"=>repl($months[$i-1]),
"value"=>$s[$i]['p'],
);
}
for($i=0;$i<count($arr_s);$i++){
$data_1[]=$arr_s[$i]['value'];
$data_2[]=$arr_s[$i]['value']-$arr_p[$i]['value'];
$cats[]=$arr_s[$i]['name']." ".$year;
}
$g = new graph();
//$g->title( 'Sales: '.$year_month, '{font-size:20px; color: #000000; margin: 5px; background-color: #ffffff; padding:5px; padding-left: 20px; padding-right: 20px;}' );
$g->bg_colour = '#ffffff';
//$g->bg_colour = '#000000';
$d1 = new bar( 75, '#D54C78' );
$d2 = new bar( 75, '#3334AD' );
$d1->key( 'Sales', 10 );
$d2->key( 'PLN Margin', 10 );
for($i=0;$i<count($data_1);$i++){
$d1->add_data_tip($data_1[$i],"Sales: ".round($data_1[$i],2)."\nPLN Margin: ".round($data_2[$i],2)."\nMargin: ".@round(100*($data_2[$i])/$data_1[$i],2)."%");
$d2->add_data_tip($data_2[$i],"Sales: ".round($data_1[$i],2)."\nPLN Margin: ".round($data_2[$i],2)."\nMargin: ".@round(100*($data_2[$i])/$data_1[$i],2)."%");
}
$g->data_sets[]=$d1;
$g->data_sets[]=$d2;
$g->set_tool_tip( '#x_label#<br>#tip#<br>' );
//$g->set_data($data_1);
//$g->bar( 75, '#D54C78', '', 10 );
//$g->set_data($data_2);
//$g->bar( 75, '#3334AD', '', 10 );
//$g->attach_to_y_right_axis(2);
$g->x_axis_colour( '#909090', '#ADB5C7' );
$g->y_axis_colour( '#909090', '#ADB5C7' );
$g->y_right_axis_colour( '#909090' );
$g->set_x_labels( $cats );
$g->set_x_label_style( 10, '#000000', 2 );
$g->set_y_max( $temp );
$g->set_y_right_max( $temp);
$g->y_label_steps( 20 );
//$g->y_right_label_steps( 5 );
$g->set_y_legend( '', 12, '#736AFF' );
$g->set_y_right_legend( '' ,12 , '#164166' );
echo $g->render();
mysql_close($sql);
?>

View File

@@ -0,0 +1,106 @@
<?php
session_start();
include_once( '/var/www/html/e5crm/config.php');
$sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']);
mysql_select_db($sugar_config['dbconfig']['db_name']);
mysql_query("set names utf8");
include_once( '/var/www/html/e5crm/include/ECM/open_flash_chart/ofc-library/open-flash-chart.php' );
//include_once('/var/www/html/e5crm/modules/EcmCharts/chartHelper.php');
include_once("/var/www/html/e5crm/modules/EcmReports/cache.php");
function repl($t){
$a1=array("ą","ś","ę","ż","ź","ć","ń","ó","ł","Ą","Ś","Ę","Ż","Ź","Ć","Ń","Ó","Ł");
$a2=array("a","s","e","z","z","c","n","o","l","A","S","E","Z","Z","C","N","O","L");
return str_replace($a1,$a2,$t);
}
function getStock($category_id){
$ww=mysql_query("select sum(h.value) as sum from ecmproducts_history_states as h inner join ecmproducts as p on p.id=h.ecmproduct_id where p.product_category_id='".$category_id."' and p.deleted='0' and h.ecmstock_id='c7afd71a-4c3a-bde4-138d-4acaee1644e4' and p.product_active='1'");
$rr=mysql_fetch_array($ww);
$i=mysql_num_rows(mysql_query("select distinct date from ecmproducts_history_states"));
$v=$rr['sum'];
return $v/$i;
}
if((int)date("m")==1){
$mmm=12;
$year=date("Y")-1;
}
else{
$mmm=(int)date("m")-1;
$year=date("Y");
}
$s=sum($year,"","","","");
//$w=mysql_query("select id,name from ecmproductcategories where deleted='0' and name!=''");
//while($r=mysql_fetch_array($w)){
//$ss=getSum($s,$year,"",$r['id']);
//@$rot[$r['id']]=12*($ss['total_purchase']/$mmm)/getStock($r['id']);
//if($tempr<$rot[$r['id']])$tempr=$rot[$r['id']];
//}
//echo '<pre>';
//print_r($rot);
//echo '</pre>';m
$w=mysql_query("select p.id,p.product_category_id from ecmproducts as p inner join ecmproductcategories as c on c.id=p.product_category_id where p.deleted='0' order by c.name asc");
while($r=mysql_fetch_array($w)){
$qty=0;
$ww=mysql_query("select quantity,price from ecmstockstates where deleted='0' and product_id='".$r['id']."'");
while($rrr=mysql_fetch_array($ww)){
$qty+=$rrr['quantity']*$rrr['price'];
}
$cats[$r['product_category_id']]+=$qty;
if($cats[$r['product_category_id']]>$temp)$temp=$cats[$r['product_category_id']];
}
//$arr_s=multisort($arr_s,array(array('key'=>'value','sort'=>'desc')));
$i=0;
foreach($cats as $k=>$v){
$r=mysql_fetch_array(mysql_query("select name from ecmproductcategories where id='".$k."' and deleted='0'"));
if($r['name']){
$data_1[$i]=$v;
if($v)$data_2[$i]=$rot[$k];
else $data_2[$i]=0;
$cn[$i]=repl($r['name']);
$i++;
}
}
$g = new graph();
//$g->title( 'Stocks', '{font-size:20px; color: #000000; margin: 5px; background-color: #ffffff; padding:5px; padding-left: 20px; padding-right: 20px;}' );
$g->bg_colour = '#ffffff';
$d1 = new bar( 75, '#D54C78' );
$d2 = new bar( 75, '#3334AD' );
$d1->key( 'Inventory valueee', 10 );
$d2->key( 'Rotation', 10 );
for($i=0;$i<count($data_1);$i++){
$d1->add_data_tip($data_1[$i],"Value: ".$data_1[$i]."\nRotation: ".round($data_2[$i],2));
//$d2->add_data_tip($data_2[$i],"Value: ".$data_1[$i]."\nRotation: ".round($data_2[$i],2));
}
$g->data_sets[]=$d1;
//$g->data_sets[]=$d2;
$g->set_tool_tip( '#x_label#<br>#tip#<br>' );
$g->attach_to_y_right_axis(2);
$g->x_axis_colour( '#909090', '#ADB5C7' );
$g->y_axis_colour( '#909090', '#ADB5C7' );
$g->y_right_axis_colour( '#909090' );
$g->set_x_labels( $cn );
$g->set_x_label_style( 10, '#000000', 2 );
$g->set_y_max( $temp );
$g->set_y_right_max( $tempr);
$g->y_label_steps( 20 );
//$g->y_right_label_steps( 5 );
$g->set_y_legend( 'Inventory value', 12, '#D54C78' );
$g->set_y_right_legend( 'Rotation' ,12 , '#3334AD' );
echo $g->render();
mysql_close($sql);
?>

View File

@@ -0,0 +1,35 @@
<?php
session_start();
include_once( '/var/www/html/e5crm/vserver/e5crm.more7.com/www/config.php');
include_once( '/var/www/html/e5crm/vserver/e5crm.more7.com/www/guid.php');
$sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']);
mysql_select_db($sugar_config['dbconfig']['db_name']);
mysql_query("set names utf8");
//mysql_query("truncate table ecmproducts_history_states");
$date="2010-08-02";
$www=mysql_query("select id,name from ecmstocks where deleted='0' and no='1'");
while($rrr=mysql_fetch_array($www)){
$stock_id=$rrr['id'];
$ww=mysql_query("select id,code from ecmproducts where deleted='0' and code!='' order by code");
while($rr=mysql_fetch_array($ww)){
$v=0;
$product_id=$rr['id'];
$w=mysql_query("select type,quantity,price from ecmstockoperations where stock_id='".$stock_id."' and product_id='".$product_id."' and deleted='0'");
while($r=mysql_fetch_array($w)){
if($r['type']==0)$v+=$r['price']*$r['quantity'];
else $v-=$r['price']*$r['quantity'];
}
if($v<0)$v=0;
$set="date='".$date."',ecmproduct_id='".$product_id."',ecmstock_id='".$stock_id."',value='".$v."'";
if(mysql_num_rows(mysql_query("select id from ecmproducts_history_states where ecmstock_id='".$stock_id."' and ecmproduct_id='".$product_id."' and date='".$date."'"))==0){
mysql_query("insert into ecmproducts_history_states set id='".create_guid()."',".$set);
}
else{
mysql_query("update ecmproducts_history_states set value='".$v."' where ecmstock_id='".$stock_id."' and ecmproduct_id='".$product_id."' and date='".$date."'");
}
echo $rr['code']." ".$v."\n";
}
}
mysql_close($sql);
?>

View File

@@ -0,0 +1,86 @@
<?php
session_start();
include_once( '/var/www/html/e5crm/config.php');
include_once( '/var/www/html/e5crm/guid.php');
$sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']);
mysql_select_db($sugar_config['dbconfig']['db_name']);
mysql_query("set names utf8");
//mysql_query("truncate table ecmproductcategories_realisation");
$mdate=date("Y-m");
//$w=mysql_query("select * from ecmsales where delivery_date like '".$mdate."%' and deleted='0' and status='s30' and type='sales_order'");
$w=mysql_query("select e.* from ecmsales as e inner join ecmstockdocouts as w on w.so_id=e.id inner join ecminvoiceouts as inv on inv.wz_id=w.id where e.deleted='0' and inv.register_date like '".$mdate."%' and e.type='sales_order' and e.status!='s10'");
while($r=mysql_fetch_array($w)){
$rsale=mysql_fetch_array(mysql_query("select sum(quantity*price) as qty from ecmsaleitems where ecmsale_id='".$r['id']."'"));
$rwz=mysql_fetch_array(mysql_query("select id from ecmstockdocouts where so_id='".$r['id']."'"));
$rwzi=mysql_fetch_array(mysql_query("select sum(quantity*selling_price) as qty from ecmstockdocoutitems where ecmstockdocout_id='".$rwz['id']."'"));
$ecmstockdocout_id=$rwz['id'];
if(mysql_num_rows(mysql_query("select id from ecminvoiceouts where wz_id='".$ecmstockdocout_id."' and deleted='0'"))==0)continue;
if($ecmstockdocout_id){
$sum_wz_qty+=$rwzi['qty'];
$sum_sale_qty+=$rsale['qty'];
}
$qty_diff=$rwzi['qty']-$rsale['qty'];
$diff_minus=$diff_plus=0;
$rst=$rsale['qty'];
$rwt=$rwzi['qty'];
if($ecmstockdocout_id){
$wsale=mysql_query("select quantity,price,code,ecmproduct_id from ecmsaleitems where deleted='0' and ecmsale_id='".$r['id']."' order by code");
while($rsale=mysql_fetch_array($wsale)){
$qty=0;
$wwz=mysql_query("select quantity,selling_price from ecmstockdocoutitems where deleted='0' and ecmproduct_id='".$rsale['ecmproduct_id']."' and ecmstockdocout_id='".$ecmstockdocout_id."'");
while($rwz=mysql_fetch_array($wwz)){
$qty+=$rwz['quantity']*$rwz['selling_price'];
}
if($rsale['quantity']*$rsale['price']>$qty)$diff_minus+=$qty-$rsale['quantity']*$rsale['price'];
if($rsale['quantity']*$rsale['price']<$qty)$diff_plus+=$qty-$rsale['quantity']*$rsale['price'];
$sum[$rsale['ecmproduct_id']]['wz']+=$qty;
$sum[$rsale['ecmproduct_id']]['sale']+=$rsale['quantity']*$rsale['price'];
}
}
}
$percent=number_format((100*$sum_wz_qty/$sum_sale_qty),2,",",".")."%";
$rst=0;
$rwt=0;
$diff_plus=$diff_minus=0;
$ww=mysql_query("select id,product_category_id from ecmproducts where deleted='0' order by code asc");
while($rr=mysql_fetch_array($ww)){
$k=$rr['id'];
if(!$sum[$k])continue;
$rst+=$sum[$k]['sale'];
$rwt+=$sum[$k]['wz'];
$cst[$rr['product_category_id']]+=$sum[$k]['sale'];
$cwt[$rr['product_category_id']]+=$sum[$k]['wz'];
if($sum[$k]['sale']>$sum[$k]['wz'])$diff_minus+=$sum[$k]['wz']-$sum[$k]['sale'];
if($sum[$k]['sale']<$sum[$k]['wz'])$diff_plus+=$sum[$k]['wz']-$sum[$k]['sale'];
}
$ww=mysql_query("select id,name from ecmproductcategories where deleted='0' order by name asc");
while($rr=mysql_fetch_array($ww)){
$k=$rr['id'];
if($cwt[$k]<$cst[$k])$color="red";
elseif($cwt[$k]>$cst[$k])$color="green";
else $color="black";
$set="date='".$mdate."',product_category_id='".$rr['id']."',value_sale='".$cst[$k]."',value_wz='".$cwt[$k]."'";
if(mysql_num_rows(mysql_query("select id from ecmproductcategories_realisation where product_category_id='".$rr['id']."' and date like '".$mdate."%'"))==0){
mysql_query("insert into ecmproductcategories_realisation set id='".create_guid()."',".$set);
}
else mysql_query("update ecmproductcategories_realisation set ".$set." where product_category_id='".$rr['id']."' and date like '".$mdate."%'");
echo $rr['name']."\n";
}
$set="date='".$mdate."',product_category_id='diff_minus',value_sale='".$diff_minus."'";
if(mysql_num_rows(mysql_query("select id from ecmproductcategories_realisation where product_category_id='diff_minus' and date like '".$mdate."%'"))==0){
mysql_query("insert into ecmproductcategories_realisation set id='".create_guid()."',".$set);
}
else mysql_query("update ecmproductcategories_realisation set ".$set." where product_category_id='diff_minus' and date like '".$mdate."%'");
$set="date='".$mdate."',product_category_id='diff_plus',value_sale='".$diff_plus."'";
if(mysql_num_rows(mysql_query("select id from ecmproductcategories_realisation where product_category_id='diff_plus' and date like '".$mdate."%'"))==0){
mysql_query("insert into ecmproductcategories_realisation set id='".create_guid()."',".$set);
}
else mysql_query("update ecmproductcategories_realisation set ".$set." where product_category_id='diff_plus' and date like '".$mdate."%'");
mysql_close($sql);
?>

View File

@@ -0,0 +1,53 @@
<?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".
********************************************************************************/
$dashletStrings['RSSDashlet'] = array('LBL_TITLE' => 'News Feed',
'LBL_DESCRIPTION' => 'News Feed',
'LBL_SAVING' => 'Parsing ...',
'LBL_SAVED' => 'Complete',
'LBL_AUTO_SCROLL' => 'Auto Scroll',
'LBL_SCROLL_SPEED' => 'Scroll Speed (%)',
'LBL_CONFIGURE_TITLE' => 'Title',
'LBL_CONFIGURE_HEIGHT' => 'Height (1 - 300)',
'LBL_CONFIGURE_RSSURL' => 'RSS Url',
'LBL_DBLCLICK_HELP' => '',
'ERR_LOADING_FEED' => 'Failed loading RSS Feed',
);
?>

View File

@@ -0,0 +1,46 @@
<?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".
********************************************************************************/
global $app_strings, $current_language;
$dashletMeta['RSSDashlet'] = array('title' => 'LBL_TITLE', // array index in language pack
'description' => 'LBL_DESCRIPTION', // array index in language pack
'category' => 'Web',
'hidden' => true);
?>

View File

@@ -0,0 +1,175 @@
<?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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
require_once('include/Sugar_Smarty.php');
class RSSDashlet extends Dashlet
{
protected $url = 'http://www.sugarcrm.com/crm/aggregator/rss/1';
protected $height = '200'; // height of the pad
protected $images_dir = 'modules/Home/Dashlets/RSSDashlet/images';
/**
* Constructor
*
* @global string current language
* @param guid $id id for the current dashlet (assigned from Home module)
* @param array $def options saved for this dashlet
*/
public function __construct($id, $def)
{
$this->loadLanguage('RSSDashlet', 'modules/Home/Dashlets/'); // load the language strings here
if(!empty($def['height'])) // set a default height if none is set
$this->height = $def['height'];
if(!empty($def['url']))
$this->url = $def['url'];
if(!empty($def['title']))
$this->title = $def['title'];
else
$this->title = $this->dashletStrings['LBL_TITLE'];
parent::Dashlet($id); // call parent constructor
$this->isConfigurable = true; // dashlet is configurable
$this->hasScript = false; // dashlet has javascript attached to it
}
/**
* Displays the dashlet
*
* @return string html to display dashlet
*/
public function display()
{
$ss = new Sugar_Smarty();
$ss->assign('saving', $this->dashletStrings['LBL_SAVING']);
$ss->assign('saved', $this->dashletStrings['LBL_SAVED']);
$ss->assign('id', $this->id);
$ss->assign('height', $this->height);
$ss->assign('rss_output', $this->getRSSOutput($this->url));
$str = $ss->fetch('modules/Home/Dashlets/RSSDashlet/RSSDashlet.tpl');
return parent::display($this->dashletStrings['LBL_DBLCLICK_HELP']) . $str; // return parent::display for title and such
}
/**
* Displays the configuration form for the dashlet
*
* @return string html to display form
*/
public function displayOptions() {
global $app_strings, $sugar_version, $sugar_config;
$ss = new Sugar_Smarty();
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
$ss->assign('heightLbl', $this->dashletStrings['LBL_CONFIGURE_HEIGHT']);
$ss->assign('rssUrlLbl', $this->dashletStrings['LBL_CONFIGURE_RSSURL']);
$ss->assign('saveLbl', $app_strings['LBL_SAVE_BUTTON_LABEL']);
$ss->assign('title', $this->title);
$ss->assign('height', $this->height);
$ss->assign('url', $this->url);
$ss->assign('id', $this->id);
return parent::displayOptions() . $ss->fetch('modules/Home/Dashlets/RSSDashlet/RSSDashletOptions.tpl');
}
/**
* called to filter out $_REQUEST object when the user submits the configure dropdown
*
* @param array $req $_REQUEST
* @return array filtered options to save
*/
public function saveOptions(
array $req
)
{
$options = array();
$options['title'] = $req['title'];
$options['url'] = $req['url'];
$options['height'] = $req['height'];
return $options;
}
protected function getRSSOutput(
$url
)
{
// suppress XML errors
libxml_use_internal_errors(true);
$rssdoc = simplexml_load_file($url);
// return back the error message if the loading wasn't successful
if (!$rssdoc)
return $this->dashletStrings['ERR_LOADING_FEED'];
$output = "<table class='edit view'>";
if ( isset($rssdoc->channel) ) {
foreach ( $rssdoc->channel as $channel ) {
if ( isset($channel->item ) ) {
foreach ( $channel->item as $item ) {
$output .= <<<EOHTML
<tr>
<td>
<h3><a href="{$item->link}" target="_child">{$item->title}</a></h3>
{$item->description}
</td>
</tr>
EOHTML;
}
}
}
}
else {
foreach ( $rssdoc->entry as $entry ) {
$output .= <<<EOHTML
<tr>
<td>
<h3><a href="{$entry->link}" target="_child">{$entry->title}</a></h3>
{$entry->summary}
</td>
</tr>
EOHTML;
}
}
$output .= "</table>";
return $output;
}
}

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".
********************************************************************************/
*}
<div id='rss_{$id}' style='overflow: auto; width: 100%; height: {$height}px; border: 1px #ddd solid'>
{$rss_output}
</div>

View File

@@ -0,0 +1,76 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<div style='width: 500px'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="400" cellpadding="0" cellspacing="0" border="0" class="edit view" align="center">
<tr>
<td valign='top' nowrap scope='row'>{$titleLbl}</td>
<td valign='top'>
<input class="text" name="title" size='20' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap scope='row'>{$rssUrlLbl}</td>
<td valign='top'>
<input class="text" name="url" size='20' value='{$url}'>
</td>
</tr>
<tr>
<td valign='top' nowrap scope='row'>{$heightLbl}</td>
<td valign='top'>
<input class="text" name="height" size='3' value='{$height}'>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLbl}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
global $app_strings;
$dashletMeta['SugarNewsDashlet'] = array('module' => 'Home',
'title' => translate('LBL_DASHLET_SUGAR_NEWS', 'Home'),
'description' => 'A customizeable portal page',
'icon' => 'themes/default/images/icon_SugarNews_32.gif',
'category' => 'Tools',
'hidden' => true);

View File

@@ -0,0 +1,110 @@
<?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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
class SugarNewsDashlet extends Dashlet {
var $displayTpl = 'modules/Home/Dashlets/SugarNewsDashlet/display.tpl';
var $configureTpl = 'modules/Home/Dashlets/SugarNewsDashlet/configure.tpl';
var $defaultURL = 'http://apps.sugarcrm.com/dashlet/sugarcrm-news-dashlet.html?lang=@@LANG@@&edition=@@EDITION@@&ver=@@VER@@';
var $url;
function SugarNewsDashlet($id, $options = null) {
parent::Dashlet($id);
$this->isConfigurable = true;
if(empty($options['title'])) {
$this->title = translate('LBL_DASHLET_SUGAR_NEWS', 'Home');
} else {
$this->title = $options['title'];
}
if(empty($options['url'])) {
$this->url = $this->defaultURL;
} else {
$this->url = $options['url'];
}
if(empty($options['height']) || (int)$options['height'] < 1 ) {
$this->height = 315;
} else {
$this->height = (int)$options['height'];
}
}
function displayOptions() {
global $app_strings;
$ss = new Sugar_Smarty();
$ss->assign('titleLBL', translate('LBL_DASHLET_OPT_TITLE', 'Home'));
$ss->assign('urlLBL', translate('LBL_DASHLET_OPT_URL', 'Home'));
$ss->assign('heightLBL', translate('LBL_DASHLET_OPT_HEIGHT', 'Home'));
$ss->assign('title', $this->title);
$ss->assign('url', $this->url);
$ss->assign('id', $this->id);
$ss->assign('height', $this->height);
$ss->assign('saveLBL', $app_strings['LBL_SAVE_BUTTON_LABEL']);
return $ss->fetch('modules/Home/Dashlets/SugarNewsDashlet/configure.tpl');
}
function saveOptions($req) {
$options = array();
if ( isset($req['title']) ) {
$options['title'] = $req['title'];
}
if ( isset($req['url']) ) {
$options['url'] = $req['url'];
}
if ( isset($req['height']) ) {
$options['height'] = (int)$req['height'];
}
return $options;
}
function display(){
$sugar_edition = 'COM';
$out_url = str_replace(
array('@@LANG@@','@@VER@@','@@EDITION@@'),
array($GLOBALS['current_language'],$GLOBALS['sugar_config']['sugar_version'],$sugar_edition),
$this->url);
return parent::display() . "<iframe class='teamNoticeBox' src='".$out_url."' height='".$this->height."px'></iframe>";
}
}

View File

@@ -0,0 +1,73 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<div style='width:100%'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>{$titleLBL}</td>
<td valign='top' class='dataField'>
<input class="text" name="title" size='20' maxlength='80' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$urlLBL}</td>
<td valign='top' class='dataField'>
<input class="text" name="url" size='20' maxlength='255' value='{$url}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$heightLBL}</td>
<td valign='top' class='dataField'>
<input class="text" name="height" size='20' maxlength='80' value='{$height}'>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLBL}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,73 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<div style='width:100%'>
<form name='configure_{$id}' action="index.php" method="post" onSubmit='return SUGAR.dashlets.postForm("configure_{$id}", SUGAR.mySugar.uncoverPage);'>
<input type='hidden' name='id' value='{$id}'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='action' value='ConfigureDashlet'>
<input type='hidden' name='to_pdf' value='true'>
<input type='hidden' name='configure' value='true'>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tabForm" align="center">
<tr>
<td valign='top' nowrap class='dataLabel'>{$titleLBL}</td>
<td valign='top' class='dataField'>
<input class="text" name="title" size='20' maxlength='80' value='{$title}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$urlLBL}</td>
<td valign='top' class='dataField'>
<input class="text" name="url" size='20' maxlength='255' value='{$url}'>
</td>
</tr>
<tr>
<td valign='top' nowrap class='dataLabel'>{$heightLBL}</td>
<td valign='top' class='dataField'>
<input class="text" name="height" size='20' maxlength='80' value='{$height}'>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type='submit' class='button' value='{$saveLBL}'>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
global $app_strings;
$dashletMeta['iFrameDashlet'] = array('module' => 'Home',
'title' => translate('LBL_DASHLET_TITLE', 'Home'),
'description' => 'A customizeable portal page',
'icon' => 'themes/default/images/icon_iFrames_32.gif',
'category' => 'Web',
'hidden' => true);

View File

@@ -0,0 +1,124 @@
<?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".
********************************************************************************/
require_once('include/Dashlets/Dashlet.php');
class iFrameDashlet extends Dashlet {
var $displayTpl = 'modules/Home/Dashlets/iFrameDashlet/display.tpl';
var $configureTpl = 'modules/Home/Dashlets/iFrameDashlet/configure.tpl';
var $defaultURL = 'http://apps.sugarcrm.com/dashlet/sugarcrm-news-dashlet.html?lang=@@LANG@@&edition=@@EDITION@@&ver=@@VER@@';
var $url;
protected $allowed_schemes = array("http", "https");
function iFrameDashlet($id, $options = null) {
parent::Dashlet($id);
$this->isConfigurable = true;
if(empty($options['title'])) {
$this->title = translate('LBL_DASHLET_TITLE', 'Home');
$this->title = translate('LBL_DASHLET_DISCOVER_SUGAR_PRO', 'Home');
} else {
$this->title = $options['title'];
}
if(empty($options['url'])) {
$this->url = $this->defaultURL;
$this->url = 'http://apps.sugarcrm.com/dashlet/go-pro.html?lang=@@LANG@@&edition=@@EDITION@@&ver=@@VER@@';
} else {
$this->url = $options['url'];
}
$this->checkURL();
if(empty($options['height']) || (int)$options['height'] < 1 ) {
$this->height = 315;
} else {
$this->height = (int)$options['height'];
}
}
protected function checkURL()
{
$scheme = parse_url($this->url, PHP_URL_SCHEME);
if(!in_array($scheme, $this->allowed_schemes)) {
$this->url = 'about:blank';
}
}
function displayOptions() {
global $app_strings;
$ss = new Sugar_Smarty();
$ss->assign('titleLBL', translate('LBL_DASHLET_OPT_TITLE', 'Home'));
$ss->assign('urlLBL', translate('LBL_DASHLET_OPT_URL', 'Home'));
$ss->assign('heightLBL', translate('LBL_DASHLET_OPT_HEIGHT', 'Home'));
$ss->assign('title', $this->title);
$ss->assign('url', $this->url);
$ss->assign('id', $this->id);
$ss->assign('height', $this->height);
$ss->assign('saveLBL', $app_strings['LBL_SAVE_BUTTON_LABEL']);
return $ss->fetch('modules/Home/Dashlets/iFrameDashlet/configure.tpl');
}
function saveOptions($req) {
$options = array();
if ( isset($req['title']) ) {
$options['title'] = $req['title'];
}
if ( isset($req['url']) ) {
$options['url'] = $req['url'];
}
if ( isset($req['height']) ) {
$options['height'] = (int)$req['height'];
}
return $options;
}
function display(){
$sugar_edition = 'COM';
$out_url = str_replace(
array('@@LANG@@','@@VER@@','@@EDITION@@'),
array($GLOBALS['current_language'],$GLOBALS['sugar_config']['sugar_version'],$sugar_edition),
$this->url);
return parent::display() . "<iframe class='teamNoticeBox' src='".$out_url."' height='".$this->height."px'></iframe>";
}
}

49
modules/Home/DynamicAction.php Executable file
View File

@@ -0,0 +1,49 @@
<?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".
********************************************************************************/
require_once('include/MySugar/MySugar.php');
$mySugar = new MySugar($_REQUEST['module']);
if (!isset($_REQUEST['DynamicAction'])) {
$_REQUEST['DynamicAction'] = 'displayDashlet';
}
echo $mySugar->$_REQUEST['DynamicAction']();
?>

View File

@@ -0,0 +1,24 @@
<?php
if($_REQUEST['function'] == "GetSettings") {
global $current_user;
$p = $current_user->getPreference($_REQUEST['from_module'].'AjaxSearchSettings');
if($p) {
$json = getJSONobj();
echo '['.str_replace('&quot;','\"',$json->encode($p)).']';
die();
}
} else
if($_REQUEST['function'] == "SaveSettings") {
global $current_user;
$settings = array(
'pos_top' => $_REQUEST['pos_top'],
'pos_left' => $_REQUEST['pos_left'],
'frozen' => $_REQUEST['frozen']
);
$current_user->setPreference($_REQUEST['from_module'].'AjaxSearchSettings', $settings, 0, 'global', $current_user);
}
?>

60
modules/Home/Home.html Executable file
View File

@@ -0,0 +1,60 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellspacing="0" cellpadding="0" border="0" valign="top" width="100%">
<tr> <td valign="top" width="100%">
<slot>{MYAPPOINTMENTS}</slot>
<slot>{MYEMAILS}</slot>
<slot>{MYQUEUES}</slot>
<slot>{MYINVITES}</slot>
<slot>{MYOPPORTUNITIES}</slot>
<slot>{MYCASES}</slot>
<slot>{MYLEADS}</slot>
<slot>{MYTASKS}</slot>
<slot>{MYBUGS}</slot>
<slot>{MYFORECASTS}</slot>
<slot>{MY_PROJECT_TASKS}</slot>
</td>
<td style="padding-left: 10px;" valign="top">
<slot>{SYNC}</slot>
<slot>{MYCAL}</slot>
<slot>{TEAMNOTICES}</slot>
<slot>{MYPIPELINE}</slot>
</td>
</tr>
</table>
<!-- END: main -->

213
modules/Home/Home.tpl Executable file
View File

@@ -0,0 +1,213 @@
{*
/*********************************************************************************
* 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;
}
</style>
{/literal}
<!-- begin includes for overlib -->
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000"></div>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_overlib.js'}"></script>
<!-- end includes for overlib -->
<script type="text/javascript">
var numPages = {$numPages};
var theme = '{$theme}';
var loadedPages = new Array();
var activePage = {$activePage};
loadedPages[0] = '{$loadedPage}';
current_user_id = '{$current_user}';
jsChartsArray = new Array();
var moduleName = 'Home';
</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>
<link rel='stylesheet' href='{sugar_getjspath file='include/javascript/yui/build/assets/skins/sam/skin.css'}'>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/swfobject.js'}"></script>
<div id="pageContainer">
<div id="pageNum_{$activePage}_div">
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="subpanelTabForm" style="border-top: 0px none; margin-bottom: 4px;">
<tr>
{if $numCols > 2}
<td>
&nbsp;
</td>
<td rowspan="3">
<img src='{sugar_getimagepath file='blank.gif'}' width='15' height='1' border='0'>
</td>
{/if}
{if $numCols > 1}
<td>
&nbsp;
</td>
<td rowspan="3">
<img src='{sugar_getimagepath file='blank.gif'}' width='15' height='1' border='0'>
</td>
{/if}
<td align='right'>
<input id="add_dashlets" class="button" type="button" value="{$lblAddDashlets}" onclick="return SUGAR.mySugar.showDashletsTree();"/>
<a href='index.php?module=Administration&action=SupportPortal&view=documentation&version={$sugarVersion}&edition={$sugarFlavor}&lang={$currentLanguage}&help_module=Home&help_action=index&key={$serverUniqueKey}' class='utilsLink' target='_blank'>
<img src='{sugar_getimagepath file="help.gif"}' width='13' height='13' alt='{$lblLnkHelp}' border='0' align='absmiddle'>
</a>
<a href='index.php?module=Administration&action=SupportPortal&view=documentation&version={$sugarVersion}&edition={$sugarFlavor}&lang={$currentLanguage}&help_module=Home&help_action=index&key={$serverUniqueKey}' class='utilsLink' target='_blank'>
{$lblLnkHelp}
</a>
</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' 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}'>
{$dashlet.script}
{$dashlet.display}
</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="addPageDialog" style="display:none;">
<div class="hd">Add Page</div>
<div class="bd">
<form method="POST" action="index.php?module=Home&action=newTab&to_pdf=1">
<label for="pageName">Page Name: </label><input type="textbox" name="pageName" /><br /><br />
<label for="numColumns">Number of Columns:</label>
<table align="center">
<tr>
<td><input type="radio" name="numColumns" value="1" />1</td>
<td><input type="radio" name="numColumns" value="2" checked />2</td>
<td><input type="radio" name="numColumns" value="3" />3</td>
</tr>
</table>
</form>
</div>
</div>
<div id="changeLayoutDialog" style="display:none;">
<div class="hd">Change Layout</div>
<div class="bd">
<form method="POST" action="index.php?module=Home&action=changeLayout&to_pdf=1">
<label for="numColumns">Number of Columns:</label>
<table align="center">
<tr>
<td><input type="radio" name="numColumns" value="1" />1</td>
<td><input type="radio" name="numColumns" value="2" checked />2</td>
<td><input type="radio" name="numColumns" value="3" />3</td>
</tr>
</table>
<input type="hidden" name="changeLayoutParams" value="1" />
</form>
</div>
</div>
<div id="dashletsDialog">
<div class="hd"></div>
<div class="bd">
<form></form>
</div>
</div>
</div>
{if !$lock_homepage}
{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};
{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;
SUGAR.mySugar.renderAddPageDialog();
SUGAR.mySugar.renderDashletsTree();
SUGAR.mySugar.renderChangeLayoutDialog();
}
YAHOO.util.Event.addListener(window, 'load', SUGAR.mySugar.init);
</script>
{/literal}
{/if}

71
modules/Home/LastViewed.php Executable file
View File

@@ -0,0 +1,71 @@
<?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".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $theme;
global $current_user;
// Create the head of the table.
?>
<table cellpadding="2" cellspacing="0" border="0">
<?php
$current_row=1;
$tracker = new Tracker();
$history = $tracker->get_recently_viewed($current_user->id);
foreach($history as $row)
{
$moduleImage = SugarThemeRegistry::current()->getImageURL("{$row['module_name']}.gif");
echo <<<EOQ
<tr>
<td vAlign="top"><IMG width="20" alt="{$row['module_name']}" src="{$moduleImage}" 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;
}
?>
</table>

45
modules/Home/Menu.php Executable file
View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
/*********************************************************************************
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
?>

145
modules/Home/PopupSugar.php Executable file
View File

@@ -0,0 +1,145 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Header: /cvsroot/sugarcrm/sugarcrm/modules/Products/ListView.html,v 1.4 2004/07/02 07:02:27 sugarclint Exp {APP.LBL_LIST_CURRENCY_SYM}
********************************************************************************/
-->
<body style="margin: 0px;">
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $theme;
insert_popup_header($theme);
$sugarteam = array( 'Julian Ostrow', 'Lam Huynh', 'Majed Itani', 'Joey Parsons', 'Ajay Gupta', 'Jason Nassi', 'Andy Dreisch', 'Roger Smith', 'Matt Heitzenroder', 'Liliya Bederov', 'Sadek Baroudi', 'Yun-Ping Hsu', 'Franklin Liu', 'Jennifer Yim', 'Sujata Pamidi', 'Andrew Wu', 'Eddy Ramirez', 'Jenny Gonsalves', 'Collin Lee', 'Joey Chao', 'Tom Young', 'David Wheeler', 'Samir Gandhi', 'Donald Wong', 'Benjamin Soufflet', 'John Mertic', 'Ran Zhou', 'Fabrice Aissah' , 'Maxime Aubert', 'Joshua Chi','Wynn Dong','Martin Hu','Mason Hu','Catherine Ma','Shine Ye','Leon Zhang', 'Gloria Chen','Emily Gan','Penny Gao','Randy Lee','Doni Shen','Eric Yang','Jane Ye','Stacey Zhu','Oliver Yang','Ray Yu' );
switch($_REQUEST['style']){
case 'rev':
$sugarteam = array_map('strrev', $sugarteam);
break;
case 'rand':
shuffle($sugarteam);
break;
case 'dec':
$sugarteam = array_reverse($sugarteam);
break;
case 'sort':
sort($sugarteam);
break;
case 'rsort':
rsort($sugarteam);
break;
}
$founders = array("<b>Founders:</b>", 'John Roberts', 'Clint Oram', 'Jacob Taylor');
$body = implode('<br>', $founders) . "<br><br><b>Developers:</b><br>" . implode('<br>', $sugarteam);
?>
<script>
var user_notices = new Array();
var delay = 25000
var index = 0;
var lastIndex = 0;
var scrollerHeight=200
var bodyHeight = ''
var scrollSpeed = 1;
var curTeam = 'all';
var scrolling = true;
function stopNotice(){
scrolling = false;
}
function startNotice(){
scrolling = true;
}
function scrollNotice(){
if(scrolling){
var body = document.getElementById('NOTICEBODY')
var daddy = document.getElementById('daddydiv')
if(parseInt(body.style.top) > bodyHeight *-1 ){
body.style.top = (parseInt(body.style.top) - scrollSpeed) + 'px';
}else{
body.style.top =scrollerHeight + "px"
}
}
setTimeout("scrollNotice()", 50);
}
function nextNotice(){
body = document.getElementById('NOTICEBODY');
if(scrolling){
body.style.top = scrollerHeight/2 +'px'
bodyHeight= parseInt(body.offsetHeight);
}
}
</script>
<div style="width: 300px; height: 400px; text-align: center; border:0; padding: 5px;">
<div id='daddydiv' style="position:relative;width=100%;height:350px;overflow:hidden">
<div id='NOTICEBODY' style="position:absolute;left:0px;top:0px;width:100%;z-index: 1; text-align: left;">
<?php echo $body; ?>
</div>
</div>
<script>
if(window.addEventListener){
window.addEventListener("load", nextNotice, false);
window.addEventListener("load", scrollNotice, false);
}else{
window.attachEvent("onload", nextNotice);
window.attachEvent("onload", scrollNotice);
}
</script>

View File

@@ -0,0 +1,59 @@
<?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".
********************************************************************************/
global $current_user;
if(!empty($_REQUEST['layout']) && !empty($_REQUEST['layoutModule'])) {
// sleep (2);
// _ppd($_REQUEST['layout']);
$subpanels = explode(',', $_REQUEST['layout']);
$layoutParam = $_REQUEST['layoutModule'];
if(!empty($_REQUEST['layoutGroup']) && $_REQUEST['layoutGroup']!= translate('LBL_TABGROUP_ALL')) {
$layoutParam .= ':'.$_REQUEST['layoutGroup'];
}
$current_user->setPreference('subpanelLayout', $subpanels, 0, $layoutParam);
}
else {
echo 'oops';
}
?>

View File

@@ -0,0 +1,58 @@
<?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".
********************************************************************************/
$mod_strings = return_module_language($current_language, $_REQUEST['target_module']);
if(file_exists('modules/'. $_REQUEST['target_module'] . '/EditView.php')){
$target_module = $_REQUEST['target_module']; // target class
if(is_file('modules/' . $target_module . '/' . $target_module . 'QuickCreate.php')) { // if there is a quickcreate override
require_once('modules/' . $target_module . '/' . $target_module . 'QuickCreate.php');
$editviewClass = $target_module . 'QuickCreate'; // eg. OpportunitiesQuickCreate
$editview = new $editviewClass($target_module, 'modules/' . $target_module . '/tpls/' . $_REQUEST['tpl']);
$editview->viaAJAX = true;
}
else { // else use base class
require_once('include/EditView/EditViewQuickCreate.php');
$editview = new EditViewQuickCreate($target_module, 'modules/' . $target_module . '/tpls/' . $_REQUEST['tpl']);
}
$editview->process();
echo $editview->display();
}else{
require_once('include/EditView/SubpanelQuickCreate.php');
$view = (!empty($_REQUEST['target_view']))?$_REQUEST['target_view']: 'QuickCreate';
$sqc = new SubpanelQuickCreate($_REQUEST['target_module'], $view);
}
?>

64
modules/Home/TrainingPortal.php Executable file
View File

@@ -0,0 +1,64 @@
<?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".
********************************************************************************/
global $mod_strings;
global $app_list_strings;
global $app_strings;
global $current_language;
global $sugar_config;
global $sugar_flavor;
global $sugar_version;
$send_version = isset($sugar_version) ? $sugar_version : "";
$send_edition = isset($sugar_flavor) ? $sugar_flavor : "";
$send_lang = isset($current_language) ? $current_language : "";
$send_key = isset($sugar_config['unique_key']) ? $sugar_config['unique_key'] : "";
$sugar_smarty = new Sugar_Smarty();
$iframe_url = add_http("www.sugarcrm.com/network/redirect.php?to=training&tmpl=network&version={$send_version}&edition={$send_edition}&language={$send_lang}&key={$send_key}");
$sugar_smarty->assign('iframeURL', $iframe_url);
echo $sugar_smarty->fetch('modules/Home/TrainingPortal.tpl');
?>

43
modules/Home/TrainingPortal.tpl Executable file
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".
********************************************************************************/
*}
<IFRAME frameborder="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF" SRC="{$iframeURL}" NAME="SUGARIFRAME" ID="SUGARIFRAME" WIDTH="100%" height="1000"></IFRAME>

60
modules/Home/UnifiedSearch.php Executable file
View File

@@ -0,0 +1,60 @@
<?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".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('modules/Home/UnifiedSearchAdvanced.php');
if(!empty($_REQUEST['usa_form'])) {
$usa = new UnifiedSearchAdvanced();
echo $usa->getDropDownDiv();
}
else {
global $mod_strings, $modListHeader, $app_strings, $beanList, $beanFiles;
echo get_module_title("Search", $mod_strings['LBL_SEARCH_RESULTS'], true);
$usa = new UnifiedSearchAdvanced();
$usa->search();
}
?>

View File

@@ -0,0 +1,326 @@
<?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".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
class UnifiedSearchAdvanced {
function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') {
global $app_list_strings;
if(!file_exists($GLOBALS['sugar_config']['cache_dir'].'modules/unified_search_modules.php'))
$this->buildCache();
include($GLOBALS['sugar_config']['cache_dir'].'modules/unified_search_modules.php');
global $mod_strings, $modListHeader, $app_list_strings, $current_user, $app_strings, $beanList;
$users_modules = $current_user->getPreference('globalSearch', 'search');
if(!isset($users_modules)) { // preferences are empty, select all
$users_modules = array();
foreach($unified_search_modules as $module=>$data) {
if ( !empty($data['default']) ) {
$users_modules[$module] = $beanList[$module];
}
}
$current_user->setPreference('globalSearch', $users_modules, 0, 'search');
}
$sugar_smarty = new Sugar_Smarty();
$modules_to_search = array();
foreach($unified_search_modules as $module => $data) {
if(ACLController::checkAccess($module, 'list', true)) {
$modules_to_search[$module] = array('translated' => $app_list_strings['moduleList'][$module]);
if(array_key_exists($module, $users_modules)) $modules_to_search[$module]['checked'] = true;
else $modules_to_search[$module]['checked'] = false;
}
}
if(!empty($_REQUEST['query_string'])) $sugar_smarty->assign('query_string', securexss($_REQUEST['query_string']));
else $sugar_smarty->assign('query_string', '');
$sugar_smarty->assign('USE_SEARCH_GIF', 0);
$sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_SEARCH_BUTTON_LABEL']);
$sugar_smarty->assign('MODULES_TO_SEARCH', $modules_to_search);
$sugar_smarty->debugging = true;
return $sugar_smarty->fetch($tpl);
}
function search() {
if(!file_exists($GLOBALS['sugar_config']['cache_dir'].'modules/unified_search_modules.php'))
$this->buildCache();
include $GLOBALS['sugar_config']['cache_dir'].'modules/unified_search_modules.php';
require_once 'include/ListView/ListViewSmarty.php';
global $modListHeader, $beanList, $beanFiles, $current_language, $app_strings, $current_user, $mod_strings;
$home_mod_strings = return_module_language($current_language, 'Home');
$overlib = true;
$_REQUEST['query_string'] = $GLOBALS['db']->quote(securexss(from_html(clean_string($_REQUEST['query_string'], 'UNIFIED_SEARCH'))));
if(!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') {
$modules_to_search = array();
foreach($_REQUEST as $param => $value) {
if(preg_match('/^search_mod_(.*)$/', $param, $match)) {
$modules_to_search[$match[1]] = $beanList[$match[1]];
}
}
$current_user->setPreference('globalSearch', $modules_to_search, 0, 'search'); // save selections to user preference
}
else {
$users_modules = $current_user->getPreference('globalSearch', 'search');
if(isset($users_modules)) { // use user's previous selections
foreach ( $users_modules as $key => $value ) {
if ( isset($unified_search_modules[$key]) ) {
$modules_to_search[$key] = $value;
}
}
}
else { // select all the modules (ie first time user has used global search)
foreach($unified_search_modules as $module=>$data) {
if ( !empty($data['default']) ) {
$modules_to_search[$module] = $beanList[$module];
}
}
}
$current_user->setPreference('globalSearch', $modules_to_search, 'search');
}
echo $this->getDropDownDiv('modules/Home/UnifiedSearchAdvancedForm.tpl');
$module_results = array();
$module_counts = array();
$has_results = false;
if(!empty($_REQUEST['query_string'])) {
// MFH BUG 15404: Added support to trim off whitespace at the beginning and end of a search string
$_REQUEST['query_string'] = trim($_REQUEST['query_string']);
foreach($modules_to_search as $moduleName => $beanName) {
require_once $beanFiles[$beanName] ;
$seed = new $beanName();
$lv = new ListViewSmarty();
$lv->lvd->additionalDetails = false;
$mod_strings = return_module_language($current_language, $seed->module_dir);
if(file_exists('custom/modules/'.$seed->module_dir.'/metadata/listviewdefs.php')){
require_once('custom/modules/'.$seed->module_dir.'/metadata/listviewdefs.php');
}else{
require_once('modules/'.$seed->module_dir.'/metadata/listviewdefs.php');
}
if ( !isset($listViewDefs) || !isset($listViewDefs[$seed->module_dir]) )
continue;
$unifiedSearchFields = array () ;
$innerJoins = array();
foreach ( $unified_search_modules[ $moduleName ]['fields'] as $field=>$def )
{
$listViewCheckField = strtoupper($field);
if ( empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) {
// Bug 40032 - Add special case for field EMAIL; check for matching column
// EMAIL1 in the listviewdefs as an alternate column.
if ( $listViewCheckField == 'EMAIL'
&& !empty($listViewDefs[$seed->module_dir]['EMAIL1']['default']) ) {
// we've found the alternate matching column
}
else {
continue;
}
}
//bug: 34125 we might want to try to use the LEFT JOIN operator instead of the INNER JOIN in the case we are
//joining against a field that has not been populated.
if(!empty($def['innerjoin']) ){
if (empty($def['db_field']) )
continue;
$innerJoins[$field] = $def;
$def['innerjoin'] = str_replace('INNER', 'LEFT', $def['innerjoin']);
}
$unifiedSearchFields[ $moduleName ] [ $field ] = $def ;
$unifiedSearchFields[ $moduleName ] [ $field ][ 'value' ] = $_REQUEST['query_string'] ;
}
/*
* Use searchForm2->generateSearchWhere() to create the search query, as it can generate SQL for the full set of comparisons required
* generateSearchWhere() expects to find the search conditions for a field in the 'value' parameter of the searchFields entry for that field
*/
require_once 'include/SearchForm/SearchForm2.php' ;
$searchForm = new SearchForm ( $seed, $moduleName ) ;
$searchForm->setup (array ( $moduleName => array() ) , $unifiedSearchFields , '' , 'saved_views' /* hack to avoid setup doing further unwanted processing */ ) ;
$where_clauses = $searchForm->generateSearchWhere() ;
//add inner joins back into the where clause
$params = array('custom_select' => "");
foreach($innerJoins as $field=>$def) {
if (isset ($def['db_field'])) {
foreach($def['db_field'] as $dbfield)
$where_clauses[] = $dbfield . " LIKE '" . $_REQUEST['query_string'] . "%'";
$params['custom_select'] .= ", $dbfield";
$params['distinct'] = true;
//$filterFields[$dbfield] = $dbfield;
}
}
if (count($where_clauses) > 0 )
$where = '(('. implode(' ) OR ( ', $where_clauses) . '))';
$displayColumns = array();
foreach($listViewDefs[$seed->module_dir] as $colName => $param) {
if(!empty($param['default']) && $param['default'] == true) {
$param['url_sort'] = true;//bug 27933
$displayColumns[$colName] = $param;
}
}
if(count($displayColumns) > 0) $lv->displayColumns = $displayColumns;
else $lv->displayColumns = $listViewDefs[$seed->module_dir];
$lv->export = false;
$lv->mergeduplicates = false;
$lv->multiSelect = false;
$lv->delete = false;
$lv->select = false;
$lv->showMassupdateFields = false;
if($overlib) {
$lv->overlib = true;
$overlib = false;
}
else $lv->overlib = false;
$lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where, $params, 0, 10);
$module_results[$moduleName] = '<br /><br />' . get_form_header($GLOBALS['app_list_strings']['moduleList'][$seed->module_dir] . ' (' . $lv->data['pageData']['offsets']['total'] . ')', '', false);
$module_counts[$moduleName] = $lv->data['pageData']['offsets']['total'];
if($lv->data['pageData']['offsets']['total'] == 0) {
$module_results[$moduleName] .= '<h2>' . $home_mod_strings['LBL_NO_RESULTS_IN_MODULE'] . '</h2>';
}
else {
$has_results = true;
$module_results[$moduleName] .= $lv->display(false, false);
}
}
}
if($has_results) {
arsort($module_counts);
foreach($module_counts as $name=>$value) {
echo $module_results[$name];
}
}
else {
echo '<br>';
echo $home_mod_strings['LBL_NO_RESULTS'];
echo $home_mod_strings['LBL_NO_RESULTS_TIPS'];
}
}
function buildCache()
{
global $beanList, $beanFiles, $dictionary;
$supported_modules = array();
foreach($beanList as $moduleName=>$beanName)
{
if (!isset($beanFiles[$beanName]))
continue;
if($beanName == 'aCase') $beanName = 'Case';
$manager = new VardefManager ( );
$manager->loadVardef( $moduleName , $beanName ) ;
// obtain the field definitions used by generateSearchWhere (duplicate code in view.list.php)
if(!empty($metafiles[$moduleName]['searchfields']))
require $metafiles[$moduleName]['searchfields'] ;
elseif(file_exists("modules/{$moduleName}/metadata/SearchFields.php"))
require "modules/{$moduleName}/metadata/SearchFields.php" ;
if(isset($dictionary[$beanName]['unified_search']) && $dictionary[$beanName]['unified_search']) // if bean participates in uf
{
$fields = array();
foreach ( $dictionary [ $beanName ][ 'fields' ] as $field => $def )
{
// We cannot enable or disable unified_search for email in the vardefs as we don't actually have a vardef entry for 'email' -
// the searchFields entry for 'email' doesn't correspond to any vardef entry. Instead it contains SQL to directly perform the search.
// So as a proxy we allow any field in the vardefs that has a name starting with 'email...' to be tagged with the 'unified_search' parameter
if (strpos($field,'email') !== false)
$field = 'email' ;
//bug: 38139 - allow phone to be searched through Global Search
if (strpos($field,'phone') !== false)
$field = 'phone' ;
if ( isset($def['unified_search']) && $def['unified_search'] && isset ( $searchFields [ $moduleName ] [ $field ] ))
{
$fields [ $field ] = $searchFields [ $moduleName ] [ $field ] ;
}
}
if(count($fields) > 0) {
$supported_modules [$moduleName] ['fields'] = $fields;
if ( isset($dictionary[$beanName]['unified_search_default_enabled']) &&
$dictionary[$beanName]['unified_search_default_enabled'] == FALSE ) {
$supported_modules [$moduleName]['default'] = false;
}
else {
$supported_modules [$moduleName]['default'] = true;
}
}
}
}
ksort($supported_modules);
write_array_to_file('unified_search_modules', $supported_modules, $GLOBALS['sugar_config']['cache_dir'].'modules/unified_search_modules.php');
}
}
?>

View File

@@ -0,0 +1,72 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<form name='UnifiedSearchAdvanced' action='index.php' method='get'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='query_string' value=''>
<input type='hidden' name='advanced' value='true'>
<input type='hidden' name='action' value='UnifiedSearch'>
<input type='hidden' name='search_form' value='false'>
<table width='300' class='edit view' border='0' cellpadding='0' cellspacing='1'>
<tr>
<th style='text-align: left;' colspan='3'>{sugar_translate label='LBL_MODULES_TO_SEARCH' module='Home'}</th>
<th style='text-align: right;'>
<img onclick='SUGAR.unifiedSearchAdvanced.get_content()' src='{sugar_getimagepath file="close.gif"}' border='0'>
</th>
</tr>
{foreach from=$MODULES_TO_SEARCH name=m key=module item=info}
{if $smarty.foreach.m.first}
<tr style='padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px'>
{/if}
<td width='1' style='border: none; padding: 0px 10px 0px 0px; margin: 0px 0px 0px 0px'>
<input class='checkbox' id='cb_{$module}' type='checkbox' name='search_mod_{$module}' value='true' {if $info.checked}checked{/if}>
</td>
<td style='border: none; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; cursor: hand; cursor: pointer' onclick="document.getElementById('cb_{$module}').checked = !document.getElementById('cb_{$module}').checked;">
{$info.translated}
</td>
{if $smarty.foreach.m.index % 2 == 1}
</tr><tr style='padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px'>
{/if}
{/foreach}
</tr>
</table>
</form>

View File

@@ -0,0 +1,73 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<br />
<form name='UnifiedSearchAdvancedMain' action='index.php' method='get'>
<input type='hidden' name='module' value='Home'>
<input type='hidden' name='query_string' value='test'>
<input type='hidden' name='advanced' value='true'>
<input type='hidden' name='action' value='UnifiedSearch'>
<input type='hidden' name='search_form' value='false'>
<table width='600' class='edit view' border='0' cellspacing='1'>
<tr style='padding-bottom: 10px'>
<td colspan='8' nowrap>
<input id='searchFieldMain' class='searchField' type='text' size='80' name='query_string' value='{$query_string}'>
&nbsp;<input type="submit" class="button" value="{$LBL_SEARCH_BUTTON_LABEL}">
</td>
</tr>
<tr height='5'><td></td></tr>
<tr style='padding-top: 10px;'>
{foreach from=$MODULES_TO_SEARCH name=m key=module item=info}
<td width='20' style='padding: 0px 10px 0px 0px;' >
<input class='checkbox' id='cb_{$module}_f' type='checkbox' name='search_mod_{$module}' value='true' {if $info.checked}checked{/if}>
</td>
<td width='130' style='padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; cursor: hand; cursor: pointer' onclick="document.getElementById('cb_{$module}_f').checked = !document.getElementById('cb_{$module}_f').checked;">
{$info.translated}
</td>
{if $smarty.foreach.m.index % 4 == 3}
</tr><tr style='padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px'>
{/if}
{/foreach}
</tr>
</table>
</form>

View File

@@ -0,0 +1,152 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
{if $overlib}
<script type="text/javascript" src="include/javascript/sugar_grp_overlib.js"></script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
{/if}
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<tr class='pagination'>
<td colspan="{$colCount}" align="right">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">{$exportLink}{$mergeLink}{$selectedObjectsSpan}&nbsp;</td>
<td align="right" nowrap="nowrap">
{if $pageData.urls.startPage}
<a href="{$pageData.urls.startPage}" {if $prerow}onclick="javascript:return sListView.save_checks(0, '{$moduleString}')"{/if} ><img src="{sugar_getimagepath file="start.gif"}" alt="Start" align="absmiddle" border="0" height="10" width="11">&nbsp;Start</a>&nbsp;&nbsp;
{else}
<img src="{sugar_getimagepath file="start_off.gif"}" alt="Start" align="absmiddle" border="0" height="10" width="11">&nbsp;Start&nbsp;&nbsp;
{/if}
{if $pageData.urls.prevPage}
<a href="{$pageData.urls.prevPage}" {if $prerow}onclick="javascript:return sListView.save_checks(0, '{$moduleString}')"{/if} ><img src="{sugar_getimagepath file="previous.gif"}" alt="Previous" align="absmiddle" border="0" height="10" width="6">&nbsp;Previous</a>&nbsp;&nbsp;
{else}
<img src="{sugar_getimagepath file="previous_off.gif"}" alt="Previous" align="absmiddle" border="0" height="10" width="6">&nbsp;Previous&nbsp;&nbsp;
{/if}
<span class="pageNumbers">({$pageData.offsets.current+1} - {$pageData.offsets.next} of {if $pageData.offsets.totalCounted}{$pageData.offsets.total}{else}{$rowCount+1}}+{/if})</span>&nbsp;&nbsp;
{if $pageData.urls.nextPage}
<a href="{$pageData.urls.nextPage}" {if $prerow}onclick="javascript:return sListView.save_checks(40, '{$moduleString}')"{/if} >Next&nbsp;<img src="{sugar_getimagepath file="next.gif"}" alt="Next" align="absmiddle" border="0" height="10" width="6"></a>&nbsp;&nbsp;
{else}
&nbsp;&nbsp;Next&nbsp;<img src="{sugar_getimagepath file="next_off.gif"}" alt="Next" align="absmiddle" border="0" height="10" width="6">
{/if}
{if $pageData.urls.endPage}
<a href="{$pageData.urls.endPage}" {if $prerow}onclick="javascript:return sListView.save_checks(980, '{$moduleString}')"{/if} >End&nbsp;<img src="{sugar_getimagepath file="end.gif"}" alt="End" align="absmiddle" border="0" height="10" width="11"></a></td>
{else}
&nbsp;&nbsp;Next&nbsp;<img src="{sugar_getimagepath file="next_off.gif"}" alt="Next" align="absmiddle" border="0" height="10" width="6">
{/if}
</td>
</tr>
</table>
</td>
</tr>
<tr height="20">
{if $prerow}
<td scope="col" NOWRAP>{$checkall}</td>
{/if}
{foreach from=$displayColumns key=colHeader item=params}
<td scope="col" width="{$params.width}" align="{$params.align}" nowrap>
<slot><a href="{$pageData.urls.orderBy}{$params.orderBy}" class="listViewThLinkS1">{$params.label}&nbsp;<img src="{smarty_function_sugar_getimagepath file='arrow.gif'}" alt="Sort" align="absmiddle" border="0"></a></slot>
</td>
{/foreach}
</tr>
{counter start=0 name=rowCounter print=false}
{foreach from=$data key=id item=rowData}
{if $rowCounter is even}
{assign var="_rowColor" value=$rowColor[0]}
{else}
{assign var="_rowColor" value=$rowColor[1]}
{/if}
<tr height="20" class="{$_rowColor}S1">
{if $prerow}
<td><input onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox' class='checkbox' name='mass[]' value='{$id}'></td>
{/if}
{foreach from=$displayColumns key=col item=params}
<td scope='row' align="{$params.align|default:"left"}" valign="top"><slot>
{if $params.link}
{if $params.customCode}
{sugar_evalcolumn_old var=$params.customCode rowData=$rowData}
{else}
<{$pageData.tag.$id.MAIN} href="index.php?action={$params.action|default:"DetailView"}&module={$params.module|default:$pageData.bean.moduleDir}&record={$rowData[$params.id]|default:$id}&offset={$pageData.offsets.current}&stamp={$pageData.stamp}" >{$rowData.$col}</{$pageData.tag.$id.MAIN}>
{/if}
{else}
{$rowData.$col}
{/if}
</slot></td>
{/foreach}
</tr>
{counter print=false}
{/foreach}
<tr class='pagination'>
<td colspan="{$colCount}" align="right">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">{$exportLink}{$mergeLink}{$selectedObjectsSpan}&nbsp;</td>
<td align="right" nowrap="nowrap">
{if $pageData.urls.startPage}
<a href="{$pageData.urls.startPage}" onclick="javascript:return sListView.save_checks(0, '{$moduleString}')" ><img src="{sugar_getimagepath file="start.gif"}" alt="Start" align="absmiddle" border="0" height="10" width="11">&nbsp;Start</a>&nbsp;&nbsp;
{else}
<img src="{sugar_getimagepath file="start_off.gif"}" alt="Start" align="absmiddle" border="0" height="10" width="11">&nbsp;Start&nbsp;&nbsp;
{/if}
{if $pageData.urls.prevPage}
<a href="{$pageData.urls.prevPage}" onclick="javascript:return sListView.save_checks(0, '{$moduleString}')" ><img src="{sugar_getimagepath file="previous.gif"}" alt="Previous" align="absmiddle" border="0" height="10" width="6">&nbsp;Previous</a>&nbsp;&nbsp;
{else}
<img src="{sugar_getimagepath file="previous_off.gif"}" alt="Previous" align="absmiddle" border="0" height="10" width="6">&nbsp;Previous&nbsp;&nbsp;
{/if}
<span class="pageNumbers">({$pageData.offsets.current+1} - {$pageData.offsets.next} of {if $pageData.offsets.totalCounted}{$pageData.offsets.end}{else}{$rowCount+1}}+{/if})</span>&nbsp;&nbsp;
{if $pageData.urls.nextPage}
<a href="{$pageData.urls.nextPage}" onclick="javascript:return sListView.save_checks(40, '{$moduleString}')" >Next&nbsp;<img src="{sugar_getimagepath file="next.gif"}" alt="Next" align="absmiddle" border="0" height="10" width="6"></a>&nbsp;&nbsp;
{else}
&nbsp;&nbsp;Next&nbsp;<img src="{sugar_getimagepath file="next_off.gif"}" alt="Next" align="absmiddle" border="0" height="10" width="6">
{/if}
{if $pageData.urls.endPage}
<a href="{$pageData.urls.endPage}" onclick="javascript:return sListView.save_checks(980, '{$moduleString}')" >End&nbsp;<img src="{sugar_getimagepath file="end.gif"}" alt="End" align="absmiddle" border="0" height="10" width="11"></a></td>
{else}
&nbsp;&nbsp;Next&nbsp;<img src="{sugar_getimagepath file="next_off.gif"}" alt="Next" align="absmiddle" border="0" height="10" width="6">
{/if}
</td>
</tr>
</table>
</td>
</tr>
</table>

35
modules/Home/about.js Normal file
View File

@@ -0,0 +1,35 @@
/*********************************************************************************
* 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".
********************************************************************************/
var abouter=function(){return{display:function(){abouter.div=document.getElementById('abouterdiv');abouter.div.style.display='';abouter.div.src="index.php?module=Home&action=PopupSugar&to_pdf=true&style="+abouter.style;},ab:function(index,style){if(abouter.starter==3){abouter.style=style;abouter.display();}else{if(index==abouter.starter+1){abouter.starter++;}else{abouter.starter=0;}}}}}();abouter.starter=0;abouter.style='inc';

View File

@@ -0,0 +1,31 @@
<?php
$db=$GLOBALS['db'];
if($_REQUEST['query']!=""){
$result['fields']=[];
if($_REQUEST['type']=='EcmProducts'){
$query="select id,code,name from ecmproducts where deleted=0 and code like '".$_REQUEST['query']."%' limit 10";
$zap = $db->query($query);
while($dane=$db->fetchByAssoc($zap)){
$result['fields'][]=$dane;
}
}
if($_REQUEST['type']=='EcmActions'){
$query="select id,name from ecmactions where deleted=0 and name like '%".$_REQUEST['query']."%' limit 10";
$zap = $db->query($query);
while($dane=$db->fetchByAssoc($zap)){
$result['fields'][]=$dane;
}
}
echo json_encode($result);
}
?>

56
modules/Home/dashlets.php Executable file
View File

@@ -0,0 +1,56 @@
<?php
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* Description:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
*********************************************************************************/
$defaultDashlets = array(
'MyCallsDashlet'=>'Calls',
'MyMeetingsDashlet'=>'Meetings',
'MyOpportunitiesDashlet'=>'Opportunities',
'MyAccountsDashlet'=>'Accounts',
'MyLeadsDashlet'=>'Leads',
'MyEcmCalendarsDashlets',
);
if (is_file('custom/modules/Home/dashlets.php')) include_once('custom/modules/Home/dashlets.php');
?>

290
modules/Home/index.php Executable file
View File

@@ -0,0 +1,290 @@
<?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".
********************************************************************************/
global $current_user, $sugar_version, $sugar_config, $beanFiles;
require_once('include/MySugar/MySugar.php');
// build dashlet cache file if not found
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');
require('modules/Home/dashlets.php');
$pages = $current_user->getPreference('pages', 'Home');
$dashlets = $current_user->getPreference('dashlets', 'Home');
$defaultHomepage = false;
// BEGIN fill in with default homepage and dashlet selections
$hasUserPreferences = (!isset($pages) || empty($pages) || !isset($dashlets) || empty($dashlets)) ? false : true;
if(!$hasUserPreferences){
$dashlets = array();
//list of preferences to move over and to where
$prefstomove = array(
'mypbss_date_start' => 'MyPipelineBySalesStageDashlet',
'mypbss_date_end' => 'MyPipelineBySalesStageDashlet',
'mypbss_sales_stages' => 'MyPipelineBySalesStageDashlet',
'mypbss_chart_type' => 'MyPipelineBySalesStageDashlet',
'lsbo_lead_sources' => 'OpportunitiesByLeadSourceByOutcomeDashlet',
'lsbo_ids' => 'OpportunitiesByLeadSourceByOutcomeDashlet',
'pbls_lead_sources' => 'OpportunitiesByLeadSourceDashlet',
'pbls_ids' => 'OpportunitiesByLeadSourceDashlet',
'pbss_date_start' => 'PipelineBySalesStageDashlet',
'pbss_date_end' => 'PipelineBySalesStageDashlet',
'pbss_sales_stages' => 'PipelineBySalesStageDashlet',
'pbss_chart_type' => 'PipelineBySalesStageDashlet',
'obm_date_start' => 'OutcomeByMonthDashlet',
'obm_date_end' => 'OutcomeByMonthDashlet',
'obm_ids' => 'OutcomeByMonthDashlet');
//upgrading from pre-5.0 homepage
$old_columns = $current_user->getPreference('columns', 'home');
$old_dashlets = $current_user->getPreference('dashlets', 'home');
if (isset($old_columns) && !empty($old_columns) && isset($old_dashlets) && !empty($old_dashlets)){
$columns = $old_columns;
$dashlets = $old_dashlets;
// resetting old columns and dashlets to have no preference and data
$old_columns = array();
$old_dashlets = array();
$current_user->setPreference('columns', $old_columns, 0, 'home');
$current_user->setPreference('dashlets', $old_dashlets, 0, 'home');
}
else{
// This is here to get Sugar dashlets added above the rest
$dashlets[create_guid()] = array('className' => 'iFrameDashlet',
'module' => 'Home',
'forceColumn' => 0,
'fileLocation' => $dashletsFiles['iFrameDashlet']['file'],
'options' => array('title' => translate('LBL_DASHLET_DISCOVER_SUGAR_PRO','Home'),
'url' => 'http://www.sugarcrm.com/crm/product/gopro',
'height' => 315,
));
$dashlets[create_guid()] = array ('className' => 'SugarFeedDashlet',
'module' => 'SugarFeed',
'forceColumn' => 1,
'fileLocation' => $dashletsFiles['SugarFeedDashlet']['file'],
);
$dashlets[create_guid()] = array('className' => 'iFrameDashlet',
'module' => 'Home',
'forceColumn' => 1,
'fileLocation' => $dashletsFiles['iFrameDashlet']['file'],
'options' => array('title' => translate('LBL_DASHLET_SUGAR_NEWS','Home'),
'url' => 'http://www.sugarcrm.com/crm/product/news',
'height' => 315,
));
foreach($defaultDashlets as $dashletName=>$module){
// clint - fixes bug #20398
// only display dashlets that are from visibile modules and that the user has permission to list
$myDashlet = new MySugar($module);
$displayDashlet = $myDashlet->checkDashletDisplay();
if (isset($dashletsFiles[$dashletName]) && $displayDashlet){
$options = array();
$prefsforthisdashlet = array_keys($prefstomove,$dashletName);
foreach ( $prefsforthisdashlet as $pref ) {
$options[$pref] = $current_user->getPreference($pref);
}
$dashlets[create_guid()] = array('className' => $dashletName,
'module' => $module,
'forceColumn' => 0,
'fileLocation' => $dashletsFiles[$dashletName]['file'],
'options' => $options);
}
}
$count = 0;
$columns = array();
$columns[0] = array();
$columns[0]['width'] = '60%';
$columns[0]['dashlets'] = array();
$columns[1] = array();
$columns[1]['width'] = '40%';
$columns[1]['dashlets'] = array();
foreach($dashlets as $guid=>$dashlet) {
if( $dashlet['forceColumn'] == 0 ) array_push($columns[0]['dashlets'], $guid);
else array_push($columns[1]['dashlets'], $guid);
$count++;
}
}
$current_user->setPreference('dashlets', $dashlets, 0, 'Home');
}
// handles upgrading from versions that had the 'Dashboard' module; move those items over to the Home page
$pagesDashboard = $current_user->getPreference('pages', 'Dashboard');
$dashletsDashboard = $current_user->getPreference('dashlets', 'Dashboard');
if ( !empty($pagesDashboard) ) {
// move dashlets from the dashboard to be at the end of the home screen dashlets
foreach ($pagesDashboard[0]['columns'] as $dashboardColumnKey => $dashboardColumn ) {
foreach ($dashboardColumn['dashlets'] as $dashletItem ) {
$pages[0]['columns'][$dashboardColumnKey]['dashlets'][] = $dashletItem;
}
}
$pages = array_merge($pages,$pagesDashboard);
$current_user->setPreference('pages', $pages, 0, 'Home');
}
if ( !empty($dashletsDashboard) ) {
$dashlets = array_merge($dashlets,$dashletsDashboard);
$current_user->setPreference('dashlets', $dashlets, 0, 'Home');
}
if ( !empty($pagesDashboard) || !empty($dashletsDashboard) )
$current_user->resetPreferences('Dashboard');
if (empty($pages)){
$pages = array();
$pageIndex = 0;
$pages[0]['columns'] = $columns;
$pages[0]['numColumns'] = '2';
$pages[0]['pageTitle'] = $mod_strings['LBL_HOME_PAGE_1_NAME']; // "My Sugar"
$pageIndex++;
$current_user->setPreference('pages', $pages, 0, 'Home');
$activePage = 0;
}
$sugar_smarty = new Sugar_Smarty();
$activePage = 0;
$divPages[] = $activePage;
$numCols = $pages[$activePage]['numColumns'];
$count = 0;
$dashletIds = array(); // collect ids to pass to javascript
$display = array();
foreach($pages[$activePage]['columns'] as $colNum => $column) {
if ($colNum == $numCols){
break;
}
$display[$colNum]['width'] = $column['width'];
$display[$colNum]['dashlets'] = array();
foreach($column['dashlets'] as $num => $id) {
// clint - fixes bug #20398
// only display dashlets that are from visibile modules and that the user has permission to list
if(!empty($id) && isset($dashlets[$id]) && is_file($dashlets[$id]['fileLocation'])) {
$module = 'Home';
if ( isset($dashletsFiles[$dashlets[$id]['className']]['module']) )
$module = $dashletsFiles[$dashlets[$id]['className']]['module'];
$myDashlet = new MySugar($module);
if($myDashlet->checkDashletDisplay()) {
require_once($dashlets[$id]['fileLocation']);
$dashlet = new $dashlets[$id]['className']($id, (isset($dashlets[$id]['options']) ? $dashlets[$id]['options'] : array()));
// Need to add support to dynamically display/hide dashlets
// If it has a method 'shouldDisplay' we will call it to see if we should display it or not
if (method_exists($dashlet,'shouldDisplay')) {
if (!$dashlet->shouldDisplay()) {
// This dashlet doesn't want us to show it, skip it.
continue;
}
}
array_push($dashletIds, $id);
$dashlet->process();
try {
$display[$colNum]['dashlets'][$id]['display'] = $dashlet->display();
$display[$colNum]['dashlets'][$id]['displayHeader'] = $dashlet->getHeader();
$display[$colNum]['dashlets'][$id]['displayFooter'] = $dashlet->getFooter();
if($dashlet->hasScript) {
$display[$colNum]['dashlets'][$id]['script'] = $dashlet->displayScript();
}
} catch (Exception $ex) {
$display[$colNum]['dashlets'][$id]['display'] = $ex->getMessage();
$display[$colNum]['dashlets'][$id]['displayHeader'] = $dashlet->getHeader();
$display[$colNum]['dashlets'][$id]['displayFooter'] = $dashlet->getFooter();
}
}
}
}
}
if(!empty($sugar_config['lock_homepage']) && $sugar_config['lock_homepage'] == true) $sugar_smarty->assign('lock_homepage', true);
$sugar_smarty->assign('sugarVersion', $sugar_version);
$sugar_smarty->assign('sugarFlavor', $sugar_flavor);
$sugar_smarty->assign('currentLanguage', $GLOBALS['current_language']);
$sugar_smarty->assign('serverUniqueKey', $GLOBALS['server_unique_key']);
$sugar_smarty->assign('imagePath', $GLOBALS['image_path']);
$sugar_smarty->assign('jsCustomVersion', $sugar_config['js_custom_version']);
$sugar_smarty->assign('maxCount', empty($sugar_config['max_dashlets_homepage']) ? 15 : $sugar_config['max_dashlets_homepage']);
$sugar_smarty->assign('dashletCount', $count);
$sugar_smarty->assign('dashletIds', '["' . implode('","', $dashletIds) . '"]');
$sugar_smarty->assign('columns', $display);
global $theme;
$sugar_smarty->assign('theme', $theme);
$sugar_smarty->assign('divPages', $divPages);
$sugar_smarty->assign('activePage', $activePage);
$sugar_smarty->assign('current_user', $current_user->id);
$sugar_smarty->assign('lblAdd', $GLOBALS['app_strings']['LBL_ADD_BUTTON']);
$sugar_smarty->assign('lblAddDashlets', $GLOBALS['app_strings']['LBL_ADD_DASHLETS']);
$sugar_smarty->assign('lblLnkHelp', $GLOBALS['app_strings']['LNK_HELP']);
$sugar_smarty->assign('mod', return_module_language($sugar_config['default_language'], 'Home'));
$sugar_smarty->assign('app', $GLOBALS['app_strings']);
$sugar_smarty->assign('module', 'Home');
echo $sugar_smarty->fetch('include/MySugar/tpls/MySugar.tpl');
?>

View File

@@ -0,0 +1,245 @@
<?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".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_SAVE' => 'Save',
'LBL_CANCEL' => 'Cancel',
'LBL_MODULE_NAME' => 'Home',
'LBL_MODULES_TO_SEARCH' => 'Modules to Search',
'LBL_NEW_FORM_TITLE' => 'New Contact',
'LBL_FIRST_NAME' => 'First Name:',
'LBL_LAST_NAME' => 'Last Name:',
'LBL_LIST_LAST_NAME' => 'Last Name',
'LBL_PHONE' => 'Phone:',
'LBL_EMAIL_ADDRESS' => 'Email Address:',
'LBL_MY_PIPELINE_FORM_TITLE' => 'My Pipeline',
'LBL_PIPELINE_FORM_TITLE' => 'Pipeline By Sales Stage',
'LBL_CAMPAIGN_ROI_FORM_TITLE' => 'Campaign ROI',
'LBL_MY_CLOSED_OPPORTUNITIES_GAUGE' => 'My Closed Won Opportunities Gauge',
'LNK_NEW_CONTACT' => 'Create Contact',
'LNK_NEW_ACCOUNT' => 'Create Account',
'LNK_NEW_OPPORTUNITY' => 'Create Opportunity',
'LNK_NEW_LEAD' => 'Create Lead',
'LNK_NEW_CASE' => 'Create Case',
'LNK_NEW_NOTE' => 'Create Note or Attachment',
'LNK_NEW_CALL' => 'Log Call',
'LNK_NEW_EMAIL' => 'Archive Email',
'LNK_COMPOSE_EMAIL' => 'Compose Email',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_TASK' => 'Create Task',
'LNK_NEW_BUG' => 'Report Bug',
'LBL_ADD_BUSINESSCARD' => 'Enter Business Card',
'ERR_ONE_CHAR' => 'Please enter at least one letter or number for your search ...',
'LBL_OPEN_TASKS' => 'My Open Tasks',
'LBL_SEARCH_RESULTS' => 'Search Results',
'LBL_SEARCH_RESULTS_IN' => 'in',
'LNK_NEW_SEND_EMAIL' => 'Compose Email',
'LBL_NO_ACCESS' => 'You do not have access to this area. Contact your site administrator to obtain access',
'LBL_NO_RESULTS_IN_MODULE' => '-- No Results --',
'LBL_NO_RESULTS' => '<h2>There were no results found. Please search again.</h2><br>',
'LBL_NO_RESULTS_TIPS' => '<h3>Search Tips:</h3><ul><li>Make sure you have the proper categories selected above.</li><li>Broaden your search criteria.</li><li>If you still cannot find any results try the advanced search option.</li></ul>',
'LBL_RELOAD_PAGE' => 'Please <a href="javascript: window.location.reload()">reload the window</a> to use this Sugar Dashlet.',
'LBL_ADD_DASHLETS' => 'Add Sugar Dashlets',
'LBL_ADD_PAGE' => 'Add Page',
'LBL_DEL_PAGE' => 'Delete Page',
'LBL_WEBSITE_TITLE' => 'Website',
'LBL_RSS_TITLE' => 'News Feed',
'LBL_DELETE_PAGE' => 'Delete Page',
'LBL_CHANGE_LAYOUT' => 'Change Layout',
'LBL_RENAME_PAGE' => 'Rename Page',
'LBL_CLOSE_DASHLETS' => 'Close',
'LBL_CLOSE_SITEMAP' => 'Close',
'LBL_OPTIONS' => 'Options',
// dashlet search fields
'LBL_TODAY'=>'Today',
'LBL_YESTERDAY' => 'Yesterday',
'LBL_TOMORROW'=>'Tomorrow',
'LBL_LAST_WEEK'=>'Last Week',
'LBL_NEXT_WEEK'=>'Next Week',
'LBL_LAST_7_DAYS'=>'Last 7 Days',
'LBL_NEXT_7_DAYS'=>'Next 7 Days',
'LBL_LAST_MONTH'=>'Last Month',
'LBL_NEXT_MONTH'=>'Next Month',
'LBL_LAST_QUARTER'=>'Last Quarter',
'LBL_THIS_QUARTER'=>'This Quarter',
'LBL_LAST_YEAR'=>'Last Year',
'LBL_NEXT_YEAR'=>'Next Year',
'LBL_LAST_30_DAYS' => 'Last 30 Days',
'LBL_NEXT_30_DAYS' => 'Next 30 Days',
'LBL_THIS_MONTH' => 'This Month',
'LBL_THIS_YEAR' => 'This Year',
'LBL_MODULES' => 'Modules',
'LBL_CHARTS' => 'Charts',
'LBL_TOOLS' => 'Tools',
'LBL_WEB' => 'Web',
'LBL_SEARCH_RESULTS' => 'Search Result',
// Dashlet Categories
'dashlet_categories_dom' => array(
'Module Views' => 'Module Views',
'Portal' => 'Portal',
'Charts' => 'Charts',
'Tools' => 'Tools',
'Miscellaneous' => 'Miscellaneous'),
'LBL_MAX_DASHLETS_REACHED' => 'You have reached the maximum number of Sugar Dashlets your administrator has set. Please remove a Sugar Dashlet to add a new one.',
'LBL_ADDING_DASHLET' => 'Adding Sugar Dashlet ...',
'LBL_ADDED_DASHLET' => 'Sugar Dashlet Added',
'LBL_REMOVE_DASHLET_CONFIRM' => 'Are you sure you want to remove the Sugar Dashlet?',
'LBL_REMOVING_DASHLET' => 'Removing Sugar Dashlet ...',
'LBL_REMOVED_DASHLET' => 'Sugar Dashlet Removed',
'LBL_DASHLET_CONFIGURE_GENERAL' => 'General',
'LBL_DASHLET_CONFIGURE_FILTERS' => 'Filters',
'LBL_DASHLET_CONFIGURE_MY_ITEMS_ONLY' => 'Only My Items',
'LBL_DASHLET_CONFIGURE_TITLE' => 'Title',
'LBL_DASHLET_CONFIGURE_DISPLAY_ROWS' => 'Display Rows',
'LBL_DASHLET_DELETE' => 'Delete Sugar Dashlet',
'LBL_DASHLET_REFRESH' => 'Refresh Sugar Dashlet',
'LBL_DASHLET_EDIT' => 'Edit Sugar Dashlet',
'LBL_TRAINING_TITLE' => 'Training',
'LBL_CREATING_NEW_PAGE' => 'Creating New Page...',
'LBL_NEW_PAGE_FEEDBACK' => 'You have created a new page. You can add new content with the Add Sugar Dashlets option.',
'LBL_DELETE_PAGE_CONFIRM' => 'Are you sure you want to delete this page?',
'LBL_SAVING_PAGE_TITLE' => 'Saving Page Title...',
'LBL_RETRIEVING_PAGE' => 'Retrieving Page...',
// Default out-of-box names for tabs
'LBL_HOME_PAGE_1_NAME' => 'My Sugar',
'LBL_HOME_PAGE_2_NAME' => 'Sales',
'LBL_HOME_PAGE_3_NAME' => 'Support',
'LBL_HOME_PAGE_6_NAME' => 'Marketing',//bug 16510, separate the support and marketing page from each other
'LBL_HOME_PAGE_4_NAME' => 'Tracker',
'LBL_CLOSE_SITEMAP' =>'Close',
'LBL_SEARCH' => 'Search',
'LBL_CLEAR' => 'Clear',
'LBL_BASIC_CHARTS' => 'Basic Charts',
'LBL_REPORT_CHARTS' => 'Report Charts',
'LBL_MY_FAVORITE_REPORT_CHARTS' => 'My Favorite Reports',
'LBL_GLOBAL_REPORT_CHARTS' => 'Global Team Reports',
'LBL_MY_TEAM_REPORT_CHARTS' => 'My Team Reports',
'LBL_MY_SAVED_REPORT_CHARTS' => 'My Saved Reports',
'LBL_DASHLET_SEARCH' => 'Find Sugar Dashlet',
//ABOUT page
'LBL_VERSION' => 'Version',
'LBL_BUILD' => 'Build',
'LBL_VIEWLICENSE_COM' => '<P>This program is free software; you can redistribute it and/or modify it under the terms of the <a href="LICENSE.txt" target="_blank" class="body"> GNU Affero General Public License version 3</a> as published by the Free Software Foundation, including the additional permission set forth in the source code header.</P>',
'LBL_ADD_TERM_COM' => '<P>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 General Public License version 3, these Appropriate Legal Notices must retain the display of the &quot;Powered by SugarCRM&quot; logo. If the display of the logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices must display the words &quot;Powered by SugarCRM&quot;.</P>',
'LBL_SUGAR_COMMUNITY_EDITION' => 'Sugar Community Edition',
'LBL_SUGAR_PROFESSIONAL' => "Sugar Professional",
'LBL_SUGAR_ENTERPRISE' => "Sugar Enterprise",
'LBL_AND' => "and",
'LBL_ARE' => "are",
'LBL_TRADEMARKS' => 'trademarks',
'LBL_OF' => 'of',
'LBL_FOUNDERS' => 'Founders',
'LBL_JOIN_SUGAR_COMMUNITY' => 'Join the Sugar Community',
'LBL_DETAILS_SUGARFORGE' => 'Collaborate and develop Sugar extensions',
'LBL_DETAILS_SUGAREXCHANGE' => 'Buy and sell certified Sugar extensions',
'LBL_TRAINING' => 'Training',
'LBL_DETAILS_TRAINING' => 'Learn about Sugar using online and interactive learning content',
'LBL_FORUMS' => 'Forums',
'LBL_DETAILS_FORUMS' => 'Discuss Sugar with expert community users and developers',
'LBL_WIKI' => 'Wiki',
'LBL_DETAILS_WIKI' => 'Search the knowledge base of user and developer topics',
'LBL_DEVSITE' => 'Developer Site',
'LBL_DETAILS_DEVSITE' => 'Discover resources, tutorials, and helpful links to get you up to speed on Sugar development',
'LBL_GET_SUGARCRM_RSS' => 'Get SugarCRM RSS',
'LBL_SUGARCRM_NEWS' => 'SugarCRM News',
'LBL_SUGARCRM_TRAINING_NEWS' => 'SugarCRM Training News',
'LBL_SUGARCRM_FORUMS' => 'SugarCRM Forums',
'LBL_SUGARFORGE_NEWS' => 'SugarForge News',
'LBL_ALL_NEWS' => 'All News',
'LBL_LINK_CURRENT_CONTRIBUTORS' => 'Click this link for a current list of Sugar contributors!',
'LBL_SOURCE_CODE' => 'Source Code',
'LBL_SOURCE_SUGAR' => 'Sugar - The world\'s most popular sales force automation application created by SugarCRM Inc.',
'LBL_SOURCE_XTEMPLATE' => 'XTemplate - A template engine for PHP created by Barnabás Debreceni',
'LBL_SOURCE_NUSOAP' => 'NuSOAP - A set of PHP classes that allow developers to create and consume web services created by NuSphere Corporation and Dietrich Ayala',
'LBL_SOURCE_JSCALENDAR' => 'JS Calendar - A calendar for entering dates created by Mihai Bazon',
'LBL_SOURCE_PHPPDF' => 'PHP PDF - A library for creating PDF documents created by Wayne Munro',
'LBL_SOURCE_PNGBEHAVIOR' => 'PNG Behavior - Adds support for PNG graphic format to Internet Explorer.',
'LBL_SOURCE_JSONPHP' => 'JSON.php - A PHP script to convert to and from JSON data format by Michal Migurski.',
'LBL_SOURCE_JSON' => 'JSON.js - A JSON parser and JSON stringifier in JavaScript.',
'LBL_SOURCE_HTTP_WEBDAV_SERVER' => 'HTTP_WebDAV_Server - A WebDAV Server Implementation in PHP.',
'LBL_SOURCE_JS_O_LAIT' => 'JavaScript O Lait - A library of reusable modules and components to enhance JavaScript by Jan-Klaas Kollhof.',
'LBL_SOURCE_PCLZIP' => 'PclZip - library offers compression and extraction functions for Zip formatted archives by Vincent Blavet',
'LBL_SOURCE_SMARTY' => 'Smarty - A template engine for PHP.',
'LBL_SOURCE_OVERLIBMWS' => 'Overlibmws - JavaScript library for client-side windowing.',
'LBL_SOURCE_YAHOO_UI_LIB' => 'Yahoo! User Interface Library - The UI Library Utilities facilitate the implementation of rich client-side features.',
'LBL_SOURCE_PHPMAILER' => 'PHPMailer - A full featured email transfer class for PHP',
'LBL_SOURCE_CRYPT_BLOWFISH' => 'Crypt_Blowfish - Allows for quick two-way blowfish encryption without requiring the MCrypt PHP extension.',
'LBL_SOURCE_HTML_SAFE' => 'HTML_Safe - A parser that strips down all potentially dangerous content within HTML',
'LBL_SOURCE_XML_HTMLSAX3' => 'XML_HTMLSax3 - A SAX parser for HTML and other badly formed XML documents',
'LBL_SOURCE_YAHOO_UI_LIB_EXT' => 'Yahoo! UI Extensions Library - Extensions to the Yahoo! User Interface Library by Jack Slocum',
'LBL_SOURCE_JSMIN' => 'JSMin - filter which removes comments and unnecessary whitespace from JavaScript files.',
'LBL_SOURCE_SWFOBJECT' => 'SWFObject - Javascript Flash Player detection and embed script.',
'LBL_SOURCE_TINYMCE' => 'TinyMCE - A WYSIWYG editor control for web browsers that enables the user to edit HTML contents',
'LBL_SOURCE_EXT' => 'Ext - A client-side JavaScript framework for building web applications.',
'LBL_SOURCE_RECAPTCHA' => 'reCAPTCHA - A free CAPTCHA service that helps to digitize books, newspapers and old time radio shows.',
'LBL_SOURCE_TCPDF' => 'TCPDF - A PHP class for generating PDF documents.',
'LBL_DASHLET_TITLE' => 'My Sites',
'LBL_DASHLET_OPT_TITLE' => 'Title',
'LBL_DASHLET_OPT_URL' => 'Website Location',
'LBL_DASHLET_OPT_HEIGHT' => 'Dashlet Height (in pixels)',
'LBL_DASHLET_SUGAR_NEWS' => 'Sugar News',
'LBL_DASHLET_DISCOVER_SUGAR_PRO' => 'Discover Sugar',
);
?>

View File

@@ -0,0 +1,89 @@
<!--
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-eula.html
* By installing or using this file, You have unconditionally agreed to the
* terms and conditions of the License, and You may not use this file except in
* compliance with the License. Under the terms of the license, You shall not,
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
* or otherwise transfer Your rights to the Software, and 2) use the Software
* for timesharing or service bureau purposes such as hosting the Software for
* commercial gain and/or for the benefit of a third party. Use of the Software
* may be subject to applicable fees and any use of the Software without first
* paying applicable fees is strictly prohibited. You do not have the right to
* remove SugarCRM copyrights from the source code or user interface.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2004-2008 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Home</h1>
<p>
Use the Home page to view your upcoming meetings, scheduled calls, and other tasks. The information is displayed in panels. Every panel is a configurable Sugar Dashlet that you can move around the page to rearrange the Home page layout as needed.
<p>A Sugar Dashlet can be a module, a chart, tools such as Jot Pad, or a Sugar feed.
<p>Sugar feeds enable users to notify team members when they perform an action such as creating a new contact, lead, opportunity, or case. Team member are also notified when a lead is converted and when a case is closed. Your administrator can also enable you to post your own Sugar feeds to images, links, and YouTube videos. You can make these feeds available only to members of a specific team.
<p>To add a Sugar feed, from the Add Sugar Dashlet list, select <span class="helpButton">My Sugar Feed</span>. Click the down-arrow next to your name and select Link, YouTube, or Image. Click <span class="helpButton">Select</span> and specify the team in the Send to field, enter the URL or path in the field below, and click <span class="helpButton">Post</span>.
<p>To move a Sugar Dashlet, place the cursor on a panel title, hold down the mouse button, and drag it to the desired location on the page.
<p>To add a new Sugar Dashlet, click the down arrow on the My Sugar tab and select <span class="helpButton">Add Sugar Dashlets</span>. From the Add Sugar Dashlets menu that displays in a separate window, click a Sugar Dashlet to add it to your home page.
and Team Notices.
<p>You can add multiple Sugar Dashlets of the same kind and configure each one differently.
<p>You can also edit, refresh, and delete an existing Sugar Dashlet by clicking the appropriate icon located in the dashlet panel. Editing includes changing the columns and number of rows that are displayed as well as filters such as record creation date and assigned users and teams.
<p>The Home page displays tabs for My Sugar, Sales Page, and Marketing & Support Page.
<p>The <b>My Sugar</b> tab displays the following information that is specific to you:
<ul>
<li><span class="helpButton">My Calls</span>: Lists phone calls set up by you or others.
<li><span class="helpButton">My Top Open Opportunities</span>: Lists the top five opportunities sorted by the amount. Opportunities with a status of "Closed-Lost" or "Closed-Won" are not included.
<li><span class="helpButton">My Meetings</span>: Lists invitations to meetings set up by you or others.
<li><span class="helpButton">My Leads</span>: Displays a list of leads assigned to you by yourself or others.
<li><span class="helpButton">My Open Cases</span>: Displays a list of customer issues assigned to you for resolution.
<li><span class="helpButton">My Accounts</span>: Displays accounts assigned to you by yourself or other users.
<li><span class="helpButton">Jot Pad</span>: An area to jot down reminders to yourself or other comments
<li><span class="helpButton">Team Notices</span>: Displays any announcements targeted towards the team that you belong to.
<li><span class="helpButton">My Pipeline</span>: Displays a chart of your sales opportunities based on the cumulative amounts for selected sales stages. This chart, based on a Sugar predefined report, displays only when the expected close date is within the specified date range.
<li>The <span class="helpButton">Tracker</span> tab displays a list pre-defined tracker reports in the Select Query drop-down list. Tracker reports provide visibility into user actions and system performance. Select a report from the drop-down list to view the report results. For some reports, you can set a date filter for more specific report results.
<li>The <span class="helpButton">Sales</span> tab displays Dashboard module charts. Click the down-arrow on the tab to access options to rename the page, add a Sugar Dashlet, change the page layout, and delete the tab.
<li>The <span class="helpButton">Marketing & Support</span> tab displays your summation report charts. You can click the down-arrow on the tab to access options to rename the page, add a Sugar Dashlet, change the page layout, and delete the tab.
</ul>
<p>Click <span class="helpButton">Add Page</span> to add additional pages to your Home page to display more Sugar Dashlets. Enter a page name and specify the number of columns on the page, and click <span class="helpButton">Submit</span>. To add Sugar dashlets, change page layout, rename the page, or delete the page, click the down-arrow on the page tab and select the appropriate option.
<p>The <span class="helpButton">Shortcuts</span> menu displays options to create records in various modules such as accounts, contacts, and bugs. Click an option to create a record.<br><br>
<p>The New Contact quick form enables you create a contact with minimum information. You can enter additional information after you save the record.</p>

View File

@@ -0,0 +1,240 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("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.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.php,v for SugarCRM 4.5.1->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_SAVE' => 'Zapisz',
'LBL_CANCEL' => 'Anuluj',
'LBL_MODULE_NAME' => 'Strona główna',
'LBL_MODULES_TO_SEARCH' => 'Moduły do wyszukiwania',
'LBL_NEW_FORM_TITLE' => 'Nowy kontakt',
'LBL_FIRST_NAME' => 'Imię:',
'LBL_LAST_NAME' => 'Nazwisko:',
'LBL_LIST_LAST_NAME' => 'Nazwisko',
'LBL_PHONE' => 'Telefon:',
'LBL_EMAIL_ADDRESS' => 'Email:',
'LBL_MY_PIPELINE_FORM_TITLE' => 'Moje zestawienia',
'LBL_PIPELINE_FORM_TITLE' => 'Zestawienia etapow sprzedaży',
'LBL_CAMPAIGN_ROI_FORM_TITLE' => 'Kampanie zwrotu z inwestycji (ROI)',
'LBL_MY_CLOSED_OPPORTUNITIES_GAUGE' => 'Mój wskaźnik zamkniętych okazji',
'LNK_NEW_CONTACT' => 'Utwórz: Kontakt',
'LNK_NEW_ACCOUNT' => 'Kontrahenta',
'LNK_NEW_OPPORTUNITY' => 'Okazję',
'LNK_NEW_QUOTE' => 'Oferty',
'LNK_NEW_LEAD' => 'Adres',
'LNK_NEW_CASE' => 'Sprawę',
'LNK_NEW_NOTE' => 'Notatkę lub załącznik',
'LNK_NEW_CALL' => 'Rozmowę telefoniczną',
'LNK_NEW_EMAIL' => 'Archiwum poczty',
'LNK_COMPOSE_EMAIL' => 'Napisz email',
'LNK_NEW_MEETING' => 'Spotkanie',
'LNK_NEW_TASK' => 'Zadanie',
'LNK_NEW_BUG' => 'Zgłoś błąd',
'LBL_ADD_BUSINESSCARD' => 'Kontakt z Adresu',
'ERR_ONE_CHAR' => 'Wprowadź co najmniej jedną literę, lub cyfrę, aby przeszukać ...',
'LBL_OPEN_TASKS' => 'Moje otwarte sprawy',
'LBL_SEARCH_RESULTS' => 'Wyniki szukania',
'LBL_SEARCH_RESULTS_IN' => 'w',
'LNK_NEW_SEND_EMAIL' => 'Napisz email',
'LBL_NO_RESULTS_IN_MODULE' => '-- Brak wyników --',
'LBL_NO_RESULTS' => '<h2>Nie było wyników wyszukiwania. Przeszukaj jeszcze raz.</h2><br>',
'LBL_NO_RESULTS_TIPS' => '<h3>Podpowiedź:</h3><ul><li>Upewnij się, że wybrałeś odpowiednią kategorię powyżej</li><li>Określ swoje kryteria wyszukiwania.</li><li>Jeżeli nadal nie możesz otrzymać żadnych wyników, spróbuj zaawansowanego wyszukiwania w tym module.</li></ul>',
'LBL_RELOAD_PAGE' => '<a href="javascript: window.location.reload()">Przeładuj okno</a> aby użyć tej Belki.',
'LBL_ADD_DASHLETS' => 'Dodaj belkę',
'LBL_ADD_PAGE' => 'Dodaj stronę',
'LBL_DELETE_PAGE' => 'Usuń stronę',
'LBL_CHANGE_LAYOUT' => 'Zmień wygląd',
'LBL_RENAME_PAGE' => 'Zmień nazwę strony',
'LBL_CLOSE_DASHLETS' => 'Zamknij',
'LBL_CLOSE_SITEMAP' => 'Zamknij',
'LBL_OPTIONS' => 'Opcje',
// dashlet search fields
'LBL_TODAY'=>'Dziś',
'LBL_YESTERDAY' => 'Wczoraj',
'LBL_TOMORROW'=>'Jutro',
'LBL_LAST_WEEK'=>'W ostatnim tygodniu',
'LBL_NEXT_WEEK'=>'W następnym tygodniu',
'LBL_LAST_7_DAYS'=>'Ostatnie 7 dni',
'LBL_NEXT_7_DAYS'=>'Następne 7 dni',
'LBL_LAST_MONTH'=>'Ostatni miesiąc',
'LBL_NEXT_MONTH'=>'Następny miesiąc',
'LBL_LAST_QUARTER'=>'Ostatni kwartał',
'LBL_THIS_QUARTER'=>'Ten kwartał',
'LBL_LAST_YEAR'=>'Ostatni rok',
'LBL_NEXT_YEAR'=>'Następny rok',
'LBL_THIS_MONTH' => 'Ten miesiąc',
'LBL_THIS_YEAR' => 'Ten rok',
'LBL_LAST_30_DAYS' => 'Ostatnie 30 dni',
'LBL_NEXT_30_DAYS' => 'Następne 30 dni',
'LBL_THIS_MONTH' => 'Tego miesiąca',
'LBL_THIS_YEAR' => 'Tego Roku',
'LBL_LAST_30_DAYS' => 'Ostatnie 30 Dni',
'LBL_NEXT_30_DAYS' => 'Następne 30 dni',
'LBL_MODULES' => 'Moduły',
'LBL_CHARTS' => 'Wykresy',
'LBL_TOOLS' => 'Narzędzia',
'LBL_SEARCH_RESULTS' => 'Wyniki wyszukiwania',
// Dashlet Categories
'dashlet_categories_dom' => array(
'Module Views' => 'Widok modułu',
'Portal' => 'Portal',
'Charts' => 'Wykresy',
'Tools' => 'Narzędzia',
'Miscellaneous' => 'Inne'),
'LBL_MAX_DASHLETS_REACHED' => 'Osiągnąłeś maksymalną liczbe belek przewidzianą dla Ciebie przez administratora. Usuń belkę, aby dodać inne.',
'LBL_ADDING_DASHLET' => 'Dodaję belkę ...',
'LBL_ADDED_DASHLET' => 'Belka została dodana',
'LBL_REMOVE_DASHLET_CONFIRM' => 'Czy na pewno chcesz usunąć tę belkę?',
'LBL_REMOVING_DASHLET' => 'Usuwam belkę ...',
'LBL_REMOVED_DASHLET' => 'Belka została usunięta',
'LBL_DASHLET_CONFIGURE_GENERAL' => 'Ogólnie',
'LBL_DASHLET_CONFIGURE_FILTERS' => 'Filtry',
'LBL_DASHLET_CONFIGURE_MY_ITEMS_ONLY' => 'Tylko moje elementy',
'LBL_DASHLET_CONFIGURE_TITLE' => 'Tytuł',
'LBL_DASHLET_CONFIGURE_DISPLAY_ROWS' => 'Wyświetl wiersze',
// 'LBL_DASHLET_CONFIGURE_MY_ITEMS_ONLY' => 'My Items Only',
'LBL_DASHLET_DELETE' => 'Usuń zakładkę',
'LBL_DASHLET_REFRESH' => 'Odśwież zakładke',
'LBL_DASHLET_EDIT' => 'Edytuj zakładkę',
'LBL_TRAINING_TITLE' => 'Trening',
'LBL_CREATING_NEW_PAGE' => 'Utwórz nową stronę...',
'LBL_NEW_PAGE_FEEDBACK' => 'Możesz utworzyć nową stornę. Możesz dodać zawartość przy pomocy opcji Dodaj zakładkę.',
'LBL_DELETE_PAGE_CONFIRM' => 'Czy na pewno chcesz usunąć tę stronę?',
'LBL_SAVING_PAGE_TITLE' => 'Zapisuje tytuł strony..',
'LBL_RETRIEVING_PAGE' => 'Naprawiam stronę...',
// Default out-of-box names for tabs
'LBL_HOME_PAGE_1_NAME' => 'Mój Sugar',
'LBL_HOME_PAGE_2_NAME' => 'Strona sprzedaży',
'LBL_HOME_PAGE_3_NAME' => 'Strona wsparcia',
'LBL_HOME_PAGE_6_NAME' => 'Strona marketingu',//bug 16510, separate the support and marketing page from each other
'LBL_HOME_PAGE_4_NAME' => 'Szperacz',
'LBL_CLOSE_SITEMAP' =>'Zamknij',
'LBL_SEARCH' => 'Szukaj',
'LBL_CLEAR' => 'Wyczyść',
'LBL_BASIC_CHARTS' => 'Podstawowe wykresy',
'LBL_REPORT_CHARTS' => 'Raporty wykresów',
'LBL_MY_FAVORITE_REPORT_CHARTS' => 'Moje ulubione raporty',
'LBL_GLOBAL_REPORT_CHARTS' => 'Raporty głównego zespołu',
'LBL_MY_TEAM_REPORT_CHARTS' => 'Raporty mojego zespołu',
'LBL_MY_SAVED_REPORT_CHARTS' => 'Moje zapisane raporty',
'LBL_DASHLET_SEARCH' => 'Znajdź zakładkę',
//ABOUT page
'LBL_VERSION' => 'Wersja',
'LBL_BUILD' => 'Build',
'LBL_VIEWLICENSE_COM' => '<P>This program is free software; you can redistribute it and/or modify it under the terms of the <a href="LICENSE.txt" target="_blank" class="body"> GNU General Public License version 3</a> as published by the Free Software Foundation including the additional permission set forth in the source code header.</P>',
'LBL_ADD_TERM_COM' => '<P>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 General Public License version 3. In accordance with Section 7(b) of the GNU General Public License version 3, these Appropriate Legal Notices must retain the display of the &quot;Powered by SugarCRM&quot; logo. If the display of the logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices must display the words &quot;Powered by SugarCRM&quot;.</P>',
'LBL_SUGAR_COMMUNITY_EDITION' => 'Sugar Community Edition',
'LBL_SUGAR_PROFESSIONAL' => "Sugar Professional",
'LBL_SUGAR_ENTERPRISE' => "Sugar Enterprise",
'LBL_AND' => "i",
'LBL_ARE' => "",
'LBL_TRADEMARKS' => 'znaki towarowe',
'LBL_OF' => 'z',
'LBL_FOUNDERS' => 'Fundatorzy',
'LBL_JOIN_SUGAR_COMMUNITY' => 'Przyłącz się do Sugar Community',
'LBL_SUBSCRIBE_SUGARBUZZ' => 'Subskrybuj newsletter SugarBuzz',
'LBL_DETAILS_SUGARFORGE' => 'Wspieraj i projektuj rozszerzenia Sugar',
'LBL_DETAILS_SUGAREXCHANGE' => 'Kupuj i sprzedawaj certyfikowane rozszerzenia Sugar',
'LBL_TRAINING' => 'Trening',
'LBL_DETAILS_TRAINING' => 'Dowiedz się więcej o Sugar, używając interaktywnych poradników dostępnych online',
'LBL_FORUMS' => 'Forum',
'LBL_DETAILS_FORUMS' => 'Podyskutuj z ekspertami społeczności, użytkownikami i programistami',
'LBL_WIKI' => 'Wiki',
'LBL_DETAILS_WIKI' => 'Przeszukuj bazę wiedzy tematów pomocy',
'LBL_DEVSITE' => 'Strona progamistów',
'LBL_DETAILS_DEVSITE' => 'Odkryj zasoby, poradniki i pomocne linki, aby przyspieszyć swoje umiejetności w projektowaniu Sugar',
'LBL_GET_SUGARCRM_RSS' => 'Przejrzyj SugarCRM RSS',
'LBL_SUGARCRM_NEWS' => 'Nowości SugarCRM',
'LBL_SUGARCRM_TRAINING_NEWS' => 'Nowości w treningu SugarCRM',
'LBL_SUGARCRM_FORUMS' => 'Forum SugarCRM',
'LBL_SUGARFORGE_NEWS' => 'Nowości SugarForge',
'LBL_ALL_NEWS' => 'Wszystkie nowości',
'LBL_LINK_CURRENT_CONTRIBUTORS' => 'Kliknij ten link, aby zobaczyć bieżącą listę programistów Sugar!',
'LBL_SOURCE_CODE' => 'Kod źródłowy',
'LBL_SOURCE_SUGAR' => 'Sugar - The world\'s most popular sales force automation application created by SugarCRM Inc.',
'LBL_SOURCE_XTEMPLATE' => 'XTemplate - A template engine for PHP created by Barnabás Debreceni',
'LBL_SOURCE_LOG4PHP' => 'Log4php - A PHP port of Log4j, the most popular Java logging framework, created by Ceki Gülcü',
'LBL_SOURCE_NUSOAP' => 'NuSOAP - A set of PHP classes that allow developers to create and consume web services created by NuSphere Corporation and Dietrich Ayala',
'LBL_SOURCE_JSCALENDAR' => 'JS Calendar - A calendar for entering dates created by Mihai Bazon',
'LBL_SOURCE_PHPPDF' => 'PHP PDF - A library for creating PDF documents created by Wayne Munro',
'LBL_SOURCE_DOMIT' => 'DOMIT! - An xml parser for PHP based on the Document Object Model (DOM) Level 2 Spec.',
'LBL_SOURCE_DOMITRSS' => 'DOMIT RSS - An RSS feed parser based on the DOMIT pure PHP XML parser.',
'LBL_SOURCE_PNGBEHAVIOR' => 'PNG Behavior - Adds support for PNG graphic format to Internet Explorer.',
'LBL_SOURCE_JSONPHP' => 'JSON.php - A PHP script to convert to and from JSON data format by Michal Migurski.',
'LBL_SOURCE_JSON' => 'JSON.js - A JSON parser and JSON stringifier in JavaScript.',
'LBL_SOURCE_HTTP_WEBDAV_SERVER' => 'HTTP_WebDAV_Server - A WebDAV Server Implementation in PHP.',
'LBL_SOURCE_JS_O_LAIT' => 'JavaScript O Lait - A library of reusable modules and components to enhance JavaScript by Jan-Klaas Kollhof.',
'LBL_SOURCE_PCLZIP' => 'PclZip - library offers compression and extraction functions for Zip formatted archives by Vincent Blavet',
'LBL_SOURCE_SMARTY' => 'Smarty - A template engine for PHP.',
'LBL_SOURCE_OVERLIBMWS' => 'Overlibmws - JavaScript library for client-side windowing.',
'LBL_SOURCE_WICK' => 'WICK: Web Input Completion Kit - JavaScript type ahead control',
'LBL_SOURCE_YAHOO_UI_LIB' => 'Yahoo! User Interface Library - The UI Library Utilities facilitate the implementation of rich client-side features.',
'LBL_SOURCE_PHPMAILER' => 'PHPMailer - A full featured email transfer class for PHP',
'LBL_SOURCE_CRYPT_BLOWFISH' => 'Crypt_Blowfish - Allows for quick two-way blowfish encryption without requiring the MCrypt PHP extension.',
'LBL_SOURCE_PHP_COMPAT' => 'PHP_Compat - Provides missing functionality for older versions of PHP.',
'LBL_SOURCE_HTML_SAFE' => 'HTML_Safe - A parser that strips down all potentially dangerous content within HTML',
'LBL_SOURCE_XML_HTMLSAX3' => 'XML_HTMLSax3 - A SAX parser for HTML and other badly formed XML documents',
'LBL_SOURCE_YAHOO_UI_LIB_EXT' => 'Yahoo! UI Extensions Library - Extensions to the Yahoo! User Interface Library by Jack Slocum',
'LBL_SOURCE_JSMIN' => 'JSMin - filter which removes comments and unnecessary whitespace from JavaScript files.',
'LBL_SOURCE_SWFOBJECT' => 'SWFObject - Javascript Flash Player detection and embed script.',
'LBL_SOURCE_TINYMCE' => 'TinyMCE - A WYSIWYG editor control for web browsers that enables the user to edit HTML contents',
'LBL_SOURCE_EXT' => 'Ext - A client-side JavaScript framework for building web applications.',
'LBL_SOURCE_RECAPTCHA' => 'reCAPTCHA - A free CAPTCHA service that helps to digitize books, newspapers and old time radio shows.',
'LBL_SOURCE_TCPDF' => 'TCPDF - A PHP class for generating PDF documents.',
//add 14.09.2011
'LBL_WEB' => 'Strona WWW',
'LBL_WEBSITE_TITLE' => 'Adres strony WWW',
'LBL_RSS_TITLE' => 'Adres kanału RSS',
'LBL_DASHLET_SUGAR_NEWS' => 'Nowości Sugar',
);
?>

344
modules/Home/quicksearchQuery.php Executable file
View File

@@ -0,0 +1,344 @@
<?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".
********************************************************************************/
require_once('include/SugarObjects/templates/person/Person.php');
/**
* quicksearchQuery class, handles AJAX calls from quicksearch.js
*
* @copyright 2004-2007 SugarCRM Inc.
* @license http://www.sugarcrm.com/crm/products/sugar-professional-eula.html SugarCRM Professional End User License
* @since Class available since Release 4.5.1
*/
class quicksearchQuery {
/**
* Internal function to construct where clauses
*/
function constructWhere(&$query_obj, $focus) {
$table = $focus->getTableName();
if (! empty($table)) {
$table .= ".";
}
$cond_arr = array();
if (!is_array($query_obj['conditions'])) {
$query_obj['conditions'] = array();
}
foreach($query_obj['conditions'] as $condition) {
if($condition['op'] == 'contains') {
array_push($cond_arr,$GLOBALS['db']->quote($table.$condition['name'])." like '%".$GLOBALS['db']->quote($condition['value'])."%'");
} else if($condition['op'] == 'like_custom') {
$like = '';
if(!empty($condition['begin'])) $like .= $GLOBALS['db']->quote($condition['begin']);
$like .= $GLOBALS['db']->quote($condition['value']);
if(!empty($condition['end'])) $like .= $GLOBALS['db']->quote($condition['end']);
if ($focus instanceof Person){
if ($condition['name'] == 'name') {
array_push($cond_arr,db_concat(rtrim($table,'.'),array('first_name')) . " like '$like'");
array_push($cond_arr,db_concat(rtrim($table,'.'),array('last_name')) . " like '$like'");
} else {
array_push($cond_arr,db_concat(rtrim($table,'.'),array($condition['name'])) . " like '$like'");
}
} else if ($focus instanceof EcmWorker){
if ($condition['name'] == 'name') {
array_push($cond_arr,db_concat(rtrim($table,'.'),array('first_name')) . " like '$like'");
array_push($cond_arr,db_concat(rtrim($table,'.'),array('last_name')) . " like '$like'");
} else {
array_push($cond_arr,db_concat(rtrim($table,'.'),array($condition['name'])) . " like '$like'");
}
}else if ($focus instanceof EcmProduct){
if ($condition['name'] == 'code') {
// array_push($cond_arr,db_concat(rtrim($table,'.'),array('name')) . " like '$like%'");
array_push($cond_arr,db_concat(rtrim($table,'.'),array('code')) . " like '$like%'");
} else {
array_push($cond_arr,db_concat(rtrim($table,'.'),array($condition['code'])) . " like '$like%'");
}
}
else {
array_push($cond_arr,$GLOBALS['db']->quote($table.$condition['name'])." like '%$like'");
}
} else { // starts_with
array_push($cond_arr,$GLOBALS['db']->quote($table.$condition['name'])." like '".$GLOBALS['db']->quote($condition['value'])."%'");
}
}
$whereClause = implode(" {$query_obj['group']} ",$cond_arr);
if($table == 'users.')
$whereClause .= " AND {$table}status='Active'";
return $whereClause;
}
/**
* Query a module for a list of items
*
* @param array $args
* example for querying Account module with 'a':
* array ('modules' => array('Accounts'), // module to use
* 'field_list' => array('name', 'id'), // fields to select
* 'group' => 'or', // how the conditions should be combined
* 'conditions' => array(array( // array of where conditions to use
* 'name' => 'name', // field
* 'op' => 'like_custom', // operation
* 'end' => '%', // end of the query
* 'value' => 'a', // query value
* )
* ),
* 'order' => 'name', // order by
* 'limit' => '30', // limit, number of records to return
* )
* @return array list of elements returned
*/
function query($args) {
$json = getJSONobj();
global $sugar_config;
global $beanFiles, $beanList;
if($sugar_config['list_max_entries_per_page'] < ($args['limit'] + 1)) // override query limits
$sugar_config['list_max_entries_per_page'] = ($args['limit'] + 1);
$args['limit']=25;
$list_return = array();
foreach($args['modules'] as $module) {
require_once($beanFiles[$beanList[$module]]);
$focus = new $beanList[$module];
$query_orderby = '';
if (!empty($args['order'])) {
$query_orderby = $args['order'];
if ($focus instanceof Person && $args['order'] == 'name') {
$query_orderby = 'last_name';
}
}
$query_limit = '';
if (!empty($args['limit'])) {
$query_limit = $args['limit'];
}
if ($module=='Accounts') {
$args['conditions'][] = $args['conditions'][0];
//$args['conditions'][0]['name'] = 'index_dbf';
//$args['field_list'][] = 'index_dbf';
}
$query_where = $this->constructWhere($args, $focus);
$list_arr = array();
if($focus->ACLAccess('ListView', true)) {
$GLOBALS['log']->fatal($query_where);
$curlist = $focus->get_list($query_orderby, $query_where, 0, $query_limit, -1, 0);
$list_return = array_merge($list_return,$curlist['list']);
}
}
$list_arr = $this->formatResults($args, $list_return);
if ($module=='Accounts') {
$tmp = array();
foreach ($list_arr['fields'] as $l) {
$tmp[] = array('name' => $l['name'], 'id'=>$l['id']);
//return $json->encodeReal($l['name']);
}
$list_arr['fields'] = $tmp;
}
return $json->encodeReal($list_arr);
}
protected function formatResults($args, $list_return){
$app_list_strings = null;
$list_arr['totalCount']=count($list_return);
$list_arr['fields']= array();
for($i = 0; $i < count($list_return); $i++) {
$list_arr['fields'][$i]= array();
$list_arr['fields'][$i]['module']= $list_return[$i]->object_name;
$listData = $list_return[$i]->get_list_view_data();
foreach($args['field_list'] as $field) {
// handle enums
if( (isset($list_return[$i]->field_name_map[$field]['type']) && $list_return[$i]->field_name_map[$field]['type'] == 'enum') ||
(isset($list_return[$i]->field_name_map[$field]['custom_type']) && $list_return[$i]->field_name_map[$field]['custom_type'] == 'enum')) {
// get fields to match enum vals
if(empty($app_list_strings)) {
if(isset($_SESSION['authenticated_user_language']) && $_SESSION['authenticated_user_language'] != '') $current_language = $_SESSION['authenticated_user_language'];
else $current_language = $sugar_config['default_language'];
$app_list_strings = return_app_list_strings_language($current_language);
}
// match enum vals to text vals in language pack for return
if(!empty($app_list_strings[$list_return[$i]->field_name_map[$field]['options']])) {
$list_return[$i]->$field = $app_list_strings[$list_return[$i]->field_name_map[$field]['options']][$list_return[$i]->$field];
}
}
if (isset($listData[$field]))
{
$list_arr['fields'][$i][$field] = $listData[$field];
}
else if (isset($list_return[$i]->$field))
{
$list_arr['fields'][$i][$field] = $list_return[$i]->$field;
}
else {
$list_arr['fields'][$i][$field] = "";
}
}
}
if(is_array($list_arr['fields'])) {
foreach ( $list_arr['fields'] as $i => $recordIn ) {
if(!is_array($recordIn)){
continue;
}
foreach( $recordIn as $col => $dataIn ) {
if ( !is_scalar($dataIn) ) {
continue;
}
$list_arr['fields'][$i][$col] = html_entity_decode($dataIn,ENT_QUOTES,'UTF-8');
}
}
}
return $list_arr;
}
/**
* get_contact_array
*
*/
function get_contact_array($args) {
$json = getJSONobj();
global $sugar_config, $beanFiles, $beanList, $locale;
if($sugar_config['list_max_entries_per_page'] < ($args['limit'] + 1)) // override query limits
$sugar_config['list_max_entries_per_page'] = ($args['limit'] + 1);
$list_return = array();
foreach($args['modules'] as $module) {
require_once($beanFiles[$beanList[$module]]);
$focus = new $beanList[$module];
$query_orderby = '';
if (!empty($args['order'])) {
$query_orderby = $args['order'];
}
$query_limit = '';
if (!empty($args['limit'])) {
$query_limit = $args['limit'];
}
$query_where = $this->constructWhere($args, $focus);
$list_arr = array();
if($focus->ACLAccess('ListView', true)) {
$curlist = $focus->get_list($query_orderby, $query_where, 0, $query_limit, -1, 0);
$list_return = array_merge($list_return,$curlist['list']);
}
}
$list_arr['totalCount']=count($list_return);
$list_arr['fields']= array();
for($i = 0; $i < count($list_return); $i++) {
$list_arr['fields'][$i]= array();
$list_arr['fields'][$i]['module']= $list_return[$i]->object_name;
$contactName = "";
foreach($args['field_list'] as $field) {
// We are overriding the contact_id param and the reports_to_id param to change to 'id'
if(preg_match('/reports_to_id$/s',$field) || preg_match('/contact_id$/s',$field)) { // We are overriding the reports_to_id param to change to 'id'
$list_arr['fields'][$i][$field] = $list_return[$i]->id;
}
else {
$list_arr['fields'][$i][$field] = $list_return[$i]->$field;
}
} //foreach
$contactName = $locale->getLocaleFormattedName($list_arr['fields'][$i]['first_name'],
$list_arr['fields'][$i]['last_name'],
$list_arr['fields'][$i]['salutation']);
$list_arr['fields'][$i][$args['field_list'][0]] = $contactName;
} //for
$str = $json->encodeReal($list_arr);
return $str;
}
/**
* Returns the list of users, faster than using query method for Users module
*
* @param array $args arguments used to construct query, see query() for example
*
* @return array list of users returned
*/
function get_user_array($args) {
global $json;
$json = getJSONobj();
$response = array();
if(showFullName()) { // utils.php, if system is configured to show full name
$user_array = getUserArrayFromFullName($args['conditions'][0]['value']);
} else {
$user_array = get_user_array(false, "Active", '', false, $args['conditions'][0]['value'],null,false);
}
$response['totalCount']=count($user_array);
$response['fields']=array();
$i=0;
foreach($user_array as $id=>$name) {
array_push($response['fields'], array('id' => $id, 'user_name' => $name, 'module' => 'Users'));
$i++;
}
return $json->encodeReal($response);
}
}
$json = getJSONobj();
$data = $json->decode(html_entity_decode($_REQUEST['data']));
if(isset($_REQUEST['query']) && !empty($_REQUEST['query'])){
foreach($data['conditions'] as $k=>$v){
if(empty($data['conditions'][$k]['value'])){
$data['conditions'][$k]['value']=$_REQUEST['query'];
}
}
}
$quicksearchQuery = new quicksearchQuery();
$method = !empty($data['method']) ? $data['method'] : 'query';
if(method_exists($quicksearchQuery, $method)) {
echo $quicksearchQuery->$method($data);
}
?>

154
modules/Home/sitemap.php Executable file
View File

@@ -0,0 +1,154 @@
<?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".
********************************************************************************/
if(isset($_REQUEST['GetSiteMap']) && $_REQUEST['GetSiteMap']='now'){
echo sm_builder();
}else{return;}
function sm_build_array()
{
//if the sitemap array is already stored, then pass it back
if (isset($_SESSION['SM_ARRAY']) && !empty($_SESSION['SM_ARRAY'])){
return $_SESSION['SM_ARRAY'];
}
include("include/modules.php");
global $sugar_config,$mod_strings;
// Need to set up mod_strings when we iterate through module menus.
$orig_modstrings = array();
if(!empty($mod_strings))
{
$orig_modstrings = $mod_strings;
}
if(isset($_SESSION['authenticated_user_language']) && $_SESSION['authenticated_user_language'] != '')
{
$current_language = $_SESSION['authenticated_user_language'];
}
else
{
$current_language = $sugar_config['default_language'];
}
$exclude= array(); // in case you want to exclude any.
$mstr_array = array();
global $modListHeader;
if(!isset($modListHeader))
{
global $current_user;
if(isset($current_user))
{
$modListHeader = query_module_access_list($current_user);
}
}
foreach($modListHeader as $key=>$val)
{
if(!empty($exclusion_array) && in_array($val,$exclude ))
{
continue;
}
else
{
if (file_exists('modules/'.$val.'/Menu.php'))
{
$mod_strings = return_module_language($current_language, $val);
$module_menu = array();
include('modules/'.$val.'/Menu.php');
$tmp_menu_items = array();
foreach($module_menu as $menu)
{
if(isset($menu[0]) && !empty($menu[0]) && isset($menu[1]) && !empty($menu[1]) && trim($menu[0]) !='#')
{
$tmp_menu_items[$menu[1]] =$menu[0];
}
}
$mstr_array[$val] = $tmp_menu_items;
}
}
}
//reset the modstrings to current module
$mod_strings = $orig_modstrings ;
//store master array into session variable
$_SESSION['SM_ARRAY'] = $mstr_array;
return $mstr_array;
}
function sm_builder($tpl='modules/Home/sitemap.tpl')
{
$sm = sm_build_array();
$sm_smarty = new Sugar_Smarty();
global $sugar_config;
if(isset($_SESSION['authenticated_user_language']) && $_SESSION['authenticated_user_language'] != '')
{
$current_language = $_SESSION['authenticated_user_language'];
}
else
{
$current_language = $sugar_config['default_language'];
}
$mod_strings = return_module_language($current_language, 'Home');
$sm_smarty->assign('CLOSE', isset($mod_strings['LBL_CLOSE_SITEMAP']) ? $mod_strings['LBL_CLOSE_SITEMAP'] : '');
// get the list_strings in order for module friendly name display.
$app_list_strings = return_app_list_strings_language($current_language);
foreach ($sm as $mod_dir_name => $links)
{
$module_friendly_name = $app_list_strings['moduleList'][$mod_dir_name];
$temphtml = "";
$temphtml .= '<h4><a href="javascript:window.location=\'index.php?module='.$mod_dir_name.'&action=index\'">' . $module_friendly_name .'</a></h4><ul class=\'noBullet\'>';
foreach ($links as $name => $href)
{
$temphtml .= '<li class=\'noBullet\'><a href="javascript:window.location=\''. $href .'\'">' . $name . ' ' . '</a></li>';
}
$temphtml .= '</ul>';
$sm_smarty->assign(strtoupper($mod_dir_name), $temphtml);
}
return $sm_smarty->fetch($tpl);
}

79
modules/Home/sitemap.tpl Executable file
View File

@@ -0,0 +1,79 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<!-- begin sitemap-->
<div id="sitemap">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td align="right" colspan="5">
<input type='button' class='button' value="{$CLOSE}" id="sitemapClose">
</td>
</tr>
<tr>
<td valign="top">
<div>{$ACTIVITIES}</div>
<div>{$EMAILS}</div>
</td>
<td valign="top">
<div>{$CONTACTS}</div>
<div>{$ACCOUNTS}</div>
<div>{$LEADS}</div>
<div>{$OPPORTUNITIES}</div>
</td>
<td valign="top">
<div>{$PROJECT}</div>
<div>{$CASES}</div>
<div>{$BUGS}</div>
<div>{$DOCUMENTS}</div>
</td>
<td valign="top">
<div>{$CAMPAIGNS}</div>
<div>{$QUOTES}</div>
<div>{$REPORTS}</div>
</td>
</tr>
</table>
</div>
<!-- end sitemap-->

View File

@@ -0,0 +1,51 @@
<?php
/*********************************************************************************
* 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".
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
class HomeViewList extends ViewList{
function ActivitiesViewList(){
parent::ViewList();
}
function display(){
global $mod_strings, $export_module, $current_language, $theme, $current_user, $dashletData, $sugar_flavor;
include('modules/Home/index.php');
}
}
?>

View File

@@ -0,0 +1,55 @@
<?php
/*********************************************************************************
* 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".
********************************************************************************/
require_once('include/MVC/View/views/view.modulelistmenu.php');
class HomeViewModulelistmenu extends ViewModulelistmenu
{
public function display()
{
//last viewed
$tracker = new Tracker();
$history = $tracker->get_recently_viewed($GLOBALS['current_user']->id);
foreach ( $history as $key => $row ) {
$history[$key]['item_summary_short'] = getTrackerSubstring($row['item_summary']);
$history[$key]['image'] = SugarThemeRegistry::current()->getImage($row['module_name'],'border="0" align="absmiddle" alt="'.$row['item_summary'].'"');
}
$this->ss->assign('LAST_VIEWED',$history);
$this->ss->display('include/MVC/View/tpls/modulelistmenu.tpl');
}
}
?>