Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/2124 notification bar #2167

Merged
merged 13 commits into from
Mar 26, 2017
Merged

Feature/2124 notification bar #2167

merged 13 commits into from
Mar 26, 2017

Conversation

crossan007
Copy link
Contributor

closes #2124.

Notifications are retreived from a JSON file:
http://demo.churchcrm.io/notifications.json

Displayed if the target version matches:
image

@crossan007 crossan007 added this to the 2.6.3 milestone Mar 25, 2017
@DawoudIO
Copy link
Contributor

why Master?

*/
try
{
$_SESSION['SystemNotifications'] = json_decode(file_get_contents("http://demo.churchcrm.io/notifications.json"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have the URL in our config somewhere... i know it is static but it might change... or create a var for it.

$_SESSION['SystemNotifications']->expires = new \DateTime();
$_SESSION['SystemNotifications']->expires->add(new \DateInterval("PT".$_SESSION['SystemNotifications']->TTL."S"));
} catch (Exception $ex) {
//a failure here should never prevent the page from loading.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets still log it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this with #2062

}
}

public static function testActiveNotifications()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasActiveNotifications

@@ -62,6 +62,9 @@
</head>

<body class="hold-transition <?= $_SESSION['sStyle'] ?> sidebar-mini">
<?php
Header_system_notifications();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i like this as it is only used once, no need for a funcation

Copy link
Contributor

@DawoudIO DawoudIO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it that every time you login you see it... i think i would like a target version(s) for the notification

@crossan007
Copy link
Contributor Author

Yes - it'll always display if a notification has been set for the currently running version.

Notifications are version-targeted already ;-) take a look at http://demo.churchcrm.io/notifications.json

@DawoudIO
Copy link
Contributor

it works as MVP, but i slows down the login page and every page.. i really think this should be just AJAX Call the service not an inline call

@@ -160,7 +160,8 @@ private static function buildConfigs()
"sConfirmSincerely" => new ConfigItem(1048, "sConfirmSincerely", "text", "Sincerely", gettext("Used to end a letter before Signer")),
"googleTrackingID" => new ConfigItem(1050, "googleTrackingID", "text", "", gettext("Google Analytics Tracking Code")),
"mailChimpApiKey" => new ConfigItem(2000, "mailChimpApiKey", "text", "", gettext("see http://kb.mailchimp.com/accounts/management/about-api-keys")),
"sDepositSlipType" => new ConfigItem(2001, "sDepositSlipType", "choice", "QBDT", gettext("Deposit ticket type. QBDT - Quickbooks"), '{"Choices":["QBDT"]}')
"sDepositSlipType" => new ConfigItem(2001, "sDepositSlipType", "choice", "QBDT", gettext("Deposit ticket type. QBDT - Quickbooks"), '{"Choices":["QBDT"]}'),
"sCloudURL" => new ConfigItem(2002, "sCloudURL", "text", "http://demo.churchcrm.io/", gettext("ChurchCRM Cloud Access URL"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really need private config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will never be displayed to the user - I didn't add it to any of the sections.

@@ -31,6 +31,22 @@

use ChurchCRM\Service\SystemService;
use ChurchCRM\dto\SystemURLs;
use ChurchCRM\Service\NotificationService;

function Header_system_notifications()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should be ajax

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is only accessing the local session variable - there is no hit to the database or web services here - only session variable.

It really shouldn't be that big of a performance hit.

@DawoudIO DawoudIO merged commit 7c4f06a into master Mar 26, 2017
@crossan007 crossan007 deleted the feature/2124-notification-bar branch March 26, 2017 19:02
@crossan007 crossan007 restored the feature/2124-notification-bar branch March 26, 2017 19:07
DawoudIO pushed a commit that referenced this pull request Apr 1, 2017
* Updated Default Values

* added select2

* using memeber default & select 2 for country

using memeber default city/state & select 2

* Apply fixes from StyleCI (#1995)

* Add Behat testing (#2010)

* underp master vs develop merge

* underps

* start 2.6.1 (#2034)

* start 2.6.1

* underp 2.6.1 upgrade.

* don't include unreleased features in the changelog

* 2.6.1 rev jquery photo uploader (#2035)

* start 2.6.1

* underp 2.6.1 upgrade.

* rev photo uploader to 1.0.10

* release window documentation (#2055)

* release window doc

* release window doc

* cherry-pick #2061 for Master 2.6.1

* Update Config.php.example

* fix broken search

* rev photo uploader to 1.0.11 (#2071)

* Member Count Error in Member Dashboard (#1925)

* fix membercount error

fix #1924
* Apply left join onn family wher join with person to get the members
without family accounted.
* Also added Links to Family Roles section on membersdashboard.

* Changes to use SystemConfig

using SystemConfig::getValue('sDirRoleChild')

* PersonView, FamilyView ui changes #1863 (#2026)

* PersonView, FamilyView ui changes #1863

closes #1863
changed overlay, added view photo button. added modal for displaying
larger photo, displaying view photo button, using code from Initials.js
if photo exists.

* addressing review comments

* UI Cleanup/bugs

closes #2084 #2112

* UI Improvments

closes #2112

* Apply fixes from StyleCI (#2113)

* Fix database backup (#2118)

* closes #2099

* Apply fixes from StyleCI

* using github-release-notes in the bash script
renamed the npm target
updated changeslog.md

* updated steps and included changelog task

* Cash is displayed even if 0 #1852 (#1983)

* resolves #1852

* still show 0 cash if 0 cash 💯

* applied styleci patch

* Remove old changelog

* start 2.6.2 (#2125)

* this works on ASO demo site. (#2126)

* #2121-unable to create event (#2122)

add document ready function around the dateranger script.

fixes #2121

* start 2.6.3 (#2127)

* 2.6.3

* update changelog

* Update CHANGELOG.md

removed dbl logs

* Feature/2124 notification bar (#2167)

* Working POC

* Fix styles

* get data from web service

* Apply fixes from StyleCI

* allow for differentating admin vs all user notifications

* add TTL setting for notifications

* don't include system notifications locally

* cleanup

* underp boolean call

* address comments - handle exceptions correctly

* fix logic if captive portal intercepts notification request

* cleanup spaces

* make code work again.
@DawoudIO DawoudIO deleted the feature/2124-notification-bar branch April 2, 2017 20:00
DawoudIO pushed a commit that referenced this pull request Apr 8, 2017
* Updated Default Values

* added select2

* using memeber default & select 2 for country

using memeber default city/state & select 2

* Apply fixes from StyleCI (#1995)

* Add Behat testing (#2010)

* underp master vs develop merge

* underps

* start 2.6.1 (#2034)

* start 2.6.1

* underp 2.6.1 upgrade.

* don't include unreleased features in the changelog

* 2.6.1 rev jquery photo uploader (#2035)

* start 2.6.1

* underp 2.6.1 upgrade.

* rev photo uploader to 1.0.10

* release window documentation (#2055)

* release window doc

* release window doc

* cherry-pick #2061 for Master 2.6.1

* Update Config.php.example

* fix broken search

* rev photo uploader to 1.0.11 (#2071)

* Member Count Error in Member Dashboard (#1925)

* fix membercount error

fix #1924
* Apply left join onn family wher join with person to get the members
without family accounted.
* Also added Links to Family Roles section on membersdashboard.

* Changes to use SystemConfig

using SystemConfig::getValue('sDirRoleChild')

* PersonView, FamilyView ui changes #1863 (#2026)

* PersonView, FamilyView ui changes #1863

closes #1863
changed overlay, added view photo button. added modal for displaying
larger photo, displaying view photo button, using code from Initials.js
if photo exists.

* addressing review comments

* UI Cleanup/bugs

closes #2084 #2112

* UI Improvments

closes #2112

* Apply fixes from StyleCI (#2113)

* Fix database backup (#2118)

* closes #2099

* Apply fixes from StyleCI

* using github-release-notes in the bash script
renamed the npm target
updated changeslog.md

* updated steps and included changelog task

* Cash is displayed even if 0 #1852 (#1983)

* resolves #1852

* still show 0 cash if 0 cash 💯

* applied styleci patch

* Remove old changelog

* start 2.6.2 (#2125)

* this works on ASO demo site. (#2126)

* #2121-unable to create event (#2122)

add document ready function around the dateranger script.

fixes #2121

* start 2.6.3 (#2127)

* 2.6.3

* update changelog

* Update CHANGELOG.md

removed dbl logs

* Feature/2124 notification bar (#2167)

* Working POC

* Fix styles

* get data from web service

* Apply fixes from StyleCI

* allow for differentating admin vs all user notifications

* add TTL setting for notifications

* don't include system notifications locally

* cleanup

* underp boolean call

* address comments - handle exceptions correctly

* fix logic if captive portal intercepts notification request

* rev jQuery-photo-uploader (#2185)

* closes #2123 (#2184)

* update changelog (#2190)

* update changelog

* 2.6.3

* locked to 0.6.3

* locked to 0.6.3

* Update CHANGELOG.md

trim down to subset of changes

* Add Behat tests to TravisCI (#2011)

* underp master vs develop merge

* underps

* add test to travis

* add apache to travis.

* tweaks

* change path

* move to script. troubleshooting.

* debugging

* debugging

* fix path

* fix path

* tweaks

* tweaks

* underp

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* move fpm conf

* tweak

* tweak

* tweak

* tweak

* fingers crossed.

* fingers crossed.

* fingers crossed.

* debug

* tweak paths

* tweak config

* tweak config

* permissions

* permissions

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* add config

* tweaks

* tweaks

* revert login changes

* change index

* cleanup

* underp php fpm

* underp

* rewrite?

* rewrite?

* SetHandler

* use sockets

* derppp

* derppp

* derppp sockets

* derppp sockets

* derppp sockets

* proxy?

* test?

* tweaks? try again?

* Important! Read the above again https://wiki.apache.org/httpd/PHP-FPM

* tweak multi view

* cleanup

* Update Config.php

* Update README.md (#2247)

* added ignore question
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add System Notification Bar
2 participants