<?php

TaskerMAN\WebInterface\WebInterface::setTitle('Create New Task');
if (isset($_POST['submit'])) {
    try {
        $task = new TaskerMAN\Application\Task();
        $task->setCreatedByUser(TaskerMAN\WebInterface\WebInterface::$user->getID());
        $task->setAssignee(TaskerMAN\Core\IO::POST('assigned-to'));
        $task->setDueBy(TaskerMAN\Core\IO::POST('due-date'));
        $task->setStatus(1);
        // Allocated
        $task->setTitle(TaskerMAN\Core\IO::POST('task-title'));
        $task->createStep(TaskerMAN\Core\IO::POST('step-text'));
        $task->save();
        header('Location: index.php?p=task&id=' . $task->id);
        exit;
    } catch (TaskerMAN\Application\UserManagementException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    } catch (TaskerMAN\Application\TaskException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    }
}
?>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

	<?php 
if (isset($alert)) {
    echo $alert;
}
?>
<?php

// Hide default template
TaskerMAN\WebInterface\WebInterface::showTemplate(false);
// Intialize installation engine
$install = new TaskerMAN\Core\Install();
if (!$install->required()) {
    throw new TaskerMAN\Core\FatalException('Install Not Required', new \Exception('All database tables already exist, so an install is not required.'));
}
$alert = null;
if (isset($_POST['submit'])) {
    // Create tables
    $install->createTables();
    // Create user
    try {
        $uid = TaskerMAN\Application\UserManagement::create(TaskerMAN\Core\IO::POST('email'), TaskerMAN\Core\IO::POST('name'), TaskerMAN\Core\IO::POST('password'), true);
        header('Location: index.php?p=user&id=' . $uid);
    } catch (TaskerMAN\Application\UserManagementException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    }
}
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Install &middot; TaskerMAN</title>
示例#3
0
<?php

$uid = TaskerMAN\Core\IO::GET('id');
$user = new TaskerMAN\Application\User($uid);
// User does not exist, throw 404
if (!$user->exists) {
    throw new TaskMAN\Core\FatalException('404 - Page Not Found', new \Exception('Requested user (' . $uid . ') was not found'));
}
TaskerMAN\WebInterface\WebInterface::setTitle($user->name);
$stats = TaskerMAN\Application\DashboardStats::getStats($user->id);
if (isset($_POST['delete'])) {
    try {
        TaskerMAN\Application\UserManagement::delete($uid);
        if ($uid == TaskerMAN\WebInterface\WebInterface::$user->getID()) {
            // User deleted themselves, log them out
            TaskerMAN\WebInterface\Session::destroy();
            header('Location: index.php?p=login');
            exit;
        }
        header('Location: index.php?p=list_users');
        exit;
    } catch (TaskerMAN\Application\UserManagementException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    }
} elseif (isset($_POST['submit'])) {
    // Form submitted
    if (isset($_POST['admin'])) {
        $is_admin = true;
    } else {
        $is_admin = false;
    }
示例#4
0
<?php

TaskerMAN\WebInterface\WebInterface::setTitle('Dashboard');
$stats = TaskerMAN\Application\DashboardStats::getStats();
?>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
	<div class="row placeholders">
		<div class="col-xs-6 col-sm-3 placeholder">
			<br />
			<br />
			<span class="large-dashboard-number"><?php 
echo $stats['outstanding'];
?>
</span>
		</div>

		<div class="col-xs-6 col-sm-3 placeholder">
			<br />
			<br />
			<?php 
echo '<span class="large-dashboard-number"';
if ($stats['overdue'] > 0) {
    echo ' style="color: #F7464A"';
} else {
    echo ' style="color: #66CD00"';
}
echo '>' . $stats['overdue'] . '</span>';
?>
		</div>
示例#5
0
<?php

$task_id = TaskerMAN\Core\IO::GET('id');
// Check task exists
$task = new TaskerMAN\Application\Task($task_id);
if (is_null($task->id)) {
    throw new TaskerMAN\Core\FatalException('404 - Page Not Found', new \Exception('Requested task (' . $task_id . ') was not found'));
}
TaskerMAN\WebInterface\WebInterface::setTitle('Task ' . $task_id);
?>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

	<?php 
if (isset($_POST['submit'])) {
    try {
        $task->setTitle(TaskerMAN\Core\IO::POST('task-title'));
        $task->setDueBy(TaskerMAN\Core\IO::POST('due-date'));
        $task->setAssignee(TaskerMAN\Core\IO::POST('assigned-to'));
        // Task changed to completed
        if ($task->status != 2 && TaskerMAN\Core\IO::POST('status') == 2) {
            $task->setCompletedTime();
        }
        $task->setStatus(TaskerMAN\Core\IO::POST('status'));
        $task->save();
    } catch (TaskerMAN\Application\TaskException $e) {
        $alert = '<div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div>';
    }
}
if (isset($alert)) {
    echo $alert;
<?php

TaskerMAN\WebInterface\WebInterface::setTitle('Manage Users');
// Load all users
$UserData = TaskerMAN\Application\UserListInterface::getUsers();
?>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

	<h2 class="page-header">Users</h2>
	<h4><a href="index.php?p=new_user">Create new user</a></h4>
	<div class="table-responsive">

    <table class="table table-striped table-hover">
      <thead>
        <tr>
          <th style="text-align: center;">ID</th>
          <th>Name</th>
          <th>Email</th>
          <th style="text-align: center;">Admin Status</th>
        </tr>
      </thead>

      <tbody>

      <?php 
foreach ($UserData as $user) {
    echo '<tr>';
    echo '<td style="text-align: center;">' . $user['id'] . '</td>';
    echo '<td><a href="index.php?p=user&amp;id=' . $user['id'] . '">' . $user['name'] . '</a></td>';
    echo '<td>' . $user['email'] . '</td>';
<?php

TaskerMAN\WebInterface\WebInterface::setTitle('List Tasks');
/*
 * Search constraint for creator
*/
$created_uid = TaskerMAN\Core\IO::GET('created_uid');
if ($created_uid == 'any') {
    $created_uid = null;
}
TaskerMAN\Application\TaskListInterface::setSearchCriteria('created_uid', $created_uid);
/*
 * Search constraint for assignee
*/
$assignee_uid = TaskerMAN\Core\IO::GET('assignee_uid');
if ($assignee_uid == 'any') {
    $assignee_uid = null;
}
TaskerMAN\Application\TaskListInterface::setSearchCriteria('assignee_uid', $assignee_uid);
/*
 * Search constraint for status
*/
$status = TaskerMAN\Core\IO::GET('status');
if ($status == 'any') {
    $status = null;
}
TaskerMAN\Application\TaskListInterface::setSearchCriteria('status', $status);
/**
 * Search constraint for title
*/
$title = TaskerMAN\Core\IO::get('title');
示例#8
0
<?php

require_once 'config/init.php';
try {
    TaskerMAN\WebInterface\WebInterface::init();
} catch (TaskerMAN\Core\FatalException $e) {
    $e->display_html();
}