本文整理汇总了PHP中bug_is_readonly函数的典型用法代码示例。如果您正苦于以下问题:PHP bug_is_readonly函数的具体用法?PHP bug_is_readonly怎么用?PHP bug_is_readonly使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bug_is_readonly函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_update_product_build_validate
/**
* Validates the action on the specified bug id.
*
* @param $p_bug_id Bug ID
* @return string|null On failure: the reason why the action could not be validated. On success: null.
*/
function action_update_product_build_validate($p_bug_id)
{
$t_bug_id = (int) $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
return lang_get('actiongroup_error_issue_is_readonly');
}
if (!access_has_bug_level(config_get('update_bug_threshold'), $t_bug_id)) {
return lang_get('access_denied');
}
return null;
}
示例2: action_update_severity_validate
/**
* Validates the action on the specified bug id.
*
* @return string|null On failure: the reason why the action could not be validated. On success: null.
*/
function action_update_severity_validate($p_bug_id)
{
$f_severity = gpc_get_string('severity');
$t_update_severity_threshold = config_get('update_bug_threshold');
$t_bug_id = $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
return lang_get('actiongroup_error_issue_is_readonly');
}
if (!access_has_bug_level($t_update_severity_threshold, $t_bug_id)) {
return lang_get('access_denied');
}
return null;
}
示例3: action_update_product_build_validate
/**
* Validates the action on the specified bug id.
*
* @param $p_bug_id Bug ID
* @return true|array Action can be applied., bug_id => reason for failure
*/
function action_update_product_build_validate($p_bug_id)
{
$t_bug_id = (int) $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
$t_failed_validation_ids = array();
$t_failed_validation_ids[$t_bug_id] = lang_get('actiongroup_error_issue_is_readonly');
return $t_failed_validation_ids;
}
if (!access_has_bug_level(config_get('update_bug_threshold'), $t_bug_id)) {
$t_failed_validation_ids = array();
$t_failed_validation_ids[$t_bug_id] = lang_get('access_denied');
return $t_failed_validation_ids;
}
return true;
}
示例4: action_update_severity_validate
/**
* Validates the action on the specified bug id.
*
* @returns true Action can be applied.
* @returns array( bug_id => reason for failure )
*/
function action_update_severity_validate($p_bug_id)
{
$f_severity = gpc_get_string('severity');
$t_failed_validation_ids = array();
$t_update_severity_threshold = config_get('update_bug_threshold');
$t_bug_id = $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
$t_failed_validation_ids[$t_bug_id] = lang_get('actiongroup_error_issue_is_readonly');
return $t_failed_validation_ids;
}
if (!access_has_bug_level($t_update_severity_threshold, $t_bug_id)) {
$t_failed_validation_ids[$t_bug_id] = lang_get('access_denied');
return $t_failed_validation_ids;
}
return true;
}
示例5: action_add_note_validate
/**
* Validates the action on the specified bug id.
*
* @returns true|array Action can be applied., ( bug_id => reason for failure )
*/
function action_add_note_validate($p_bug_id)
{
$f_bugnote_text = gpc_get_string('bugnote_text');
if (is_blank($f_bugnote_text)) {
error_parameters(lang_get('bugnote'));
trigger_error(ERROR_EMPTY_FIELD, ERROR);
}
$t_failed_validation_ids = array();
$t_add_bugnote_threshold = config_get('add_bugnote_threshold');
$t_bug_id = $p_bug_id;
if (bug_is_readonly($t_bug_id)) {
$t_failed_validation_ids[$t_bug_id] = lang_get('actiongroup_error_issue_is_readonly');
return $t_failed_validation_ids;
}
if (!access_has_bug_level($t_add_bugnote_threshold, $t_bug_id)) {
$t_failed_validation_ids[$t_bug_id] = lang_get('access_denied');
return $t_failed_validation_ids;
}
return true;
}
示例6:
style="width:50px;">
<input type="hidden" name="businessValueOld[<?php
echo $row['id'];
?>
]" value="<?php
echo $row['businessValue'];
?>
"/>
</td>
<td><?php
echo $row['storyPoints'];
?>
</td>
<td width="20">
<?php
if (!bug_is_readonly($row['id'])) {
?>
<a href="bug_update_page.php?bug_id=<?php
echo $row['id'];
?>
" height="16" width="16"><img src="images/update.png" alt="Detailinformation zur User Story bearbeiten" height="16" width="16"></a><?php
}
?>
</td>
<td><a href="view.php?id=<?php
echo $row['id'];
?>
"><?php
echo $row['id'];
?>
</a></td>
示例7: require_api
require_api('helper_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('profile_api.php');
require_api('project_api.php');
require_api('relationship_api.php');
require_api('string_api.php');
require_api('utility_api.php');
require_api('version_api.php');
$f_master_bug_id = gpc_get_int('m_id', 0);
if ($f_master_bug_id > 0) {
# master bug exists...
bug_ensure_exists($f_master_bug_id);
# master bug is not read-only...
if (bug_is_readonly($f_master_bug_id)) {
error_parameters($f_master_bug_id);
trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
}
$t_bug = bug_get($f_master_bug_id, true);
#@@@ (thraxisp) Note that the master bug is cloned into the same project as the master, independent of
# what the current project is set to.
if ($t_bug->project_id != helper_get_current_project()) {
# in case the current project is not the same project of the bug we are viewing...
# ... override the current project. This to avoid problems with categories and handlers lists etc.
$g_project_override = $t_bug->project_id;
$t_changed_project = true;
} else {
$t_changed_project = false;
}
access_ensure_project_level(config_get('report_bug_threshold'));
示例8: print_column_edit
function print_column_edit($p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
if ($p_columns_target != COLUMNS_TARGET_CSV_PAGE) {
global $t_icon_path, $t_update_bug_threshold;
echo '<td>';
if (!bug_is_readonly($p_row['id']) && access_has_bug_level($t_update_bug_threshold, $p_row['id'])) {
echo '<a href="' . string_get_bug_update_url($p_row['id']) . '">';
echo '<img border="0" width="16" height="16" src="' . $t_icon_path . 'update.png';
echo '" alt="' . lang_get('update_bug_button') . '"';
echo ' title="' . lang_get('update_bug_button') . '" /></a>';
} else {
echo ' ';
}
echo '</td>';
}
}
示例9: require_api
require_api('error_api.php');
require_api('event_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('print_api.php');
require_api('string_api.php');
form_security_validate('bugnote_update');
$f_bugnote_id = gpc_get_int('bugnote_id');
$f_bugnote_text = gpc_get_string('bugnote_text', '');
$f_time_tracking = gpc_get_string('time_tracking', '0:00');
# Check if the current user is allowed to edit the bugnote
$t_user_id = auth_get_current_user_id();
$t_reporter_id = bugnote_get_field($f_bugnote_id, 'reporter_id');
if ($t_user_id == $t_reporter_id) {
access_ensure_bugnote_level(config_get('bugnote_user_edit_threshold'), $f_bugnote_id);
} else {
access_ensure_bugnote_level(config_get('update_bugnote_threshold'), $f_bugnote_id);
}
# Check if the bug is readonly
$t_bug_id = bugnote_get_field($f_bugnote_id, 'bug_id');
if (bug_is_readonly($t_bug_id)) {
error_parameters($t_bug_id);
trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
}
$f_bugnote_text = trim($f_bugnote_text) . "\n\n";
bugnote_set_text($f_bugnote_id, $f_bugnote_text);
bugnote_set_time_tracking($f_bugnote_id, $f_time_tracking);
# Plugin integration
event_signal('EVENT_BUGNOTE_EDIT', array($t_bug_id, $f_bugnote_id));
form_security_purge('bugnote_update');
print_successful_redirect(string_get_bug_view_url($t_bug_id) . '#bugnotes');
示例10: post
public function post($request)
{
/**
* Creates a new bugnote.
*
* Sets the location header and returns the main URL of the created resource,
* as RFC2616 says we SHOULD.
*
* @param $request - The Request we're responding to
*/
$this->bug_id = BugnoteList::get_bug_id_from_url($request->url);
if (!access_has_bug_level(config_get('add_bugnote_threshold'), $this->bug_id)) {
throw new HTTPException(403, "Access denied to add bugnote");
}
if (bug_is_readonly($this->bug_id)) {
throw new HTTPException(500, "Cannot add a bugnote to a read-only bug");
}
$new_note = new Bugnote();
$new_note->populate_from_repr($request->body);
$bugnote_added = bugnote_add($this->bug_id, $new_note->mantis_data['note'], '0:00', $new_note->mantis_data['view_state'] == VS_PRIVATE);
if ($bugnote_added) {
$bugnote_added_url = Bugnote::get_url_from_mantis_id($bugnote_added);
$this->rsrc_data = $bugnote_added_url;
$resp = new Response();
$resp->headers[] = "location: {$bugnote_added_url}";
$resp->status = 201;
$resp->body = json_encode($bugnote_added_url);
return $resp;
} else {
throw new HTTPException(500, "Couldn't create bugnote");
}
}
示例11: mc_issue_relationship_delete
/**
* Delete the relationship with the specified target id.
*
* @param string $p_username The name of the user trying to add a note to an issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_id The id of the source issue for the relationship.
* @param integer $p_relationship_id The id of relationship to delete.
* @return boolean true: success, false: failure
*/
function mc_issue_relationship_delete($p_username, $p_password, $p_issue_id, $p_relationship_id)
{
global $g_project_override;
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return mci_soap_fault_login_failed();
}
$t_project_id = bug_get_field($p_issue_id, 'project_id');
$g_project_override = $t_project_id;
if (!mci_has_readwrite_access($t_user_id, $t_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
# user has access to update the bug...
if (!access_has_bug_level(config_get('update_bug_threshold'), $p_issue_id, $t_user_id)) {
return mci_soap_fault_access_denied($t_user_id, 'Active user does not have access level required to remove a relationship from this issue.');
}
# bug is not read-only...
if (bug_is_readonly($p_issue_id)) {
return mci_soap_fault_access_denied($t_user_id, 'Issue \'' . $p_issue_id . '\' is readonly.');
}
# retrieve the destination bug of the relationship
$t_dest_issue_id = relationship_get_linked_bug_id($p_relationship_id, $p_issue_id);
# user can access to the related bug at least as viewer, if it's exist...
if (bug_exists($t_dest_issue_id)) {
if (!access_has_bug_level(config_get('view_bug_threshold', null, null, $t_project_id), $t_dest_issue_id, $t_user_id)) {
return mci_soap_fault_access_denied($t_user_id, 'The issue \'' . $t_dest_issue_id . '\' requires higher access level.');
}
}
$t_bug_relationship_data = relationship_get($p_relationship_id);
$t_rel_type = $t_bug_relationship_data->type;
# delete relationship from the DB
log_event(LOG_WEBSERVICE, 'deleting relationship id \'' . $p_relationship_id . '\'');
relationship_delete($p_relationship_id);
# update bug last updated
bug_update_date($p_issue_id);
bug_update_date($t_dest_issue_id);
# set the rel_type for both bug and dest_bug based on $t_rel_type and on who is the dest bug
if ($p_issue_id == $t_bug_relationship_data->src_bug_id) {
$t_bug_rel_type = $t_rel_type;
$t_dest_bug_rel_type = relationship_get_complementary_type($t_rel_type);
} else {
$t_bug_rel_type = relationship_get_complementary_type($t_rel_type);
$t_dest_bug_rel_type = $t_rel_type;
}
# send email and update the history for the src issue
history_log_event_special($p_issue_id, BUG_DEL_RELATIONSHIP, $t_bug_rel_type, $t_dest_issue_id);
email_relationship_deleted($p_issue_id, $t_dest_issue_id, $t_bug_rel_type);
if (bug_exists($t_dest_issue_id)) {
# send email and update the history for the dest issue
history_log_event_special($t_dest_issue_id, BUG_DEL_RELATIONSHIP, $t_dest_bug_rel_type, $p_issue_id);
email_relationship_deleted($t_dest_issue_id, $p_issue_id, $t_dest_bug_rel_type);
}
return true;
}
示例12: bfebugnote
function bfebugnote($t_event, $t_bug_id, $t_bugnote_id, $t_bugnote_is_private)
{
if ($t_bugnote_is_private) {
# WK: zwei neue CSS-Klassen für unsere zusätzlichen Links
$t_bugnote_bfe_css = 'bugnote-bfe-private';
$t_spacer_bfe_css = 'spacer-bfe-private';
} else {
# WK: zwei weitere CSS-Klassen für unsere zusätzlichen Links
$t_bugnote_bfe_css = 'bugnote-bfe-public';
$t_spacer_bfe_css = 'spacer-bfe-public';
}
# Mod WK/BFE: Diese Links sind die neue BFE-Funktion Notiz klonen. Nur ab Recht 'Projekte bearbeiten' oder ab Rolle 'Entwickler vor Ort'
if (!bug_is_readonly($t_bug_id)) {
if (access_has_bug_level(config_get('manage_project_threshold'), $t_bug_id) || access_has_project_level(50)) {
$t_src = relationship_get_all_src($t_bug_id);
$t_src_count = count($t_src);
$t_dest = relationship_get_all_dest($t_bug_id);
$t_dest_count = count($t_dest);
if ($t_src_count || $t_dest_count) {
echo '<tr class="row-1">';
echo ' <td class="' . $t_bugnote_bfe_css . '" colspan="2">';
# Zunächst die Destination Bug IDs
for ($z = 0; $z < $t_src_count; $z++) {
$t_thisbugid = $t_src[$z]->dest_bug_id;
$t_thisbugsumm = bug_get_field($t_thisbugid, 'summary');
$t_thisprojectid = bug_get_field($t_thisbugid, 'project_id');
echo '<a href="view.php?id=' . $t_thisbugid . '&bugnote_id=' . $t_bugnote_id . '#bugnotes">';
echo "Notiz klonen in Issue ";
echo bug_format_id($t_thisbugid) . ': ' . $t_thisbugsumm . ' [' . project_get_field($t_thisprojectid, 'name') . ']</a><br />';
}
# und jetzt die Source Bug IDs
for ($z = 0; $z < $t_dest_count; $z++) {
$t_thisbugid = $t_dest[$z]->src_bug_id;
$t_thisbugsumm = bug_get_field($t_thisbugid, 'summary');
$t_thisprojectid = bug_get_field($t_thisbugid, 'project_id');
echo '<a href="view.php?id=' . $t_thisbugid . '&bugnote_id=' . $t_bugnote_id . '#bugnotes">';
echo "Notiz klonen in Issue ";
echo bug_format_id($t_thisbugid) . ': ' . $t_thisbugsumm . ' [' . project_get_field($t_thisprojectid, 'name') . ']</a><br />';
}
echo ' </td>';
echo '</tr>';
}
}
}
echo '<tr class="' . $t_spacer_bfe_css . '" />';
}
示例13: require_api
return;
}
require_api( 'access_api.php' );
require_api( 'bug_api.php' );
require_api( 'collapse_api.php' );
require_api( 'config_api.php' );
require_api( 'constant_inc.php' );
require_api( 'event_api.php' );
require_api( 'form_api.php' );
require_api( 'helper_api.php' );
require_api( 'html_api.php' );
require_api( 'lang_api.php' );
?>
<?php if ( ( !bug_is_readonly( $f_bug_id ) ) &&
( access_has_bug_level( config_get( 'add_bugnote_threshold' ), $f_bug_id ) ) ) { ?>
<?php # Bugnote Add Form BEGIN ?>
<a id="addbugnote"></a> <br />
<?php
collapse_open( 'bugnote_add' );
?>
<form name="bugnoteadd" method="post" action="bugnote_add.php">
<?php echo form_security_field( 'bugnote_add' ) ?>
<input type="hidden" name="bug_id" value="<?php echo $f_bug_id ?>" />
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="2">
<?php
collapse_icon( 'bugnote_add' );
示例14: put
public function put($request)
{
/**
* Updates the note.
*
* Only the text and view state of the note can be altered.
*
* @param $request - The request we're responding to
*/
$this->note_id = Bugnote::get_mantis_id_from_url($request->url);
if (!bugnote_exists($this->note_id)) {
throw new HTTPException(404, "No such bug note: {$this->note_id}");
}
# Check if the current user is allowed to edit the bugnote
# (This comes from Mantis's bugnote_update.php)
$user_id = auth_get_current_user_id();
$reporter_id = bugnote_get_field($this->note_id, 'reporter_id');
$bug_id = bugnote_get_field($this->note_id, 'bug_id');
if ($user_id != $reporter_id || OFF == config_get('bugnote_allow_user_edit_delete')) {
if (!access_has_bugnote_level(config_get('update_bugnote_threshold'), $this->note_id)) {
throw new HTTPException(403, "Access denied");
}
}
if (bug_is_readonly($bug_id)) {
throw new HTTPException(500, "Can't edit a note on a read-only bug");
}
$this->populate_from_repr($request->body);
bugnote_set_view_state($this->note_id, !!$this->_get_rsrc_attr('private'));
bugnote_set_text($this->note_id, $this->_get_mantis_attr('note'));
$resp = new Response();
$resp->status = 204;
return $resp;
}
示例15: mc_issue_relationship_delete
/**
* Delete the relationship with the specified target id.
*
* @param string $p_username The name of the user trying to add a note to an issue.
* @param string $p_password The password of the user.
* @param integer $p_issue_id The id of the source issue for the relationship
* @param integer $p_relationship_id The id of relationship to delete.
* @return true: success, false: failure
*/
function mc_issue_relationship_delete($p_username, $p_password, $p_issue_id, $p_relationship_id)
{
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return new soap_fault('Client', '', 'Access Denied');
}
$t_project_id = bug_get_field($p_issue_id, 'project_id');
if (!mci_has_readwrite_access($t_user_id, $t_project_id)) {
return new soap_fault('Client', '', 'Access Denied');
}
# user has access to update the bug...
if (!access_has_bug_level(config_get('update_bug_threshold'), $p_issue_id, $t_user_id)) {
return new soap_fault('Client', '', "Active user does not have access level required to remove a relationship from this issue.");
}
# bug is not read-only...
if (bug_is_readonly($p_issue_id)) {
return new soap_fault('Client', '', "Issue '{$p_issue_id}' is readonly.");
}
# retrieve the destination bug of the relationship
$t_dest_issue_id = relationship_get_linked_bug_id($p_relationship_id, $p_issue_id);
# user can access to the related bug at least as viewer, if it's exist...
if (bug_exists($t_dest_issue_id)) {
if (!access_has_bug_level(VIEWER, $t_dest_issue_id, $t_user_id)) {
return new soap_fault('Client', '', "The issue '{$t_dest_issue_id}' requires higher access level.");
}
}
$t_bug_relationship_data = relationship_get($p_relationship_id);
$t_rel_type = $t_bug_relationship_data->type;
# delete relationship from the DB
relationship_delete($p_relationship_id);
# update bug last updated (just for the src bug)
bug_update_date($p_issue_id);
# set the rel_type for both bug and dest_bug based on $t_rel_type and on who is the dest bug
if ($p_issue_id == $t_bug_relationship_data->src_bug_id) {
$t_bug_rel_type = $t_rel_type;
$t_dest_bug_rel_type = relationship_get_complementary_type($t_rel_type);
} else {
$t_bug_rel_type = relationship_get_complementary_type($t_rel_type);
$t_dest_bug_rel_type = $t_rel_type;
}
# send email and update the history for the src issue
history_log_event_special($p_issue_id, BUG_DEL_RELATIONSHIP, $t_bug_rel_type, $t_dest_issue_id);
email_relationship_deleted($p_issue_id, $t_dest_issue_id, $t_bug_rel_type);
if (bug_exists($t_dest_issue_id)) {
# send email and update the history for the dest issue
history_log_event_special($t_dest_issue_id, BUG_DEL_RELATIONSHIP, $t_dest_bug_rel_type, $p_issue_id);
email_relationship_deleted($t_dest_issue_id, $p_issue_id, $t_dest_bug_rel_type);
}
return true;
}