forked from bitweaver/tasks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
78 lines (72 loc) · 2.5 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* $Header$
*
* Copyright (c) 2006 bitweaver.org
* All Rights Reserved. See below for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
*
* @package tasks
* @subpackage functions
*/
/**
* required setup
*/
require_once( '../kernel/setup_inc.php' );
$gBitSystem->verifyPackage( 'tasks' );
include_once( TASKS_PKG_PATH.'Tasks.php' );
$userstate = $gBitUser->getPreference( 'task_process', 0 );
if ( $userstate ) {
$gTask = new Tasks( null, $userstate );
$gTask->load();
if( !empty( $_REQUEST['finish'] ) ) {
$updatetask = array();
$updatetask['new_room'] = -1;
$gTask->store( $updatetask );
$gBitUser->storePreference('task_process', 0 );
$userstate = 0;
} else if( !empty( $_REQUEST['refer'] ) ) {
$updatetask = array();
$updatetask['new_room'] = $gTask->mInfo['department'] + 80;
$gTask->store( $updatetask );
$gBitUser->storePreference('task_process', 0 );
$userstate = 0;
} else if( !empty( $_REQUEST['new_tag'] ) ) {
$updatetask = array();
$updatetask['new_tag'] = $_REQUEST['new_tag'];
$gTask->store( $updatetask );
} else if( !empty( $_REQUEST['new_dept'] ) and ( $_REQUEST['new_dept'] <> $gTask->mInfo['department'] ) ) {
$updatetask = array();
$updatetask['new_dept'] = $_REQUEST['new_dept'];
$updatetask['new_tag'] = 0;
$gTask->store( $updatetask );
}
} else if( !empty( $_REQUEST['content_id'] ) ) {
$gTask = new Tasks( null, $_REQUEST['content_id'] );
$gTask->load();
$gBitUser->storePreference('task_process', $_REQUEST['content_id'] );
$userstate = $_REQUEST['content_id'];
} else {
$gTask = new Tasks();
}
if ( $userstate <> 0 ) {
$gBitSmarty->assign_by_ref( 'userstate', $userstate );
$gBitSmarty->assign_by_ref( 'taskInfo', $gTask->mInfo );
$dept_tree = $gTask->listQueues();
$gBitSmarty->assign_by_ref( 'departments', $dept_tree['depts'] );
$gBitSmarty->assign_by_ref( 'tags', $dept_tree['tags'] );
$gBitSmarty->assign_by_ref( 'subtags', $dept_tree['subtags'] );
require_once( PROPERTY_PKG_PATH.'Property.php');
$gProperty = new Property( $gTask->mPropertyId, null );
$gProperty->load();
if ( $gProperty->isValid() ) {
$gProperty->loadXrefList();
$gBitSmarty->assign_by_ref( 'propertyInfo', $gProperty->mInfo );
}
$gBitSystem->setBrowserTitle("Task List Item");
$gBitSystem->display( 'bitpackage:tasks/show_task.tpl', NULL, array( 'display_mode' => 'display' ));
} else {
header ("location: ".TASKS_PKG_URL."view.php");
die;
}
?>