Skip to content

Commit

Permalink
Merge branch 'modern-ui-2' of github.com:syncguru/mantisbt into moder…
Browse files Browse the repository at this point in the history
…n-ui-2

# Conflicts:
#	adm_config_report.php
#	core/html_api.php
  • Loading branch information
syncguru committed Nov 24, 2015
2 parents 80cf299 + 8e5f7da commit 95a97ff
Show file tree
Hide file tree
Showing 214 changed files with 1,673 additions and 581 deletions.
2 changes: 0 additions & 2 deletions adm_config_report.php
Expand Up @@ -57,11 +57,9 @@
$t_read_write_access = access_has_global_level( config_get( 'set_configuration_threshold' ) );

layout_page_header( lang_get( 'configuration_report' ) );

layout_page_begin( 'manage_overview_page.php' );

print_manage_menu( 'adm_permissions_report.php' );

print_manage_config_menu( 'adm_config_report.php' );

$t_config_types = array(
Expand Down
2 changes: 1 addition & 1 deletion admin/index.php
Expand Up @@ -70,7 +70,7 @@ function print_info_row( $p_description, $p_value ) {
} else {
$t_version_suffix = '';
}
print_info_row( lang_get( 'mantis_version' ), MANTIS_VERSION, $t_version_suffix );
print_info_row( lang_get( 'mantis_version' ), MANTIS_VERSION . $t_version_suffix );
print_info_row( lang_get( 'php_version' ), phpversion() );
?>
<tr>
Expand Down
1 change: 0 additions & 1 deletion api/soap/mc_filter_api.php
Expand Up @@ -274,7 +274,6 @@ function mci_filter_search_get_rows( $p_user_id, $p_filter_search, $p_page_numbe

$t_filter = filter_ensure_valid_filter( $t_filter );

$t_result = array();
$t_page_number = $p_page_number < 1 ? 1 : $p_page_number;
$t_page_count = 0;
$t_bug_count = 0;
Expand Down
5 changes: 1 addition & 4 deletions api/soap/mc_issue_api.php
Expand Up @@ -391,7 +391,6 @@ function mci_issue_get_relationships( $p_issue_id, $p_user_id ) {
function mci_issue_get_notes( $p_issue_id ) {
$t_user_id = auth_get_current_user_id();
$t_lang = mci_get_user_lang( $t_user_id );
$t_project_id = bug_get_field( $p_issue_id, 'project_id' );
$t_user_bugnote_order = 'ASC'; # always get the notes in ascending order for consistency to the calling application.
$t_has_time_tracking_access = access_has_bug_level( config_get( 'time_tracking_view_threshold' ), $p_issue_id );

Expand Down Expand Up @@ -1731,8 +1730,6 @@ function mc_issues_get_header( $p_username, $p_password, $p_issue_ids ) {
return mci_soap_fault_login_failed();
}

$t_lang = mci_get_user_lang( $t_user_id );

$t_result = array();
foreach( $p_issue_ids as $t_id ) {

Expand All @@ -1742,7 +1739,7 @@ function mc_issues_get_header( $p_username, $p_password, $p_issue_ids ) {
log_event( LOG_WEBSERVICE, 'getting details for issue \'' . $t_id . '\'' );

$t_issue_data = bug_get( $t_id, true );
$t_result[] = mci_issue_data_as_header_array( $t_issue_data, $t_user_id, $t_lang );
$t_result[] = mci_issue_data_as_header_array( $t_issue_data );
}

return $t_result;
Expand Down
2 changes: 0 additions & 2 deletions api/soap/mc_project_api.php
Expand Up @@ -1072,8 +1072,6 @@ function mc_project_get_users( $p_username, $p_password, $p_project_id, $p_acces
return mci_soap_fault_login_failed();
}

$t_users = array();

$g_project_override = $p_project_id;

$t_users = project_get_all_user_rows( $p_project_id, $p_access ); # handles ALL_PROJECTS case
Expand Down
7 changes: 2 additions & 5 deletions bug_sponsorship_list_view_inc.php
Expand Up @@ -87,10 +87,8 @@
<td width="50" rowspan="3">
<img src="images/dollars.gif" alt="<?php echo lang_get( 'sponsor_verb' ) ?>" />
</td>
<td class="bold" colspan="2">
<?php
<td class="form-title" colspan="2"><?php
collapse_icon( 'sponsorship' );

echo lang_get( 'users_sponsoring_bug' );

$t_details_url = lang_get( 'sponsorship_process_url' );
Expand Down Expand Up @@ -162,8 +160,7 @@

<table class="width100" cellspacing="1">
<tr>
<td class="bold">
<?php
<td class="form-title"><?php
collapse_icon( 'sponsorship' );
echo lang_get( 'users_sponsoring_bug' );

Expand Down
14 changes: 7 additions & 7 deletions bug_update.php
Expand Up @@ -276,12 +276,7 @@
foreach ( $t_related_custom_field_ids as $t_cf_id ) {
$t_cf_def = custom_field_get_definition( $t_cf_id );

# if this is not a full update action and custom field is not on the form, then don't
# continue with code that checks access level and validates the field.
if ( $f_update_type != BUG_UPDATE_TYPE_NORMAL && !custom_field_is_present( $t_cf_id ) ) {
continue;
}

# If the custom field is not set and is required, then complain!
if( !gpc_isset_custom_field( $t_cf_id, $t_cf_def['type'] ) ) {
if( $t_cf_def[$t_cf_require_check] &&
$f_update_type == BUG_UPDATE_TYPE_NORMAL &&
Expand All @@ -293,11 +288,16 @@
}
}

# Otherwise, if not present then skip it.
if ( !custom_field_is_present( $t_cf_id ) ) {
continue;
}

if( !custom_field_has_write_access( $t_cf_id, $f_bug_id ) ) {
trigger_error( ERROR_ACCESS_DENIED, ERROR );
}

$t_new_custom_field_value = gpc_get_custom_field( 'custom_field_' . $t_cf_id, $t_cf_def['type'], null );
$t_new_custom_field_value = gpc_get_custom_field( 'custom_field_' . $t_cf_id, $t_cf_def['type'], '' );
$t_old_custom_field_value = custom_field_get_value( $t_cf_id, $f_bug_id );

# Validate the value of the field against current validation rules.
Expand Down
4 changes: 2 additions & 2 deletions bug_update_page.php
Expand Up @@ -210,7 +210,7 @@
?>
<tbody>
<?php
event_signal( 'EVENT_UPDATE_BUG_FORM_TOP', array( $t_bug_id, true ) );
event_signal( 'EVENT_UPDATE_BUG_FORM_TOP', array( $t_bug_id ) );

if( $t_show_id || $t_show_project || $t_show_category || $t_show_view_state || $t_show_date_submitted | $t_show_last_updated ) {
#
Expand Down Expand Up @@ -641,7 +641,7 @@
echo '</tr>';
}

event_signal( 'EVENT_UPDATE_BUG_FORM', array( $t_bug_id, true ) );
event_signal( 'EVENT_UPDATE_BUG_FORM', array( $t_bug_id ) );

# spacer
echo '<tr class="spacer"><td colspan="6"></td></tr>';
Expand Down
13 changes: 4 additions & 9 deletions config_defaults_inc.php
Expand Up @@ -356,19 +356,12 @@

/**
* absolute path (with trailing slash!) to folder which contains your
* TrueType-Font files used to create the captcha image and since 0.19.3 for
* the Relationship Graphs
* TrueType-Font files used for the Relationship Graphs,
* the Workflow Graphs and the MantisGraph plugin
* @global string $g_system_font_folder
*/
$g_system_font_folder = '';

/**
* font name used to create the captcha image. i.e. arial.ttf
* (the font file has to exist in the system_font_folder)
* @global string $g_font_per_captcha
*/
$g_font_per_captcha = 'arial.ttf';

/**
* Setting to disable the 'lost your password' feature.
* @global integer $g_lost_password_feature
Expand Down Expand Up @@ -714,6 +707,7 @@
'amharic',
'arabic',
'arabicegyptianspoken',
'asturian',
'belarusian_tarask',
'breton',
'bulgarian',
Expand Down Expand Up @@ -773,6 +767,7 @@
'am' => 'amharic',
'ar' => 'arabic',
'arz' => 'arabicegyptianspoken',
'ast' => 'asturian',
'be-tarask' => 'belarusian_tarask',
'bg' => 'bulgarian',
'br' => 'breton',
Expand Down
2 changes: 1 addition & 1 deletion core/cfdefs/cfdef_standard.php
Expand Up @@ -324,7 +324,7 @@ function cfdef_input_checkbox( array $p_field_def, $p_custom_field_value ) {
echo '<input id="$t_input_id" ' . helper_get_tab_index() . ' type="checkbox" name="' . $t_input_name . '" value="' . string_attribute( $t_values[$i] ) . '"';
check_checked( $t_checked_values, $t_values[$i] );
echo " />\n";
echo '<label for="' . $t_input_id . '">"' . string_display_line( $t_values[$i] ) . '</label>' . "\n";
echo '<label for="' . $t_input_id . '">' . string_display_line( $t_values[$i] ) . '</label>' . "\n";
}
}

Expand Down
20 changes: 7 additions & 13 deletions core/collapse_api.php
Expand Up @@ -53,8 +53,7 @@

/**
* Marks the beginning of a collapse block's open phase.
* This will be visible if the block is expanded, or if
* javascript is disabled.
* This will be visible if the block is expanded or javascript is disabled.
* @param string $p_name Collapse block name.
* @param string $p_section Collapse block section.
* @param string $p_css_class CSS class to apply to the div (defaults to none).
Expand Down Expand Up @@ -86,8 +85,8 @@ function collapse_open( $p_name, $p_section = '', $p_css_class = '' ) {

/**
* Marks the end of a collapse block's open phase and the beginning
* of the block's closed phase. This will only be visible if the
* block have been collapsed and javascript is enabled.
* of the closed phase.
* This will be visible if the block is collapsed and javascript is enabled.
* @param string $p_name Collapse block name.
* @param string $p_section Collapse block section.
* @return void
Expand All @@ -107,10 +106,10 @@ function collapse_closed( $p_name, $p_section = '' ) {

$g_open_collapse_section = false;

ob_start();

$t_div_id = $t_block . '_closed';
echo "\n<div id=\"", $t_div_id, '"', ( $t_display ? ' class="collapse-open"' : ' class="collapse-closed"' ), '>';
$t_collapse_status_class = $t_display ? 'collapse-open' : 'collapse-closed';
echo "\n" . '<div id="', $t_div_id,
'" class="collapse-section-closed ' . $t_collapse_status_class . '">';
}

/**
Expand All @@ -134,12 +133,11 @@ function collapse_icon( $p_name, $p_section = '' ) {
$t_id = $p_name. '_closed_link';
}

echo '<a id="', $t_id, '" href="" class="collapse-link"><img src="images/', $t_icon, '" alt="', $t_alt, '" /></a>&#160;';
echo '<a id="', $t_id, '" class="collapse-link"><img src="images/', $t_icon, '" alt="', $t_alt, '" /></a>';
}

/**
* Marks the end of a collapse block's closed phase.
* Closed phase output is discarded if javascript is disabled.
* @param string $p_name Collapse block name.
* @param string $p_section Collapse block section.
* @return void
Expand All @@ -152,16 +150,12 @@ function collapse_end( $p_name, $p_section = '' ) {

# Make sure a section is opened, and it is the same section.
if( $t_block !== $g_current_collapse_section ) {
ob_end_clean();
trigger_error( ERROR_GENERIC, ERROR );
}

echo '</div>';

$g_open_collapse_section = false;

ob_end_flush();

$g_current_collapse_section = null;
}

Expand Down
8 changes: 6 additions & 2 deletions core/custom_field_api.php
Expand Up @@ -1114,10 +1114,14 @@ function custom_field_distinct_values( array $p_field_def, $p_project_id = ALL_P
*/
function custom_field_value_to_database( $p_value, $p_type ) {
global $g_custom_field_type_definition;

$t_value = $p_value;

if( isset( $g_custom_field_type_definition[$p_type]['#function_value_to_database'] ) ) {
return call_user_func( $g_custom_field_type_definition[$p_type]['#function_value_to_database'], $p_value );
$t_value = call_user_func( $g_custom_field_type_definition[$p_type]['#function_value_to_database'], $p_value );
}
return $p_value;

return $t_value === null ? '' : $t_value;
}

/**
Expand Down
13 changes: 5 additions & 8 deletions core/email_api.php
Expand Up @@ -455,12 +455,11 @@ function email_collect_recipients( $p_bug_id, $p_notify_type, array $p_extra_use
/**
* Send password to user
* @param integer $p_user_id A valid user identifier.
* @param string $p_password A valid password.
* @param string $p_confirm_hash Confirmation hash.
* @param string $p_admin_name Administrator name.
* @return void
*/
function email_signup( $p_user_id, $p_password, $p_confirm_hash, $p_admin_name = '' ) {
function email_signup( $p_user_id, $p_confirm_hash, $p_admin_name = '' ) {
if( ( OFF == config_get( 'send_reset_password' ) ) || ( OFF == config_get( 'enable_email_notification' ) ) ) {
return;
}
Expand Down Expand Up @@ -569,7 +568,7 @@ function email_generic( $p_bug_id, $p_notify_type, $p_message_id = null, array $
# @todo yarick123: email_collect_recipients(...) will be completely rewritten to provide additional information such as language, user access,..
# @todo yarick123:sort recipients list by language to reduce switches between different languages
$t_recipients = email_collect_recipients( $p_bug_id, $p_notify_type, $p_extra_user_ids_to_email );
email_generic_to_recipients( $p_bug_id, $p_notify_type, $t_recipients, $p_message_id, $p_header_optional_params, $p_extra_user_ids_to_email );
email_generic_to_recipients( $p_bug_id, $p_notify_type, $t_recipients, $p_message_id, $p_header_optional_params );
}

/**
Expand Down Expand Up @@ -602,7 +601,7 @@ function email_generic_to_recipients( $p_bug_id, $p_notify_type, array $p_recipi
lang_push( user_pref_get_language( $t_user_id, $t_project_id ) );

$t_visible_bug_data = email_build_visible_bug_data( $t_user_id, $p_bug_id, $p_message_id );
email_bug_info_to_one_user( $t_visible_bug_data, $p_message_id, $t_project_id, $t_user_id, $p_header_optional_params );
email_bug_info_to_one_user( $t_visible_bug_data, $p_message_id, $t_user_id, $p_header_optional_params );

lang_pop();
}
Expand Down Expand Up @@ -1207,7 +1206,7 @@ function email_bug_reminder( $p_recipients, $p_bug_id, $p_message ) {
$t_sender_email = '';
}
$t_header = "\n" . lang_get( 'on_date' ) . ' ' . $t_date . ', ' . $t_sender . ' ' . $t_sender_email . lang_get( 'sent_you_this_reminder_about' ) . ': ' . "\n\n";
$t_contents = $t_header . string_get_bug_view_url_with_fqdn( $p_bug_id, $t_recipient ) . " \n\n" . $p_message;
$t_contents = $t_header . string_get_bug_view_url_with_fqdn( $p_bug_id ) . " \n\n" . $p_message;

$t_id = email_store( $t_email, $t_subject, $t_contents );
if( $t_id !== null ) {
Expand All @@ -1226,12 +1225,11 @@ function email_bug_reminder( $p_recipients, $p_bug_id, $p_message ) {
* return true on success
* @param array $p_visible_bug_data Array of bug data information.
* @param string $p_message_id A message identifier.
* @param integer $p_project_id A project identifier.
* @param integer $p_user_id A valid user identifier.
* @param array $p_header_optional_params Array of additional email headers.
* @return void
*/
function email_bug_info_to_one_user( array $p_visible_bug_data, $p_message_id, $p_project_id, $p_user_id, array $p_header_optional_params = null ) {
function email_bug_info_to_one_user( array $p_visible_bug_data, $p_message_id, $p_user_id, array $p_header_optional_params = null ) {
$t_user_email = user_get_email( $p_user_id );

# check whether email should be sent
Expand All @@ -1244,7 +1242,6 @@ function email_bug_info_to_one_user( array $p_visible_bug_data, $p_message_id, $
$t_subject = email_build_subject( $p_visible_bug_data['email_bug'] );

# build message

$t_message = lang_get_defaulted( $p_message_id, null );

if( is_array( $p_header_optional_params ) ) {
Expand Down
4 changes: 2 additions & 2 deletions core/event_api.php
Expand Up @@ -270,9 +270,9 @@ function event_type_output( $p_event, array $p_callbacks, $p_params = null ) {
* final callback's return value will be returned to the event origin.
* @param string $p_event Event name.
* @param array $p_callbacks Array of callback function/plugin basename key/value pairs.
* @param string $p_input Input string.
* @param mixed $p_input Input data.
* @param array $p_params Parameters.
* @return string Output string
* @return mixed Output data
* @access public
*/
function event_type_chain( $p_event, array $p_callbacks, $p_input, $p_params = null ) {
Expand Down
2 changes: 0 additions & 2 deletions core/file_api.php
Expand Up @@ -669,11 +669,9 @@ function file_add( $p_bug_id, array $p_file, $p_table = 'bug', $p_title = '', $p
if( 'bug' == $p_table ) {
$t_project_id = bug_get_field( $p_bug_id, 'project_id' );
$t_id = (int)$p_bug_id;
$t_bug_id = bug_format_id( $p_bug_id );
} else {
$t_project_id = helper_get_current_project();
$t_id = $t_project_id;
$t_bug_id = 0;
}

if( $p_user_id === null ) {
Expand Down

0 comments on commit 95a97ff

Please sign in to comment.