Exemplo n.º 1
0
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     //echo 'Hello World!';
     //View::make('helloworld.html');
     //$beer = Task::find(1);
     //$tasks = Task::all();
     // Kint debugger
     //Kint::dump($beer);
     //Kint::dump($tasks);
     // $jaffa = new Task(array(
     //   'description' => '',
     //   'priority' => '0'));
     // $errors = $jaffa->errors();
     // Kint::dump($errors);
     $member = Task::getMemberOfProjects(1);
     Kint::dump($member);
     Kint::dump(TaskController::projects2string($member));
 }
Exemplo n.º 2
0
    TaskController::show($id);
});
$routes->post('/task/:id', function ($id) {
    TaskController::update($id);
});
$routes->post('/task/:id/destroy', function ($id) {
    TaskController::destroy($id);
});
$routes->get('/task/:id/edit', function ($id) {
    TaskController::edit($id);
});
$routes->get('/task/:id/markasdone', function ($id) {
    TaskController::markasdone($id);
});
$routes->get('/task/:id/markasundone', function ($id) {
    TaskController::markasundone($id);
});
$routes->post('/login', function () {
    SessionController::store();
});
$routes->get('/login', function () {
    SessionController::create();
});
$routes->get('/logout', function () {
    SessionController::destroy();
});
$routes->get('/signup', function () {
    UserController::create();
});
$routes->post('/signup', function () {
    UserController::store();
Exemplo n.º 3
0
<?php

include '../../../../../Conf/Include.php';
set_dependencies(array("TaskController"));
$id = $_REQUEST['id'] ?: NULL;
$type = $_REQUEST['type'] ?: NULL;
if (SivarApi\Tools\Validation::Is_Empty_OrNull($id)) {
    exit;
}
$task = new TaskController();
$r = $task->set_task_type($id, $type);
echo $r;
unset($r);
exit;
Exemplo n.º 4
0
<?php

require_once 'Controller/ProjectController.php';
require_once 'Controller/userStoryController.php';
require_once 'Controller/userController.php';
require_once 'Controller/SprintController.php';
require_once 'Controller/TaskController.php';
$userController = new UserController();
$projectController = new ProjectController();
$userStoryController = new UserStoryController();
$sprintController = new SprintController();
$taskController = new TaskController();
if (isset($_GET["p"])) {
    switch ($_GET["p"]) {
        case 'home':
            $userController->home();
            break;
        case 'authentify':
            $userController->authentify();
            break;
        case 'logout':
            $userController->logout();
            break;
        case 'registerView':
            $userController->registerView();
            break;
        case 'register':
            $userController->register($_POST);
            break;
        case 'loginView':
            $userController->loginView();
Exemplo n.º 5
0
});
// must be added after post new
$routes->get('/task/:id', function ($id) {
    TaskController::show($id);
});
$routes->get('/task/:id/edit', function ($id) {
    TaskController::edit($id);
});
$routes->post('/task/:id/edit', function ($id) {
    TaskController::update($id);
});
$routes->post('/task/:id/destroy', function ($id) {
    TaskController::destroy($id);
});
$routes->post('/task/:id/done', function ($id) {
    TaskController::done($id);
});
$routes->get('/login', function () {
    UserController::login();
});
$routes->post('/login', function () {
    UserController::handle_login();
});
$routes->get('/logout', function () {
    UserController::logout();
});
$routes->get('/project', function () {
    ProjectController::index();
});
$routes->post('/project', function () {
    ProjectController::store();
Exemplo n.º 6
0
 /**
  * The action to hanle an individual task
  *
  * @param SS_HTTPRequest $request
  * @return TaskController
  */
 public function task($request)
 {
     return TaskController::create()->handleRequest($request, $this->model);
 }
Exemplo n.º 7
0
<?php

include '../../../../Conf/Include.php';
Session::InitSession();
set_dependencies(array("TaskController"));
$task = new TaskController();
//declaracion de la clase
echo $task->AsignTouser(session::GetSession("login", "id"));
Exemplo n.º 8
0
 * Date: 29-03-2016
 *
 */
require_once 'TaskController.php';
$data = json_decode($_GET['data']);
if (!isset($_SESSION['token'])) {
    session_start();
}
$userId = $_SESSION['token'];
$opt = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC);
//echo json_encode($data);
switch ($data->operation) {
    case 'saveTask':
        TaskController::saveTask(null, $data->data);
        break;
    case 'getTasks':
        TaskController::getAllTask($data->sortBy, $data->keyword);
        break;
    case 'getNotes':
        TaskController::getNotes($data->taskId);
        break;
    case 'updateTask':
        TaskController::editTask($data->taskId, $data->data);
        break;
    case 'getAllTaskForUser':
        TaskController::getAllTaskForUser($data->includeCompleted);
        break;
    case 'deleteTask':
        TaskController::deleteTask($data->taskId);
        break;
}
Exemplo n.º 9
0
       "id_user": id_user,
       "user_comment": user_comment,
       "user_activate":user_activate
       
  };
* 
*/
include '../../../../Conf/Include.php';
$type = $_REQUEST['type'] ?: null;
set_dependencies(array("TaskController", "LogsController", "MessageController"));
if (SivarApi\Tools\Validation::Is_Empty_OrNull($type)) {
    echo 0;
    exit;
}
try {
    $task = new TaskController();
    Session::InitSession();
    $id_user = Session::GetSession("login", "id");
    $encript = new \SivarApi\Tools\Encriptacion\Encriptacion();
    $id_mt = $encript->Md5Encrypt(mt_rand(0, 1000) . mt_rand(100, 500) . $id_user . $_REQUEST['title']);
    $box_files = $_REQUEST['box_nodes'] ?: "";
    $mensaje = htmlspecialchars("<b>La tarea Consiste en :</b><br> " . $_REQUEST['client_description'] . "<div align='center'><a target='_blank' class='btn btn-circle green-haze btn-sm ' href='" . FunctionsController::GetUrl("task/show_task.php?id={$id_mt}") . "'>Ver tarea ...</a></div>", ENT_QUOTES);
    $asunto = " Tarea :" . $_REQUEST['title'];
    $msj = new MessageController();
    $id_msj = $msj->SetmessageLastId($_REQUEST['id_user'], $id_user, $mensaje, $asunto);
    $val = $task->SaveTask(array("id_multitask" => $id_mt, "id_client" => $_REQUEST['id_client'], "id_user_from" => $id_user, "description" => $_REQUEST['client_description'] ?: "ERROR", "title" => $_REQUEST['title'], "status" => 1), array("id_multitask" => $id_mt, "id_type" => 1, "id_user_from" => $id_user, "id_user_to" => $_REQUEST['id_user'], "id_message" => $id_msj[0]['id'], "date_asign" => FunctionsController::get_date(), "time_asign" => FunctionsController::get_time(), "box_files" => $box_files, "files" => $_REQUEST['other_docs'] ?: "", "comments" => $_REQUEST['user_comment'], "date_deadline" => FunctionsController::ReWriteDate($_REQUEST['deadline']), "time_deadline" => $_REQUEST['hourdead'], "status" => $_REQUEST['user_activate']));
    if (!$val) {
        echo 0;
    } else {
        echo $id_mt;
    }
Exemplo n.º 10
0
<?php

require __DIR__ . "/autoloder.php";
$obj = new TaskController();
$obj->indexAction();
//Mini routing
if (!empty($_GET['delete'])) {
    $obj->deleteTaskById($_GET['delete']);
    header('Location: ./index.php');
}
if (!empty($_GET['addTask'])) {
    $obj->addTask($_GET['addTask']);
    header('Location: ./index.php');
}
if (!empty($_GET['status'] && $_GET['id'])) {
    $obj->updateStatus($_GET['id'], $_GET['status']);
}
Exemplo n.º 11
0
<?php

/**
 * ESTE SCRIPT LE HACEN UNA LLAMADA AJAX DEL SCRIPT FUNCTION.JS
 * 
 *  function FindClients(){ ... }
 * 
 *@todo solo se necesita el echo a enviar los values al ajax..
 * 
 */
include '../../../../Conf/Include.php';
set_dependencies(array("TaskController"));
$task = new TaskController();
//declaracion de la clase
echo $task->Show_SelectClient();
//imprime el html option value
Exemplo n.º 12
0
/**
* INTERFAZ GRAFICO PORTLERT HELP
* var data = '<div class="col-md-4 column sortable"><div class="portlet portlet-sortable light bordered"><div class="portlet-title"><div class="caption font-green-sharp"><i class="fa fa-tasks"></i><span class="caption-subject bold uppercase">Aplicaciones</span>	<span class="caption-helper"></span>';
               data += '</div><div class="actions"><a class="btn btn-circle btn-icon-only btn-default fullscreen" href="#"></a></div></div><div class="portlet-body"><div class="scroller" style="height:200px" data-rail-visible="1" data-rail-color="yellow" data-handle-color="#a1b2bd">';
               data += '</div></div></div>';
               
               data += '<div class="portlet portlet-sortable light bordered"><div class="portlet-title"><div class="caption font-green-sharp"><i class="fa fa-tasks"></i><span class="caption-subject bold uppercase">Aplicaciones</span>	<span class="caption-helper"></span>';
               data += '</div><div class="actions"><a class="btn btn-circle btn-icon-only btn-default fullscreen" href="#"></a></div></div><div class="portlet-body"><div class="scroller" style="height:200px" data-rail-visible="1" data-rail-color="yellow" data-handle-color="#a1b2bd">';
               data += '</div></div></div>';
               
               data += '<div class="portlet portlet-sortable light bordered"><div class="portlet-title"><div class="caption font-green-sharp"><i class="fa fa-tasks"></i><span class="caption-subject bold uppercase">Aplicaciones</span>	<span class="caption-helper"></span>';
               data += '</div><div class="actions"><a class="btn btn-circle btn-icon-only btn-default fullscreen" href="#"></a></div></div><div class="portlet-body"><div class="scroller" style="height:200px" data-rail-visible="1" data-rail-color="yellow" data-handle-color="#a1b2bd">';
               data += '</div></div></div></div>';
* 
* 
*/
function PorltetStyle($request, $type, $id)
{
    $count = count($request);
    $portlet_array = array();
    $task = new TaskController();
    if ($count == 0) {
        $not_task = "<div align='center' class='col-md-12'>";
        $not_task .= "<h1><br><br><br><b>No Hay Tareas :)</b></h1>";
        $not_task .= "</div>";
        echo $not_task;
        exit;
    }
    if ($count == 1) {
        $portlet_array[] = array('<div class="col-md-4 column sortable">');
    } elseif ($count == 2) {
        $portlet_array[] = array('<div class="col-md-4 column sortable">');
        $portlet_array[] = array('<div class="col-md-4 column sortable">');
    } elseif ($count >= 3) {
        $portlet_array[] = array('<div class="col-md-4 column sortable">');
        $portlet_array[] = array('<div class="col-md-4 column sortable">');
        $portlet_array[] = array('<div class="col-md-4 column sortable">');
    }
    $i = -1;
    $max = count($portlet_array) - 1;
    //ESTADOS DE LOS TABULADORES
    $n = 1;
    $p = 2;
    $q = 3;
    /**
     * RECORRIDO DE LAS TAREAS PENDIENTES O ASIGNADAS DE ACUERDO
     * AL PERFIL DEL USUARIO DADO ...
     */
    foreach ($request as $data) {
        //GENERAL
        $mt_id = $data->mt_id;
        $mt_status = $data->status;
        $mt_description = stripcslashes(nl2br($data->mt_description));
        $title = $data->title;
        //CLIENTE
        $client_name = $data->client_name;
        $client_phone = $data->client_phone;
        $client_mail = $data->client_email;
        //USUARIO
        $user = $data->user_name;
        $user_image = $data->user_image;
        $user_mail = $data->user_email;
        //TAREA TIEMPOS
        $date_asign = $data->td_asign;
        $time_asign = $data->tt_asign;
        $date_deadline = $data->t_deadline;
        $time_deadline = $data->t_timedeadline;
        //TAREA OTROS
        $task_status = $data->t_status;
        $task_id = $data->t_id;
        $task_type_id = $data->t_idtype;
        $task_type_name = $data->t_nametype;
        $task_type_status = $data->t_typestatus;
        //FILES
        $task_box = $data->t_boxfiles;
        $task_files = $data->t_files;
        //TASK COMMENT
        $task_comment = $data->t_comment;
        $body_porlet = "";
        $body_porlet = '<div class="portlet portlet-sortable light bordered">';
        $body_porlet .= '<div class="portlet-title tabbable-line">';
        $body_porlet .= '<div class="caption">';
        /**INICIO : SELECCION SE COLOR TITULO MEDIANTE EL TYPO DE TAREA*/
        $title_color = NULL;
        switch ($task_type_id) {
            case 1:
                $title_color = "font-green-crusta";
                break;
            case 2:
                $title_color = "font-blue-crusta";
                break;
            case 3:
                $title_color = "font-red-crusta";
                break;
            case 4:
                $title_color = "font-green-crusta";
                break;
            case 5:
                $title_color = "font-yellow-crusta";
                break;
        }
        $body_porlet .= '<i class="fa fa-tasks"></i>';
        $body_porlet .= '<span class="caption-subject  bold ' . $title_color . ' uppercase">';
        $body_porlet .= $title . '</span>&nbsp;';
        /**FINAL SELECCION DE COLOR  TITULO */
        if ($task_status == 1) {
            $body_porlet .= '<span class="caption-helper"><i class="fa fa-spinner"></i></span>';
        } else {
            $body_porlet .= '<span class="caption-helper"><i class="fa fa-check"></i></span>';
        }
        $body_porlet .= '</div>';
        $body_porlet .= '<ul class="nav nav-tabs">';
        if ($type == 0) {
            $body_porlet .= '<li><a href="#portlet_tab' . $q . '" data-toggle="tab"><i class="fa fa-tachometer"></i></a></li>';
            $body_porlet .= '<li><a href="#portlet_tab' . $p . '" data-toggle="tab"><i class="fa fa-user"></i></a></li>';
            $body_porlet .= '<li class="active" ><a href="#portlet_tab' . $n . '" data-toggle="tab"><i class="fa fa-info"></i></a></li>';
        } else {
            $body_porlet .= '<li><a href="#portlet_tab' . $q . '" data-toggle="tab"><i class="fa fa-tachometer"></i></a></li>';
            $body_porlet .= '<li><a href="#portlet_tab' . $p . '" data-toggle="tab"><i class="fa fa-user"></i></a></li>';
            $body_porlet .= '<li class="active" ><a href="#portlet_tab' . $n . '" data-toggle="tab"><i class="fa fa-info"></i></a></li>';
        }
        $body_porlet .= '</ul>';
        $body_porlet .= '</div>';
        $body_porlet .= '<div class="portlet-body">';
        $body_porlet .= '<div class="tab-content">';
        //PRIMER TAB ------------------------------------------------------------------------------------------------
        $body_porlet .= '<div class="tab-pane active" id="portlet_tab' . $n . '">';
        $body_porlet .= '<div class="scroller">';
        if ($type == 0) {
            $color = "red";
            $reasign = FALSE;
            switch ($task_type_id) {
                case 1:
                    break;
                case 2:
                    $color = "blue";
                    break;
                case 3:
                    $color = "green";
                    break;
                case 4:
                    $reasign = TRUE;
                    break;
            }
            if ($reasign) {
                $body_porlet .= '<h4><label class="btn btn-circle btn-transparent grey-cascade btn-sm active"> ' . $task_type_name . '</label>&nbsp;&nbsp;<a title="Si desea tomar accion en este momento sobre la reasignacion haz clic" href="javascript:alert();" class="btn btn-circle btn-primary btn-sm"><i class="fa fa-refresh"></i>&nbsp;Accion</a>' . '</label>&nbsp;<a title="muestra un poco mas acerca de esta tarea" href="show_task.php?id=' . $mt_id . '" class="btn btn-circle btn-transparent  active" ><i class="fa fa-eye"></i></a></h4>';
            } else {
                $body_porlet .= '<h4><label class="btn btn-circle btn-transparent ' . $color . ' btn-sm active" >' . $task_type_name . '</label>&nbsp;&nbsp;&nbsp;<a title="muestra un poco mas acerca de esta tarea" href="show_task.php?id=' . $mt_id . '" class="btn btn-circle btn-transparent green  btn-sm active" ><i class="fa fa-eye"></i></a></h4>';
            }
        } else {
            $estatus_ = $task->get_task_type();
            $body_porlet .= '<select class="">';
            foreach ($estatus_ as $v) {
                if ($task_type_id == 1) {
                    $body_porlet .= "<option value='" . $v->id_type . "'>" . $v->name . "</option>";
                } else {
                    if ($v->id_type !== $task_type_id) {
                        $body_porlet .= "<option value='" . $v->id_type . "'>" . $v->name . "</option>";
                    }
                }
            }
            $body_porlet .= '</select>';
        }
        $body_porlet .= '<div class="blog-twitter">';
        $body_porlet .= '<div class="blog-twitter-block">';
        $body_porlet .= '<p><i class="fa fa-university "></i>&nbsp;&nbsp;<b>Cliente:</b>&nbsp;' . $client_name . ' </p>';
        $body_porlet .= '<i class="fa fa-envelope-o"></i>&nbsp;&nbsp;<a href="">' . $client_mail . '</a>';
        $body_porlet .= '<span><i class="fa fa-phone"></i>&nbsp;&nbsp;' . $client_phone . '</span>';
        $body_porlet .= '<i class="fa fa-university blog-twiiter-icon"></i>';
        $body_porlet .= '</div></div>';
        $body_porlet .= '<p><b>Descripcion:</b></p>';
        $body_porlet .= '<p class="">' . $mt_description . '</p>';
        $body_porlet .= '</div></div>';
        //SEGUNDO TAB --------------------------------------------------------------------------
        $body_porlet .= '<div class="tab-pane" id="portlet_tab' . $p . '">';
        $body_porlet .= '<div class="scroller">';
        $body_porlet .= '<div class="row">';
        $body_porlet .= '<div class="col-md-4">';
        if ($user_image == null) {
            $user_image = "avatar.png";
        }
        $body_porlet .= '<img src="' . FunctionsController::GetUrl("img/users/{$user_image}") . '" class="img-circle" width ="60" height="60" alt="">';
        $body_porlet .= '</div>';
        $body_porlet .= '<div class="col-md-8">';
        $body_porlet .= '<h4><b>' . $user . '</b></h4>';
        /**RECORDATORIO :  SE LE CAMBIARA EL MAILTO POR NUESTRO SISTEMA DE CORREOS */
        $body_porlet .= '<p><i class="fa fa-envelope-o"></i>&nbsp;<b><a href="mailto:' . $user_mail . '">' . current(explode("@", $user_mail)) . '</a></b></p>';
        if ($type == 0) {
            //$select_users           = $task->AsignTouser($id);
            $body_porlet .= '<div align="center">' . '<button  onclick="alert();" type="button" class="btn btn-circle btn-primary">' . '<i class="fa fa-repeat"></i> Reasignar</button>' . '</div>';
        }
        $body_porlet .= '';
        $body_porlet .= '</div>';
        $body_porlet .= '</div>';
        $body_porlet .= '</div></div>';
        /**TERCER TAB -----------------------------------------------------------------------------------------*/
        $body_porlet .= '<div class="tab-pane" id="portlet_tab' . $q . '">';
        $body_porlet .= '<div class="scroller">';
        $body_porlet .= '</div></div>';
        /* $body_porlet         .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';
           $body_porlet           .= '';*/
        $body_porlet .= '</div></div></div>';
        /*
         * TABULACION PROBLEMA MATEMATICO
         * 
         * si n = primero = 1
         *      entonces n = n+q dado q = ultimo
         * si p = segundo = 2 
         *      entonces p = p+q dado q = ultimo
         * si q = ultimo 
         *      entonces q = q + q o el doble de su producto
         */
        $n = $n + $q;
        $p = $p + $q;
        $q += $q;
        if ($i >= $max) {
            $i = 0;
        } else {
            $i++;
        }
        $portlet_array[$i][] = $body_porlet;
    }
    $paste_body = "";
    for ($i = 0; $i < count($portlet_array); $i++) {
        $portlet_array[$i][] = "</div>";
        $paste_body .= implode("", $portlet_array[$i]);
    }
    echo $paste_body;
    exit;
}
Exemplo n.º 13
0
<?php

include '../../../../Conf/Include.php';
$id = $_REQUEST['id_user'] ?: null;
set_dependencies(array("TaskController"));
if (\SivarApi\Tools\Validation::Is_Empty_OrNull($id)) {
    exit;
}
$task = new TaskController();
$info = $task->Show_UserInfo($id);
if ($info->imagen == null) {
    $info->imagen = "avatar.png";
}
echo '<label class="control-label col-md-3"> <span class="required">';
echo '</span></label>';
echo ' <div  class="col-md-4" >';
echo '<div  class="thumbnail">';
echo '<img src="../img/users/' . $info->imagen . '" alt="" width="100" height="100">';
echo '<div class="caption">';
echo '<h3  align="center"><b>' . $info->email . '</b></h3>';
echo '<p></p>';
echo '</div></div></div>';
Exemplo n.º 14
0
<?php

include '../../../../Conf/Include.php';
set_dependencies(array("TaskController"));
Session::InitSession();
$id = Session::GetSession("login", "id");
$task = new TaskController();
/**
 * TAREAS ASIGNADAS  
 */
$count_task = $task->GetCountCreateTask($id);
echo "";
unset($task);