-
Notifications
You must be signed in to change notification settings - Fork 443
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
Kiosk Checkin / Out #2333
Merged
Merged
Kiosk Checkin / Out #2333
Changes from 86 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
87e29e0
begin student classroom utils
crossan007 2b68317
begin schema changes
crossan007 81056fc
Merge branch 'develop' into 2.4.0-sundayschool-classroom-utilities
crossan007 a7db514
tweaks
crossan007 409ecbd
Merge branch 'develop' into 2.4.0-sundayschool-classroom-utilities
crossan007 7721a9f
buttons and pictures!
crossan007 7a36b34
fight with joins for role names
crossan007 9bbd358
update from master
crossan007 5ee67db
update to develop
crossan007 7b09d92
Merge branch 'develop' into 2.4.0-sundayschool-classroom-utilities
crossan007 233caf6
underp merge
crossan007 ff33aab
update with new photo and schema. still messy query.
crossan007 ebaa966
working kiddos page
crossan007 673e713
cleanup
crossan007 0f53ec3
underp merge
crossan007 680885c
ss kiosk docs
crossan007 caa5eab
tweak
crossan007 b968a79
tweaks
crossan007 0ade297
remove old
crossan007 12a8b85
move file
crossan007 e8aa5f2
alerts
crossan007 92738b1
tweaks
crossan007 4ce13d4
Merge branch 'develop' into 2.4.0-sundayschool-classroom-utilities
crossan007 5f562a6
start adding event endpoints
crossan007 9bc836a
db tweaks
crossan007 2a44c4b
ORM
crossan007 6c80300
ORM
crossan007 0a586d8
More better
crossan007 da3c7ef
More better
crossan007 9941928
fix status logic
crossan007 06049cd
emergency emails
crossan007 ba6730d
emergency emails
crossan007 0adb368
working emergency notifs
crossan007 26a30b3
working emergency notifs
crossan007 e9c82ec
working emergency notifs
crossan007 ce62701
add nexmo
crossan007 0f935cb
add nexmo
crossan007 2846938
add nexmo
crossan007 61a8be7
more config
crossan007 e2e87ac
add open LP notifications
crossan007 886f9d5
Apply fixes from StyleCI
DawoudIO 421d2c5
Merge pull request #2510 from ChurchCRM/analysis-q1lrr3
crossan007 75e42dd
move to /kiosk
crossan007 91999f2
cleanup move to /kiosk
crossan007 8d19487
begin kiosk manager
crossan007 514fd2d
kiosk manager
crossan007 5e06efb
kiosk remote commands
crossan007 4713040
fullscreen
crossan007 9d8052f
add event kiosk editor
crossan007 4a71a4e
Apply fixes from StyleCI
DawoudIO 15eeae7
Merge pull request #2513 from ChurchCRM/analysis-qByrbr
crossan007 e700a5a
API visiblilty counter
crossan007 d70cc14
windowed kiosk registration
crossan007 814d0b6
guid
crossan007 12b958a
Merge branch '2.4.0-sundayschool-classroom-utilities' of https://gith…
crossan007 f17e59a
fix kiosk point
crossan007 ba298a5
fix kiosk point
crossan007 1b0b1bf
kiosk assignments, and correct location for checkin/out
crossan007 8b6ed1d
fix notification
crossan007 d5f64a0
unlink kiosk/events
crossan007 cb87669
cleanup
crossan007 e9e223a
cleanup
crossan007 34909de
fix menu add
crossan007 1c1ea8f
kiosk random initial names and other cleanup
crossan007 d648d5f
start working on assignment handler and events api
crossan007 b691c97
assignment menus
crossan007 3055336
add kiosk ID button
crossan007 b9319fe
misc
crossan007 4e4bd8f
Apply fixes from StyleCI (#2520)
DawoudIO e53823f
fix installer
crossan007 5293a64
underp install
crossan007 e9fc72b
Merge branch 'develop' into 2.4.0-sundayschool-classroom-utilities
crossan007 f5f2568
cleanup docs - moved to wiki
crossan007 9835bb3
remove emergency wording
crossan007 694cf61
cleanup
crossan007 b5a7bc5
fix email notifications
crossan007 970e7ce
email and sms works
crossan007 5c811b0
proejctor working.
crossan007 050424f
allow auth'd openLP messages.
crossan007 5e420e0
cleanup returns
crossan007 2223630
linux is case sensitive.
crossan007 f31b996
fix duplicate PK on kiosk config
crossan007 ca7b4dd
Merge branch 'develop' into 2.4.0-sundayschool-classroom-utilities
crossan007 2062ef2
allow self signed ssl
crossan007 13f6a12
Merge branch '2.4.0-sundayschool-classroom-utilities' of https://gith…
crossan007 ad93a57
fix bad merge
crossan007 42426b8
start address comments
crossan007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace ChurchCRM\Emails; | ||
|
||
use ChurchCRM\dto\SystemConfig; | ||
|
||
class NotificationEmail extends BaseEmail | ||
{ | ||
private $notificationSource; | ||
|
||
public function __construct($toAddresses,$notificationSource) | ||
{ | ||
$this->notificationSource = $notificationSource; | ||
parent::__construct($toAddresses); | ||
$this->mail->Subject = SystemConfig::getValue("sChurchName") . ": " . $this->getSubSubject(); | ||
$this->mail->isHTML(true); | ||
$this->mail->msgHTML($this->buildMessage()); | ||
} | ||
|
||
protected function getSubSubject() | ||
{ | ||
return gettext("Notification"); | ||
} | ||
|
||
public function getTokens() | ||
{ | ||
$myTokens = [ | ||
"toName" => "Guardian(s) of ". $this->notificationSource, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. get this text |
||
"body" => gettext("A notification was triggered by the classroom teacher at " . date('Y-m-d H:i:s') ." Please go to this location") | ||
]; | ||
return array_merge($this->getCommonTokens(), $myTokens); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace ChurchCRM\dto; | ||
|
||
abstract class KioskAssignmentTypes | ||
{ | ||
const EVENTATTENDANCEKIOSK = 1; | ||
const SELFREGISTRATIONKIOSK = 2; | ||
const SELFCHECKINKIOSK = 3; | ||
const GENERALATTENDANCEKIOSK = 4; | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<?php | ||
|
||
namespace ChurchCRM\dto; | ||
|
||
use ChurchCRM\Person; | ||
use ChurchCRM\dto\SystemConfig; | ||
use ChurchCRM\Emails\NotificationEmail; | ||
use Nexmo\Client; | ||
use Nexmo\Client\Credentials\Basic as NexmoBasicCred; | ||
use ChurchCRM\dto\OpenLPNotification; | ||
|
||
class Notification | ||
{ | ||
|
||
protected $projectorText; | ||
protected $recipients; | ||
protected $person; | ||
|
||
public function __construct() | ||
{ | ||
|
||
} | ||
|
||
public function setRecipients($recipients) | ||
{ | ||
$this->recipients = $recipients; | ||
|
||
} | ||
|
||
public function setSMSText($text) | ||
{ | ||
|
||
} | ||
|
||
public function setEmailText($text) | ||
{ | ||
|
||
} | ||
|
||
public function setPerson(\ChurchCRM\Person $Person) | ||
{ | ||
$this->person = $Person; | ||
} | ||
|
||
public function setProjectorText($text) | ||
{ | ||
$this->projectorText=$text; | ||
} | ||
|
||
private function sendEmail() | ||
{ | ||
$emailaddresses = []; | ||
Foreach ($this->recipients as $recipient) | ||
{ | ||
array_push($emailaddresses,$recipient->getEmail()); | ||
} | ||
try | ||
{ | ||
$email = new NotificationEmail($emailaddresses,$this->person->getFullName()); | ||
$emailStatus=$email->send(); | ||
return $emailStatus; | ||
} catch (Exception $ex) { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
private function sendSMS() | ||
{ | ||
try | ||
{ | ||
|
||
$client = new Client(New NexmoBasicCred(SystemConfig::getValue("sNexmoAPIKey"),SystemConfig::getValue("sNexmoAPISecret"))); | ||
|
||
Foreach ($this->recipients as $recipient) | ||
{ | ||
$message = $client->message()->send([ | ||
'to' => $recipient->getNumericCellPhone(), | ||
'from' => SystemConfig::getValue("sNexmoFromNumber"), | ||
'text' => 'Notification for ' . $this->person->getFullName() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gettext |
||
]); | ||
} | ||
return $message; | ||
} catch (Exception $ex) { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
private function sendProjector() | ||
{ | ||
try | ||
{ | ||
$OLPAlert = new OpenLPNotification(SystemConfig::getValue("sOLPURL"), | ||
SystemConfig::getValue("sOLPUserName"), | ||
SystemConfig::getValue("sOLPPassword")); | ||
$OLPAlert->setAlertText($this->projectorText); | ||
return $OLPAlert->send(); | ||
} catch (Exception $ex) { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
public function send() | ||
{ | ||
|
||
$methods = []; | ||
if(SystemConfig::hasValidMailServerSettings()) | ||
{ | ||
$send = $this->sendEmail(); | ||
array_push($methods,"email: ".$send); | ||
} | ||
if (SystemConfig::hasValidSMSServerSettings()) | ||
{ | ||
$send = (boolean)$this->sendSMS(); | ||
array_push($methods,"sms: ".$send); | ||
} | ||
if(SystemConfig::hasValidOpenLPSerrings()) | ||
{ | ||
$send = (boolean)($this->sendProjector()); | ||
array_push($methods,"projector: ".$send); | ||
} | ||
$sendStatus = [ | ||
"status"=>"", | ||
"methods"=>$methods | ||
]; | ||
|
||
return json_encode($sendStatus); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace ChurchCRM\dto; | ||
|
||
|
||
class OpenLPNotification | ||
{ | ||
protected $OLPAddress; | ||
protected $OLPUsername; | ||
protected $OLPPassword; | ||
protected $AlertText; | ||
|
||
public function __construct($OLPAddress,$OLPUsername,$OLPPassword) | ||
{ | ||
$this->OLPAddress=$OLPAddress; | ||
$this->OLPUsername=$OLPUsername; | ||
$this->OLPPassword=$OLPPassword; | ||
} | ||
|
||
public function setAlertText($text) | ||
{ | ||
$this->AlertText = (string)$text; | ||
} | ||
|
||
private function getAuthorizationHeader() | ||
{ | ||
return base64_encode(SystemConfig::getValue("sOLPUserName").":".SystemConfig::getValue("sOLPPassword")); | ||
} | ||
|
||
public function send() | ||
{ | ||
$headers = array ( | ||
'http'=>array( | ||
'method' =>"GET", | ||
'timeout' => 5 | ||
), | ||
"ssl" => array( | ||
"verify_peer" => false, | ||
"allow_self_signed" => false, | ||
) | ||
); | ||
if(SystemConfig::getValue("sOLPUserName")) | ||
{ | ||
$headers['http']['header'] = "Authorization: Basic ".$this->getAuthorizationHeader()."\r\n"; | ||
} | ||
//return json_encode($headers); | ||
$request = array( | ||
"request" => array( | ||
"text" =>$this->AlertText | ||
) | ||
); | ||
$url = $this->OLPAddress."/api/alert?data=".urlencode(json_encode($request)); | ||
$context = stream_context_create($headers); | ||
$response = file_get_contents($url,false,$context); | ||
return $response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used on line 23 in GroupQuery.php