Skip to content

Commit

Permalink
Merge branch 'master-2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Apr 16, 2017
2 parents 1bf72e3 + 27b5b29 commit 8090599
Show file tree
Hide file tree
Showing 18 changed files with 543 additions and 280 deletions.
98 changes: 69 additions & 29 deletions billing_inc.php
Expand Up @@ -53,8 +53,28 @@
?>
<?php

$t_today = date( config_get( 'short_date_format' ) );
$t_date_submitted = isset( $t_bug ) ? date( config_get( 'short_date_format' ), $t_bug->date_submitted ) : $t_today;
$t_today = date( 'd:m:Y' );
$t_date_submitted = isset( $t_bug ) ? date( 'd:m:Y', $t_bug->date_submitted ) : $t_today;

$t_bugnote_stats_from_def = $t_date_submitted;
$t_bugnote_stats_from_def_ar = explode( ':', $t_bugnote_stats_from_def );
$t_bugnote_stats_from_def_d = $t_bugnote_stats_from_def_ar[0];
$t_bugnote_stats_from_def_m = $t_bugnote_stats_from_def_ar[1];
$t_bugnote_stats_from_def_y = $t_bugnote_stats_from_def_ar[2];

$t_bugnote_stats_from_d = gpc_get_int( FILTER_PROPERTY_DATE_SUBMITTED_START_DAY, $t_bugnote_stats_from_def_d );
$t_bugnote_stats_from_m = gpc_get_int( FILTER_PROPERTY_DATE_SUBMITTED_START_MONTH, $t_bugnote_stats_from_def_m );
$t_bugnote_stats_from_y = gpc_get_int( FILTER_PROPERTY_DATE_SUBMITTED_START_YEAR, $t_bugnote_stats_from_def_y );

$t_bugnote_stats_to_def = $t_today;
$t_bugnote_stats_to_def_ar = explode( ':', $t_bugnote_stats_to_def );
$t_bugnote_stats_to_def_d = $t_bugnote_stats_to_def_ar[0];
$t_bugnote_stats_to_def_m = $t_bugnote_stats_to_def_ar[1];
$t_bugnote_stats_to_def_y = $t_bugnote_stats_to_def_ar[2];

$t_bugnote_stats_to_d = gpc_get_int( FILTER_PROPERTY_DATE_SUBMITTED_END_DAY, $t_bugnote_stats_to_def_d );
$t_bugnote_stats_to_m = gpc_get_int( FILTER_PROPERTY_DATE_SUBMITTED_END_MONTH, $t_bugnote_stats_to_def_m );
$t_bugnote_stats_to_y = gpc_get_int( FILTER_PROPERTY_DATE_SUBMITTED_END_YEAR, $t_bugnote_stats_to_def_y );

$f_get_bugnote_stats_button = gpc_get_string( 'get_bugnote_stats_button', '' );

Expand Down Expand Up @@ -91,42 +111,63 @@
</div>
</div>

<div class="widget-body">
<form method="post" action="">
<div class="widget-main">
<input type="hidden" name="id" value="<?php echo isset( $f_bug_id ) ? $f_bug_id : 0 ?>" />
<?php
$t_filter = array();
$t_filter[FILTER_PROPERTY_FILTER_BY_DATE_SUBMITTED] = 'on';
$t_filter[FILTER_PROPERTY_START_DATE_SUBMITTED] = $t_date_submitted;
$t_filter[FILTER_PROPERTY_END_DATE_SUBMITTED] = $t_today;
filter_init( $t_filter );
print_filter_do_filter_by_date( true );
?>

<div class="widget-body">
<form method="post" action="">
<input type="hidden" name="id" value="<?php echo isset( $f_bug_id ) ? $f_bug_id : 0 ?>" />
<table class="width100" cellspacing="0">
<tr>
<td class="form-title" colspan="4"><?php
collapse_icon( 'bugnotestats' );
echo lang_get( 'time_tracking' ); ?>
</td>
</tr>
<tr class="row-2">
<td class="category" width="25%">
<?php
$t_filter = array();
$t_filter[FILTER_PROPERTY_FILTER_BY_DATE_SUBMITTED] = 'on';
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_START_DAY] = $t_bugnote_stats_from_d;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_START_MONTH] = $t_bugnote_stats_from_m;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_START_YEAR] = $t_bugnote_stats_from_y;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_END_DAY] = $t_bugnote_stats_to_d;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_END_MONTH] = $t_bugnote_stats_to_m;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_END_YEAR] = $t_bugnote_stats_to_y;
filter_init( $t_filter );
print_filter_do_filter_by_date( true );
?>
</td>
</tr>
<?php
if( $t_cost_col ) {
?>
<div class="space-10"></div>
<?php echo lang_get( 'time_tracking_cost_per_hour_label' ) ?>
<input type="text" name="bugnote_cost" class="input-sm" value="<?php echo $f_bugnote_cost ?>" />
<tr class="row-1">
<td>
<?php echo lang_get( 'time_tracking_cost_per_hour_label' ) ?>
<input type="text" name="bugnote_cost" value="<?php echo $f_bugnote_cost ?>" />
</td>
</tr>
<?php
}
?>
</div>
<div class="widget-toolbox padding-8 clearfix">
<input name="get_bugnote_stats_button" class="btn btn-primary btn-sm btn-white btn-round"
value="<?php echo lang_get( 'time_tracking_get_info_button' ) ?>" type="submit">
</div>
</form>
<tr>
<td class="center" colspan="2">
<input type="submit" class="button"
name="get_bugnote_stats_button"
value="<?php echo lang_get( 'time_tracking_get_info_button' ) ?>"
/>
</td>
</tr>
</table>
</form>
</div>
</div>

<?php
if( !is_blank( $f_get_bugnote_stats_button ) ) {
# Retrieve time tracking information
$t_from = $t_date_submitted;
$t_to = $t_today;
$t_from = $t_bugnote_stats_from_y . '-' . $t_bugnote_stats_from_m . '-' . $t_bugnote_stats_from_d;
$t_to = $t_bugnote_stats_to_y . '-' . $t_bugnote_stats_to_m . '-' . $t_bugnote_stats_to_d;
$t_bugnote_stats = billing_get_summaries( $f_project_id, $t_from, $t_to, $f_bugnote_cost );

# Sort the array by bug_id, user/real name
Expand All @@ -148,12 +189,11 @@
);

foreach( $t_exports as $t_export_label => $t_export_page ) {
echo '<a class="btn btn-primary btn-sm btn-white btn-round" ';
echo 'href="' . $t_export_page . '?';
echo '[ <a href="' . $t_export_page . '?';
echo 'from=' . $t_from . '&amp;to=' . $t_to;
echo '&amp;cost=' . $f_bugnote_cost;
echo '&amp;project_id=' . $f_project_id;
echo '">' . lang_get( $t_export_label ) . '</a> ';
echo '">' . lang_get( $t_export_label ) . '</a> ] ';
}

echo '<br />';
Expand Down Expand Up @@ -203,7 +243,7 @@
} # end for issues loop ?>

<tr>
<td class="small-caption bold">
<td class="small-caption">
<?php echo lang_get( 'total_time' ); ?>
</td>
<td class="small-caption bold">
Expand Down
4 changes: 2 additions & 2 deletions bug_actiongroup_page.php
Expand Up @@ -283,9 +283,9 @@
}
}

echo '<input type="text" id="due_date" name="due_date" class="datetimepicker input-sm" size="16" maxlength="20" ' .
echo '<input type="text" id="due_date" name="due_date" class="datetimepicker input-sm" size="16" maxlength="16" ' .
'data-picker-locale="' . lang_get_current_datetime_locale() .
'" data-picker-format="' . convert_date_format_to_momentjs( config_get( 'normal_date_format' ) ) . '"' .
'" data-picker-format="' . config_get( 'datetime_picker_format' ) . '"' .
'" value="' . $t_date_to_display . '" />';
echo '<i class="fa fa-calendar fa-xlg datetimepicker"></i>';
} else {
Expand Down
6 changes: 3 additions & 3 deletions bug_change_status_page.php
Expand Up @@ -241,9 +241,9 @@
<?php echo lang_get( 'due_date' ) ?>
</th>
<td>
<input type="text" id="due_date" name="due_date" class="datetimepicker input-sm" size="16" maxlength="20"
data-picker-locale="<?php echo lang_get_current_datetime_locale() ?>"
data-picker-format="<?php echo convert_date_format_to_momentjs( config_get( 'normal_date_format' ) ) ?>"
<input type="text" id="due_date" name="due_date" class="datetimepicker input-sm" size="16" maxlength="16"
data-picker-locale="<?php lang_get_current_datetime_locale() ?>"
data-picker-format="<?php echo config_get( 'datetime_picker_format' ) ?>"
<?php helper_get_tab_index() ?> value="<?php echo $t_date_to_display ?>" />
<i class="fa fa-calendar fa-xlg datetimepicker"></i>
</td>
Expand Down
4 changes: 2 additions & 2 deletions bug_report_page.php
Expand Up @@ -357,8 +357,8 @@ class="dropzone-form"
<td>
<?php echo '<input ' . helper_get_tab_index() . ' type="text" id="due_date" name="due_date" class="datetimepicker input-sm" ' .
'data-picker-locale="' . lang_get_current_datetime_locale() .
'" data-picker-format="' . convert_date_format_to_momentjs( config_get( 'normal_date_format' ) ) . '" ' .
'size="16" maxlength="20" value="' . $t_date_to_display . '" />' ?>
'" data-picker-format="' . config_get( 'datetime_picker_format' ) . '" ' .
'size="20" maxlength="16" value="' . $t_date_to_display . '" />' ?>
<i class="fa fa-calendar fa-xlg datetimepicker"></i>
</td>
</tr>
Expand Down
5 changes: 2 additions & 3 deletions bug_update_page.php
Expand Up @@ -339,9 +339,8 @@
$t_date_to_display = date( config_get( 'normal_date_format' ), $t_bug->due_date );
}
echo '<input ' . helper_get_tab_index() . ' type="text" id="due_date" name="due_date" class="datetimepicker input-sm" size="16" ' .
'data-picker-locale="' . lang_get_current_datetime_locale() .
'" data-picker-format="' . convert_date_format_to_momentjs( config_get( 'normal_date_format' ) ) .
'" maxlength="20" value="' . $t_date_to_display . '" />';
'data-picker-locale="' . lang_get_current_datetime_locale() . '" data-picker-format="' . config_get( 'datetime_picker_format' ) . '" ' .
'" maxlength="16" value="' . $t_date_to_display . '" />';
echo '<i class="fa fa-calendar fa-xlg datetimepicker"></i>';
} else {
if( !date_is_null( $t_bug->due_date ) ) {
Expand Down
76 changes: 55 additions & 21 deletions bugnote_stats_inc.php
Expand Up @@ -55,8 +55,25 @@

<?php

$t_bugnote_stats_from = date( config_get( 'short_date_format' ), $t_bug->date_submitted );
$t_bugnote_stats_to = date( config_get( 'short_date_format' ) );
$t_bugnote_stats_from_def = date( 'd:m:Y', $t_bug->date_submitted );
$t_bugnote_stats_from_def_ar = explode( ':', $t_bugnote_stats_from_def );
$t_bugnote_stats_from_def_d = $t_bugnote_stats_from_def_ar[0];
$t_bugnote_stats_from_def_m = $t_bugnote_stats_from_def_ar[1];
$t_bugnote_stats_from_def_y = $t_bugnote_stats_from_def_ar[2];

$t_bugnote_stats_from_d = gpc_get_string( FILTER_PROPERTY_DATE_SUBMITTED_START_DAY, $t_bugnote_stats_from_def_d );
$t_bugnote_stats_from_m = gpc_get_string( FILTER_PROPERTY_DATE_SUBMITTED_START_MONTH, $t_bugnote_stats_from_def_m );
$t_bugnote_stats_from_y = gpc_get_string( FILTER_PROPERTY_DATE_SUBMITTED_START_YEAR, $t_bugnote_stats_from_def_y );

$t_bugnote_stats_to_def = date( 'd:m:Y' );
$t_bugnote_stats_to_def_ar = explode( ':', $t_bugnote_stats_to_def );
$t_bugnote_stats_to_def_d = $t_bugnote_stats_to_def_ar[0];
$t_bugnote_stats_to_def_m = $t_bugnote_stats_to_def_ar[1];
$t_bugnote_stats_to_def_y = $t_bugnote_stats_to_def_ar[2];

$t_bugnote_stats_to_d = gpc_get_string( FILTER_PROPERTY_DATE_SUBMITTED_END_DAY, $t_bugnote_stats_to_def_d );
$t_bugnote_stats_to_m = gpc_get_string( FILTER_PROPERTY_DATE_SUBMITTED_END_MONTH, $t_bugnote_stats_to_def_m );
$t_bugnote_stats_to_y = gpc_get_string( FILTER_PROPERTY_DATE_SUBMITTED_END_YEAR, $t_bugnote_stats_to_def_y );

$f_get_bugnote_stats_button = gpc_get_string( 'get_bugnote_stats_button', '' );

Expand Down Expand Up @@ -85,32 +102,48 @@
</div>

<form method="post" action="#bugnotestats">
<div class="widget-body">
<div class="widget-body">
<div class="widget-main">
<input type="hidden" name="id" value="<?php echo $f_bug_id ?>" />
<?php
$t_filter = array();
$t_filter[FILTER_PROPERTY_FILTER_BY_DATE_SUBMITTED] = 'on';
$t_filter[FILTER_PROPERTY_START_DATE_SUBMITTED] = $t_bugnote_stats_from;
$t_filter[FILTER_PROPERTY_END_DATE_SUBMITTED] = $t_bugnote_stats_to;
filter_init( $t_filter );
print_filter_do_filter_by_date( true );
?>

</div>
<div class="widget-toolbox padding-8 clearfix">
<input name="get_bugnote_stats_button" class="btn btn-primary btn-sm btn-white btn-round"
value="<?php echo lang_get( 'time_tracking_get_info_button' ) ?>" type="submit">
</div>
</div>
<input type="hidden" name="id" value="<?php echo $f_bug_id ?>" />
<table class="width100" cellspacing="0">
<tr>
<td class="form-title" colspan="4"><?php
collapse_icon( 'bugnotestats' );
echo lang_get( 'time_tracking' ); ?>
</td>
</tr>
<tr class="row-2">
<td class="category" width="25%">
<?php
$t_filter = array();
$t_filter[FILTER_PROPERTY_FILTER_BY_DATE_SUBMITTED] = 'on';
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_START_DAY] = $t_bugnote_stats_from_d;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_START_MONTH] = $t_bugnote_stats_from_m;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_START_YEAR] = $t_bugnote_stats_from_y;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_END_DAY] = $t_bugnote_stats_to_d;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_END_MONTH] = $t_bugnote_stats_to_m;
$t_filter[FILTER_PROPERTY_DATE_SUBMITTED_END_YEAR] = $t_bugnote_stats_to_y;
filter_init( $t_filter );
print_filter_do_filter_by_date( true );
?>
</td>
</tr>
<tr>
<td class="center" colspan="2">
<input type="submit" class="button"
name="get_bugnote_stats_button"
value="<?php echo lang_get( 'time_tracking_get_info_button' ) ?>" />
</td>
</tr>
</table>
</form>

<?php
# Print time tracking information if requested
if( !is_blank( $f_get_bugnote_stats_button ) ) {
# Retrieve time tracking information
$t_from = $t_bugnote_stats_from;
$t_to = $t_bugnote_stats_to;
$t_from = $t_bugnote_stats_from_y . '-' . $t_bugnote_stats_from_m . '-' . $t_bugnote_stats_from_d;
$t_to = $t_bugnote_stats_to_y . '-' . $t_bugnote_stats_to_m . '-' . $t_bugnote_stats_to_d;
$t_bugnote_stats = bugnote_stats_get_events_array( $f_bug_id, $t_from, $t_to );

# Sort the array by user/real name
Expand Down Expand Up @@ -174,4 +207,5 @@
</form>
</div>
</div>
</div>

1 change: 1 addition & 0 deletions config_defaults_inc.php
Expand Up @@ -1166,6 +1166,7 @@
*/
$g_datetime_picker_format = 'Y-MM-DD HH:mm';


##############################
# MantisBT TimeZone Settings #
##############################
Expand Down

0 comments on commit 8090599

Please sign in to comment.