Widget('plugin_scmgit_user_myrepositories'); $this->setOwner($owner_id, $owner_type); } function getTitle() { return _("My Git personal Repositories List"); } function getCategory() { return _('SCM'); } function getDescription() { return _("Get the list of URLS of your personal Git repository cloned from projects."); } function getContent() { $user = UserManager::instance()->getCurrentUser(); $scmgitplugin = plugin_get_object('scmgit'); $GitRepositories = $this->getMyRepositoriesList(); if (count($GitRepositories)) { $returnhtml = '
git clone git+ssh://'.$user->getUnixName().'@' . $scmgitplugin->getBoxForProject($project) . forge_get_config('repos_path', 'scmgit') .'/'. $project->getUnixName() .'/users/'. $user->getUnixName() .'.git |
'._('No personal git repository').'
'; } } function getMyRepositoriesList() { $returnedArray = array(); $res = db_query_params('SELECT p.group_id FROM plugin_scmgit_personal_repos p, users u WHERE u.user_id=p.user_id AND u.unix_status = $1 AND u.user_id = $2', array('A',$this->owner_id)); if (!$res) { return $returnedArray; } else { $rows = db_numrows($res); for ($i=0; $i<$rows; $i++) { $returnedArray[] = db_result($res,$i,'group_id'); } } return $returnedArray; } } ?>