本文整理汇总了PHP中user_link函数的典型用法代码示例。如果您正苦于以下问题:PHP user_link函数的具体用法?PHP user_link怎么用?PHP user_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: user_edit_vouchers_controller
function user_edit_vouchers_controller()
{
global $privileges, $user;
if (isset($_REQUEST['user_id'])) {
$user_source = User($_REQUEST['user_id']);
} else {
$user_source = $user;
}
if (!in_array('admin_user', $privileges)) {
redirect(page_link_to(''));
}
if (isset($_REQUEST['submit'])) {
$ok = true;
if (isset($_REQUEST['vouchers']) && test_request_int('vouchers') && trim($_REQUEST['vouchers']) >= 0) {
$vouchers = trim($_REQUEST['vouchers']);
} else {
$ok = false;
error(_("Please enter a valid number of vouchers."));
}
if ($ok) {
$user_source['got_voucher'] = $vouchers;
$result = User_update($user_source);
if ($result === false) {
engelsystem_error('Unable to update user.');
}
success(_("Saved the number of vouchers."));
engelsystem_log(User_Nick_render($user_source) . ': ' . sprintf("Got %s vouchers", $user_source['got_voucher']));
redirect(user_link($user_source));
}
}
return array(sprintf(_("%s's vouchers"), $user_source['Nick']), User_edit_vouchers_view($user_source));
}
开发者ID:max-weller,项目名称:engelsystem,代码行数:32,代码来源:users_controller.php
示例2: UserDriverLicense_edit_view
/**
* Edit a user's driving license information.
* @param User $user_source
* @param bool $wants_to_drive
* @param bool $has_car
* @param bool $has_license_car
* @param bool $has_license_3_5t_transporter
* @param bool $has_license_7_5t_truck
* @param bool $has_license_12_5t_truck
* @param bool $has_license_forklift
*/
function UserDriverLicense_edit_view($user_source, $wants_to_drive, $has_car, $has_license_car, $has_license_3_5t_transporter, $has_license_7_5t_truck, $has_license_12_5t_truck, $has_license_forklift)
{
return page_with_title(sprintf(_("Edit %s driving license information"), User_Nick_render($user_source)), [buttons([button(user_link($user_source), _("Back to profile"), 'back')]), msg(), form([form_info(_("Privacy"), _("Your driving license information is only visible for coordinators and admins.")), form_checkbox('wants_to_drive', _("I am willing to operate cars for the PL"), $wants_to_drive), div('panel panel-default', [div('panel-body', [form_checkbox('has_car', _("I have my own car with me and am willing to use it for the PL (You'll get reimbursed for fuel)"), $has_car), heading(_("Driver license"), 3), form_checkbox('has_license_car', _("Car"), $has_license_car), form_checkbox('has_license_3_5t_transporter', _("Transporter 3,5t"), $has_license_3_5t_transporter), form_checkbox('has_license_7_5t_truck', _("Truck 7,5t"), $has_license_7_5t_truck), form_checkbox('has_license_12_5t_truck', _("Truck 12,5t"), $has_license_12_5t_truck), form_checkbox('has_license_forklift', _("Forklift"), $has_license_forklift)])], 'driving_license'), form_submit('submit', _("Save"))]), '<script type="text/javascript">
$(function() {
if($("#wants_to_drive").is(":checked"))
$("#driving_license").show();
else
$("#driving_license").hide();
$("#wants_to_drive").click(
function(e) {
if($("#wants_to_drive").is(":checked"))
$("#driving_license").show();
else
$("#driving_license").hide();
}
);
});
</script>']);
}
开发者ID:bjelline,项目名称:engelsystem,代码行数:31,代码来源:UserDriverLicenses_view.php
示例3: user_got_voucher_controller
function user_got_voucher_controller()
{
global $privileges, $user;
if (isset($_REQUEST['user_id'])) {
$user_source = User($_REQUEST['user_id']);
} else {
$user_source = $user;
}
$admin_user_privilege = in_array('admin_user', $privileges);
if (!in_array('admin_user', $privileges)) {
redirect(page_link_to(''));
}
if (!isset($_REQUEST['got_voucher'])) {
redirect(page_link_to(''));
}
$user_source['got_voucher'] = $_REQUEST['got_voucher'] == 'true';
$result = User_update($user_source);
if ($result === false) {
engelsystem_error('Unable to update user.');
}
success($user_source['got_voucher'] ? _('User got vouchers.') : _('User didnt got vouchers.'));
engelsystem_log(User_Nick_render($user_source) . ($user_source['got_voucher'] ? ' got vouchers' : ' didnt got vouchers'));
redirect(user_link($user_source));
}
开发者ID:20-100,项目名称:engelsystem,代码行数:24,代码来源:users_controller.php
示例4: slot
<?php
slot('header_text', $network['name']);
slot('header_link', LsListTable::getNetworkInternalUrl($network));
?>
<?php
include_partial('global/section', array('title' => 'Analysts in this Network', 'pager' => $user_pager));
?>
<div class="padded">
<?php
foreach ($user_pager->execute() as $user) {
?>
<div style="float: left; padding: .6em; height: 5em; text-align: center;">
<?php
echo user_pic($user);
?>
<br />
<span class="text_small"><?php
echo user_link($user);
?>
</span>
</div>
<?php
}
?>
</div>
开发者ID:silky,项目名称:littlesis,代码行数:29,代码来源:analystsSuccess.php
示例5: user_link
<? $author = CI::model('users')->getUserById( $data); ?>
<? $thumb = CI::model('users')->getUserThumbnail( $author['id'], 70); ?>
<li>
<a href="<? print user_link($author['id']); ?>"> <span style="background-image: url('<? print $thumb; ?>');"></span> <strong><? print user_name($author['id']) ; ?></strong> </a> </li>
开发者ID:Gninety,项目名称:Microweber,代码行数:9,代码来源:user_small_square.php
示例6: response_header
| Authors: Martin Jansen <[email protected]> |
+----------------------------------------------------------------------+
$Id$
*/
response_header('Announcing the PEAR Group');
?>
<h1>Announcing the PEAR Group</h1>
[August 20, 2003]
<div id="news-entry">
<p>
On 12th August 2003 <?php
echo user_link('ssb', true);
?>
, the founder of PEAR, announced
the forming of the PEAR Group, which will be the governing body of
PEAR. The full announcement can be
<?php
echo make_link('http://marc.theaimsgroup.com/?l=pear-dev&m=106073080219083&w=2', 'found here');
?>
.
</p>
<p>
More information about the Group, including a first administrative
document, can be found at a <?php
echo make_link("/group/", "dedicated place");
?>
开发者ID:stof,项目名称:pearweb,代码行数:31,代码来源:group-announce.php
示例7: sendActionEmail
function sendActionEmail($event, $userType, $user_handle = null, $comment = '')
{
global $dbh, $karma, $auth_user;
if (empty($karma)) {
$karma = new Damblan_Karma($dbh);
}
require 'pepr/pepr-emails.php';
$email = $proposalEmailTexts[$event];
if (empty($email)) {
return PEAR::raiseError("Email template for {$event} not found");
}
switch ($userType) {
case 'admin':
$prefix = "[ADMIN]";
break;
case 'mixed':
if ($karma->has($user_handle, "pear.pepr.admin") && $this->user_handle != $user_handle) {
$prefix = "[ADMIN]";
} else {
$prefix = "";
}
break;
default:
$prefix = "";
}
$prefix = PROPOSAL_EMAIL_PREFIX . $prefix . " ";
include_once 'pear-database-user.php';
$actorinfo = user::info($user_handle);
$ownerinfo = user::info($this->user_handle);
$this->getVotes($dbh);
$vote = @$this->votes[$user_handle];
if (isset($vote)) {
$vote->value = $vote->value > 0 ? "+" . $vote->value : $vote->value;
if ($vote->is_conditional) {
$vote_conditional = "\n\nThis vote is conditional. The condition is:\n\n" . $vote->comment;
} elseif ($vote->comment) {
$comment = "\n\nComment:\n\n" . $vote->comment;
}
$vote_url = "http://" . PEAR_CHANNELNAME . "/pepr/pepr-vote-show.php?id=" . $this->id . "&handle=" . $user_handle;
}
if ($event == 'change_status_finished') {
$proposalVotesSum = ppVote::getSum($dbh, $this->id);
$vote_result = 'Sum of Votes: ' . $proposalVotesSum['all'];
$vote_result .= ' (' . $proposalVotesSum['conditional'] . ' conditional)';
if ($proposalVotesSum['all'] >= 5) {
$vote_result .= "\nResult: This proposal was accepted";
} else {
$vote_result .= "\nResult: This proposal was rejected";
}
}
$proposal_url = "http://" . PEAR_CHANNELNAME . "/pepr/pepr-proposal-show.php?id=" . $this->id;
$end_voting_time = @$this->longened_date > 0 ? $this->longened_date + PROPOSAL_STATUS_VOTE_TIMELINE : @$this->vote_date + PROPOSAL_STATUS_VOTE_TIMELINE;
if ($event == 'proposal_comment' && $user_handle == $this->user_handle) {
$email['to'] = $email['to']['owner'];
} else {
if (!isset($user_handle)) {
$email['to'] = $email['to']['pearweb'];
} else {
if ($karma->has($user_handle, "pear.pepr.admin")) {
$email['to'] = $email['to']['admin'];
} else {
$email['to'] = $email['to']['user'];
}
}
}
$email['subject'] = $prefix . $email['subject'];
$replace = array("/\\{pkg_category\\}/", "/\\{pkg_name\\}/", "/\\{owner_name\\}/", "/\\{owner_email\\}/", "/\\{owner_link\\}/", "/\\{actor_name\\}/", "/\\{actor_email\\}/", "/\\{actor_link\\}/", "/\\{proposal_url\\}/", "/\\{end_voting_time\\}/", "/\\{vote_value\\}/", "/\\{vote_url\\}/", "/\\{email_pear_dev\\}/", "/\\{email_pear_group\\}/", "/\\{comment\\}/", "/\\{vote_result\\}/", "/\\{vote_conditional\\}/");
$replacements = array($this->pkg_category, $this->pkg_name, isset($ownerinfo['name']) ? $ownerinfo['name'] : "", isset($ownerinfo['email']) ? "<{$ownerinfo['email']}>" : '', isset($ownerinfo['handle']) ? user_link($ownerinfo['handle'], true) : "", isset($actorinfo['name']) ? $actorinfo['name'] : "", isset($actorinfo['email']) ? $actorinfo['email'] : "", isset($actorinfo['handle']) ? "http://" . PEAR_CHANNELNAME . "/user/" . $actorinfo['handle'] : "", $proposal_url, format_date($end_voting_time), isset($vote) ? $vote->value : 0, isset($vote) ? $vote_url : "", PROPOSAL_MAIL_PEAR_DEV, PROPOSAL_MAIL_PEAR_GROUP, isset($comment) ? wordwrap($comment) : '', isset($vote_result) ? $vote_result : '', isset($vote_conditional) ? $vote_conditional : "");
$email = preg_replace($replace, $replacements, $email);
$email['text'] .= PROPOSAL_EMAIL_POSTFIX;
if (is_object($auth_user)) {
$from = '"' . $auth_user->name . '" <' . $auth_user->email . '>';
} else {
$from = PROPOSAL_MAIL_FROM;
}
$to = explode(", ", $email['to']);
$email['to'] = array_shift($to);
$headers = "CC: " . implode(", ", $to) . "\n";
$headers .= "From: " . $from . "\n";
$headers .= "X-Mailer: " . "PEPr, PEAR Proposal System" . "\n";
$headers .= "X-PEAR-Category: " . $this->pkg_category . "\n";
$headers .= "X-PEAR-Package: " . $this->pkg_name . "\n";
$headers .= "X-PEPr-Status: " . $this->getStatus() . "\n";
if ($event == "change_status_proposal") {
$headers .= "Message-ID: <proposal-" . $this->id . "@" . PEAR_CHANNELNAME . ">\n";
} else {
$headers .= "In-Reply-To: <proposal-" . $this->id . "@" . PEAR_CHANNELNAME . ">\n";
}
if (!DEVBOX) {
$res = mail($email['to'], $email['subject'], $email['text'], $headers, '-f ' . PEAR_BOUNCE_EMAIL);
} else {
$res = true;
}
if (!$res) {
return PEAR::raiseError('Could not send notification email.');
}
return true;
}
开发者ID:stof,项目名称:pearweb,代码行数:98,代码来源:pepr-proposal.php
示例8: link_to
<tr>
<td>
<strong><?php
echo link_to($object->getOneLiner(), 'entity/addressModifications?id=' . $object->id);
?>
</strong>
</td>
<td>
<?php
echo $object->created_at;
?>
by <?php
echo user_link($object->getCreatedByUser());
?>
</td>
<td>
<?php
echo time_ago_in_words(strtotime($object->updated_at));
?>
</td>
<td>
<?php
echo $object->is_deleted ? 'deteled' : 'active';
?>
</td>
</td>
开发者ID:silky,项目名称:littlesis,代码行数:26,代码来源:_addresslistrow.php
示例9: user_link
echo $__info['pic_hd_url'];
?>
">高清图</a>
<?php
}
if ($__info['pic_url'] != $__info['pic_hd_url']) {
?>
<a class="label label-primary hidden-print" href="<?php
echo $__info['pic_url'];
?>
">原图</a>
<?php
}
?>
<a class="visible-print glyphicon glyphicon-user" href="<?php
echo user_link($__info['user_name']);
?>
"><?php
echo $__info['user_aliases'];
?>
</a>
</p>
</div>
<ul class="pager left">
<?php
if ($__info['previous_id'] < $__info['pic_id'] && $__info['previous_id'] != 0) {
?>
<li class="previous">
<a title="第 <?php
echo $__info['previous_id'];
?>
开发者ID:ttym7993,项目名称:Linger,代码行数:31,代码来源:picture.php
示例10: admin_arrive
function admin_arrive()
{
$msg = "";
$search = "";
if (isset($_REQUEST['search'])) {
$search = strip_request_item('search');
}
if (isset($_REQUEST['reset']) && preg_match("/^[0-9]*\$/", $_REQUEST['reset'])) {
$id = $_REQUEST['reset'];
$user_source = User($id);
if ($user_source != null) {
sql_query("UPDATE `User` SET `Gekommen`=0, `arrival_date` = NULL WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
engelsystem_log("User set to not arrived: " . User_Nick_render($user_source));
success(_("Reset done. Angel has not arrived."));
redirect(user_link($user_source));
} else {
$msg = error(_("Angel not found."), true);
}
} elseif (isset($_REQUEST['arrived']) && preg_match("/^[0-9]*\$/", $_REQUEST['arrived'])) {
$id = $_REQUEST['arrived'];
$user_source = User($id);
if ($user_source != null) {
sql_query("UPDATE `User` SET `Gekommen`=1, `arrival_date`='" . time() . "' WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
engelsystem_log("User set has arrived: " . User_Nick_render($user_source));
success(_("Angel has been marked as arrived."));
redirect(user_link($user_source));
} else {
$msg = error(_("Angel not found."), true);
}
}
$users = sql_select("SELECT * FROM `User` ORDER BY `Nick`");
$arrival_count_at_day = [];
$planned_arrival_count_at_day = [];
$planned_departure_count_at_day = [];
$table = "";
$users_matched = [];
if ($search == "") {
$tokens = [];
} else {
$tokens = explode(" ", $search);
}
foreach ($users as $usr) {
if (count($tokens) > 0) {
$match = false;
$index = join(" ", $usr);
foreach ($tokens as $t) {
if (stristr($index, trim($t))) {
$match = true;
break;
}
}
if (!$match) {
continue;
}
}
$usr['nick'] = User_Nick_render($usr);
if ($usr['planned_departure_date'] != null) {
$usr['rendered_planned_departure_date'] = date('Y-m-d', $usr['planned_departure_date']);
} else {
$usr['rendered_planned_departure_date'] = '-';
}
$usr['rendered_planned_arrival_date'] = date('Y-m-d', $usr['planned_arrival_date']);
$usr['rendered_arrival_date'] = $usr['arrival_date'] > 0 ? date('Y-m-d', $usr['arrival_date']) : "-";
$usr['arrived'] = $usr['Gekommen'] == 1 ? _("yes") : "";
$usr['actions'] = $usr['Gekommen'] == 1 ? '<a href="' . page_link_to('admin_arrive') . '&reset=' . $usr['UID'] . '&search=' . $search . '">' . _("reset") . '</a>' : '<a href="' . page_link_to('admin_arrive') . '&arrived=' . $usr['UID'] . '&search=' . $search . '">' . _("arrived") . '</a>';
if ($usr['arrival_date'] > 0) {
$day = date('Y-m-d', $usr['arrival_date']);
if (!isset($arrival_count_at_day[$day])) {
$arrival_count_at_day[$day] = 0;
}
$arrival_count_at_day[$day]++;
}
if ($usr['planned_arrival_date'] != null) {
$day = date('Y-m-d', $usr['planned_arrival_date']);
if (!isset($planned_arrival_count_at_day[$day])) {
$planned_arrival_count_at_day[$day] = 0;
}
$planned_arrival_count_at_day[$day]++;
}
if ($usr['planned_departure_date'] != null && $usr['Gekommen'] == 1) {
$day = date('Y-m-d', $usr['planned_departure_date']);
if (!isset($planned_departure_count_at_day[$day])) {
$planned_departure_count_at_day[$day] = 0;
}
$planned_departure_count_at_day[$day]++;
}
$users_matched[] = $usr;
}
ksort($arrival_count_at_day);
ksort($planned_arrival_count_at_day);
ksort($planned_departure_count_at_day);
$arrival_at_day = [];
$arrival_sum = 0;
foreach ($arrival_count_at_day as $day => $count) {
$arrival_sum += $count;
$arrival_at_day[$day] = ['day' => $day, 'count' => $count, 'sum' => $arrival_sum];
}
$planned_arrival_sum_at_day = [];
$planned_arrival_sum = 0;
foreach ($planned_arrival_count_at_day as $day => $count) {
//.........这里部分代码省略.........
开发者ID:bjelline,项目名称:engelsystem,代码行数:101,代码来源:admin_arrive.php
示例11: user_link
?>
</li>
<li><?php
echo user_link('ssb');
?>
</li>
<li><?php
echo user_link('richard');
?>
</li>
<li><?php
echo user_link('cmv');
?>
</li>
<li><?php
echo user_link('toby');
?>
</li>
</ul>
<small>(In alphabetic order)</small>
<p>The website team can be reached at
<?php
echo make_mailto_link(PEAR_WEBMASTER_EMAIL);
?>
.</p>
<p>More information about the website can be found on a
<a href="/about/">dedicated page</a>.</p>
开发者ID:stof,项目名称:pearweb,代码行数:30,代码来源:credits.php
示例12: user_link
* @var ULib\Comment $__comment
*/
?>
<div class="comment-msg">
<div class="comment-head clearfix">
<img class="img-rounded pull-left comment-avatar" alt="<?php
echo $__comment->getUser()->getName();
?>
" src="<?php
echo $__comment->getUser()->getAvatar();
?>
">
<div class="pull-left">
<p class="comment-info"><strong class="comment-aliases"><a href="<?php
echo user_link($__comment->getUser()->getName());
?>
"><?php
echo $__comment->getUser()->getAliases();
?>
</a></strong>
<span class="comment-name"><?php
echo $__comment->getUser()->getName();
?>
</span>
</p>
<p>
<small class="comment-post-at">评论于:</small>
<span class="comment-time"><?php
echo convert_time($__comment->getCommentTime());
开发者ID:ttym7993,项目名称:Linger,代码行数:31,代码来源:comment.php
示例13: include_partial
<?php
include_partial('global/section', array('title' => "Who's Watching", 'action' => array('credential' => 'editor', 'text' => $sf_user->getGuardUser()->Profile->watching_opt_out ? 'opt in' : 'opt out', 'url' => 'home/editSettings')));
?>
<div class="padded" style="padding-bottom: .6em">
<br />
</div>
<?php
foreach ($watchers as $watcher) {
?>
<div style = "float:left; padding: .6em; height: 5em">
<span style="vertical-align:bottom">
<?php
echo user_pic($watcher);
?>
</span>
<br />
<span class="text_small" style="vertical-align:top">
<?php
echo user_link($watcher, null, false);
?>
</span>
</div>
<?php
}
?>
<?php
}
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_watchers.php
示例14: user_pic
for ($i = 3; $i < 10; $i++) {
?>
<?php
$top_analyst = $top_analysts[$i];
?>
<table style="border-bottom: 1px dotted #EEEEEE;">
<tr>
<td style="padding: 0.5em; width: 40px;">
<?php
echo user_pic($top_analyst, 'profile', array('width' => 40));
?>
</td>
<td style="padding: 0.5em;">
<span class="text_big"><?php
echo user_link($top_analyst);
?>
</span>
<br />
<span style="color: #666;"><?php
echo $top_analyst->group_score;
?>
points</span>
</td>
</tr>
</table>
<?php
}
?>
<?php
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:contestSuccess.php
示例15: include_partial
<?php
include_partial('global/section', array('title' => 'Recent Chatters', 'pointer' => 'Analysts who have viewed this page in the past five minutes'));
?>
<table>
<?php
foreach ($users as $u) {
?>
<tr>
<td style="width: 50px; padding-top: 5px;">
<?php
echo user_pic($u, 'profile', array('width' => 40));
?>
</td>
<td style="vertical-align: middle;">
<span class="text_big"><?php
echo user_link($u);
?>
</span>
</td>
</tr>
<?php
}
?>
</table>
<?php
end_slot();
?>
<script type="text/javascript">
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:chatSuccess.php
示例16: user_link
<?php
$fields = $object->Field;
?>
<tr>
<td>
<?php
echo user_link($object->User);
?>
<?php
echo time_ago_in_words(strtotime($object->created_at));
?>
ago
</td>
<td>
<?php
if ($obj = $object->getObject()) {
?>
<?php
echo object_link($obj);
?>
<?php
} else {
?>
<strong><?php
echo $object->object_name;
?>
</strong>
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_updatedlistrow.php
示例17: go_user
public function go_user()
{
redirect(user_link(req()->get('name')));
}
开发者ID:ttym7993,项目名称:Linger,代码行数:4,代码来源:Tool.php
示例18: user_myshifts
function user_myshifts()
{
global $LETZTES_AUSTRAGEN;
global $user, $privileges;
$msg = "";
if (isset($_REQUEST['id']) && in_array("user_shifts_admin", $privileges) && preg_match("/^[0-9]{1,}\$/", $_REQUEST['id']) && sql_num_query("SELECT * FROM `User` WHERE `UID`='" . sql_escape($_REQUEST['id']) . "'") > 0) {
$id = $_REQUEST['id'];
} else {
$id = $user['UID'];
}
list($shifts_user) = sql_select("SELECT * FROM `User` WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
if (isset($_REQUEST['reset'])) {
if ($_REQUEST['reset'] == "ack") {
User_reset_api_key($user);
success(_("Key changed."));
redirect(page_link_to('user_myshifts'));
}
return page_with_title(_("Reset API key"), array(error(_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."), true), button(page_link_to('user_myshifts') . '&reset=ack', _("Continue"), 'btn-danger')));
} elseif (isset($_REQUEST['edit']) && preg_match("/^[0-9]*\$/", $_REQUEST['edit'])) {
$id = $_REQUEST['edit'];
$shift = sql_select("SELECT\n `ShiftEntry`.`freeloaded`,\n `ShiftEntry`.`freeload_comment`,\n `ShiftEntry`.`Comment`,\n `ShiftEntry`.`UID`,\n `ShiftTypes`.`name`,\n `Shifts`.*,\n `Room`.`Name`,\n `AngelTypes`.`name` as `angel_type`\n FROM `ShiftEntry`\n JOIN `AngelTypes` ON (`ShiftEntry`.`TID` = `AngelTypes`.`id`)\n JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)\n JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)\n JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`)\n WHERE `ShiftEntry`.`id`='" . sql_escape($id) . "'\n AND `UID`='" . sql_escape($shifts_user['UID']) . "' LIMIT 1");
if (count($shift) > 0) {
$shift = $shift[0];
if (isset($_REQUEST['submit'])) {
$freeloaded = $shift['freeloaded'];
$freeload_comment = $shift['freeload_comment'];
if (in_array("user_shifts_admin", $privileges)) {
$freeloaded = isset($_REQUEST['freeloaded']);
$freeload_comment = strip_request_item_nl('freeload_comment');
}
$comment = strip_request_item_nl('comment');
$user_source = User($shift['UID']);
$result = ShiftEntry_update(array('id' => $id, 'Comment' => $comment, 'freeloaded' => $freeloaded, 'freeload_comment' => $freeload_comment));
if ($result === false) {
engelsystem_error('Unable to update shift entr.');
}
engelsystem_log("Updated " . User_Nick_render($user_source) . "'s shift " . $shift['name'] . " from " . date("Y-m-d H:i", $shift['start']) . " to " . date("Y-m-d H:i", $shift['end']) . " with comment " . $comment . ". Freeloaded: " . ($freeloaded ? "YES Comment: " . $freeload_comment : "NO"));
success(_("Shift saved."));
redirect(page_link_to('users') . '&action=view&user_id=' . $shifts_user['UID']);
}
return ShiftEntry_edit_view(User_Nick_render($shifts_user), date("Y-m-d H:i", $shift['start']) . ', ' . shift_length($shift), $shift['Name'], $shift['name'], $shift['angel_type'], $shift['Comment'], $shift['freeloaded'], $shift['freeload_comment'], in_array("user_shifts_admin", $privileges));
} else {
redirect(page_link_to('user_myshifts'));
}
} elseif (isset($_REQUEST['cancel']) && preg_match("/^[0-9]*\$/", $_REQUEST['cancel'])) {
$id = $_REQUEST['cancel'];
$shift = sql_select("\n SELECT *\n FROM `Shifts` \n INNER JOIN `ShiftEntry` USING (`SID`) \n WHERE `ShiftEntry`.`id`='" . sql_escape($id) . "' AND `UID`='" . sql_escape($shifts_user['UID']) . "'");
if (count($shift) > 0) {
$shift = $shift[0];
if ($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600 || in_array('user_shifts_admin', $privileges)) {
$result = ShiftEntry_delete($id);
if ($result === false) {
engelsystem_error('Unable to delete shift entry.');
}
$room = Room($shift['RID']);
$angeltype = AngelType($shift['TID']);
$shifttype = ShiftType($shift['shifttype_id']);
engelsystem_log("Deleted own shift: " . $shifttype['name'] . " at " . $room['Name'] . " from " . date("Y-m-d H:i", $shift['start']) . " to " . date("Y-m-d H:i", $shift['end']) . " as " . $angeltype['name']);
success(_("You have been signed off from the shift."));
} else {
error(_("It's too late to sign yourself off the shift. If neccessary, ask the dispatcher to do so."));
}
} else {
redirect(user_link($shifts_user));
}
}
redirect(page_link_to('users') . '&action=view');
}
开发者ID:max-weller,项目名称:engelsystem,代码行数:68,代码来源:user_myshifts.php
示例19: user_pic
?>
<td class="note_reply"> </td>
<?php
}
?>
<td class="note_pic">
<?php
echo user_pic($note['User'], 'profile', array('width' => 40));
?>
</td>
<td class="note_body">
<?php
echo user_link($note['User']);
?>
<?php
if ($note['is_private']) {
?>
<?php
echo image_tag('system/lock.png');
?>
<?php
}
?>
<?php
echo NoteTable::prepareBodyForDisplay($note['body']);
?>
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_full.php
示例20: convertValueForDisplay
static function convertValueForDisplay($value, $field, $excerpt = 40)
{
if (is_null($value)) {
return 'NULL';
}
if (!($mod = self::loadModification($field))) {
return $value;
}
$table = Doctrine::getTable($mod['object_model']);
$columns = $table->getColumns();
if ($mod['object_model'] == 'Entity') {
if (!array_key_exists($field['field_name'], $columns)) {
if ($extensionName = EntityTable::getExtensionNameByFieldName($field['field_name'])) {
$table = Doctrine::getTable($extensionName);
}
}
} elseif ($mod['object_model'] == 'Relationship') {
if (!array_key_exists($field['field_name'], $columns)) {
$table = Doctrine::getTable(RelationshipTable::getCategoryNameByFieldName($field['field_name']));
}
}
if ($alias = self::getFieldNameAlias($field)) {
$class = $table->getRelation($alias)->getClass();
if ($record = Doctrine::getTable($class)->find($value, Doctrine::HYDRATE_ARRAY)) {
if ($class == 'Entity') {
sfLoader::loadHelpers('Ls');
return entity_link($record, null);
} elseif ($class == 'sfGuardUser') {
sfLoader::loadHelpers('Ls');
return user_link($record);
}
return $record;
}
}
if (in_array($field['field_name'], array('start_date', 'end_date'))) {
return Dateable::convertForDisplay($value);
}
$def = $table->getColumnDefinition($field['field_name']);
switch ($def['type']) {
case 'integer':
return (double) $value;
break;
case 'boolean':
return $value ? 'yes' : 'no';
break;
}
if ($excerpt) {
$short = LsString::excerpt($value, $excerpt);
return $short == $value ? $value : '<span title="' . strip_tags($value) . '">' . $short . '</span>';
}
return $value;
}
开发者ID:silky,项目名称:littlesis,代码行数:52,代码来源:ModificationFieldTable.class.php
注:本文中的user_link函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论