turn tasks into an app

This commit is contained in:
zotlabs 2019-06-29 19:23:31 -07:00
parent a2a7a22c38
commit 1933d0f3dd
4 changed files with 28 additions and 2 deletions

View file

@ -341,6 +341,7 @@ class Apps {
'View Profile' => t('View Profile'),
'Photos' => t('Photos'),
'Events' => t('Events'),
'Tasks' => t('Tasks'),
'No Comment' => t('No Comment'),
'Directory' => t('Directory'),
'Help' => t('Help'),

View file

@ -3,6 +3,7 @@ namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
require_once('include/event.php');
@ -96,4 +97,19 @@ class Tasks extends Controller {
json_return_and_die($x);
}
}
function get() {
$desc = t('This app provides a simple personal and task list.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Tasks'))) {
return $text;
}
$obj = new \Zotlabs\Widget\Tasklist;
return $obj->widget([]);
}
}

View file

@ -2,14 +2,17 @@
namespace Zotlabs\Widget;
use Zotlabs\Lib\Apps;
require_once('include/event.php');
class Tasklist {
function widget($arr) {
if (! local_channel())
return;
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Tasks'))) {
return EMPTY_STR;
}
$o .= '<script>var tasksShowAll = 0; $(document).ready(function() { tasksFetch(); $("#tasklist-new-form").submit(function(event) { event.preventDefault(); $.post( "tasks/new", $("#tasklist-new-form").serialize(), function(data) { tasksFetch(); $("#tasklist-new-summary").val(""); } ); return false; } )});</script>';
$o .= '<script>function taskComplete(id) { $.post("tasks/complete/"+id, function(data) { tasksFetch();}); }

6
app/tasks.apd Normal file
View file

@ -0,0 +1,6 @@
version: 1
url: $baseurl/tasks
requires: local_channel
name: Tasks
photo: icon:list
categories: Productivity