diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/.htaccess | 1 | ||||
-rwxr-xr-x | scripts/create-random-projects.php | 18 | ||||
-rwxr-xr-x | scripts/create-random-tasks.php | 58 | ||||
-rwxr-xr-x | scripts/create-random-users.php | 17 | ||||
-rwxr-xr-x | scripts/create-sample-burndown.php | 55 | ||||
-rwxr-xr-x | scripts/create-sample-cfd.php | 63 | ||||
-rwxr-xr-x | scripts/create-sample-lead-time.php | 70 | ||||
-rw-r--r-- | scripts/kanboard.py | 1104 | ||||
-rwxr-xr-x | scripts/make-archive.sh | 73 | ||||
-rwxr-xr-x | scripts/make-assets.sh | 66 | ||||
-rwxr-xr-x | scripts/make-tag.sh | 6 |
11 files changed, 0 insertions, 1531 deletions
diff --git a/scripts/.htaccess b/scripts/.htaccess deleted file mode 100644 index 14249c50..00000000 --- a/scripts/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all
\ No newline at end of file diff --git a/scripts/create-random-projects.php b/scripts/create-random-projects.php deleted file mode 100755 index 2b68174e..00000000 --- a/scripts/create-random-projects.php +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env php -<?php - -require __DIR__.'/../app/common.php'; - -use Model\Project; -use Model\ProjectPermission; - -$projectModel = new Project($container); -$permissionModel = new ProjectPermission($container); - -for ($i = 0; $i < 100; $i++) { - $id = $projectModel->create(array( - 'name' => 'Project #'.$i - )); - - $permissionModel->addMember($id, 1); -} diff --git a/scripts/create-random-tasks.php b/scripts/create-random-tasks.php deleted file mode 100755 index 203c414d..00000000 --- a/scripts/create-random-tasks.php +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env php -<?php - -require __DIR__.'/../app/common.php'; - -use Model\TaskCreation; -use Model\Subtask; -use Model\Project; -use Model\ProjectPermission; -use Model\User; - -$task_per_column = 200; - -$userModel = new User($container); -$projectModel = new Project($container); -$permissionModel = new ProjectPermission($container); -$taskModel = new TaskCreation($container); -$subtaskModel = new Subtask($container); - -$project_id = $projectModel->create(array( - 'name' => 'Project #1' -)); - -$permissionModel->addMember($project_id, 1); - -for ($i = 0; $i <= 5; $i++) { - $userModel->create(array( - 'username' => 'user'.$i, - 'password' => 'password'.$i, - 'name' => 'User #'.$i, - 'email' => 'user'.$i.'@localhost', - )); -} - -foreach (array(1, 2, 3, 4) as $column_id) { - - for ($i = 1; $i <= $task_per_column; $i++) { - - $task = array( - 'title' => 'Task #'.$i.'-'.$column_id, - 'project_id' => 1, - 'column_id' => $column_id, - 'owner_id' => 1, - 'color_id' => mt_rand(0, 1) === 0 ? 'green' : 'purple', - 'score' => mt_rand(0, 21), - 'is_active' => mt_rand(0, 1), - ); - - $id = $taskModel->create($task); - - $subtaskModel->create(array( - 'title' => 'Subtask of task #'.$id, - 'user_id' => 1, - 'status' => mt_rand(0, 2), - 'task_id' => $id, - )); - } -} diff --git a/scripts/create-random-users.php b/scripts/create-random-users.php deleted file mode 100755 index a8b7e4d3..00000000 --- a/scripts/create-random-users.php +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env php -<?php - -require __DIR__.'/../app/common.php'; - -use Model\User; - -$userModel = new User($container); - -for ($i = 0; $i < 500; $i++) { - $userModel->create(array( - 'username' => 'user'.$i, - 'password' => 'password'.$i, - 'name' => 'User #'.$i, - 'email' => 'user'.$i.'@localhost', - )); -} diff --git a/scripts/create-sample-burndown.php b/scripts/create-sample-burndown.php deleted file mode 100755 index 188ad7d9..00000000 --- a/scripts/create-sample-burndown.php +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env php -<?php - -require __DIR__.'/../app/common.php'; - -use Model\ProjectDailyColumnStats; -use Model\TaskCreation; -use Model\TaskStatus; - -$pds = new ProjectDailyColumnStats($container); -$taskCreation = new TaskCreation($container); -$taskStatus = new TaskStatus($container); - -for ($i = 1; $i <= 15; $i++) { - - $task = array( - 'title' => 'Task #'.$i, - 'project_id' => 1, - 'column_id' => rand(1, 4), - 'score' => rand(1, 21) - ); - - $taskCreation->create($task); -} - -$pds->updateTotals(1, date('Y-m-d', strtotime('-7 days'))); - -$taskStatus->close(1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-6 days'))); - -$taskStatus->close(2); -$taskStatus->close(3); -$pds->updateTotals(1, date('Y-m-d', strtotime('-5 days'))); - -$taskStatus->close(4); -$pds->updateTotals(1, date('Y-m-d', strtotime('-4 days'))); - -$taskStatus->close(5); -$pds->updateTotals(1, date('Y-m-d', strtotime('-3 days'))); - -$taskStatus->close(6); -$taskStatus->close(7); -$taskStatus->close(8); -$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days'))); - -$taskStatus->close(9); -$taskStatus->close(10); -$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days'))); - -$taskStatus->close(12); -$taskStatus->close(13); -$pds->updateTotals(1, date('Y-m-d', strtotime('-1 days'))); - -$taskStatus->close(1); -$pds->updateTotals(1, date('Y-m-d'));
\ No newline at end of file diff --git a/scripts/create-sample-cfd.php b/scripts/create-sample-cfd.php deleted file mode 100755 index e7ff1ec9..00000000 --- a/scripts/create-sample-cfd.php +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env php -<?php - -require __DIR__.'/../app/common.php'; - -use Model\ProjectDailyColumnStats; -use Model\TaskCreation; -use Model\TaskPosition; - -$pds = new ProjectDailyColumnStats($container); -$taskCreation = new TaskCreation($container); -$taskPosition = new TaskPosition($container); - -for ($i = 1; $i <= 15; $i++) { - - $task = array( - 'title' => 'Task #'.$i, - 'project_id' => 1, - 'column_id' => 1, - ); - - $taskCreation->create($task); -} - -$pds->updateTotals(1, date('Y-m-d', strtotime('-7 days'))); - -$taskPosition->movePosition(1, 1, 2, 1); -$taskPosition->movePosition(1, 2, 2, 1); -$taskPosition->movePosition(1, 3, 2, 1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-6 days'))); - -$taskPosition->movePosition(1, 3, 3, 1); -$taskPosition->movePosition(1, 4, 3, 1); -$taskPosition->movePosition(1, 5, 3, 1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-5 days'))); - -$taskPosition->movePosition(1, 5, 4, 1); -$taskPosition->movePosition(1, 6, 4, 1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-4 days'))); - -$taskPosition->movePosition(1, 7, 4, 1); -$taskPosition->movePosition(1, 8, 4, 1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-3 days'))); - -$taskPosition->movePosition(1, 9, 3, 1); -$taskPosition->movePosition(1, 10, 2, 1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days'))); - -$taskCreation->create(array('title' => 'Random task', 'project_id' => 1)); -$taskPosition->movePosition(1, 11, 2, 1); -$taskPosition->movePosition(1, 12, 4, 1); -$taskPosition->movePosition(1, 13, 4, 1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days'))); - -$taskPosition->movePosition(1, 14, 3, 1); -$pds->updateTotals(1, date('Y-m-d', strtotime('-1 days'))); - -$taskPosition->movePosition(1, 15, 4, 1); -$taskPosition->movePosition(1, 16, 4, 1); - -$taskCreation->create(array('title' => 'Random task', 'project_id' => 1)); - -$pds->updateTotals(1, date('Y-m-d'));
\ No newline at end of file diff --git a/scripts/create-sample-lead-time.php b/scripts/create-sample-lead-time.php deleted file mode 100755 index d4d82006..00000000 --- a/scripts/create-sample-lead-time.php +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env php -<?php - -require __DIR__.'/../app/common.php'; - -use Model\Project; -use Model\ProjectDailyStats; - -$p = new Project($container); -$pds = new ProjectDailyStats($container); - -$p->create(array('name' => 'Test Lead/Cycle time')); - -$container['db']->table('tasks')->insert(array( - 'title' => 'Lead time = 4d | Cycle time = 3d', - 'date_creation' => strtotime('-7 days'), - 'date_started' => strtotime('-6 days'), - 'date_completed' => strtotime('-3 days'), - 'is_active' => 0, - 'project_id' => 1, - 'column_id' => 1, -)); - -$container['db']->table('tasks')->insert(array( - 'title' => 'Lead time = 1d | Cycle time = 1d', - 'date_creation' => strtotime('-7 days'), - 'date_started' => strtotime('-7 days'), - 'date_completed' => strtotime('-6 days'), - 'is_active' => 0, - 'project_id' => 1, - 'column_id' => 1, -)); - -$pds->updateTotals(1, date('Y-m-d', strtotime('-6 days'))); - -$container['db']->table('tasks')->insert(array( - 'title' => 'Lead time = 7d | Cycle time = 5d', - 'date_creation' => strtotime('-7 days'), - 'date_started' => strtotime('-5 days'), - 'date_completed' => strtotime('today'), - 'is_active' => 0, - 'project_id' => 1, - 'column_id' => 1, -)); - -$pds->updateTotals(1, date('Y-m-d', strtotime('-5 days'))); - -$container['db']->table('tasks')->insert(array( - 'title' => 'Lead time = 1d | Cycle time = 0', - 'date_creation' => strtotime('-3 days'), - 'date_started' => 0, - 'date_completed' => 0, - 'is_active' => 0, - 'project_id' => 1, - 'column_id' => 1, -)); - -$pds->updateTotals(1, date('Y-m-d', strtotime('-4 days'))); - -$container['db']->table('tasks')->insert(array( - 'title' => 'Lead time = 1d | Cycle time = 1d', - 'date_creation' => strtotime('-3 days'), - 'date_started' => strtotime('-3 days'), - 'date_completed' => 0, - 'is_active' => 0, - 'project_id' => 1, - 'column_id' => 1, -)); - -$pds->updateTotals(1, date('Y-m-d', strtotime('-3 days'))); diff --git a/scripts/kanboard.py b/scripts/kanboard.py deleted file mode 100644 index 6c9d2287..00000000 --- a/scripts/kanboard.py +++ /dev/null @@ -1,1104 +0,0 @@ -#!/usr/bin/env python -''' -This module implements Kanboard Json-RPC API in Python. - -Example: - kanboard = Kanboard("kanboard-token") - - projects = kanboard.getAllProjects() - - for p in projects: - proj = kanboard.getProjectById(p['id']) - - pprint(proj) - - categories = kanboard.getAllCategories(p['id']) - for c in categories: - category = kanboard.getCategory(c['id']) - - try: - pprint(category) - except: - print("Cannot print category %s" % category['id']) - continue - - tasks = kanboard.getAllTasks(p['id'], 1) - for t in tasks: - task = kanboard.getTask(t['id']) - - try: - pprint(task) - except: - print("Cannot print task %s" % task['id']) - continue - - subtasks = kanboard.getAllSubtasks(task['id']) - for st in subtasks: - subtask = kanboard.getSubtask(st['id']) - - try: - pprint(subtask) - except: - print("Cannot print subtask %s" % subtask['id']) - continue - - comments = kanboard.getAllComments(task['id']) - for c in comments: - comment = kanboard.getComment(c['id']) - - try: - pprint(comment) - except: - print("Cannot print comment %s" % comment['id']) - continue - -Created on 18.09.2014 - -@author: dzudek -''' - -import requests -import json -from datetime import datetime - - -def getfromid(iid, ilist, arg='name'): - for u in ilist: - if u['id'] == iid: - return u[arg] - - -getdate = lambda timestamp: getfromtimestamp("%x", timestamp) - -getdatetime = lambda timestamp: getfromtimestamp("%x %X", timestamp) - -getfromtimestamp = lambda format, timestamp: datetime.fromtimestamp(int(timestamp)).strftime(format) if timestamp is not None else None - -class Kanboard(): - url = "http://localhost/kanboard/jsonrpc.php" - headers = {'content-type': 'application/json'} - - username = "jsonrpc" - token = None - - _id = 0 - - def __init__(self, token, url = None): - if url is not None: - self.url = url - - self.token = token - - def _getId(self): - self._id += 1 - return self._id - - def getTimezone(self): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getTimezone", - "id" : kid, - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - assert response.ok - assert response.json()['id'] == kid - return response.json()['result'] - - def createProject(self, name): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "createProject", - "id" : kid, - "params": { - "name": name - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getProjectById(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getProjectById", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getProjectByName(self, name): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getProjectByName", - "id" : kid, - "params": { - "name": name - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getAllProjects(self): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getAllProjects", - "id" : kid - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def updateProject(self, project_id, name, is_active = None, token = None, is_public = None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "updateProject", - "id" : kid, - "params": { - "id": project_id, - "name": name - } - } - - #optional parameters - if is_active is not None: - params['params']["is_active"] = is_active - if token is not None: - params['params']["token"] = token - if is_public is not None: - params['params']["is_public"] = is_public - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def enableProject(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "enableProject", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def disableProject(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "disableProject", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def removeProject(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "removeProject", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def enableProjectPublicAccess(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "enableProjectPublicAccess", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def disableProjectPublicAccess(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "disableProjectPublicAccess", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getAllowedUsers(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getAllowedUsers", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def revokeUser(self, project_id, user_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "revokeUser", - "id" : kid, - "params": { - "project_id": project_id, - "user_id": user_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def allowUser(self, project_id, user_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "allowUser", - "id" : kid, - "params": { - "project_id": project_id, - "user_id": user_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getBoard(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getBoard", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getColumns(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getColumns", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getColumn(self, column_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getColumn", - "id" : kid, - "params": { - "column_id": column_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def moveColumnUp(self, project_id, column_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "moveColumnUp", - "id" : kid, - "params": { - "project_id": project_id, - "column_id": column_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def moveColumnDown(self, project_id, column_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "moveColumnDown", - "id" : kid, - "params": { - "project_id": project_id, - "column_id": column_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def updateColumn(self, column_id, title, task_limit=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "updateColumn", - "id" : kid, - "params": { - "column_id": column_id, - "title": title, - } - } - - #optional parameter - if task_limit is not None: - params['params']["task_limit"] = task_limit - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def addColumn(self, project_id, title, task_limit=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "addColumn", - "id" : kid, - "params": { - "project_id": project_id, - "title": title, - } - } - - #optional parameter - if task_limit is not None: - params['params']["task_limit"] = task_limit - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def removeColumn(self, column_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "removeColumn", - "id" : kid, - "params": { - "column_id": column_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def createTask(self, project_id, title, color_id=None, column_id=None, description=None, owner_id=None, creator_id=None, score=None, date_due=None, category_id=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "createTask", - "id" : kid, - "params": { - "project_id": project_id, - "title": title, - } - } - - #optional parameters - if color_id is not None: - params['params']["color_id"] = color_id - if column_id is not None: - params['params']["column_id"] = column_id - if description is not None: - params['params']["description"] = description - if owner_id is not None: - params['params']["owner_id"] = owner_id - if creator_id is not None: - params['params']["creator_id"] = creator_id - if score is not None: - params['params']["score"] = score - if date_due is not None: - params['params']["date_due"] = date_due - if category_id is not None: - params['params']["category_id"] = category_id - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getTask(self, task_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getTask", - "id" : kid, - "params": { - "task_id": task_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getAllTasks(self, project_id, status_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getAllTasks", - "id" : kid, - "params": { - "project_id": project_id, - "status_id": status_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def updateTask(self, task_id, project_id=None, title=None, color_id=None, column_id=None, description=None, owner_id=None, creator_id=None, score=None, date_due=None, category_id=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "createTask", - "id" : kid, - "params": { - "id": task_id, - } - } - - #optional parameters - if title is not None: - params['params']["title"] = title - if project_id is not None: - params['params']["project_id"] = project_id - if color_id is not None: - params['params']["color_id"] = color_id - if column_id is not None: - params['params']["column_id"] = column_id - if description is not None: - params['params']["description"] = description - if owner_id is not None: - params['params']["owner_id"] = owner_id - if creator_id is not None: - params['params']["creator_id"] = creator_id - if score is not None: - params['params']["score"] = score - if date_due is not None: - params['params']["date_due"] = date_due - if category_id is not None: - params['params']["category_id"] = category_id - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def openTask(self, task_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "openTask", - "id" : kid, - "params": { - "task_id": task_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def closeTask(self, task_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "closeTask", - "id" : kid, - "params": { - "task_id": task_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def removeTask(self, task_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "removeTask", - "id" : kid, - "params": { - "task_id": task_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def moveTaskPosition(self, project_id, task_id, column_id, position): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "removeTask", - "id" : kid, - "params": { - "project_id": project_id, - "task_id": task_id, - "column_id": column_id, - "position": position - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def createUser(self, username, password, name=None, email=None, is_admin=None, default_project_id=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "createUser", - "id" : kid, - "params": { - "username": username, - "password": password - } - } - - #optional parameters - if name is not None: - params['params']["name"] = name - if email is not None: - params['params']["email"] = email - if is_admin is not None: - params['params']["is_admin"] = is_admin - if default_project_id is not None: - params['params']["default_project_id"] = default_project_id - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getUser(self, user_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getUser", - "id" : kid, - "params": { - "user_id": user_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getAllUsers(self): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getAllUsers", - "id" : kid - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def updateUser(self, user_id, username=None, name=None, email=None, is_admin=None, default_project_id=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "updateUser", - "id" : kid, - "params": { - "id": user_id - } - } - - #optional parameters - if username is not None: - params['params']["username"] = username - if name is not None: - params['params']["name"] = name - if email is not None: - params['params']["email"] = email - if is_admin is not None: - params['params']["is_admin"] = is_admin - if default_project_id is not None: - params['params']["default_project_id"] = default_project_id - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def removeUser(self, user_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "removeUser", - "id" : kid, - "params": { - "user_id": user_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def createCategory(self, project_id, name): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "createCategory", - "id" : kid, - "params": { - "project_id": project_id, - "name": name - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getCategory(self, category_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getCategory", - "id" : kid, - "params": { - "category_id": category_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getAllCategories(self, project_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getAllCategories", - "id" : kid, - "params": { - "project_id": project_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def updateCategory(self, category_id, name): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "updateCategory", - "id" : kid, - "params": { - "id": category_id, - "name": name - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def removeCategory(self, category_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "updateCategory", - "id" : kid, - "params": { - "id": category_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def createComment(self, task_id, user_id, content): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "createComment", - "id" : kid, - "params": { - "task_id": task_id, - "user_id": user_id, - "content": content - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getComment(self, comment_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getComment", - "id" : kid, - "params": { - "comment_id": comment_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getAllComments(self, task_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getAllComments", - "id" : kid, - "params": { - "task_id": task_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def updateComment(self, comment_id, content): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "updateComment", - "id" : kid, - "params": { - "id": comment_id, - "content": content - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def removeComment(self, comment_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "removeComment", - "id" : kid, - "params": { - "id": comment_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def createSubtask(self, task_id, title, user_id=None, time_estimated=None, time_spent=None, status=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "createSubtask", - "id" : kid, - "params": { - "task_id": task_id, - "title": title - } - } - - #optional parameters - if user_id is not None: - params['params']["user_id"] = user_id - if time_estimated is not None: - params['params']["time_estimated"] = time_estimated - if time_spent is not None: - params['params']["time_spent"] = time_spent - if status is not None: - params['params']["status"] = status - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getSubtask(self, subtask_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getSubtask", - "id" : kid, - "params": { - "subtask_id": subtask_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def getAllSubtasks(self, task_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "getAllSubtasks", - "id" : kid, - "params": { - "task_id": task_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def updateSubtask(self, subtask_id, task_id, title=None, user_id=None, time_estimated=None, time_spent=None, status=None): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "updateSubtask", - "id" : kid, - "params": { - "id": subtask_id, - "task_id": task_id - } - } - - #optional parameters - if title is not None: - params['params']["title"] = title - if user_id is not None: - params['params']["user_id"] = user_id - if time_estimated is not None: - params['params']["time_estimated"] = time_estimated - if time_spent is not None: - params['params']["time_spent"] = time_spent - if status is not None: - params['params']["status"] = status - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - - def removeSubtask(self, subtask_id): - kid = self._getId() - params = { - "jsonrpc": "2.0", - "method": "removeSubtask", - "id" : kid, - "params": { - "subtask_id": subtask_id - } - } - - response = requests.post(self.url, data=json.dumps(params), headers=self.headers, auth=(self.username, self.token)) - - assert response.ok - assert response.json()['id'] == kid - - return response.json()['result'] - diff --git a/scripts/make-archive.sh b/scripts/make-archive.sh deleted file mode 100755 index a2f1fade..00000000 --- a/scripts/make-archive.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -if [ "$#" -lt 1 ] -then - echo "Usage: $0 <version> [destination]" - exit 1 -fi - -APP="kanboard" -VERSION=$1 -DESTINATION=$2 - -if [ -z "$2" ] -then - DESTINATION=~/Devel/websites/$APP -fi - -echo "Build package for version $VERSION => $DESTINATION" - -# Cleanup -rm -rf /tmp/$APP /tmp/$APP-*.zip 2>/dev/null - -# Download source code -cd /tmp -git clone --depth 1 -q https://github.com/fguillot/$APP.git >/dev/null - -# Install vendors -cd /tmp/$APP -composer --prefer-dist --no-dev --optimize-autoloader --quiet install - -# Remove useless files -rm -rf data/*.sqlite \ - .git \ - .gitignore \ - scripts \ - tests \ - Vagrantfile \ - .*.yml \ - *.md \ - *.markdown \ - docs \ - Dockerfile \ - composer.* \ - app.json - -find ./vendor -name doc -type d -exec rm -rf {} +; -find ./vendor -name notes -type d -exec rm -rf {} +; -find ./vendor -name test -type d -exec rm -rf {} +; -find ./vendor -name tests -type d -exec rm -rf {} +; -find ./vendor -name composer.json -delete -find ./vendor -name phpunit.xml -delete -find ./vendor -name .travis.yml -delete -find ./vendor -name README.* -delete -find ./vendor -name .gitignore -delete - -# Set the version number -sed -i.bak s/master/$VERSION/g app/constants.php && rm -f app/*.bak - -# Make the archive -cd /tmp -zip -r $APP-$VERSION.zip $APP > /dev/null -mv $APP-$VERSION.zip $DESTINATION - -cd $DESTINATION - -# Make symlink for generic archive -if [ -L $APP-latest.zip ] -then - unlink $APP-latest.zip - ln -s $APP-$VERSION.zip $APP-latest.zip -fi - -rm -rf /tmp/$APP 2>/dev/null diff --git a/scripts/make-assets.sh b/scripts/make-assets.sh deleted file mode 100755 index 5aaaa0b6..00000000 --- a/scripts/make-assets.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -print_css="print links table board task comment subtask markdown" -app_css="base links title table form button alert tooltip header board task comment subtask markdown listing activity dashboard pagination popover confirm sidebar responsive dropdown screenshot filters gantt" -vendor_css="jquery-ui.min jquery-ui-timepicker-addon.min chosen.min fullcalendar.min font-awesome.min c3.min" - -app_js="Popover Dropdown Tooltip Markdown Sidebar Search App Screenshot Calendar Board Swimlane Gantt TaskRepartitionChart UserRepartitionChart CumulativeFlowDiagram BurndownChart BudgetChart AvgTimeColumnChart TaskTimeColumnChart LeadCycleTimeChart Router" -vendor_js="jquery-1.11.1.min jquery-ui.min jquery-ui-timepicker-addon.min chosen.jquery.min moment.min fullcalendar.min mousetrap.min mousetrap-global-bind.min app.min" -lang_js="da de es fi fr hu it ja nl pl pt pt-br ru sv sr th tr zh-cn" - -function merge_css { - - local app_file="assets/css/app.css" - local print_file="assets/css/print.css" - - rm -f $app_file 2>/dev/null - rm -f $print_file 2>/dev/null - echo "/* DO NOT EDIT: AUTO-GENERATED FILE */" > $app_file - echo "/************************************/" >> $app_file - echo "/* DO NOT EDIT: AUTO-GENERATED FILE */" > $print_file - echo "/************************************/" >> $print_file - - for file in $vendor_css; do cat "assets/css/vendor/${file}.css" >> $app_file; done - for file in $vendor_css; do cat "assets/css/vendor/${file}.css" >> $print_file; done - - for file in $app_css; do cat "assets/css/src/${file}.css" >> $app_file; done - for file in $print_css; do cat "assets/css/src/${file}.css" >> $print_file; done -} - -function minify_js { - - local tmp_file="assets/js/minify.js" - local dst_file="assets/js/vendor/app.min.js" - - rm -f $dst_file $tmp_file 2>/dev/null - - echo "(function() { 'use strict';" > $tmp_file; - for file in $app_js; do cat "assets/js/src/${file}.js" >> $tmp_file; done - echo "})();" >> $tmp_file; - - curl -s \ - -d compilation_level=SIMPLE_OPTIMIZATIONS \ - -d output_format=text \ - -d output_info=compiled_code \ - --data-urlencode "js_code@${tmp_file}" \ - http://closure-compiler.appspot.com/compile > $dst_file - - rm -f $tmp_file 2>/dev/null -} - -function merge_js { - - local tmp_file="assets/js/vendor/app.min.js" - local dst_file="assets/js/app.js" - - rm -f $dst_file 2>/dev/null - - for file in $vendor_js; do cat "assets/js/vendor/${file}.js" >> $dst_file; done - for file in $lang_js; do cat "assets/js/vendor/lang/${file}.js" >> $dst_file; done - - rm -f $tmp_file 2>/dev/null -} - -merge_css -minify_js -merge_js diff --git a/scripts/make-tag.sh b/scripts/make-tag.sh deleted file mode 100755 index 108444fc..00000000 --- a/scripts/make-tag.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -VERSION=$1 - -git tag -a v$VERSION -m "Version $VERSION" -git push origin v$VERSION |