aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-08-20 20:40:42 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-08-20 20:40:42 -0700
commit49c4aa1a546264fa39754ae8a7c08243a6896b04 (patch)
treec5dfd1e0a0b6587cefe29d7685eb4f5b96d3659a /mod
parentafbbc9cd72e48a9eb4fb035eb01cd6e742d0088e (diff)
downloadvolse-hubzilla-49c4aa1a546264fa39754ae8a7c08243a6896b04.tar.gz
volse-hubzilla-49c4aa1a546264fa39754ae8a7c08243a6896b04.tar.bz2
volse-hubzilla-49c4aa1a546264fa39754ae8a7c08243a6896b04.zip
cleanup of task widget - make jquery workflow a bit smoother
Diffstat (limited to 'mod')
-rw-r--r--mod/tasks.php54
1 files changed, 32 insertions, 22 deletions
diff --git a/mod/tasks.php b/mod/tasks.php
index 869d9b3cd..ed267cc92 100644
--- a/mod/tasks.php
+++ b/mod/tasks.php
@@ -1,8 +1,39 @@
<?php
+require_once('include/event.php');
+
+
+function tasks_init(&$a) {
+
+
+// logger('request: ' . print_r($_REQUEST,true));
+
+ $arr = array();
+
+ if(argc() > 1 && argv(1) === 'fetch') {
+ if(argc() > 2 && argv(2) === 'all')
+ $arr['all'] = 1;
+
+ $x = tasks_fetch($arr);
+ if($x['tasks']) {
+ $x['html'] = '';
+ foreach($x['tasks'] as $y) {
+ $x['html'] .= '<div class="tasklist-item"><input type="checkbox" onchange="taskComplete(' . $y['id'] . '); return false;" /> ' . $y['summary'] . '</div>';
+ }
+ }
+ json_return_and_die($x);
+ }
+
+}
+
+
function tasks_post(&$a) {
+
+// logger('post: ' . print_r($_POST,true));
+
+
if(! local_channel())
return;
@@ -71,27 +102,6 @@ function tasks_content(&$a) {
if(! local_channel())
return;
- $ret = array();
- $sql_extra = " and event_status != 'COMPLETED' ";
- if(argc() > 1 && argv(1) === 'all')
- $sql_extra = '';
-dbg(1);
- $r = q("select * from event where type = 'task' and uid = %d $sql_extra ",
- intval(local_channel())
- );
-dbg(0);
-
- $ret['success'] = (($r) ? true : false);
- if($r) {
- $ret['tasks'] = $r;
- }
-
-// return $ret;
-
- return json_encode($ret);
-
-// json_return_and_die($ret);
-
-
+ return '';
} \ No newline at end of file