\OCP\App::checkAppEnabled('collaboration');
OCP\App::setActiveNavigationEntry('collaboration');
OCP\Util::addScript('collaboration', 'update_task');
OCP\Util::addScript('collaboration/3rdparty', 'jquery-ui-sliderAccess');
OCP\Util::addScript('collaboration/3rdparty', 'jquery-ui-timepicker-addon');
OCP\Util::addScript('collaboration/3rdparty', 'jquery-te');
OCP\Util::addStyle('collaboration/3rdparty', 'jquery-te');
OCP\Util::addStyle('collaboration/3rdparty', 'jquery-ui-timepicker-addon');
OCP\Util::addStyle('collaboration', 'content_header');
OCP\Util::addStyle('collaboration', 'tabs');
OCP\Util::addStyle('collaboration', 'update_task');
$l = OC_L10N::get('collaboration');
$tpl = new OCP\Template('collaboration', 'update_task', 'user');
$bol = OC_Collaboration_Project::isAdmin();
if ($bol == true) {
    if (isset($_POST['tid'])) {
        $tpl->assign('title', $l->t('Update Task'));
        $tpl->assign('submit_btn_name', $l->t('Update'));
        $tpl->assign('tid', $_POST['tid']);
        $tpl->assign('task_details', OC_Collaboration_Task::readTask($_POST['tid']));
    } else {
        $tpl->assign('title', $l->t('Create Task'));
        $tpl->assign('submit_btn_name', $l->t('Create'));
        $tpl->assign('projects', OC_Collaboration_Project::getProjects(OC_User::getUser()));
    }
    $tpl->printPage();
} else {
    header('Location: ' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'dashboard')));
    \OCP\Util::writeLog('collaboration', 'Permission denied for ' . OC_User::getUser() . ' to create task.', \OCP\Util::WARN);
    exit;
}
 /**
  * @brief Delete a member from a role of a project
  * @param Project ID from which the role has to be removed
  * @param Member whose role has to be removed
  * @param Role to be removed
  * @param Member who removed the other member from his/her role
  * @param Whether the calling method has already initiated the (database) transaction
  * @return int|boolean (ID of the post intimating the role removal|false)
  */
 public static function deleteMemberRole($pid, $member, $role, $user, $inTransaction = false)
 {
     try {
         if (!$inTransaction) {
             \OCP\DB::beginTransaction();
         }
         // Remove from all roles
         if (is_null($pid) && is_null($role)) {
             $query = \OCP\DB::prepare('DELETE FROM `*PREFIX*collaboration_works_on` WHERE `member`=?');
             $result = $query->execute(array($member));
         } else {
             $query = \OCP\DB::prepare('DELETE FROM `*PREFIX*collaboration_works_on` WHERE `pid`=? AND `member`=? AND `role`=?');
             $result = $query->execute(array($pid, $member, $role));
         }
         // Member removed from owncloud
         if (is_null($pid)) {
             OC_Collaboration_Task::removeMembersTasks($member, $user, true);
         } else {
             if (!self::isMemberWorkingOnProject($member, $pid)) {
                 OC_Collaboration_Task::unassignMembersTasks($member, $pid, $user, true);
             }
         }
         $post_id = OC_Collaboration_Post::createPost('Removed from role', 'You are removed from \'' . $role . '\' role from project \'' . self::getProjectTitle($pid) . '\'.', $user, $pid, 'Role Deletion', array($member), true);
         if (!$inTransaction) {
             \OCP\DB::commit();
         }
         return $post_id;
     } catch (\Exception $e) {
         OC_Log::write('collaboration', __METHOD__ . ', Exception: ' . $e->getMessage(), OCP\Util::DEBUG);
         return false;
     }
 }
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('collaboration');
OCP\App::setActiveNavigationEntry('collaboration');
OCP\Util::addScript('collaboration', 'display_message');
OCP\Util::addStyle('collaboration', 'tabs');
OCP\Util::addStyle('collaboration', 'content_header');
OCP\Util::addStyle('collaboration', 'display_message');
$l = OC_L10N::get('collaboration');
$tpl = new OCP\Template('collaboration', 'display_message', 'user');
if ($_GET['task'] != false && $_GET['task'] != 0) {
    $tpl->assign('title', $l->t('Success'));
    $tpl->assign('msg', $l->t('Task \'%s\' has been created successfully.', array($_GET['title'])));
    OC_Collaboration_Task::addEvent($_GET['task'], $_GET['event_id']);
} else {
    $tpl->assign('title', $l->t('Failed'));
    $tpl->assign('msg', $l->t('Task \'%s\' cannot be created. Kindly try after some time.', array($_GET['title'])));
}
$tpl->printPage();
						<?php 
    $ev_stat = array();
    $status = NULL;
    if (!isset($_['tid'])) {
        $ev_stat = OC_Collaboration_Task::getEventStatus('Created', 'Creator');
        $status = 'New';
    } else {
        $ev_stat = OC_Collaboration_Task::getEventStatus($_['task_details']['status'], 'Creator');
        $status = $_['task_details']['status'];
        $member = $_['task_details']['member'];
        print_unescaped('<span id="task_status">' . OC_Collaboration_Task::getStatusInFormat($status, $member, OC_User::getUser()) . '</span><br />');
    }
    $i = 0;
    foreach ($ev_stat as $event => $status) {
        print_unescaped('<input class="event" id="event_' . $i . '" value="' . $status . '" name="status" type="radio" data-next-status="' . $status . '" />');
        print_unescaped('<label for="event_' . $i . '" >' . OC_Collaboration_Task::translateEvent($event) . '</label>');
        switch ($event) {
            case 'Assign':
                print_unescaped('<span class="event_info" id="event_info_' . $i . '" >
															<select id="members" name="member" ></select>
															<br />
															<a id="skillset_link" href="" target="_blank" >' . $l->t('View availablility & skillset') . '</a><br />
															<input type="checkbox" id="send_mail" name="send_mail" />
															<label for="send_mail" >' . $l->t('Inform member via mail') . '</label></span>');
                break;
            case 'Cancel':
            case 'Reject':
                print_unescaped('<span class="event_info" id="event_info_' . $i . '" >
															<input type="text" name="reason" placeholder="' . $l->t('Reason') . '" />
														</span>');
                break;
    $text = '';
    foreach ($tasks as $each) {
        if (!isset($each['tid']) || $each['tid'] == '') {
            break;
        }
        $datetime = OC_Collaboration_Time::convertDBTimeToUITime($each['ending_time']);
        $text .= '<div class="unit">
					<div class="task_title">' . $each['title'] . '</div>

					<div class="contents">	
						<div class="description">' . $each['description'] . '</div>							
							<br />
							<form class="view_details" action="' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'task_details')) . '" method="post" >
								<input type="hidden" name="tid" value="' . $each['tid'] . '" />
								<input type="submit" value="' . $l->t('View details') . '" />
						</form>' . (strcasecmp(OC_Collaboration_Task::getTaskCreator($each['tid']), OC_User::getUser()) == 0 ? '<div class="edit" >
							<button class="btn_edit" id="btn_edit_' . $each['tid'] . '" >' . $l->t('Edit') . '</button>
							</div>' : '') . '</div>

					<div class="details">
						<div class="task_status">' . $l->t('Status: %s', array(OC_Collaboration_Task::getStatusInFormat($each['status'], $each['member'], $each['creator']))) . '</div>
						
						<div class="deadline_details">' . $l->t('Deadline: %s', array($l->l('datetime', $datetime))) . '</div>
					</div>
				</div>';
    }
    OCP\JSON::success(array('tasks' => $text));
    exit;
}
OC_JSON::error();
exit;
?>
</th>
		</tr>
		<?php 
for ($i = 0; $i < count($_['status_details']); $i++) {
    print_unescaped('
				<tr>
				  <td>' . OC_Collaboration_Task::getStatusInFormat($_['status_details'][$i]['status'], $_['status_details'][$i]['member'], $_['task_details']['creator']) . '</td>
				  <td>' . OC_Collaboration_Time::convertDBTimeToUITime($_['status_details'][$i]['time']) . '</td><td>' . $_['status_details'][$i]['comment'] . '</td>
				</tr>');
}
?>
	 </table>

	 <?php 
if (strcasecmp(OC_Collaboration_Task::getTaskCreator($_['task_details']['tid']), OC_User::getUser()) == 0) {
    ?>
		 <form action="<?php 
    print_unescaped(OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'update_task')));
    ?>
" method="post" >
			 <input type="hidden" name="tid" value="<?php 
    p($_['task_details']['tid']);
    ?>
" />
			 <input type="submit" value="<?php 
    p($l->t('Edit'));
    ?>
" id="edit_task_btn" disabled />
		 </form>
	 <?php 
* version 3 of the License, or any later version.
* 
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*  
* You should have received a copy of the GNU Lesser General Public 
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
* 
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
OCP\JSON::checkAppEnabled('collaboration');
if (isset($_POST['tid']) && isset($_POST['event']) && isset($_POST['reason'])) {
    if (strcasecmp(OC_Collaboration_Task::getWorkingMember($_POST['tid']), OC_User::getUser()) != 0) {
        throw new Exception(OC_User::getUser() . ' is trying to change status of task ' . $_POST['tid']);
        OC_JSON::error();
        exit;
    }
    $tid = $_POST['tid'];
    $title = OC_Collaboration_Task::getTaskTitle($tid);
    $status = OC_Collaboration_Task::getStatusFromPerformerEvent($_POST['event']);
    $creator = OC_User::getUser();
    OC_Collaboration_Task::changeStatus($tid, $title, $status, $creator, NULL, $_POST['reason'], false);
    OCP\JSON::success(array());
    exit;
}
OC_Log::write('collaboration', $_POST['tid'] . ' ' . $_POST['event'] . ' ' . $_POST['reason'], OCP\Util::DEBUG);
OC_JSON::error();
exit;
OCP\Util::addStyle('collaboration', 'content_header');
OCP\Util::addStyle('collaboration', 'tasks');
$tpl = new OCP\Template("collaboration", "tasks", "user");
$args = array('project' => NULL, 'status' => NULL, 'assigned_by' => NULL, 'assigned_to' => NULL);
if (isset($_GET['project']) && $_GET['project'] != 'ALL') {
    if (!OC_Collaboration_Project::isMemberWorkingOnProjectByTitle(OC_User::getUser(), $_GET['project'])) {
        header('Location: ' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'dashboard')));
        throw new Exception(OC_User::getUser() . ' is trying to access project ' . $_GET['project']);
        exit;
    } else {
        $tpl->assign('project', $_GET['project']);
        $args['project'] = $_GET['project'];
    }
}
if (isset($_GET['status']) && $_GET['status'] != 'ALL') {
    $tpl->assign('status', $_GET['status']);
    $args['status'] = $_GET['status'];
}
if (!isset($_GET['assigned_by']) && !isset($_GET['assigned_to'])) {
    $_GET['assigned_by'] = $_GET['assigned_to'] = 'on';
}
if (isset($_GET['assigned_by'])) {
    $tpl->assign('assigned_by', $_GET['assigned_by']);
    $args['assigned_by'] = OC_User::getUser();
}
if (isset($_GET['assigned_to'])) {
    $tpl->assign('assigned_to', $_GET['assigned_to']);
    $args['assigned_to'] = OC_User::getUser();
}
$tpl->assign('tasks', OC_Collaboration_Task::readTasks($args));
$tpl->printPage();
                p($l->t('Edit'));
                ?>
											</button>
										</div>
						  	  <?php 
            }
            ?>
								<?php 
        }
        ?>
                <?php 
        if (strcasecmp(OC_Collaboration_Task::getWorkingMember($each['tid']), OC_User::getUser()) == 0) {
            print_unescaped('<div class="status_event" data-tid="' . $each['tid'] . '" >');
            $ev_stat = OC_Collaboration_Task::getEventStatus($each['status'], 'Performer');
            foreach ($ev_stat as $event => $status) {
                print_unescaped('<button class="event_btn" value="' . $event . '" >' . OC_Collaboration_Task::translateEvent($event) . '</button>');
            }
            print_unescaped('</div>');
        }
        ?>
            </div>
					</div>
				</div>
      </div>
    </div>
	<?php 
    }
}
?>
</div>
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('collaboration');
OCP\App::setActiveNavigationEntry('collaboration');
OCP\Util::addScript('collaboration', 'dashboard');
OCP\Util::addStyle('collaboration', 'tabs');
OCP\Util::addStyle('collaboration', 'content_header');
OCP\Util::addStyle('collaboration', 'dashboard');
$tpl = new OCP\Template("collaboration", "dashboard", "user");
if (isset($_GET['project']) && $_GET['project'] != 'ALL') {
    if (!OC_Collaboration_Project::isMemberWorkingOnProjectByTitle(OC_User::getUser(), $_GET['project'])) {
        header('Location: ' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'dashboard')));
        \OCP\Util::writeLog('collaboration', OC_User::getUser() . ' is trying to access project ' . $_GET['project'], \OCP\Util::WARN);
        exit;
    } else {
        $tpl->assign('project', $_GET['project']);
        $tpl->assign('posts', OC_Collaboration_Post::readPosts(OC_User::getUser(), $_GET['project']));
        $task_params["assigned_by"] = OC_User::getUser();
        $task_params["project"] = $_GET['project'];
        $tpl->assign('tasks', OC_Collaboration_Task::readTasks($task_params));
    }
} else {
    $tpl->assign('posts', OC_Collaboration_Post::readPosts(OC_User::getUser()));
    $task_params["assigned_to"] = OC_User::getUser();
    $tpl->assign('tasks', OC_Collaboration_Task::readTasks($task_params));
}
$tpl->printPage();
<?php

/**
* ownCloud - bookmarks plugin
*
* @authors Dr.J.Akilandeswari, R.Ramki, R.Sasidharan, P.Suresh
* 
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either 
* version 3 of the License, or any later version.
* 
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*  
* You should have received a copy of the GNU Lesser General Public 
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
* 
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
OCP\JSON::checkAppEnabled('collaboration');
if (isset($_POST['pid'])) {
    OCP\JSON::success(array('has_pending_tasks' => OC_Collaboration_Task::hasPendingTasks($_POST['pid'])));
    exit;
}
OC_JSON::error();
exit;
            $tid = OC_Collaboration_Task::createTask($_POST['title'], $_POST['description'], OC_User::getUser(), $_POST['pid'], $_POST['priority'], $_POST['deadline_time'], 'Unassigned', NULL);
        }
        if ($tid != false && isset($_POST['send_mail'])) {
            OC_Collaboration_Mail::sendTaskCreationMail($_POST['title'], $_POST['description'], $_POST['pid'], $_POST['member'], $_POST['deadline_time']);
        }
        $eve->assign('title', $l->t('Loading...'));
        $eve->assign('permission_granted', 'true');
        $eve->assign('task', $tid);
        $eve->printPage();
    } else {
        if (!isset($_POST['status'])) {
            $_POST['status'] = NULL;
        }
        if (!isset($_POST['member'])) {
            $_POST['member'] = NULL;
        }
        if (!isset($_POST['reason'])) {
            $_POST['reason'] = NULL;
        }
        $status = OC_Collaboration_Task::updateTask($_POST['tid'], $_POST['title'], $_POST['description'], OC_User::getUser(), $_POST['pid'], $_POST['priority'], $_POST['deadline_time'], $_POST['status'], $_POST['member'], $_POST['reason']);
        if ($status != false && isset($_POST['send_mail'])) {
            OC_Collaboration_Mail::sendTaskCreationMail($_POST['title'], $_POST['description'], $_POST['pid'], $_POST['member'], $_POST['deadline_time']);
        }
        $eve = new OCP\Template('collaboration', 'event_edit_form', 'user');
        $eve->assign('title', $l->t('Loading...'));
        $eve->assign('permission_granted', 'true');
        $eve->assign('task', $_POST['tid']);
        $eve->printPage();
        //		print_unescaped('<META HTTP-EQUIV="Refresh" Content="0; URL=' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'submit_change_task')) . '?task=' . $_POST['tid'] . '&title=' . $_POST['title'] . '">');
    }
}
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('collaboration');
OCP\App::setActiveNavigationEntry('collaboration');
OCP\Util::addScript('collaboration', 'skillset_details');
OCP\Util::addStyle('collaboration', 'tabs');
OCP\Util::addStyle('collaboration', 'content_header');
OCP\Util::addStyle('collaboration', 'skillset_details');
$tpl = new OCP\Template("collaboration", "skillset_details", "user");
if (isset($_GET['project'])) {
    $skills = OC_Collaboration_Task::getTasksCount($_GET['project']);
    if (!OC_Collaboration_Project::isMemberWorkingOnProject(OC_User::getUser(), $_GET['project']) || $skills == false) {
        header('Location: ' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'dashboard')));
        \OCP\Util::writeLog('collaboration', OC_User::getUser() . ' is trying to access project ' . $_GET['project'], \OCP\Util::WARN);
        exit;
    } else {
        $tpl->assign('project', $_GET['project']);
        $tpl->assign('members', $skills);
    }
} else {
    header('Location: ' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'dashboard')));
    exit;
}
$tpl->printPage();