Adding a custom newsfeed to the customer-dashboard, fixes #1408

Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
Roman Schmerold (BNoiZe)
2014-06-01 18:46:15 +02:00
parent fd3ab6221c
commit 3acfcd4a95
22 changed files with 84 additions and 6 deletions

View File

@@ -202,6 +202,24 @@ return array(
'default' => true,
'save_method' => 'storeSettingField',
),
'customer_show_news_feed' => array(
'label' => $lng['admin']['customer_show_news_feed'],
'settinggroup' => 'customer',
'varname' => 'show_news_feed',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
),
'customer_news_feed_url' => array(
'label' => $lng['admin']['customer_news_feed_url'],
'settinggroup' => 'customer',
'varname' => 'news_feed_url',
'type' => 'string',
'string_type' => 'url',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
),
'panel_allow_domain_change_admin' => array(
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
'settinggroup' => 'panel',

BIN
css/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -93,6 +93,8 @@ if ($page == 'overview') {
if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI";
$services_enabled = implode(", ", $se);
$news_feed_url = Settings::Get('customer.news_feed_url');
eval("echo \"" . getTemplate('index/index') . "\";");
} elseif ($page == 'change_password') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {

View File

@@ -341,6 +341,8 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('customer', 'ftpprefix', 'ftp'),
('customer', 'mysqlprefix', 'sql'),
('customer', 'ftpatdomain', '0'),
('customer', 'show_news_feed', '0'),
('customer', 'news_feed_url', ''),
('ticket', 'noreply_email', 'NO-REPLY@SERVERNAME'),
('ticket', 'worktime_all', '1'),
('ticket', 'worktime_begin', '00:00'),

View File

@@ -2770,3 +2770,14 @@ if (isFroxlorVersion('0.9.32-rc3')) {
showUpdateStep("Updating from 0.9.32-rc3 to 0.9.32 final", false);
updateToVersion('0.9.32');
}
if (isFroxlorVersion('0.9.32')) {
showUpdateStep("Updating from 0.9.32 to 0.9.33-dev1", false);
showUpdateStep("Adding settings for custom newsfeed on customer-dashboard");
Settings::AddNew("customer.show_news_feed", isset($_POST['customer_show_news_feed']) ? (int)$_POST['customer_show_news_feed'] : '0');
Settings::AddNew("customer.news_feed_url", isset($_POST['customer_news_feed_url']) ? $_POST['customer_news_feed_url'] : '');
lastStepStatus(0);
updateToVersion('0.9.33-dev1');
}

View File

@@ -658,4 +658,14 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if (versionInUpdate($current_version, '0.9.33-dev1')) {
$has_preconfig = true;
$description = 'You can enable/disable the display/usage of the custom newsfeed for customers.<br /><br />';
$question = '<strong>Do you want to enable the custom newsfeed for customer? (default: no):</strong>&nbsp;';
$question.= makeyesno('customer_show_news_feed', '1', '0', '0').'<br />';
$question.= '<strong>You have to set the URL for your RSS-feed here, if you have choosen to enable the custom newsfeed on the customer-dashboard:</strong>&nbsp;';
$question.= '<input type="text" class="text" name="customer_news_feed_url" value="" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}

BIN
js/.DS_Store vendored Normal file

Binary file not shown.

BIN
lib/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -25,7 +25,11 @@ if(isset($_POST['action'])) {
}
if ($action == "newsfeed") {
$feed = "http://inside.froxlor.org/news/";
if (isset($_GET['url'])) {
$feed = $_GET['url'];
} else {
$feed = "http://inside.froxlor.org/news/";
}
if (function_exists("simplexml_load_file") == false) {
die();

BIN
lib/classes/.DS_Store vendored Normal file

Binary file not shown.

BIN
lib/functions/froxlor/.DS_Store vendored Normal file

Binary file not shown.

BIN
lib/navigation/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -51,6 +51,6 @@ define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings');
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
// VERSION INFO
$version = '0.9.32';
$version = '0.9.33-dev1';
$dbversion = '2';
$branding = '';

BIN
lng/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -1818,3 +1818,7 @@ $lng['error']['cannotdeletedefaultphpconfig'] = 'This PHP-configuration is set a
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Allow automatic database updates';
$lng['serversettings']['system_cron_allowautoupdate']['description'] = '<div style="color:red"><b>ATTENTION:</b></div> This settings allows the cronjob to bypass the version-check of froxlors files and database and runs the database-updates in case a version-mismatch occurs.<br><br><div style="color:red">Auto-update will always set default values for new settings or changes. This might not always suite your system. Please think twice before activating this option</div>';
$lng['error']['passwordshouldnotbeusername'] = 'The password should not be the same as the username.';
// Added in Froxlor 0.9.33
$lng['admin']['customer_show_news_feed'] = "Show custom newsfeed on customer-dashboard";
$lng['admin']['customer_news_feed_url'] = "RSS-Feed for the custom newsfeed";

View File

@@ -1542,3 +1542,7 @@ $lng['error']['cannotdeletedefaultphpconfig'] = 'Diese PHP-Konfiguration ist als
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Erlaube automatische Datenbank-Aktualisierungen';
$lng['serversettings']['system_cron_allowautoupdate']['description'] = '<div style="color:red"><b>WARNUNG:</b></div> Diese Einstellung erlaubt es dem Cronjob die Prüfung der Dateien- und Datenbank-Version zu umgehen und bei einem Versions-Unterschied die Datenbank-Aktualisierungen automatisiert auszuführen.<br><br><div style="color:red">Das automatische Update setzt für neue Einstellungen und Änderungen immer die default-Werte. Diese müssen nicht zwingend zu dem genutzten System passen. Bitte zwei mal nachdenken, bevor diese Option aktiviert wird.</div>';
$lng['error']['passwordshouldnotbeusername'] = 'Das Passwort sollte nicht mit dem Benutzernamen übereinstimmen.';
// Added in Froxlor 0.9.33
$lng['admin']['customer_show_news_feed'] = "Zeige benutzerdefinierten Newsfeed im Kunden-Dashboard";
$lng['admin']['customer_news_feed_url'] = "RSS-Feed für den benutzerdefinierten Newsfeed";

BIN
templates/Sparkle/.DS_Store vendored Normal file

Binary file not shown.

BIN
templates/Sparkle/assets/css/.DS_Store vendored Normal file

Binary file not shown.

BIN
templates/Sparkle/assets/img/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -28,13 +28,17 @@ $(document).ready(function() {
// Load Newsfeed
var ajax_load = "<div id='newsitem'>Loading newsfeed...</div>";
$("#newsfeeditems").html(ajax_load).load("lib/ajax.php?action=newsfeed", function() {
var url = "";
if (typeof $("#newsfeed").data("url") !== "undefined") {
url = "&url=" + $("#newsfeed").data("url");
}
$("#newsfeeditems").html(ajax_load).load("lib/ajax.php?action=newsfeed" + url, function() {
if ($("#newsfeeditems").html().length > 0) {
$(window).trigger('resize');
$("#newsfeed").slideDown();
}
});
// Enable Infobubbles
$(".tipper").tipper({
direction: "right"

BIN
templates/Sparkle/customer/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -149,6 +149,18 @@ $header
</div>
<div class="grid-u-1-2">
<if Settings::Get('customer.show_news_feed') == '1'>
<table class="dboarditem full" id="newsfeed" data-url="{$news_feed_url}">
<thead>
<tr>
<th>News</th>
</tr>
</thead>
<tbody id="newsfeeditems">
</tbody>
</table>
</if>
<table class="dboarditem">
<thead>
<tr>
@@ -174,10 +186,17 @@ $header
<td>{$lng['customer']['services']}:</td>
<td>$services_enabled</td>
</tr>
</tbody>
</table>
<table class="dboarditem">
<thead>
<tr>
<th colspan="2">{$lng['index']['customerdetails']}</th>
<th colspan="2">{$lng['index']['customerdetails']}</th>
</tr>
<if $userinfo['customernumber'] >
</thead>
<tbody>
<if $userinfo['customernumber'] >
<tr>
<td>{$lng['customer']['customernumber']}:</td>
<td>{$userinfo['customernumber']}</td>