示例#1
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
if (isset($model->data['id'])) {
    $pm = new \bbn\appui\task($model->db);
    $res = $pm->comment($model->data['id'], ['files' => !empty($model->data['files']) ? $model->data['files'] : false, 'title' => isset($model->data['title']) ? $model->data['title'] : '', 'text' => isset($model->data['text']) ? $model->data['text'] : '']);
    return ['success' => $res, 'comment' => $pm->get_comment($model->data['id'], $res)];
}
示例#2
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
$res = false;
if (isset($model->data['id_task'], $model->data['role'], $model->data['id_user'])) {
    $pm = new \bbn\appui\task($model->db);
    $res = $pm->add_role($model->data['id_task'], $model->data['role'], $model->data['id_user']);
}
return ['success' => $res];
示例#3
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
$s =& $model->inc->session;
$pm = new \bbn\appui\task($model->db);
return ['root' => $model->data['root'], 'roles' => \bbn\appui\task::get_roles(), 'states' => \bbn\appui\task::get_states(), 'options' => \bbn\appui\task::get_options(), 'categories' => \bbn\appui\task::get_cats(), 'lng' => ['new_task_search' => 'Nouvelle tâche / Recherche', 'no_role_permission' => _("You have no right to modify the roles in this task"), 'opened_tasks' => _("Opened tasks"), 'new_task' => _("New task"), 'demo_task' => _("Demo task form"), 'my_ongoing_tasks' => _("My ongoing tasks"), 'timeline' => _("Timeline"), 'search' => _("Search"), 'soon' => _("Soon"), 'all_tasks' => _("All tasks"), 'confirm_delete' => _("Are you sure you want to remove yourself from this task??"), 'file' => _("File"), 'link' => _("Link"), 'problem_file' => _("Problem with the file..."), 'error_uploading' => _("Problem during the upload"), 'file_exists' => _("A file with this name already exists"), 'user' => _("User"), 'date' => _("Date"), 'action' => _("Action"), 'global_view' => _("Global view"), 'roles' => _("Roles"), 'journal' => _("Events journal"), 'no_comment_text' => _("You have to enter a comment, a link, or a file"), 'sure_to_hold' => _("Are you sure you want to put this task on hold?"), 'sure_to_resume' => _("Are you sure you want to resume this task?"), 'sure_to_close' => _("Are you sure you want to close this task?"), 'sure_to_unfollow' => _("Are you sure you want to unfollow this task?")], 'groups' => array_map(function ($a) use($s) {
    if ($a['id'] !== $s->get('user', 'id_group')) {
        $a['expanded'] = false;
    }
    return $a;
}, $model->get_model('usergroup/picker')), 'categories' => $model->inc->options->map(function ($a) {
    $a['is_parent'] = !empty($a['items']);
    if ($a['is_parent']) {
        $a['expanded'] = true;
    }
    return $a;
}, $pm->categories(), 1)];
示例#4
0
文件: logs.php 项目: nabab/appui-task
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
if (isset($model->data['id_task'])) {
    $pm = new \bbn\appui\task($model->db);
    return $pm->get_log($model->data['id_task']);
}
return [];
示例#5
0
文件: tree.php 项目: nabab/appui-task
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
if (isset($model->data['id'])) {
    $task = new \bbn\appui\task($model->db);
    //$statuses = empty($model->data['closed']) ? 'opened|ongoing|holding' : false;
    return $task->get_tree($model->data['id']);
}
return [];
示例#6
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
if (isset($model->data['id'])) {
    $task = new \bbn\appui\task($model->db);
    return ['info' => $task->info($model->data['id'], true)];
}
return [];
示例#7
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
$res = false;
if (isset($model->data['id_task'], $model->data['id_user'])) {
    $pm = new \bbn\appui\task($model->db);
    $res = $pm->remove_role($model->data['id_task'], $model->data['id_user']);
}
return ['success' => $res];
示例#8
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
$pm = new \bbn\appui\task($model->db);
if (!empty($model->data['search'])) {
    return $pm->get_slist($model->data['search']);
} else {
    $ops = ['eq' => '=', 'neq' => '!=', 'gt' => '>', 'gte' => '>=', 'lt' => '<', 'lte' => '<=', 'contains' => 'LIKE', 'isnotnull' => 'IS NOT NULL', 'isnull' => 'IS NULL'];
    $res = [];
    $done = [];
    if (isset($model->data['filter'], $model->data['filter']['filters'])) {
        $fs =& $model->data['filter']['filters'];
        foreach ($fs as $f) {
            if (isset($f['field'], $f['operator'], $ops[$f['operator']])) {
                if (!isset($done[$f['field']])) {
                    $done[$f['field']] = count($res);
                    array_push($res, [$f['field'], $ops[$f['operator']], $f['value']]);
                } else {
                    if (!is_array($res[$done[$f['field']]][2])) {
                        $res[$done[$f['field']]][2] = [$res[$done[$f['field']]][2]];
                    }
                    array_push($res[$done[$f['field']]][2], $f['value']);
                }
            } else {
                if (isset($f['filters']) && count($f['filters'])) {
                    $r = [$f['filters'][0]['field'], '=', []];
                    foreach ($f['filters'] as $f2) {
示例#9
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
$pm = new \bbn\appui\task($model->db);
return $pm->get_mine(empty($model->data['id']) ? null : $model->data['id']);
示例#10
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
$pm = new \bbn\appui\task($model->db);
return ['success' => isset($model->data['title'], $model->data['type']) ? $pm->insert(['title' => $model->data['title'], 'type' => $model->data['type'], 'deadline' => empty($model->data['deadline']) ? null : $model->data['deadline']]) : false];
示例#11
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
if (isset($model->data['search'])) {
    $pm = new \bbn\appui\task($model->db);
    if ($rows = $pm->search($model->data['search'])) {
        return ['rows' => $rows];
    }
}
return ['rows' => []];
示例#12
0
<?php

/*
 * Describe what it does or you're a pussy
 *
 **/
/** @var $model \bbn\mvc\model*/
$pm = new \bbn\appui\task($model->db);
return ['success' => isset($model->data['id_task'], $model->data['prop']) ? $pm->update($model->data['id_task'], $model->data['prop'], isset($model->data['val']) ? $model->data['val'] : null) : false];