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

Tasks v2 #655

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions src/Include/Header-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ function Header_body_menu() {
<?php } ?>
</ul><div class="slimScrollBar" style="width: 3px; position: absolute; top: 11px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 188.679px; background: rgb(0, 0, 0);"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div>
</li>
<li class="footer">
<!--<li class="footer">
<a href="<?= $sRootPath ?>/Tasks.php">View all tasks</a>
</li>
</li>-->
</ul>
</li>
<?php } ?>
Expand Down
14 changes: 14 additions & 0 deletions src/Service/TaskService.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<?php

// This file is generated by Composer
require_once dirname(__FILE__) . '/../vendor/autoload.php';

class TaskService
{
private $baseURL;
private $installedVersion;
private $latestVersion;

public function __construct()
{
$this->baseURL = $_SESSION['sRootPath'];

$client = new \Github\Client();
$this->latestVersion = $client->api('repo')->releases()->latest('churchcrm', 'crm');
$this->installedVersion = $_SESSION['sSoftwareInstalledVersion'];
}

function getAdminTasks() {
Expand All @@ -29,6 +38,11 @@ function getAdminTasks() {
if ($sSMTPHost == "") {
array_push($tasks, $this->addTask("Set Email Settings", "/SystemSettings.php", true));
}

if ($this->latestVersion["name"] != $this->installedVersion) {
array_push($tasks, $this->addTask("New Release ". $this->latestVersion["name"], $this->latestVersion["html_url"], true));
}

return $tasks;
}

Expand Down
3 changes: 2 additions & 1 deletion src/api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
require_once "../Service/ReportingService.php";
require_once '../Service/NoteService.php';

require_once '../vendor/Slim/slim/Slim/Slim.php';
// This file is generated by Composer
require_once dirname(__FILE__) . '/../vendor/autoload.php';

use Slim\Slim;

Expand Down
3 changes: 2 additions & 1 deletion src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"require": {
"mailchimp/mailchimp": "2.0.6",
"slim/slim": "2.6.2"
"slim/slim": "2.6.2",
"knplabs/github-api": "~1.4"
}
}
Loading