/** * Handle user removal from ownCloud */ public static function notifyUserDeletion($args) { try { \OCP\DB::beginTransaction(); $query = \OCP\DB::prepare('SELECT `pid`, `title` FROM `*PREFIX*collaboration_project` WHERE `pid` IN (SELECT DISTINCT(`pid`) FROM `*PREFIX*collaboration_works_on` WHERE `member`=?) AND `completed`=?'); $result = $query->execute(array($args['uid'], false)); $projs = $result->fetchAll(); if (count($projs) != 0) { $projects = $projs[0]['title']; $pids = $projs[0]['pid']; for ($i = 1; $i < count($projs); $i++) { $projects .= ', ' . $projs[$i]['title']; $pids .= ' ' . $projs[$i]['pid']; } OC_Collaboration_Post::createPost('Member Removed', 'Owncloud member \'' . $args['uid'] . '\' has been removed from owncloud and hence from the project(s) ' . $projects, OC_User::getUser(), NULL, 'Member removal', OC_Collaboration_Project::getMembersWorkingOnProjects(explode(' ', $pids)), true); } OC_Collaboration_Project::deleteMemberRole(NULL, $args['uid'], NULL, OC_User::getUser(), true); OC_Collaboration_Skillset::removeSkillsOfMember($args['uid']); OC_Collaboration_Post::removePostsByMember($args['uid'], true); \OCP\DB::commit(); OC_Log::write('collaboration', 'User deletion notification posted.', OCP\Util::INFO); } catch (\Exception $e) { OC_Log::write('collaboration', __METHOD__ . ', Exception: ' . $e->getMessage(), OCP\Util::DEBUG); return false; } }
?> </th> <th> <?php p($l->t('Experience')); ?> </th> </tr> <?php foreach ($_['members'] as $member => $cnt) { if (!is_null($member) && $member != '0') { $skills = OC_Collaboration_Skillset::readSkills($member); $skl_cnt = count($skills); if ($skl_cnt == 0) { print_unescaped('<tr><td>' . $member . '</td><td>' . $cnt['proj_cnt'] . '</td><td>' . $cnt['tot_cnt'] . '</td><td colspan="3" >' . $l->t('Skills yet to be added by member') . '</td></tr>'); } else { print_unescaped('<tr><td rowspan="' . $skl_cnt . '" >' . $member . '</td><td rowspan="' . $skl_cnt . '" >' . $cnt['proj_cnt'] . '</td><td rowspan="' . $skl_cnt . '" >' . $cnt['tot_cnt'] . '</td>'); foreach ($skills as $skill) { print_unescaped('<td>' . $skill['skill'] . '</td><td>' . OC_Collaboration_Skillset::getExpertiseString($skill['expertise']) . '</td><td>' . $skill['experience'] . ' ' . $l->t('year(s)') . '</td></tr><tr>'); } print_unescaped('</tr>'); } } } ?> </table> </div>
* 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'); $tpl->assign('title', $l->t('Loading...')); $tpl->assign('msg', $l->t('Adding skills. Please be patient.')); $tpl->printPage(); if (count($_POST) != 0) { // Fetch member list $details = array(array()); $i = 0; foreach ($_POST as $key => $value) { if (strpos($key, 'skill_name') === 0) { $id = substr($key, 10); $details[$i]['skill'] = $value; $details[$i]['expertise'] = $_POST['expertise' . $id]; $details[$i]['experience'] = $_POST['skill_exp' . $id]; $i++; } } $success = OC_Collaboration_Skillset::addSkills(OC_User::getUser(), $details); } print_unescaped('<META HTTP-EQUIV="Refresh" Content="0; URL=' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'add_skills')) . '?success=' . $success . '">');
</th> <th><?php p($l->t('Expertise')); ?> </th> <th><?php print_unescaped($l->t('Experience') . '<br />' . $l->t('(in years)')); ?> </th> <th></th> </tr> <?php $skills = OC_Collaboration_Skillset::readSkills(OC_User::getUser()); foreach ($skills as $skill) { print_unescaped('<tr><td>' . $skill['skill'] . '</td><td>' . OC_Collaboration_Skillset::getExpertiseString($skill['expertise']) . '</td><td>' . $skill['experience'] . '</td><td><img class="old_skill" src="' . OCP\Util::imagePath('core', 'actions/delete.png') . '" width="15px" height="15px" /></td></tr>'); } ?> <tr> <td id="add_skill0" > <input type="button" id="btn_add_skill" value="<?php p($l->t('Add a skill')); ?> " /> </td> </tr> </table> <div id="submit_btn" > <input type="submit" value="<?php p($l->t('Update'));
<?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['skill'])) { OCP\JSON::success(array('delete_succeeded' => OC_Collaboration_Skillset::removeSkill(OC_User::getUser(), $_POST['skill']))); exit; } OC_JSON::error(); exit;