本文整理汇总了PHP中user_getname函数的典型用法代码示例。如果您正苦于以下问题:PHP user_getname函数的具体用法?PHP user_getname怎么用?PHP user_getname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_getname函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getBodyHeaderActions
function getBodyHeaderActions($params)
{
$html = '';
$html .= '<ul>';
if (user_isloggedin()) {
$html .= '<li class="header_actions_nolink">' . $GLOBALS['Language']->getText('include_menu', 'logged_in') . ': ' . user_getname() . '</li>';
$html .= '<li><a href="/account/logout.php">' . $GLOBALS['Language']->getText('include_menu', 'logout') . '</a></li>';
if (isset($GLOBALS['sys_use_project_registration']) && $GLOBALS['sys_use_project_registration'] == 1 || !isset($GLOBALS['sys_use_project_registration'])) {
$html .= '<li><a href="/project/register.php">' . $GLOBALS['Language']->getText('include_menu', 'register_new_proj') . '</a></li>';
}
if (!HTTPRequest::instance()->isPost()) {
$add_bookmark_url = http_build_query(array('bookmark_url' => $_SERVER['REQUEST_URI'], 'bookmark_title' => str_replace($GLOBALS['sys_name'] . ': ', '', $params['title'])));
$html .= '<li class="bookmarkpage"><a href="/my/bookmark_add.php?' . $add_bookmark_url . '">' . $GLOBALS['Language']->getText('include_menu', 'bookmark_this_page') . '</a></li>';
}
} else {
$html .= '<li class="header_actions_nolink highlight">' . $GLOBALS['Language']->getText('include_menu', 'not_logged_in') . '</li>';
$login_url = '/account/login.php';
if ($_SERVER['REQUEST_URI'] != $login_url) {
$login_url .= '?return_to=' . urlencode($_SERVER['REQUEST_URI']);
}
$html .= '<li><a href="' . $this->purifier->purify($login_url) . '">' . $GLOBALS['Language']->getText('include_menu', 'login') . '</a></li>';
$em =& EventManager::instance();
$display_new_user = true;
$em->processEvent('display_newaccount', array('allow' => &$display_new_user));
if ($display_new_user) {
$html .= '<li><a href="/account/register.php">' . $GLOBALS['Language']->getText('include_menu', 'new_user') . '</a></li>';
}
}
$html .= '</ul>';
return $html;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:31,代码来源:DivBasedTabbedLayout.class.php
示例2: svn_data_get_revision_detail
function svn_data_get_revision_detail($group_id, $commit_id, $rev_id = 0, $order = '')
{
$order_str = "";
if ($order) {
if ($order != 'filename') {
// SQLi Warning: no real possibility to escape $order here.
// We rely on a proper filtering of user input by calling methods.
$order_str = " ORDER BY " . $order;
} else {
$order_str = " ORDER BY dir, file";
}
}
//check user access rights
$pm = ProjectManager::instance();
$project = $pm->getProject($group_id);
$forbidden = svn_utils_get_forbidden_paths(user_getname(), $project->getSVNRootPath());
$where_forbidden = "";
if (!empty($forbidden)) {
while (list($no_access, ) = each($forbidden)) {
$where_forbidden .= " AND svn_dirs.dir not like '%" . db_es(substr($no_access, 1)) . "%' ";
}
}
// if the subversion revision id is given then it akes precedence on
// the internal commit_id (this is to make it easy for users to build
// URL to access a revision
if ($rev_id) {
// To be done -> get the commit ID from the svn-commit table
$sql = "SELECT svn_commits.description, svn_commits.date, svn_commits.revision, svn_checkins.type,svn_checkins.commitid,svn_dirs.dir,svn_files.file " . "FROM svn_dirs, svn_files, svn_checkins, svn_commits " . "WHERE svn_checkins.fileid=svn_files.id " . "AND svn_checkins.dirid=svn_dirs.id " . "AND svn_checkins.commitid=svn_commits.id " . "AND svn_commits.revision=" . db_ei($rev_id) . " " . "AND svn_commits.group_id=" . db_ei($group_id) . " " . $where_forbidden . $order_str;
} else {
$sql = "SELECT svn_commits.description, svn_commits.date, svn_commits.revision, svn_checkins.type,svn_checkins.commitid,svn_dirs.dir,svn_files.file " . "FROM svn_dirs, svn_files, svn_checkins, svn_commits " . "WHERE svn_checkins.fileid=svn_files.id " . "AND svn_checkins.dirid=svn_dirs.id " . "AND svn_checkins.commitid=svn_commits.id " . "AND svn_commits.id=" . db_ei($commit_id) . " " . $where_forbidden . $order_str;
}
$result = db_query($sql);
return $result;
}
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:34,代码来源:svn_data.php
示例3: RemovePage
function RemovePage(&$request)
{
global $WikiTheme;
$page = $request->getPage();
$pagelink = WikiLink($page);
if ($request->getArg('cancel')) {
$request->redirect(WikiURL($page));
// noreturn
}
$current = $page->getCurrentRevision();
if (!$current or !($version = $current->getVersion())) {
$html = HTML(HTML::h2(_("Already deleted")), HTML::p(_("Sorry, this page is not in the database.")));
} elseif (!$request->isPost() || !$request->getArg('verify')) {
$removeB = Button('submit:verify', _("Remove Page"), 'wikiadmin');
$cancelB = Button('submit:cancel', _("Cancel"), 'button');
// use generic wiki button look
$html = HTML(HTML::h2(fmt("You are about to remove '%s'!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, 'pagename' => $page->getName(), 'action' => 'remove')), HTML::div(array('class' => 'toolbar'), $removeB, $WikiTheme->getButtonSeparator(), $cancelB)), HTML::hr());
$sample = HTML::div(array('class' => 'transclusion'));
// simple and fast preview expanding only newlines
foreach (explode("\n", firstNWordsOfContent(100, $current->getPackedContent())) as $s) {
$sample->pushContent($s, HTML::br());
}
$html->pushContent(HTML::div(array('class' => 'wikitext'), $sample));
} elseif ($request->getArg('currentversion') != $version) {
$html = HTML(HTML::h2(_("Someone has edited the page!")), HTML::p(fmt("Since you started the deletion process, someone has saved a new version of %s. Please check to make sure you still want to permanently remove the page from the database.", $pagelink)));
} else {
// Codendi specific: remove the deleted wiki page from ProjectWantedPages
$projectPageName = 'ProjectWantedPages';
$pagename = $page->getName();
$dbi = $request->getDbh();
require_once PHPWIKI_DIR . "/lib/loadsave.php";
$pagehandle = $dbi->getPage($projectPageName);
if ($pagehandle->exists()) {
// don't replace default contents
$current = $pagehandle->getCurrentRevision();
$version = $current->getVersion();
$text = $current->getPackedContent();
$meta = $current->_data;
}
$text = str_replace("* [{$pagename}]", "", $text);
$meta['summary'] = $GLOBALS['Language']->getText('wiki_lib_wikipagewrap', 'page_added', array($pagename));
$meta['author'] = user_getname();
$pagehandle->save($text, $version + 1, $meta);
//Codendi specific: remove permissions for this page @codenditodo: may be transferable otherwhere.
require_once 'common/wiki/lib/WikiPage.class.php';
$wiki_page = new WikiPage(GROUP_ID, $_REQUEST['pagename']);
$wiki_page->resetPermissions();
// Real delete.
//$pagename = $page->getName();
$dbi = $request->getDbh();
$dbi->deletePage($pagename);
$dbi->touch();
$link = HTML::a(array('href' => 'javascript:history.go(-2)'), _("Back to the previous page."));
$html = HTML(HTML::h2(fmt("Removed page '%s' successfully.", $pagename)), HTML::div($link), HTML::hr());
}
GeneratePage($html, _("Remove Page"));
}
开发者ID:nterray,项目名称:tuleap,代码行数:57,代码来源:removepage.php
示例4: getBodyHeader
function getBodyHeader($params)
{
$output = '
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="header_osdn">' . $this->getOsdnNavBar() . '</td>
<td class="header_actions">
<ul>';
if (user_isloggedin()) {
$output .= '<li class="header_actions_nolink">' . $GLOBALS['Language']->getText('include_menu', 'logged_in') . ': ' . user_getname() . '</li>';
$output .= '<li><a href="/account/logout.php">' . $GLOBALS['Language']->getText('include_menu', 'logout') . '</a></li>';
if (isset($GLOBALS['sys_use_project_registration']) && $GLOBALS['sys_use_project_registration'] == 1 || !isset($GLOBALS['sys_use_project_registration'])) {
$output .= '<li><a href="/project/register.php">' . $GLOBALS['Language']->getText('include_menu', 'register_new_proj') . '</a></li>';
}
$request = HTTPRequest::instance();
if (!$request->isPost()) {
$bookmark_title = urlencode(str_replace($GLOBALS['sys_name'] . ': ', '', $params['title']));
$output .= '<li class="bookmarkpage"><a href="/my/bookmark_add.php?bookmark_url=' . urlencode($_SERVER['REQUEST_URI']) . '&bookmark_title=' . $bookmark_title . '">' . $GLOBALS['Language']->getText('include_menu', 'bookmark_this_page') . '</a></li>';
}
} else {
$output .= '<li class="header_actions_nolink highlight">' . $GLOBALS['Language']->getText('include_menu', 'not_logged_in') . '</li>';
$output .= '<li><a href="/account/login.php">' . $GLOBALS['Language']->getText('include_menu', 'login') . '</a></li>';
$em =& EventManager::instance();
$display_new_user = true;
$params = array('allow' => &$display_new_user);
$em->processEvent('display_newaccount', $params);
if ($display_new_user) {
$output .= '<li><a href="/account/register.php">' . $GLOBALS['Language']->getText('include_menu', 'new_user') . '</a></li>';
}
}
$output .= '</ul>
</td>
</tr>
<tr>
<td class="header_logo">
<a class="header_logo" href="/"><img src="' . $this->imgroot . 'organization_logo.png" /></a>
</td>
<td class="header_searchbox"><br />' . $this->getSearchBox() . '</td>
</tr>
</table>';
return $output;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:42,代码来源:TabbedLayout.class.php
示例5: cvs_get_revisions
function cvs_get_revisions(&$project, $offset, $chunksz, $_tag = 100, $_branch = 100, $_commit_id = '', $_commiter = 100, $_srch = '', $order_by = '', $pv = 0)
{
//if tag selected, and more to where clause
if ($_tag != 100) {
//for open tasks, add status=100 to make sure we show all
$tag_str = "AND cvs_checkins.stickytag='{$_tag}'";
} else {
//no status was chosen, so don't add it to where clause
$tag_str = '';
}
//if status selected, and more to where clause
if ($_branch != 100) {
//for open tasks, add status=100 to make sure we show all
$branch_str = "AND cvs_checkins.branchid='{$_branch}'";
} else {
//no status was chosen, so don't add it to where clause
$branch_str = '';
}
//if assigned to selected, and more to where clause
if ($_commit_id != '') {
$commit_str = "AND cvs_commits.id='{$_commit_id}' AND cvs_checkins.commitid != 0 ";
} else {
$commit_str = '';
}
if ($_commiter != 100) {
$commiter_str = "AND user.user_id=cvs_checkins.whoid " . "AND user.user_name='{$_commiter}' ";
} else {
//no assigned to was chosen, so don't add it to where clause
$commiter_str = '';
}
if ($_srch != '') {
$srch_str = "AND cvs_descs.description like '%" . $_srch . "%' ";
} else {
$srch_str = "";
}
//build page title to make bookmarking easier
//if a user was selected, add the user_name to the title
//same for status
//commits_header(array('title'=>'Browse Commits'.
// (($_assigned_to)?' For: '.user_getname($_assigned_to):'').
// (($_tag && ($_tag != 100))?' By Status: '. get_commits_status_nam//e($_status):''),
// 'help' => 'CommitsManager.html'));
// get repository id
$query = "SELECT id from cvs_repositories where cvs_repositories.repository='/cvsroot/" . $project->getUnixName(false) . "' ";
$rs = db_query($query);
$repo_id = db_result($rs, 0, 0);
$repo_id = $repo_id ? $repo_id : -1;
$select = 'SELECT distinct cvs_checkins.commitid as id, cvs_checkins.commitid as revision, cvs_descs.id as did, cvs_descs.description, cvs_commits.comm_when as c_when, cvs_commits.comm_when as date, cvs_commits.comm_when as f_when, user.user_name as who ';
$from = "FROM cvs_descs, cvs_checkins, user, cvs_commits ";
$where = "WHERE cvs_checkins.descid=cvs_descs.id " . "AND " . (check_cvs_access(user_getname(), $project->getUnixName(false), '') ? 1 : 0) . " " . "AND cvs_checkins.commitid=cvs_commits.id " . "AND user.user_id=cvs_checkins.whoid " . "AND cvs_checkins.repositoryid=" . $repo_id . " " . "{$commiter_str} " . "{$commit_str} " . "{$srch_str} " . "{$branch_str} ";
if (!$pv) {
$limit = " LIMIT {$offset},{$chunksz}";
}
if (!$order_by) {
$order_by = " ORDER BY id desc, f_when desc ";
}
$sql = $select . $from . $where . $order_by . $limit;
$result = db_query($sql);
/* expensive way to have total rows number didn'get a cheaper one */
$sql1 = $select . $from . $where;
$result1 = db_query($sql1);
$totalrows = db_numrows($result1);
return array($result, $totalrows);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:64,代码来源:commit_utils.php
示例6: svn_utils_check_access
/**
* Function svn_utils_check_access : check if the user $username can access the path $svnpath of the project $gname
* regarding the global arrays $SVNACCESS and $SVNGROUPS.
*
* @param string $username the login name of the user we want to check the perms
* @param string $project_svnroot the unix name of the group (project)
* @param string $svnpath the subversion path to check
* @global array $SVNACCESS the array populated with the rights for each user for this project $gname
* @global array $SVNGROUPS the array populated with the members of each ugroup of this project
*
* Warning:
* The code source of this function is writing in Python too.
* If you modify part of this code, thanks to check if
* the corresponding Python code needs to be updated too.
* (see src/utils/svn/svnaccess.py)
*/
function svn_utils_check_access($username, $project_svnroot, $svnpath)
{
global $SVNACCESS;
if (user_getname() == $username && user_is_super_user()) {
return true;
}
$em =& EventManager::instance();
$em->processEvent('svn_check_access_username', array('username' => &$username, 'project_svnroot' => $project_svnroot));
$username = strtolower($username);
if ($SVNACCESS == "None") {
svn_utils_parse_access_file($project_svnroot);
}
$perm = '';
$path = '/' . $svnpath;
while (true) {
if (array_key_exists($username, $SVNACCESS) && array_key_exists($path, $SVNACCESS[$username])) {
$perm = $SVNACCESS[$username][$path];
//echo "match: SVNACCESS[$username][$path] $perm";
break;
} else {
if (array_key_exists('*', $SVNACCESS) && array_key_exists($path, $SVNACCESS['*'])) {
$perm = $SVNACCESS['*'][$path];
//echo "match: SVNACCESS[*][$path] $perm";
break;
} else {
// see if it maches higher in the path
if ($path == '/') {
break;
}
$idx = strrpos($path, '/');
if ($idx == 0) {
$path = '/';
} else {
$path = substr($path, 0, $idx);
}
}
}
}
if (strpos($perm, 'r') === false) {
return false;
} else {
return true;
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:60,代码来源:svn_utils.php
示例7: patch_header
// $Id: mod_patch.php,v 1.3 2003/11/26 15:01:17 helix Exp $
patch_header(array('title' => 'Modify a Patch'));
$sql = "SELECT * FROM patch WHERE patch_id='{$patch_id}' AND group_id='{$group_id}'";
$result = db_query($sql);
if (db_numrows($result) > 0) {
echo '
<H2>[ Patch #' . $patch_id . ' ] ' . db_result($result, 0, 'summary') . '</H2>';
echo '
<FORM ACTION="' . $PHP_SELF . '" METHOD="POST" enctype="multipart/form-data">
<INPUT TYPE="HIDDEN" NAME="func" VALUE="postmodpatch">
<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . $group_id . '">
<INPUT TYPE="HIDDEN" NAME="patch_id" VALUE="' . $patch_id . '">
<TABLE WIDTH="100%">
<TR>
<TD><B>Submitted By:</B><BR>' . user_getname(db_result($result, 0, 'submitted_by')) . '</TD>
<TD><B>Group:</B><BR>' . group_getname($group_id) . '</TD>
</TR>
<TR>
<TD><B>Date Submitted:</B><BR>
' . date($sys_datefmt, db_result($result, 0, 'open_date')) . '
</TD>
<TD><FONT SIZE="-1">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Submit Changes">
</TD>
</TR>
<TR>
<TD><B>Category:</B><BR>';
echo patch_category_box($group_id, 'patch_category_id', db_result($result, 0, 'patch_category_id'));
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:31,代码来源:mod_patch.php
示例8: show_grouphistory
function show_grouphistory($group_id)
{
/*
show the group_history rows that are relevant to
this group_id
*/
global $sys_datefmt;
$result = group_get_history($group_id);
$rows = db_numrows($result);
if ($rows > 0) {
echo '
<H3>Group Change History</H3>
<P>';
$title_arr = array();
$title_arr[] = 'Field';
$title_arr[] = 'Old Value';
$title_arr[] = 'Date';
$title_arr[] = 'By';
echo html_build_list_table_top($title_arr);
for ($i = 0; $i < $rows; $i++) {
$field = db_result($result, $i, 'field_name');
echo '
<TR BGCOLOR="' . html_get_alt_row_color($i) . '"><TD>' . $field . '</TD><TD>';
if ($field == 'removed user') {
echo user_getname(db_result($result, $i, 'old_value'));
} else {
echo db_result($result, $i, 'old_value');
}
echo '</TD>' . '<TD>' . date($sys_datefmt, db_result($result, $i, 'date')) . '</TD>' . '<TD>' . db_result($result, $i, 'user_name') . '</TD></TR>';
}
echo '
</TABLE>';
} else {
echo '
<H3>No Changes Have Been Made to This Group</H3>';
}
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:37,代码来源:project_admin_utils.php
示例9: _getField
function _getField()
{
$name = $this->_getFieldName();
$value = $this->md->getValue();
if ($value === null) {
$value = $this->md->getDefaultValue();
}
$v = '';
if ($value != null && $value != '' && $value > 0) {
$v = user_getname($value);
}
$field = '<input type="text" class="text_field" name="' . $this->_getFieldName() . '" value="' . $v . '" />';
return $field;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:Docman_MetadataHtml.class.php
示例10: ArtifactHtml
$addresses = $agnf->getAllAddresses($ath->getID(), true);
$ah->mailFollowupWithPermissions($addresses, $changes);
}
$GLOBALS['Response']->redirect('?group_id=' . (int) $group_id . '&atid=' . (int) $atid . '&aid=' . (int) $aid . '&func=detail');
}
}
break;
case 'delete_file':
//
// Delete a file from this artifact
//
$ah = new ArtifactHtml($ath, $aid);
// Check permissions
$id = $request->get('id');
$file_array = $ah->getAttachedFile($id);
if (user_ismember($group_id) || user_getname(user_getid()) == $file_array['user_name']) {
$afh = new ArtifactFileHtml($ah, $id);
if (!$afh || !is_object($afh)) {
$GLOBALS['Response']->addFeedback('error', $Language->getText('tracker_index', 'not_create_file_obj', $afh->getName()));
} elseif ($afh->isError()) {
$GLOBALS['Response']->addFeedback('error', $afh->getErrorMessage() . '::' . $hp->purify($afh->getName(), CODENDI_PURIFIER_CONVERT_HTML));
} else {
if (!$afh->delete()) {
$GLOBALS['Response']->addFeedback('error', $Language->getText('tracker_index', 'file_delete', $afh->getErrorMessage()));
} else {
$GLOBALS['Response']->addFeedback('info', $Language->getText('tracker_index', 'file_delete_success'));
}
}
$GLOBALS['Response']->redirect('?group_id=' . (int) $group_id . '&atid=' . (int) $atid . '&aid=' . (int) $aid . '&func=detail');
} else {
// Invalid permission
开发者ID:nterray,项目名称:tuleap,代码行数:31,代码来源:index.php
示例11: html_scrub
<B>Title of policy</B><BR>
<INPUT TYPE="TEXT" NAME="name" VALUE="<?php
echo html_scrub($name);
?>
" SIZE="40" MAXLENGTH="50">
<P>
<B>Someone who believes that...</B><BR>
<textarea name="description" rows="6" cols="80"><?php
echo html_scrub($description);
?>
</textarea></p>
<p><span class="ptitle">Privacy notes:</span>
By creating a policy you are making your user name
<b><?php
echo user_getname();
?>
</b> and the policy's voting record public.
<p><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Make Policy">
</FORM>
<p>If you like you can <a href="/forum/viewforum.php?f=1">discuss policies on our forum</a>.
<?php
}
pw_footer();
} else {
login_screen();
}
?>
开发者ID:damncabbage,项目名称:publicwhip,代码行数:31,代码来源:addpolicy.php
示例12: showAttachedFiles
/**
* Display the list of attached files
*
* @param group_id: the group id
* @param group_artifact_id: the artifact type ID
* @param ascii: ascii mode
*
* @return void
*/
function showAttachedFiles($group_id, $group_artifact_id, $ascii = false, $pv = 0)
{
global $Language;
$hp = $this->getHtmlPurifier();
//
// show the files attached to this artifact
//
$result = $this->getAttachedFiles();
$rows = db_numrows($result);
// No file attached -> return now
if ($rows <= 0) {
if ($ascii) {
$out = $Language->getText('tracker_include_artifact', 'no_file_attached') . $GLOBALS['sys_lf'];
} else {
$out = '<H4>' . $Language->getText('tracker_include_artifact', 'no_file_attached') . '</H4>';
}
return $out;
}
// Header first
if ($ascii) {
$out = $Language->getText('tracker_include_artifact', 'file_attachment') . $GLOBALS['sys_lf'] . str_repeat("*", strlen($Language->getText('tracker_include_artifact', 'file_attachment')));
} else {
$title_arr = array();
$title_arr[] = $Language->getText('tracker_include_artifact', 'name');
$title_arr[] = $Language->getText('tracker_include_artifact', 'desc');
$title_arr[] = $Language->getText('tracker_include_artifact', 'size_kb');
$title_arr[] = $Language->getText('global', 'by');
$title_arr[] = $Language->getText('tracker_include_artifact', 'posted_on');
if ($pv == 0) {
$title_arr[] = $Language->getText('tracker_include_canned', 'delete');
}
$out = html_build_list_table_top($title_arr);
}
// Determine what the print out format is based on output type (Ascii, HTML)
if ($ascii) {
$fmt = $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . "------------------------------------------------------------------" . $GLOBALS['sys_lf'] . $Language->getText('tracker_import_utils', 'date') . ": %s " . $Language->getText('tracker_include_artifact', 'name') . ": %s " . $Language->getText('tracker_include_artifact', 'size') . ": %dKB " . $Language->getText('global', 'by') . ": %s" . $GLOBALS['sys_lf'] . "%s" . $GLOBALS['sys_lf'] . "%s";
} else {
$fmt = "" . $GLOBALS['sys_lf'] . '<TR class="%s"><td>%s</td><td>%s</td><td align="center">%s</td><td align="center">%s</td><td align="center">%s</td>';
if ($pv == 0) {
$fmt .= '<td align="center">%s</td>';
}
$fmt .= '</tr>';
}
// Determine which protocl to use for embedded URL in ASCII format
$server = get_server_url();
// Loop throuh the attached files and format them
for ($i = 0; $i < $rows; $i++) {
$artifact_file_id = db_result($result, $i, 'id');
$href = "/tracker/download.php?artifact_id=" . (int) $this->getID() . "&id=" . (int) $artifact_file_id;
if ($ascii) {
$out .= sprintf($fmt, format_date($GLOBALS['Language']->getText('system', 'datefmt'), db_result($result, $i, 'adddate')), db_result($result, $i, 'filename'), intval(db_result($result, $i, 'filesize') / 1024), db_result($result, $i, 'user_name'), SimpleSanitizer::unsanitize(db_result($result, $i, 'description')), $server . $href);
} else {
// show CC delete icon if one of the condition is met:
// (a) current user is group member
// (b) the current user is the person who added a gieven name in CC list
if (user_ismember($this->ArtifactType->getGroupID()) || user_getname(user_getid()) == db_result($result, $i, 'user_name')) {
$html_delete = '<a href="?func=delete_file&group_id=' . (int) $group_id . "&atid=" . (int) $group_artifact_id . "&aid=" . (int) $this->getID() . "&id=" . (int) db_result($result, $i, 'id') . '" ' . ' onClick="return confirm(\'' . $Language->getText('tracker_include_artifact', 'delete_attachment') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" BORDER="0" ALT="' . $Language->getText('global', 'btn_delete') . '"></A>';
} else {
$html_delete = '-';
}
$out .= sprintf($fmt, util_get_alt_row_color($i), '<a href="' . $href . '">' . $hp->purify(db_result($result, $i, 'filename'), CODENDI_PURIFIER_CONVERT_HTML) . '</a>', $hp->purify(SimpleSanitizer::unsanitize(db_result($result, $i, 'description')), CODENDI_PURIFIER_BASIC, $group_id), intval(db_result($result, $i, 'filesize') / 1024), util_user_link(db_result($result, $i, 'user_name')), format_date($GLOBALS['Language']->getText('system', 'datefmt'), db_result($result, $i, 'adddate')), $html_delete);
}
}
// for
// final touch...
$out .= $ascii ? "" . $GLOBALS['sys_lf'] . "" : "</TABLE>";
return $out;
}
开发者ID:nterray,项目名称:tuleap,代码行数:77,代码来源:Artifact.class.php
示例13: _getFieldLabelAndValueForUser
/**
* return a field for the given user.
*
* @protected
**/
function _getFieldLabelAndValueForUser($group_id, $group_artifact_id, &$field, $user_id, $force_read_only = false)
{
$html = false;
if ($field->userCanRead($group_id, $group_artifact_id, $user_id)) {
$read_only = $force_read_only || !$field->userCanUpdate($group_id, $group_artifact_id, $user_id);
// For multi select box, we need to retrieve all the values
if ($field->isMultiSelectBox()) {
$field_value = $field->getValues($this->getID());
} else {
$field_value = $this->getValue($field->getName());
}
$field_html = new ArtifactFieldHtml($field);
$label = $field_html->labelDisplay(false, false, !$read_only);
$label .= $field->isEmptyOk() ? '' : '<span class="highlight"><big>*</big></b></span>';
// original submission field must be displayed read-only,
// except for site admin, tracker admin and for the artifact submitter
if ($field->getName() == 'details') {
if (user_is_super_user() || $this->ArtifactType->userIsAdmin() || $this->getSubmittedBy() == $user_id) {
// original submission is editable
$value = $field_html->display($this->ArtifactType->getID(), $field_value, false, false, $read_only);
} else {
$value = util_make_links($field_html->display($this->ArtifactType->getID(), $field_value, false, false, true), $group_id, $group_artifact_id);
}
} else {
if ($field->getName() == 'submitted_by') {
$value = util_user_link(user_getname($field_value));
} else {
if ($field->getName() == 'open_date') {
$value = format_date($GLOBALS['Language']->getText('system', 'datefmt'), $field_value);
} else {
if ($field->getName() == 'last_update_date') {
$value = format_date($GLOBALS['Language']->getText('system', 'datefmt'), $field_value);
} else {
$value = $field_html->display($this->ArtifactType->getID(), $field_value, false, false, $read_only);
if ($read_only) {
$value = util_make_links($value, $group_id, $group_artifact_id);
}
}
}
}
}
$html = array('label' => $label, 'value' => $value);
}
return $html;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:50,代码来源:ArtifactHtml.class.php
示例14: db_query
/*
Show the submit form
*/
$sql = "SELECT groups.unix_group_name,news_bytes.* " . "FROM news_bytes,groups WHERE id='{$id}' " . "AND news_bytes.group_id=groups.group_id ";
$result = db_query($sql);
if (db_numrows($result) < 1) {
exit_error('Error', 'Error - not found');
}
echo '
<H3>Approve a NewsByte</H3>
<P>
<FORM ACTION="' . $PHP_SELF . '" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="for_group" VALUE="' . db_result($result, 0, 'group_id') . '">
<INPUT TYPE="HIDDEN" NAME="id" VALUE="' . db_result($result, 0, 'id') . '">
<B>Submitted for group:</B> <a href="/projects/' . strtolower(db_result($result, 0, 'unix_group_name')) . '/">' . group_getname(db_result($result, 0, 'group_id')) . '</a><BR>
<B>Submitted by:</B> ' . user_getname(db_result($result, 0, 'submitted_by')) . '<BR>
<INPUT TYPE="HIDDEN" NAME="approve" VALUE="y">
<INPUT TYPE="HIDDEN" NAME="post_changes" VALUE="y">
<INPUT TYPE="RADIO" NAME="status" VALUE="1"> Approve For Front Page<BR>
<INPUT TYPE="RADIO" NAME="status" VALUE="0"> Do Nothing<BR>
<INPUT TYPE="RADIO" NAME="status" VALUE="2" CHECKED> Delete<BR>
<B>Subject:</B><BR>
<INPUT TYPE="TEXT" NAME="summary" VALUE="' . db_result($result, 0, 'summary') . '" SIZE="30" MAXLENGTH="60"><BR>
<B>Details:</B><BR>
<TEXTAREA NAME="details" ROWS="5" COLS="50" WRAP="SOFT">' . db_result($result, 0, 'details') . '</TEXTAREA><BR>
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="SUBMIT">
</FORM>';
} else {
/*
Show list of waiting news items
*/
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:31,代码来源:index.php
示例15: bug_header
echo $PHP_SELF;
?>
" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="func" VALUE="postmodfilters">
<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="<?php
echo $group_id;
?>
">
<INPUT TYPE="HIDDEN" NAME="subfunc" VALUE="turn_off">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Deactivate Filters">
</FORM>
<?php
}
bug_header(array('title' => 'Create a Personal Filter'));
if (user_isloggedin()) {
echo "<H2>Create a personal filter for " . user_getname() . "</H2>";
echo "<B>Creating or modifying a filter makes it your active filter</B><P>";
echo "Be sure include 'bug.' before each field name, as in the example, as multiple tables are being joined in the query";
show_filters($group_id);
$sql = "SELECT users.user_id,users.user_name FROM users,user_group WHERE users.user_id=user_group.user_id AND user_group.bug_flags IN (1,2) AND user_group.group_id='{$group_id}'";
$result = db_query($sql);
$sql = "select * from bug_status";
$result2 = db_query($sql);
$sql = "select bug_category_id,category_name from bug_category WHERE group_id='{$group_id}'";
$result3 = db_query($sql);
$sql = "select * from bug_resolution";
$result4 = db_query($sql);
$sql = "select bug_group_id,group_name from bug_group WHERE group_id='{$group_id}'";
$result5 = db_query($sql);
?>
<TABLE WIDTH="100%" CELLPADDING="3">
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:31,代码来源:mod_filters.php
示例16: displayAdminNotifications_Personnal
protected function displayAdminNotifications_Personnal($current_user)
{
$user_id = $current_user->getId();
$hp = Codendi_HTMLPurifier::instance();
// Build Wachees UI
$arr_watchees = array();
foreach ($this->getWatcherDao()->searchWatchees($this->tracker->id, $current_user->getId()) as $row) {
$arr_watchees[] = user_getname($row['watchee_id']);
}
$watchees = join(',', $arr_watchees);
echo '<h3>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'perso_mail_notif') . '</h3>';
if ($this->tracker->userIsAdmin()) {
// To watch other users you must have at least admin rights on the tracker
echo '
<h4>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'users_to_watch') . ' ' . help_button('TrackerV5Administration.html#TrackerV5Watchers') . '</h4>
<P>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'backup_person') . '
<p><INPUT TYPE="TEXT" NAME="watchees" VALUE="' . $hp->purify($watchees, CODENDI_PURIFIER_CONVERT_HTML) . '" SIZE="55" MAXLENGTH="255"><br></p>
';
$watchers = "";
foreach ($this->getWatcherDao()->searchWatchers($this->tracker->id, $current_user->getId()) as $row) {
$watcher_name = user_getname($row_watcher['user_id']);
$watchers .= '<a href="/users/' . urlencode($watcher_name) . '">' . $hp->purify($watcher_name, CODENDI_PURIFIER_CONVERT_HTML) . '</a>,';
}
$watchers = substr($watchers, 0, -1);
// remove extra comma at the end
if ($watchers) {
echo "<p>" . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'watchers', $hp->purify($watchers, CODENDI_PURIFIER_CONVERT_HTML));
} else {
echo "<p>" . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'no_watcher');
}
echo '<br><br>';
}
// Build Role/Event table
$dar_roles = $this->getNotificationDao()->searchRoles($this->tracker->id);
$num_roles = $dar_roles->rowCount();
$dar_events = $this->getNotificationDao()->searchEvents($this->tracker->id);
$num_events = $dar_events->rowCount();
$arr_notif = array();
// By default it's all 'yes'
foreach ($dar_roles as $role) {
foreach ($dar_events as $event) {
$arr_notif[$role['role_label']][$event['event_label']] = 1;
}
}
foreach ($this->getNotificationDao()->searchNotification($this->tracker->id, $current_user->getId()) as $arr) {
$arr_notif[$arr['role_label']][$arr['event_label']] = $arr['notify'];
}
// Rk: Can't use html_build_list_table_top because of the specific layout
echo '<h4>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'event_settings') . ' ' . help_button('TrackerV5Administration.html#TrackerV5EventRoleBasedEmailNotification') . '</h4>
<P>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'tune_settings');
echo '
<table BORDER="0" CELLSPACING="1" CELLPADDING="2" class="small">
<tr class="boxtitle">
<td colspan="' . (int) $num_roles . '" align="center" width="50%"><b>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'role_is') . '</b></td>
<td rowspan="2" width="50%"><b> ' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'notify_me') . '</b></td>
</tr>';
$dar_roles->rewind();
foreach ($dar_roles as $role) {
echo '<td align="center" width="10%"><b>' . $GLOBALS['Language']->getText('plugin_tracker_common_types', $role['short_description_msg']) . "</b></td>\n";
}
echo "</tr>\n";
$dar_events->rewind();
$dar_roles->rewind();
$i = 0;
foreach ($dar_events as $event) {
$event_label = $event['event_label'];
echo "<tr class=\"" . util_get_alt_row_color($i++) . "\">\n";
foreach ($dar_roles as $role) {
$role_label = $role['role_label'];
$cbox_name = 'cb_' . $role['role_id'] . '_' . $event['event_id'];
if ($event_label == 'NEW_ARTIFACT' && $role_label != 'ASSIGNEE' && $role_label != 'SUBMITTER' || $event_label == 'ROLE_CHANGE' && $role_label != 'ASSIGNEE' && $role_label != 'CC') {
// if the user is not a member then the ASSIGNEE column cannot
// be set. If it's not an assignee or a submitter the new_artifact event is meaningless
echo ' <td align="center"><input type="hidden" name="' . $cbox_name . '" value="1">-</td>' . "\n";
} else {
echo ' <td align="center"><input type="checkbox" name="' . $cbox_name . '" value="1" ' . ($arr_notif[$role_label][$event_label] ? 'checked' : '') . "></td>\n";
}
}
echo ' <td> ' . $GLOBALS['Language']->getText('plugin_tracker_common_types', $event['description_msg']) . "</td>\n";
echo "</tr>\n";
}
echo '
</table>';
}
开发者ID:nterray,项目名称:tuleap,代码行数:84,代码来源:Tracker_NotificationsManager.class.php
|
请发表评论