本文整理汇总了PHP中confGet函数的典型用法代码示例。如果您正苦于以下问题:PHP confGet函数的具体用法?PHP confGet怎么用?PHP confGet使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了confGet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_automatic
/**
* print a complete list as html
* - use filters
* - use check list style (tree, list, grouped)
* - check customization-values
* - check sorting
* - get objects from database
*
*/
public function print_automatic()
{
require_once confGet('DIR_STREBER') . 'render/render_wiki.inc.php';
global $PH;
if (!($this->active_block_function = $this->getBlockStyleFromCookie())) {
$this->active_block_function = 'list';
}
$this->initOrderQueryOption();
### grouped view ###
if ($this->active_block_function == 'grouped') {
$this->group_by = get("blockstyle_{$PH->cur_page->id}_{$this->id}_grouping");
/**
* @@@ later use only once...
*
* $this->columns= filterOptions($this->columns,"CURPAGE.BLOCKS[{$this->id}].STYLE[{$this->active_block_function}].COLUMNS");
*/
if (isset($this->columns[$this->group_by])) {
unset($this->columns[$this->group_by]);
}
### prepend key to sorting ###
if (isset($this->query_options['order_by'])) {
$this->query_options['order_by'] = $this->groupings->getActiveFromCookie() . "," . $this->query_options['order_by'];
} else {
$this->query_options['order_by'] = $this->groupings->getActiveFromCookie();
}
}
$versions = Task::getAll($this->query_options);
$this->render_list($versions);
}
示例2: __toString
public function __toString()
{
global $PH;
global $auth;
require_once confGet('DIR_STREBER') . 'lists/list_files.inc.php';
$files = File::getall(array('parent_item' => $this->item_with_attachments->id));
$list = new ListBlock_files();
$list->reduced_header = true;
$list->query_options['parent_item'] = $this->item_with_attachments->id;
$list->show_functions = false;
unset($list->columns['status']);
unset($list->columns['mimetype']);
unset($list->columns['filesize']);
unset($list->columns['created_by']);
unset($list->columns['version']);
unset($list->columns['_select_col_']);
unset($list->columns['modified']);
unset($list->columns['name']);
unset($list->columns['thumbnail']);
unset($list->block_functions['list']);
unset($list->block_functions['grouped']);
unset($list->functions['fileEdit']);
unset($list->functions['filesDelete']);
$list->title = __('Attached files');
if ($this->item_with_attachments->isEditable()) {
$list->summary = buildFileUploadForm($this->item_with_attachments);
}
$list->print_automatic($project);
$PH->go_submit = $PH->getValidPage('filesUpload')->id;
return "";
}
示例3: error
/**
* Shown, if unknown page-id requested
*
* @ingroup pages
*
* \TODO this should only trigger an error and relay to home
* \TODO removing this function would make renderBacktrace() obsolete, too
*/
function error()
{
global $PH;
require_once confGet('DIR_STREBER') . 'render/render_list.inc.php';
$page = new Page();
$page->tabs['error'] = array('target' => "index.php?go=error", 'title' => __('Error', 'top navigation tab'), 'bg' => "error");
$page->cur_tab = 'error';
$page->title = __("Unknown Page");
$page->type = __("Error");
$page->title_minor = get('go');
echo new PageHeader();
echo new PageContentOpen();
$block = new PageBlock(array('title' => __('Error'), 'id' => 'error'));
$block->render_blockStart();
echo "<div class=text>";
echo "<p>Sorry but you found a function that has not yet been implemented.<br>";
echo "If you feel this a bug, or a very important function is missing, please help us to fix this,\r\n Please hit the back-button of your browser and use the 'Wiki + Help' option to follow to the online\r\n documentation. Then edit 'issue' or 'request-part'.</p>";
echo "</div>";
### Show traceback only for admins
if ($auth->cur_user->user_rights & RIGHT_VIEWALL) {
$block->render_blockEnd();
$block = new PageBlock(array('title' => 'Details', 'id' => 'details'));
$block->render_blockStart();
echo "<div class=text>";
echo "<pre>";
echo renderBacktrace(debug_backtrace());
echo "</pre>";
echo "</div>";
$block->render_blockEnd();
}
echo new PageContentClose();
echo new PageHtmlEnd();
}
示例4: itemsRemoveManyPreview
/**
* Remove items of certain type and autho
*
*/
function itemsRemoveManyPreview()
{
global $PH;
global $auth;
### cancel ? ###
if (get('form_do_cancel')) {
if (!$PH->showFromPage()) {
$PH->show('home', array());
}
exit;
}
$PH->go_submit = 'itemsRemoveManySubmit';
$page = new Page();
$page->cur_tab = 'home';
$page->title = __('Following items will be removed');
$page->title_minor = '';
echo new PageHeader();
echo new PageContentOpen();
require_once confGet('DIR_STREBER') . "render/render_form.inc.php";
$form = new PageForm();
$form->button_cancel = true;
renderPreviewList();
echo $form;
echo new PageContentClose();
echo new PageHtmlEnd();
}
示例5: itemsRemoveMany
/**
* Remove items of certain type and autho
*
* This method can be used to remove spam comments or attachments
*
* person - id of person who did the changes
* data - date to with revert changes
* delete_history (Default off) - Reverting can't be undone! The person's modification are lost forever!
* This can be useful on massive changes to avoid sending huge
* notification mails.
*/
function itemsRemoveMany()
{
global $PH;
global $auth;
$PH->go_submit = 'itemsRemoveManyPreview';
$page = new Page();
$page->cur_tab = 'home';
$page->title = __('Remove many items');
$page->title_minor = '';
echo new PageHeader();
echo new PageContentOpen();
require_once confGet('DIR_STREBER') . "render/render_form.inc.php";
$form = new PageForm();
$form->button_cancel = true;
### author
$people = array(0 => 'anybody');
foreach (Person::getPeople() as $p) {
$people[$p->id] = $p->nickname;
}
$form->add(new Form_Dropdown('person', __("Created by"), array_flip($people), 0));
$form->add(new Form_Checkbox('type_comment', __("Comments"), true));
$form->add(new Form_Checkbox('only_spam_comments', __("Only comments that look like spam"), true));
$form->add(new Form_Checkbox('type_task', __("Tasks"), false));
$form->add(new Form_Checkbox('type_topic', __("Topic"), false));
$form->add(new Form_DateTime('time_start', __('starting at', 'label for time filter'), getGMTString(time() - 7 * 24 * 60 * 60)));
$form->add(new Form_DateTime('time_end', __('ending at', 'label for time filter'), getGMTString(time() + 60 * 60)));
echo $form;
echo new PageContentClose();
echo new PageHtmlEnd();
}
示例6: projViewFiles
function projViewFiles()
{
global $PH;
global $auth;
require_once confGet('DIR_STREBER') . "render/render_wiki.inc.php";
### get current project ###
$id = getOnePassedId('prj', 'projects_*');
$project = Project::getVisibleById($id);
if (!$project || !$project->id) {
$PH->abortWarning(__("invalid project-id"));
return;
}
### define from-handle ###
$PH->defineFromHandle(array('prj' => $project->id));
## is viewed by user ##
$project->nowViewedByUser();
## next milestone ##
$next = $project->getNextMilestone();
$page = new Page();
$page->crumbs = build_project_crumbs($project);
$page->options = build_projView_options($project);
$page->cur_tab = 'projects';
$page->title = $project->name;
$page->title_minor = __("Downloads");
if ($project->status == STATUS_TEMPLATE) {
$page->type = __("Project Template");
} else {
if ($project->status >= STATUS_COMPLETED) {
$page->type = __("Inactive Project");
} else {
$page->type = __("Project", "Page Type");
}
}
### render title ###
echo new PageHeader();
echo new PageContentOpen();
measure_stop('init2');
measure_start('info');
$block = new PageBlock(array('id' => 'support'));
$block->render_blockStart();
echo "<div class=text>";
if ($task = Task::getVisibleById(3645)) {
echo wikifieldAsHtml($task, 'description');
}
echo "</div>";
$block->render_blockEnd();
echo new PageContentClose();
echo new PageHtmlEnd();
}
示例7: validateEnvironment
/**
* do some checks before doing anything serious
*
* This file is assumed to be php4 valid.
* - will exit script on errors!
*/
function validateEnvironment()
{
# NOTE: it's weird that we have to use strings for referring to functions...
foreach (array('testPhpVersion', 'testDb', 'testInstallDirectoryExists') as $test_function) {
$result = $test_function();
if ($result !== true) {
### Set uft8
header("Content-type: text/html; charset=utf-8");
### Disable page caching ###
header("Expires: -1");
header("Cache-Control: post-check=0, pre-check=0");
header("Pragma: no-cache");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
echo sprintf(confGet('MESSAGE_OFFLINE'), confGet('EMAIL_ADMINISTRATOR'), confGet('EMAIL_ADMINISTRATOR'));
echo $result;
exit;
}
}
return true;
}
示例8: render_blockFooter
function render_blockFooter()
{
global $PH;
global $g_valid_login_params;
$form = new PageForm();
$form->add(new Form_Input('login_name', __('Nickname', 'label in login form'), ''));
$form->add(new Form_Password('login_password', __('Password', 'label in login form'), ''));
#$form->form_options[]="<span class=option><input name='login_forgot_password' class='checker' type=checkbox>".__("I forgot my password")."</span>";
$form->form_options[] = $PH->getLink('loginForgotPassword');
if (confGet('ANONYMOUS_USER')) {
$form->form_options[] = $PH->getLink('home', __("Continue anonymously"));
}
### add probably go-values as hidden fields ###
$go_after = NULL;
if (confGet('USE_MOD_REWRITE') && get('go') == 'globalView') {
$go_after = get('id');
if ($go_after == 'login') {
$go_after = '';
}
} else {
$go_after = get('go');
}
if ($go_after != "" && $go_after != 'logout' && $go_after != 'loginForm' && $go_after != 'loginFormSubmit') {
$form->add(new Form_Hiddenfield('go_after', '', $go_after));
foreach ($g_valid_login_params as $var) {
if ($value = get($var)) {
$form->add(new Form_Hiddenfield($var, '', $value));
}
}
}
### guess user's local time with javascript ###
echo "<input type=hidden id=user_timeoffset name=user_timeoffset>";
echo '<script type="text/javascript">
var now = new Date();document.getElementById("user_timeoffset").value= (now.getHours() + ":" + now.getMinutes() +":"+ now.getSeconds());
</script>';
echo $form;
#$this->render_blockEnd();
$PH->go_submit = 'loginFormSubmit';
}
示例9: commentsMoveToFolder
/**
* move comments to folder...
*/
function commentsMoveToFolder()
{
global $PH;
$comment_ids = getPassedIds('comment', 'comments_*');
if (!$comment_ids) {
$PH->abortWarning(__("Select some comments to move"));
return;
}
/**
* if folder was given, directly move tasks...
*/
$target_id = -1;
# target is unknown
$folder_ids = getPassedIds('folder', 'folders_*');
if (count($folder_ids) == 1) {
if ($folder_task = Task::getVisibleById($folder_ids[0])) {
$target_id = $folder_task->id;
}
} else {
if (get('from_selection')) {
$target_id = 0;
# to ungrout to root?
}
}
if ($target_id != -1) {
if ($target_id != 0) {
if (!($target_task = Task::getEditableById($target_id))) {
$PH->abortWarning(__("insufficient rights"));
}
}
$count = 0;
foreach ($comment_ids as $id) {
if ($comment = Comment::getEditableById($id)) {
$comment->task = $target_id;
/**
* @@@ do we have to reset ->comment as well?
*
* this splits discussions into separate comments...
*/
$comment->comment = 0;
$comment->update();
} else {
new FeedbackWarning(sprintf(__("Can not edit comment %s"), asHtml($comment->name)));
}
}
### return to from-page? ###
if (!$PH->showFromPage()) {
$PH->show('home');
}
exit;
}
/**
* build page folder list to select target...
*/
require_once confGet('DIR_STREBER') . 'lists/list_tasks.inc.php';
### get project ####
if (!($comment = Comment::getVisibleById($comment_ids[0]))) {
$PH->abortWarning("could not get comment", ERROR_BUG);
}
if (!($project = Project::getVisibleById($comment->project))) {
$PH->abortWarning("task without project?", ERROR_BUG);
}
$page = new Page(array('use_jscalendar' => false, 'autofocus_field' => 'company_name'));
$page->cur_tab = 'projects';
$page->type = __("Edit tasks");
$page->title = $project->name;
$page->title_minor = __("Select one folder to move comments into");
$page->crumbs = build_project_crumbs($project);
$page->options[] = new NaviOption(array('target_id' => 'commentsMoveToFolder'));
echo new PageHeader();
echo new PageContentOpen();
echo __("... or select nothing to move to project root");
### write selected comments as hidden fields ###
foreach ($comment_ids as $id) {
if ($comment = Comment::getEditableById($id)) {
echo "<input type=hidden name='comments_{$id}_chk' value='1'>";
}
}
$list = new ListBlock_tasks();
$list->reduced_header = true;
$list->query_options['show_folders'] = true;
$list->query_options['folders_only'] = true;
$list->query_options['project'] = $project->id;
$list->groupings = NULL;
$list->block_functions = NULL;
$list->id = 'folders';
unset($list->columns['project']);
unset($list->columns['status']);
unset($list->columns['date_start']);
unset($list->columns['days_left']);
unset($list->columns['created_by']);
unset($list->columns['label']);
$list->no_items_html = __("No folders in this project...");
$list->functions = array();
$list->active_block_function = 'tree';
$list->print_automatic($project);
echo "<input type=hidden name='from_selection' value='1'>";
//.........这里部分代码省略.........
示例10: homeListEfforts
/**
* display efforts for current user @ingroup pages
*
* @NOTE
* - actually this is an excact copy for personViewEfforts
* - this is of course not a good solution, but otherwise the breadcrumbs would change
*
*/
function homeListEfforts()
{
global $PH;
global $auth;
require_once confGet('DIR_STREBER') . 'db/class_effort.inc.php';
require_once confGet('DIR_STREBER') . 'lists/list_efforts.inc.php';
### get current project ###
$person = $auth->cur_user;
$presets = array('all_efforts' => array('name' => __('all'), 'filters' => array('effort_status' => array('id' => 'effort_status', 'visible' => true, 'active' => true, 'min' => EFFORT_STATUS_NEW, 'max' => EFFORT_STATUS_BALANCED)), 'list_settings' => array('tasks' => array('hide_columns' => array(''), 'style' => 'list'))), 'new_efforts' => array('name' => __('new'), 'filters' => array('effort_status' => array('id' => 'effort_status', 'visible' => true, 'active' => true, 'min' => EFFORT_STATUS_NEW, 'max' => EFFORT_STATUS_NEW)), 'list_settings' => array('tasks' => array('hide_columns' => array(''), 'style' => 'list'))), 'open_efforts' => array('name' => __('open'), 'filters' => array('effort_status' => array('id' => 'effort_status', 'visible' => true, 'active' => true, 'min' => EFFORT_STATUS_OPEN, 'max' => EFFORT_STATUS_OPEN)), 'list_settings' => array('tasks' => array('hide_columns' => array(''), 'style' => 'list'))), 'discounted_efforts' => array('name' => __('discounted'), 'filters' => array('effort_status' => array('id' => 'effort_status', 'visible' => true, 'active' => true, 'min' => EFFORT_STATUS_DISCOUNTED, 'max' => EFFORT_STATUS_DISCOUNTED)), 'list_settings' => array('tasks' => array('hide_columns' => array(''), 'style' => 'list'))), 'notchargeable_efforts' => array('name' => __('not chargeable'), 'filters' => array('effort_status' => array('id' => 'effort_status', 'visible' => true, 'active' => true, 'min' => EFFORT_STATUS_NOTCHARGEABLE, 'max' => EFFORT_STATUS_NOTCHARGEABLE)), 'list_settings' => array('tasks' => array('hide_columns' => array(''), 'style' => 'list'))), 'balanced_efforts' => array('name' => __('balanced'), 'filters' => array('effort_status' => array('id' => 'effort_status', 'visible' => true, 'active' => true, 'min' => EFFORT_STATUS_BALANCED, 'max' => EFFORT_STATUS_BALANCED)), 'list_settings' => array('tasks' => array('hide_columns' => array(''), 'style' => 'list'))), 'last_logout' => array('name' => __('last logout'), 'filters' => array('last_logout' => array('id' => 'last_logout', 'visible' => true, 'active' => true, 'value' => $auth->cur_user->id)), 'list_settings' => array('changes' => array('hide_columns' => array(''), 'style' => 'list'))), 'last_week' => array('name' => __('1 week'), 'filters' => array('last_weeks' => array('id' => 'last_weeks', 'visible' => true, 'active' => true, 'factor' => 7, 'value' => $auth->cur_user->id)), 'list_settings' => array('changes' => array('hide_columns' => array(''), 'style' => 'list'))), 'last_two_weeks' => array('name' => __('2 weeks'), 'filters' => array('last_weeks' => array('id' => 'last_weeks', 'visible' => true, 'active' => true, 'factor' => 14, 'value' => $auth->cur_user->id)), 'list_settings' => array('changes' => array('hide_columns' => array(''), 'style' => 'list'))), 'last_three_weeks' => array('name' => __('3 weeks'), 'filters' => array('last_weeks' => array('id' => 'last_weeks', 'visible' => true, 'active' => true, 'factor' => 21, 'value' => $auth->cur_user->id)), 'list_settings' => array('changes' => array('hide_columns' => array(''), 'style' => 'list'))), 'last_month' => array('name' => __('1 month'), 'filters' => array('last_weeks' => array('id' => 'last_weeks', 'visible' => true, 'active' => true, 'factor' => 28, 'value' => $auth->cur_user->id)), 'list_settings' => array('changes' => array('hide_columns' => array(''), 'style' => 'list'))), 'prior' => array('name' => __('prior'), 'filters' => array('prior' => array('id' => 'prior', 'visible' => true, 'active' => true, 'factor' => 29, 'value' => $auth->cur_user->id)), 'list_settings' => array('changes' => array('hide_columns' => array(''), 'style' => 'list'))));
## set preset location ##
$preset_location = 'homeListEfforts';
$preset_id = 'all_efforts';
# default value
if ($tmp_preset_id = get('preset')) {
if (isset($presets[$tmp_preset_id])) {
$preset_id = $tmp_preset_id;
}
### set cookie
setcookie('STREBER_homeListEfforts_preset', $preset_id, time() + 60 * 60 * 24 * 30, '', '', 0);
} else {
if ($tmp_preset_id = get('STREBER_homeListEfforts_preset')) {
if (isset($presets[$tmp_preset_id])) {
$preset_id = $tmp_preset_id;
}
}
}
### create from handle ###
$PH->defineFromHandle(array('person' => $person->id, 'preset_id' => $preset_id));
$page = new Page();
$page->cur_tab = 'home';
$page->title = __("Your efforts");
$page->title_minor = __('Efforts', 'Page title add on');
$page->type = __("Person");
#$page->crumbs = build_person_crumbs($person);
$page->options = build_home_options($person);
echo new PageHeader();
echo new PageContentOpen();
$order_by = get('sort_' . $PH->cur_page->id . "_efforts");
require_once confGet('DIR_STREBER') . 'db/class_effort.inc.php';
/*$efforts= Effort::getAll(array(
'person' => $person->id,
'order_by' => $order_by,
));*/
$list = new ListBlock_efforts();
unset($list->functions['effortNew']);
unset($list->functions['effortNew']);
$list->no_items_html = __('no efforts yet');
$list->filters[] = new ListFilter_efforts();
$preset = $presets[$preset_id];
foreach ($preset['filters'] as $f_name => $f_settings) {
switch ($f_name) {
case 'effort_status':
$list->filters[] = new ListFilter_effort_status_min(array('value' => $f_settings['min']));
$list->filters[] = new ListFilter_effort_status_max(array('value' => $f_settings['max']));
break;
case 'last_logout':
$list->filters[] = new ListFilter_last_logout(array('value' => $f_settings['value']));
break;
case 'last_weeks':
$list->filters[] = new ListFilter_min_week(array('value' => $f_settings['value'], 'factor' => $f_settings['factor']));
break;
case 'prior':
$list->filters[] = new ListFilter_max_week(array('value' => $f_settings['value'], 'factor' => $f_settings['factor']));
break;
default:
trigger_error("Unknown filter setting {$f_name}", E_USER_WARNING);
break;
}
}
$filter_empty_folders = isset($preset['filter_empty_folders']) && $preset['filter_empty_folders'] ? true : NULL;
$page->print_presets(array('target' => $preset_location, 'project_id' => '', 'preset_id' => $preset_id, 'presets' => $presets, 'person_id' => $person->id));
$list->query_options['order_by'] = $order_by;
$list->query_options['person'] = $person->id;
$list->print_automatic();
//$list->render_list($efforts);
echo '<input type="hidden" name="person" value="' . $person->id . '">';
echo new PageContentClose();
echo new PageHtmlEnd();
}
示例11: _render_commentField
protected function _render_commentField()
{
global $PH;
echo "<div class=footer_form>";
require_once confGet('DIR_STREBER') . "render/render_form.inc.php";
$project = new Project($this->item_with_comments->project);
$form = new PageForm();
$form->button_cancel = false;
$form->add(new Form_CustomHTML('<h3>' . __("Add Comment") . "</h3>"));
### Comment ###
$comment_name = '';
$comment = new Comment(array('id' => 0, 'name' => $comment_name));
$e = $comment->fields['description']->getFormElement($comment, __('Comment'));
$e->rows = 8;
$form->add($e);
$form->add($comment->fields['name']->getFormElement($comment, __('Summary')));
### request feedback
$form->add(buildRequestFeedbackInput($project));
/**
* to reduce spam, enforce captcha test for guests
*/
global $auth;
if ($auth->cur_user->id == confGet('ANONYMOUS_USER')) {
$form->addCaptcha();
}
### some required hidden fields for correct data passing ###
$form->add(new Form_HiddenField('comment_task', '', $this->item_with_comments->id));
$form->add(new Form_HiddenField('comment', '', 0));
if ($return = get('return')) {
$form->add(new Form_HiddenField('return', '', asHtml($return)));
}
$PH->go_submit = 'commentEditSubmit';
echo $form;
echo "</div>";
}
示例12: render_tr
function render_tr(&$obj, $style = "")
{
if (!isset($obj) || !$obj instanceof Effort) {
trigger_error("ListBlock->render_tr() called without valid object", E_USER_WARNING);
return;
}
if ($obj->as_duration) {
echo "<td>-</td>";
} else {
$tmp = mysqlDatetime2utc($obj->time_start);
$day_time_start = confGet('DAYGRAPH_START_HOUR') * 60 * 60;
$day_time_end = confGet('DAYGRAPH_END_HOUR') * 60 * 60;
$stretch = confGet('DAYGRAPH_WIDTH') / ($day_time_end - $day_time_start);
$time_start = round(($tmp['hour'] * 60 * 60 + $tmp['min'] * 60 + $tmp['sec'] - $day_time_start) * $stretch, 0);
if ($time_start < 0) {
$time_start = 0;
}
$tmp = mysqlDatetime2utc($obj->time_end);
$time_end = round(($tmp['hour'] * 60 * 60 + $tmp['min'] * 60 + $tmp['sec'] - $day_time_start) * $stretch, 0);
if ($time_end < $time_start) {
$time_end = 0;
}
$time_len = $time_end - $time_start;
echo "<td>";
echo "<nobr>";
echo "<img src='" . getThemeFile("img/pixel.gif") . "' style='width:{$time_start}px;height:3px;'>";
echo "<img src='" . getThemeFile("img/pixel.gif") . "' style='width:{$time_len}px;height:12px;background-color:#f00;'>";
echo "</nobr>";
echo "</td>";
}
}
示例13: getUrlToItem
/**
* Depending on the MOD_REWRITE-setting, urls inside the Email have to look differently
*/
protected function getUrlToItem($id)
{
$url = confGet('SELF_PROTOCOL') . '://' . confGet('SELF_URL');
# returns something like http://localhost/streber/index.php
if (confGet('USE_MOD_REWRITE')) {
$url = str_replace('index.php', '', $url);
return $url . "/" . intval($id);
} else {
return $url . "?go=itemView&id=" . intval($id);
}
}
示例14: Copyright
exit;
}
# streber - a php based project management system
# Copyright (c) 2005 Thomas Mann - thomas@pixtur.de
# Distributed under the terms and conditions of the GPL as stated in docs/license.txt
/**\file
* pages relating to people
*
* @author Thomas Mann
*
*/
require_once confGet('DIR_STREBER') . 'db/class_task.inc.php';
require_once confGet('DIR_STREBER') . 'db/class_project.inc.php';
require_once confGet('DIR_STREBER') . 'db/class_person.inc.php';
require_once confGet('DIR_STREBER') . 'db/db_itemchange.inc.php';
require_once confGet('DIR_STREBER') . 'render/render_list.inc.php';
/**
* revert changes of a person
*
* Notes:
* - This function is only available of people with RIGHT_PROJECT_EDIT.
* - This will only effect changes to fields.
* - Following changes will not be reverted:
* - Creation of new items (Tasks, Topis, Efforts, Projects, etc.)
* - Task-assignments
* - Uploading of files
*
* person - id of person who did the changes
* data - date to with revert changes
* delete_history (Default off) - Reverting can't be undone! The person's modification are lost forever!
* This can be useful on massive changes to avoid sending huge
示例15: renderLinkFromItemId
/**
* tries to build a valid a href-link to an item.
*
* - uses $this->name
* - sets -this-html
* - does all the neccessary security checks, styles and conversions
*/
static function renderLinkFromItemId($target_id, $name = "")
{
global $PH;
$target_id = intval($target_id);
$html = "";
if (!($item = DbProjectItem::getVisibleById($target_id))) {
$html = '<em>' . sprintf(__("Unkwown item %s"), $target_id) . '</em>';
} else {
switch ($item->type) {
case ITEM_TASK:
if ($task = Task::getVisibleById($item->id)) {
$style_isdone = $task->status >= STATUS_COMPLETED ? 'isDone' : '';
if ($name) {
$html = $PH->getLink('taskView', $name, array('tsk' => $task->id), $style_isdone, true);
} else {
$html = $task->getLink(false);
}
}
break;
case ITEM_FILE:
require_once confGet('DIR_STREBER') . "db/class_file.inc.php";
if ($file = File::getVisibleById($item->id)) {
if ($name) {
$html = $PH->getLink('fileDownloadAsImage', $name, array('file' => $file->id), NULL, true);
} else {
$html = $PH->getLink('fileDownloadAsImage', $file->name, array('file' => $file->id));
}
}
break;
case ITEM_COMMENT:
require_once confGet('DIR_STREBER') . "db/class_comment.inc.php";
if ($comment = Comment::getVisibleById($item->id)) {
if ($name) {
$html = $PH->getLink('commentView', $name, array('comment' => $comment->id), NULL, true);
} else {
$html = $PH->getLink('commentView', $comment->name, array('comment' => $comment->id));
}
}
break;
case ITEM_PERSON:
if ($person = Person::getVisibleById($item->id)) {
if ($name) {
$html = $PH->getLink('personView', $name, array('person' => $person->id), NULL, true);
} else {
$html = $PH->getLink('personView', $person->name, array('person' => $person->id));
}
}
break;
case ITEM_PROJECT:
if ($project = Project::getVisibleById($item->id)) {
if ($name == "") {
$name = asHtml($project->name);
}
$html = $PH->getLink('projView', $name, array('prj' => $project->id), NULL, true);
}
break;
default:
$html = '<em>' . sprintf(__('Cannot link to item #%s of type %s'), intval($target_id), $item->type) . '</em>';
break;
}
}
return $html;
}