[Vtigercrm-commits] [vtiger-commits] r7939 - in /vtigercrm/trunk: Smarty/templates/Header.tpl include/utils/CommonUtils.php modules/Users/UsersAjax.php themes/blue/header.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Jul 10 08:56:23 EDT 2006
Author: richie
Date: Mon Jul 10 06:56:14 2006
New Revision: 7939
Log:
announcements has been fixed
Modified:
vtigercrm/trunk/Smarty/templates/Header.tpl
vtigercrm/trunk/include/utils/CommonUtils.php
vtigercrm/trunk/modules/Users/UsersAjax.php
vtigercrm/trunk/themes/blue/header.php
Modified: vtigercrm/trunk/Smarty/templates/Header.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Header.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Header.tpl Mon Jul 10 06:56:14 2006
@@ -17,7 +17,7 @@
<link REL="SHORTCUT ICON" HREF="include/images/vtigercrm_icon.ico">
<style type="text/css">@import url("themes/{$THEME}/style.css");</style>
</head>
- <body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 class=small onLoad="Announcement_rss()">
+ <body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 class=small>
<a name="top"></a>
<!-- header -->
<!-- header-vtiger crm name & RSS -->
@@ -34,7 +34,7 @@
<td width=100% align=center>
<table border=0 cellspacing=0 cellpadding=2 width=90% class="rssDisplay">
<tr>
- <td class=rssDisplayPanel align=center><marquee id="rss" direction="left" scrolldelay="10" scrollamount="3" behavior="scroll" class="marStyle" onMouseOver="javascript:stop();" onMouseOut="javascript:start();"> </marquee></td>
+ <td class=rssDisplayPanel align=center><marquee id="rss" direction="left" scrolldelay="10" scrollamount="3" behavior="scroll" class="marStyle" onMouseOver="javascript:stop();" onMouseOut="javascript:start();"> {$ANNOUNCEMENT}</marquee></td>
{*<td class=rssDisplayPanel align=center> RSS is not configured. <a href="#">Click here</a> to configure</td>*}
</tr>
</table>
@@ -178,24 +178,6 @@
{rdelim}
);
{rdelim}
-
-function Announcement_rss()
-{ldelim}
- new Ajax.Request(
- 'index.php',
- {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
- method: 'post',
- postBody: 'module=Users&action=UsersAjax&announce_rss=yes',
- onComplete: function(response)
- {ldelim}
- if($("rss").innerHTML != response.responseText)
- $("rss").innerHTML=response.responseText;
- {rdelim}
- {rdelim}
- );
-
-{rdelim}
-setInterval("Announcement_rss()",300000)
</script>
<script>
Modified: vtigercrm/trunk/include/utils/CommonUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/CommonUtils.php (original)
+++ vtigercrm/trunk/include/utils/CommonUtils.php Mon Jul 10 06:56:14 2006
@@ -2442,4 +2442,22 @@
return $fieldval;
}
+/** Function used to retrieve the announcements from database
+ * The function accepts no argument and returns the announcements
+ * return string $announcement - List of announments for the CRM users
+ */
+
+function get_announcements()
+{
+ global $adb;
+ $sql="select * from vtiger_announcement order by time";
+ $result=$adb->query($sql);
+ for($i=0;$i<$adb->num_rows($result);$i++)
+ {
+ $announce = getUserName($adb->query_result($result,$i,'creatorid')).' : '.$adb->query_result($result,$i,'announcement').' ';
+ if($adb->query_result($result,$i,'announcement')!='')
+ $announcement.=$announce;
+ }
+ return $announcement;
+}
?>
Modified: vtigercrm/trunk/modules/Users/UsersAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Users/UsersAjax.php (original)
+++ vtigercrm/trunk/modules/Users/UsersAjax.php Mon Jul 10 06:56:14 2006
@@ -20,20 +20,7 @@
{
require_once('modules/Users/CreateSharingRule.php');
}
-elseif(isset($_REQUEST['announce_rss']) && ($_REQUEST['announce_rss'] != ''))
-{
- $announcement='';
- $sql="select * from vtiger_announcement order by time";
- $result=$adb->query($sql);
- for($i=0;$i<$adb->num_rows($result);$i++)
- {
- $announce = getUserName($adb->query_result($result,$i,'creatorid')).' : '.$adb->query_result($result,$i,'announcement').' ';
- if($adb->query_result($result,$i,'announcement')!='')
- $announcement.=$announce;
- }
- echo $announcement;
-
-}elseif(isset($_REQUEST['announce_save']) && ($_REQUEST['announce_save'] != ''))
+elseif(isset($_REQUEST['announce_save']) && ($_REQUEST['announce_save'] != ''))
{
$date_var = date('YmdHis');
$announcement = $_REQUEST['announcement'];
Modified: vtigercrm/trunk/themes/blue/header.php
==============================================================================
--- vtigercrm/trunk/themes/blue/header.php (original)
+++ vtigercrm/trunk/themes/blue/header.php Mon Jul 10 06:56:14 2006
@@ -83,6 +83,7 @@
$smarty->assign("CATEGORY",getParentTab());
$smarty->assign("CALC",get_calc($image_path));
$smarty->assign("QUICKACCESS",getAllParenttabmoduleslist());
+$smarty->assign("ANNOUNCEMENT",get_announcements());
if (is_admin($current_user)) $smarty->assign("ADMIN_LINK", "<a href='index.php?module=Settings&action=index'>".$app_strings['LBL_SETTINGS']."</a>");
More information about the vtigercrm-commits
mailing list