* * 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', 'projects'); OCP\Util::addStyle('collaboration', 'tabs'); OCP\Util::addStyle('collaboration', 'content_header'); OCP\Util::addStyle('collaboration', 'projects'); $tpl = new OCP\Template("collaboration", "projects", "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'))); throw new Exception(OC_User::getUser() . ' is trying to access project ' . $_GET['project']); exit; } else { $tpl->assign('project', $_GET['project']); $tpl->assign('projects', OC_Collaboration_Project::getProjectDetails(OC_User::getUser(), $_GET['project'])); } } else { $tpl->assign('projects', OC_Collaboration_Project::getProjectDetails(OC_User::getUser())); } $tpl->printPage();
* * 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'); $l = OC_L10N::get('collaboration'); if (isset($_POST['member']) && isset($_POST['start']) && isset($_POST['count'])) { if (strcasecmp($_POST['member'], OC_User::getUser()) != 0) { \OCP\Util::writeLog('collaboration', OC_User::getUser() . ' is trying to access projects of ' . $_POST['member'], \OCP\Util::WARN); OC_JSON::error(); exit; } $projects = OC_Collaboration_Project::getProjectDetails(OC_User::getUser(), NULL, $_POST['start'], $_POST['count']); $text = ''; foreach ($projects as $each) { $datetime = explode(' ', $each['starting_date']); $datetime1 = explode(' ', $each['ending_date']); if (!isset($each['title']) || $each['title'] == '') { break; } $datetime = explode(' ', $each['time']); $text .= '<div class="unit"> <div class="project_title">' . $each['title'] . '</div> <div class="contents"><div class="description" >' . $each['description'] . '</div>' . (!OC_Collaboration_Project::isAdmin() ? '' : '<br /> <br /> <div class="edit" > <button class="btn_edit" id="btn_edit_' . $each['pid'] . '" >' . $l->t('Edit') . '</button>