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

[email protected]


git-svn-id: https://svn.code.sf.net/p/hawebs/svn@640 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-11-17 02:01:32 +00:00
parent 10d1929f36
commit e0a7fe27e3
14 changed files with 1051 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: Deletes an Account record and then redirects the browser to the
* defined return URL.
********************************************************************************/
global $adb;
if(!isset($_REQUEST['record']))
die($mod_strings['ERR_DELETE_RECORD']);
$del_query = "DELETE FROM vtiger_rss WHERE rssid=?";
$adb->pquery($del_query, array($_REQUEST['record']));
//code added for returning back to the current view after delete from list view
header("Location: index.php?module=".vtlib_purify($_REQUEST['return_module'])."&action=RssAjax&file=ListView&directmode=ajax");
?>
+45
View File
@@ -0,0 +1,45 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: Contains a variety of utility functions specific to this module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once("modules/Rss/Rss.php");
$oRss = new vtigerRSS();
$allrsshtml = $oRss->getAllRssFeeds();
function get_rssfeeds_form() {
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $image_path;
$oRss = new vtigerRSS();
$allrsshtml = $oRss->getRSSCategoryHTML();
//$starred_rss_html = $oRss->getStarredRssFolder();
$the_form .= '<table width="100%" border="0" cellspacing="2" cellpadding="0" style="margin-top:10px">';
$the_form .= $allrsshtml;
$the_form .= "</table>";
return $the_form;
}
?>
@@ -0,0 +1,45 @@
<!--*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<!-- BEGIN: main -->
<style>
.rssFolder {
font: bold 11px Verdana, Arial, Helvetica, Sans-serif;
text-decoration: none;
}
.rssFolder:hover {
text-decoration: underline;
}
.rssSelectedTitle {
background-color: #CCCCCC;
}
.rssNews {
font: 12px Arial, Helvetica, Sans-serif bold;
}
</style>
<script language="JavaScript" type="text/javascript" src="general.js"></script>
<script language="JavaScript" type="text/javascript" src="modules/Rss/Rss.js">
var httpRequest = false;
</script>
<form action="index.php" method="POST">
<input type="hidden" name="action" value="Save">
<input type="hidden" name="module" value="Rss">
<input type="hidden" name="return_action" value="index">
<input type="hidden" name="return_module" value="Rss">
{RSSFEEDS_TITLE}
<br>
{RSSFEEDS}
<br>
{RSSDETAILS}
<br>
</form>
<!-- END: main -->
+92
View File
@@ -0,0 +1,92 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once("data/Tracker.php");
require_once('Smarty_setup.php');
require_once('include/logging.php');
require_once('include/ListView/ListView.php');
require_once('include/utils/utils.php');
require_once('modules/Rss/Rss.php');
global $app_strings;
global $app_list_strings;
global $mod_strings;
$current_module_strings = return_module_language($current_language, 'Rss');
$log = LoggerManager::getLogger('rss_list');
global $currentModule;
global $image_path;
global $theme;
global $cache_dir;
// focus_list is the means of passing data to a ListView.
global $focus_list;
global $adb;
$oRss = new vtigerRSS();
if(isset($_REQUEST['folders']) && $_REQUEST['folders'] == 'true')
{
require_once("modules/".$currentModule."/Forms.php");
echo get_rssfeeds_form();
die;
}
if(isset($_REQUEST['record']))
{
$recordid = vtlib_purify($_REQUEST['record']);
}
$rss_form = new vtigerCRM_Smarty;
$rss_form->assign("MOD", $mod_strings);
$rss_form->assign("APP", $app_strings);
$rss_form->assign("THEME",$theme);
$rss_form->assign("IMAGE_PATH",$image_path);
$rss_form->assign("MODULE", $currentModule);
$rss_form->assign("CATEGORY", getParenttab());
//<<<<<<<<<<<<<<lastrss>>>>>>>>>>>>>>>>>>//
//$url = 'http://forums/rss.php?name=forums&file=rss';
//$url = 'http://forums/weblog_rss.php?w=202';
if(isset($_REQUEST[record]))
{
$recordid = vtlib_purify($_REQUEST['record']);
$url = $oRss->getRssUrlfromId($recordid);
if($oRss->setRSSUrl($url))
{
$rss_html = $oRss->getSelectedRssHTML($recordid);
}else
{
$rss_html = "<strong>".$mod_strings['LBL_ERROR_MSG']."</strong>";
}
$rss_form->assign("TITLE",gerRssTitle($recordid));
$rss_form->assign("ID",$recordid);
}else
{
$rss_form->assign("TITLE",gerRssTitle());
$rss_html = $oRss->getStarredRssHTML();
$query = "select rssid from vtiger_rss where starred=1";
$result = $adb->pquery($query, array());
$recordid = $adb->query_result($result,0,'rssid');
$rss_form->assign("ID",$recordid);
$rss_form->assign("DEFAULT",'yes');
}
if($currentModule == "Rss")
{
require_once("modules/".$currentModule."/Forms.php");
if (function_exists('get_rssfeeds_form'))
{
$rss_form->assign("RSSFEEDS", get_rssfeeds_form());
}
}
$rss_form->assign("RSSDETAILS",$rss_html);
//<<<<<<<<<<<<<<lastrss>>>>>>>>>>>>>>>>>>//
if(isset($_REQUEST['directmode']) && $_REQUEST['directmode'] == 'ajax')
$rss_form->display("RssFeeds.tpl");
else
$rss_form->display("Rss.tpl");
?>
+57
View File
@@ -0,0 +1,57 @@
<!--*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<!-- BEGIN: main -->
<html>
<script language="JavaScript" type="text/javascript" src="include/js/general.js"></script>
<script type="text/javascript" language="JavaScript" src="modules/Rss/Rss.js">
{JAVASCRIPT}
</script>
<head>
<title></title>
<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
<link rel="stylesheet" type="text/css" href="{THEME_PATH}style.css"/>
</head>
<form name="NewRss" action="index.php" onsubmit="return verify_data(NewRss)">
<input type="hidden" name="action" value="Popup">
<input type="hidden" name="module" value="Rss">
<body topmargin="5" leftmargin="5">
<table width="100%" border=0 cellspacing=2 cellpadding=2 class="formOuterBorder">
<tr>
<td colspan="2" class="formSecHeader">Add RSS Feed:</td>
</tr>
<tr>
<td nowrap="nowrap" class="dataLabel" width="15%">RSS Feed URL:</td>
<td nowrap><input type="text" name="rssurl" class="textField" style="width:100%"/></td>
</tr>
<tr>
<td nowrap="nowrap" valign="top" class="dataLabel">Choose Category: </td>
<td nowrap>
<select name="rsscategory" class="select" style="width:100%">
{RSS_CATEGORY}
</select> </td>
</tr>
<tr>
<td class="dataLabel"></td>
<td><input name="setstarred" type="checkbox" value="1"> Set as Starred</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="5" class="buttonLayer">
<tr>
<td align=center><input type="submit" name="Button" value="Add" class="button" tabindex="5">
<input type='button' value="Cancel" class="button" onClick="window.close()"/>
</td>
</tr>
</table>
<p></p>
</body>
</form>
</html>
<!-- END: main -->
+50
View File
@@ -0,0 +1,50 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once("data/Tracker.php");
require_once('include/logging.php');
require_once('include/utils/utils.php');
require_once('modules/Rss/Rss.php');
global $mod_strings;
$log = LoggerManager::getLogger('rss_save');
if(isset($_REQUEST["record"]))
{
global $adb;
$query = 'update vtiger_rss set starred=0';
$adb->pquery($query, array());
$query = 'update vtiger_rss set starred=1 where rssid =?';
$adb->pquery($query, array($_REQUEST["record"]));
echo vtlib_purify($_REQUEST["record"]);
}
elseif(isset($_REQUEST["rssurl"]))
{
$newRssUrl = str_replace('##amp##','&',$_REQUEST["rssurl"]);
$setstarred = 0;
$oRss = new vtigerRSS();
if($oRss->setRSSUrl($newRssUrl))
{
$result = $oRss->saveRSSUrl($newRssUrl,$setstarred);
if($result == false)
{
echo $mod_strings['UNABLE_TO_SAVE'] ;
}else
{
echo $result;
}
}else
{
echo $mod_strings['NOT_A_VALID'];
}
}
?>
+60
View File
@@ -0,0 +1,60 @@
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
function star(id, starred)
{
location.href = "index.php?module=Rss&action=Star&record="+id+"&starred="+starred;
var elem = document.getElementById("star-"+id);
if(elem.src.indexOf("onstar.gif") != -1) {
elem.src = "themes/images/offstar.gif";
}else {
elem.src = "themes/images/onstar.gif";
}
}
function getRequest() {
if ( !httpRequest ) {
httpRequest = new XMLHttpRequest();
}
return httpRequest;
}
function makeRequest(targetUrl) {
var httpRequest = getRequest();
httpRequest.open("GET", targetUrl, false, false, false);
httpRequest.send("");
switch ( httpRequest.status ) {
case 200:
return httpRequest.responseText;
break;
default:
alert(alert_arr.PROBLEM_ACCESSSING_URL+targetUrl+alert_arr.CODE+httpRequest.status);
return null;
break;
}
}
function verify_data(form) {
var isError = false;
var errorMessage = "";
if (trim(form.rssurl.value) == "") {
isError = true;
errorMessage += "\nRSS Feed URL";
}
// Here we decide whether to submit the form.
if (isError == true) {
alert(alert_arr.MISSING_REQUIRED_FIELDS + errorMessage);
return false;
}
return true;
}
function display(url,id)
{
document.getElementById('rsstitle').innerHTML = document.getElementById(id).innerHTML;
document.getElementById('mysite').src = url;
}
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
checkFileAccess('modules/'.$_REQUEST['module'].'/'.$_REQUEST['file'].'.php');
require_once('modules/'.$_REQUEST['module'].'/'.$_REQUEST['file'].'.php');
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require_once('modules/Rss/Rss.php');
require_once('include/logging.php');
global $mod_strings;
if (isset($_REQUEST["rssurl"])) $newRssUrl = $_REQUEST["rssurl"];
$oRss = new vtigerRSS();
if($oRss->setRSSUrl($newRssUrl)) {
if($oRss->saveRSSUrl($newRssUrl) == false) {
echo $mod_strings['UNABLE_TO_SAVE'];
}
} else {
echo $mod_strings['INVALID_RSS_URL'];
}
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require_once('include/database/PearDatabase.php');
global $adb;
if(isset($_REQUEST['record']))
{
$recordid = $_REQUEST['record'];
if(!isset($_REQUEST['starred'])) $starred = 0;
$starred = $_REQUEST['starred'];
$sSQL = "update vtiger_rss set starred=? where vtiger_rssid=?";
$result = $adb->pquery($sSQL, array($starred, $recordid));
}
header("Location: index.php?module=Rss&action=index");
?>
+27
View File
@@ -0,0 +1,27 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: TODO: To be written.
********************************************************************************/
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
global $mod_strings;
include ('modules/Rss/ListView.php');
?>
@@ -0,0 +1,59 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: Defines the English language pack for the Account module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = Array(
'LBL_MODULE_NAME'=>'RSS',
'LBL_MODULE_TITLE'=>'RSS: Home',
'LBL_NEW_RSS_ENTRY'=>'New RSS News Feed URL:',
'LBL_SEARCH_RSS'=>'Search Title:',
'LBL_NEW_RSS_BUTTON'=>'Add',
'LBL_STARRED_RSS'=>'Starred Feeds',
'LBL_POP_CRM_RSS'=>'Popular CRM Related Feeds',
'LBL_ALL_RSS_FEEDS'=>'All RSS Feeds',
'LBL_VTIGER_RSS_READER'=>'vtiger RSS Reader',
'LBL_MORE'=>'More...',
'LBL_SUBJECT'=>'Subject',
'LBL_SENDER'=>'Sender',
'LBL_CATEGORY'=>'Category :',
'LBL_FEED'=>'Feed :',
'LBL_FEED_SOURCES'=> 'Feed Sources',
'LBL_ADD_RSS_FEED'=>'Add RSS Feed',
'LBL_DELETE_BUTTON'=>'Delete',
'LBL_SET_DEFAULT_BUTTON'=>'Set As Default',
'LBL_FEEDS_LIST'=>'Feeds list from :',
'LBL_ERROR_MSG'=>'No RSS Feeds are selected or Your Proxy Settings is not Proper',
'LBL_REGRET_MSG'=>'Sorry: It\'s not possible to reach RSS URL',
'UNABLE_TO_SAVE'=>'Unable to save the RSS Feed URL',
// Added/Updated for vtiger CRM 5.0.4
'NOT_A_VALID'=>'Not a valid RSS Feed or Your Proxy Settings is not Proper',
// Added after 5.0.4 GA
'INVALID_RSS_URL' => 'Not a valid RSS URL',
'UNABLE_TO_SAVE' => 'Unable to save the Url',
);
?>
@@ -0,0 +1,58 @@
<?php
/**
* Copyright (C) 2006-2010 YUCHENG HU
*
* ---------------------------------------------
* HA WEBSYSTEMS
* http://www.hawebs.net
* https://www.hawebs.org/forums/computer/
*
* CONTACT
* [email protected] / [email protected]
*
* ---------------------------------------------
* [A] GNU GENERAL PUBLIC LICENSE GNU/LGPL
* [B] Apache License, Version 2.0
*
* ---------------------------------------------
* NOTE
* 1. 所有的语言配置文件请采用 UTF-8 编码
*
* ---------------------------------------------
*/
$mod_strings = Array(
'LBL_MODULE_NAME' => '新闻',
'LBL_MODULE_TITLE' => '新闻:首页',
'LBL_NEW_RSS_ENTRY' => '新闻RSS资料来源网址:',
'LBL_SEARCH_RSS' => '标题搜寻:',
'LBL_NEW_RSS_BUTTON' => '新增',
'LBL_STARRED_RSS' => '重要新闻',
'LBL_POP_CRM_RSS' => 'CRM相关热门新闻',
'LBL_ALL_RSS_FEEDS' => '所有他站新闻',
'LBL_VTIGER_RSS_READER'=>'vtiger RSS 读者',
'LBL_MORE' => '更多...',
'LBL_SUBJECT' => '主旨',
'LBL_SENDER' => '寄件人',
'LBL_CATEGORY' => '类别:',
'LBL_FEED' => '资料来源:',
'LBL_FEED_SOURCES'=> 'Feed 来源',
'LBL_ADD_RSS_FEED' => '新增 RSS 资料来源',
'LBL_DELETE_BUTTON'=>'删除',
'LBL_SET_DEFAULT_BUTTON'=>'预设',
'LBL_FEEDS_LIST' => '资料来源:',
'LBL_ERROR_MSG' => '没有选择 RSS 来源或是您的代理服务器设定有问题',
'LBL_REGRET_MSG' => '抱歉:无法取得 RSS 网址',
'UNABLE_TO_SAVE'=>'无法保存 RSS 资料地址',
// Added/Updated for vtiger CRM 5.0.4
'NOT_A_VALID'=>'不是一个有效的rss资料或你的代理服务器设置是不正确的',
// Added after 5.0.4 GA
'INVALID_RSS_URL' => 'Not a valid RSS URL',
'UNABLE_TO_SAVE' => 'Unable to save the Url',
);
?>