function display_commit_message($event, $bugid)
 {
     if (!$bugid) {
         return;
     }
     $t_fields = config_get('bug_view_page_fields');
     $t_fields = columns_filter_disabled($t_fields);
     $tpl_show_id = in_array('id', $t_fields);
     $tpl_show_description = in_array('description', $t_fields);
     $tpl_show_status = in_array('status', $t_fields);
     if ($tpl_show_id && $tpl_show_description && $tpl_show_status) {
         bug_ensure_exists($bugid);
         $bug = bug_get($bugid, true);
         access_ensure_bug_level(VIEWER, $bugid);
         $tpl_description = string_display_links($bug->summary);
         $tpl_status = get_enum_element('status', $bug->status);
         $tpl_link = config_get('path') . string_get_bug_view_url($bugid, null);
         $message = sprintf('%s - #JJ%d: %s<br/>%s', strtoupper($tpl_status), $bugid, $tpl_description, $tpl_link);
         echo '<tr ', helper_alternate_class(), '>';
         echo '<td class="category">', plugin_lang_get('commit_message'), '</td>';
         echo '<td colspan="5">' . $message . '</td>';
         echo '</tr>';
     }
 }
Exemple #2
0
</td>
		</tr>
	<?php 
if (!empty($teams)) {
    foreach ($teams as $num => $row) {
        ?>
	<tr <?php 
        echo helper_alternate_class();
        ?>
>
			<td><?php 
        echo string_display_line_links($row['name']);
        ?>
</td>
			<td><?php 
        echo string_display_links($row['description']);
        ?>
</td>
			<td><?php 
        echo string_display_line_links($agilemantis_team->getTeamBacklog($row['product_backlog']));
        ?>
</td>
			<td><?php 
        echo $agilemantis_team->getProductOwner($row['id']);
        ?>
</td>
			<td><?php 
        echo $agilemantis_team->getScrumMaster($row['id']);
        ?>
</td>
			<td class="right" width="205">
Exemple #3
0
/**
 * Print column content for column additional information
 *
 * @param BugData $p_bug bug object
 * @param int $p_columns_target see COLUMNS_TARGET_* in constant_inc.php
 * @return null
 * @access public
 */
function print_column_additional_information($p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
    $t_additional_information = string_display_links($p_bug->additional_information);
    echo '<td class="column-additional-information">', $t_additional_information, '</td>';
}
function print_news_entry($p_headline, $p_body, $p_poster_id, $p_view_state, $p_announcement, $p_date_posted)
{
    $t_headline = string_display_links($p_headline);
    $t_body = string_display_links($p_body);
    $t_date_posted = date(config_get('normal_date_format'), $p_date_posted);
    if (VS_PRIVATE == $p_view_state) {
        $t_news_css = 'news-heading-private';
    } else {
        $t_news_css = 'news-heading-public';
    }
    $output = '<div align="center">';
    $output .= '<table class="width75" cellspacing="0">';
    $output .= '<tr>';
    $output .= "<td class=\"{$t_news_css}\">";
    $output .= "<span class=\"bold\">{$t_headline}</span> - ";
    $output .= "<span class=\"italic-small\">{$t_date_posted}</span> - ";
    echo $output;
    /** @todo eventually we should replace print's with methods to construct the strings. */
    print_user($p_poster_id);
    $output = '';
    if (1 == $p_announcement) {
        $output .= ' <span class="small">';
        $output .= '[' . lang_get('announcement') . ']';
        $output .= '</span>';
    }
    if (VS_PRIVATE == $p_view_state) {
        $output .= ' <span class="small">';
        $output .= '[' . lang_get('private') . ']';
        $output .= '</span>';
    }
    $output .= '</td>';
    $output .= '</tr>';
    $output .= '<tr>';
    $output .= "<td class=\"news-body\">{$t_body}</td>";
    $output .= '</tr>';
    $output .= '</table>';
    $output .= '</div>';
    echo $output;
}
        case REMINDER:
            echo '<em>' . lang_get('reminder_sent_to') . ' ';
            $t_note_attr = utf8_substr($t_bugnote->note_attr, 1, utf8_strlen($t_bugnote->note_attr) - 2);
            $t_to = array();
            foreach (explode('|', $t_note_attr) as $t_recipient) {
                $t_to[] = prepare_user_name($t_recipient);
            }
            echo implode(', ', $t_to) . '</em><br /><br />';
            break;
        case TIME_TRACKING:
            if (access_has_bug_level(config_get('time_tracking_view_threshold'), $f_bug_id)) {
                echo '<div class="time-tracked">', lang_get('time_tracking_time_spent') . ' ' . $t_time_tracking_hhmm, '</div>';
            }
            break;
    }
    echo string_display_links($t_bugnote->note);
    ?>
	</td>
</tr>
<?php 
    event_signal('EVENT_VIEW_BUGNOTE', array($f_bug_id, $t_bugnote->id, VS_PRIVATE == $t_bugnote->view_state));
    ?>
<tr class="spacer">
	<td colspan="2"></td>
</tr>
<?php 
}
# end for loop
event_signal('EVENT_VIEW_BUGNOTES_END', $f_bug_id);
?>
</table>
$t_date_submitted = $t_show_date_submitted ? string_display_line(date(config_get('normal_date_format'), $t_bug->date_submitted)) : '';
$t_last_updated = $t_show_last_updated ? string_display_line(date(config_get('normal_date_format'), $t_bug->last_updated)) : '';
$t_platform = string_display_line($t_bug->platform);
$t_os = string_display_line($t_bug->os);
$t_os_version = string_display_line($t_bug->os_build);
$t_is = string_display_line($t_bug->os);
$t_status = string_display_line(get_enum_element('status', $t_bug->status));
$t_priority = string_display_line(get_enum_element('priority', $t_bug->priority));
$t_resolution = string_display_line(get_enum_element('resolution', $t_bug->resolution));
$t_product_build = string_display_line($t_bug->build);
$t_projection = string_display_line(get_enum_element('projection', $t_bug->projection));
$t_eta = string_display_line(get_enum_element('eta', $t_bug->eta));
$t_summary = string_display_line_links(bug_format_summary($f_bug_id, SUMMARY_FIELD));
$t_description = string_display_links($t_bug->description);
$t_steps_to_reproduce = string_display_links($t_bug->steps_to_reproduce);
$t_additional_information = string_display_links($t_bug->additional_information);
$t_view_state = $t_show_view_state ? get_enum_element('view_state', $t_bug->view_state) : '';
if ($t_show_due_date) {
    if (!date_is_null($t_bug->due_date)) {
        $t_due_date = date(config_get('normal_date_format'), $t_bug->due_date);
    } else {
        $t_due_date = '';
    }
}
$t_product_version = $t_show_product_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->version, $t_bug->project_id))) : '';
$t_target_version = $t_show_target_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->target_version, $t_bug->project_id))) : '';
$t_fixed_in_version = $t_show_fixed_in_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->fixed_in_version, $t_bug->project_id))) : '';
html_page_top1(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
html_head_end();
html_body_begin();
echo '<br />';
Exemple #7
0
/**
 * Prepare a string containing a custom field value for display
 * @param array   $p_def      Contains the definition of the custom field.
 * @param integer $p_field_id Contains the id of the field.
 * @param integer $p_bug_id   Contains the bug id to display the custom field value for.
 * @return string
 * @access public
 */
function string_custom_field_value(array $p_def, $p_field_id, $p_bug_id)
{
    $t_custom_field_value = custom_field_get_value($p_field_id, $p_bug_id);
    if ($t_custom_field_value === null) {
        return '';
    }
    global $g_custom_field_type_definition;
    if (isset($g_custom_field_type_definition[$p_def['type']]['#function_string_value'])) {
        return call_user_func($g_custom_field_type_definition[$p_def['type']]['#function_string_value'], $t_custom_field_value);
    }
    return string_display_links($t_custom_field_value);
}
 function string_custom_field_value($p_field_def, $p_node_id, $p_value_field = 'value')
 {
     $t_custom_field_value = htmlspecialchars($p_field_def[$p_value_field]);
     switch ($this->custom_field_types[$p_field_def['type']]) {
         case 'email':
             return "<a href=\"mailto:{$t_custom_field_value}\">{$t_custom_field_value}</a>";
             break;
         case 'enum':
         case 'list':
         case 'multiselection list':
         case 'checkbox':
             return str_replace('|', ', ', $t_custom_field_value);
             break;
         case 'date':
             if ($t_custom_field_value != null) {
                 // must remove %
                 $t_date_format = str_replace("%", "", config_get('date_format'));
                 $xdate = date($t_date_format, $t_custom_field_value);
                 return $xdate;
             }
             break;
         case 'datetime':
             if ($t_custom_field_value != null) {
                 // must remove %
                 // $t_date_format=str_replace("%","",config_get( 'timestamp_format'));
                 // $datetime_format=$t_date_format;
                 $t_date_format = str_replace("%", "", config_get('date_format'));
                 $cfg = config_get('gui');
                 $datetime_format = $t_date_format . " " . $cfg->custom_fields->time_format;
                 $xdate = date($datetime_format, $t_custom_field_value);
                 return $xdate;
             }
             break;
         case 'text area':
             if ($t_custom_field_value != null) {
                 return nl2br($t_custom_field_value);
             }
             break;
         default:
             // 20071027 - franciscom
             // This code manages URLs
             return string_display_links($t_custom_field_value);
             // return($t_custom_field_value);
     }
 }
Exemple #9
0
function bug_prepare_display($p_bug_data)
{
    $p_bug_data->category = string_display_line($p_bug_data->category);
    $p_bug_data->date_submitted = string_display_line($p_bug_data->date_submitted);
    $p_bug_data->last_updated = string_display_line($p_bug_data->last_updated);
    $p_bug_data->os = string_display_line($p_bug_data->os);
    $p_bug_data->os_build = string_display_line($p_bug_data->os_build);
    $p_bug_data->platform = string_display_line($p_bug_data->platform);
    $p_bug_data->version = string_display_line($p_bug_data->version);
    $p_bug_data->build = string_display_line($p_bug_data->build);
    $p_bug_data->target_version = string_display_line($p_bug_data->target_version);
    $p_bug_data->fixed_in_version = string_display_line($p_bug_data->fixed_in_version);
    $p_bug_data->summary = string_display_line_links($p_bug_data->summary);
    $p_bug_data->sponsorship_total = string_display_line($p_bug_data->sponsorship_total);
    $p_bug_data->sticky = string_display_line($p_bug_data->sticky);
    $p_bug_data->description = string_display_links($p_bug_data->description);
    $p_bug_data->steps_to_reproduce = string_display_links($p_bug_data->steps_to_reproduce);
    $p_bug_data->additional_information = string_display_links($p_bug_data->additional_information);
    return $p_bug_data;
}
    echo nl2br(string_display_links($usSumText[0]['steps_to_reproduce']));
    ?>
			</td>
		</tr>
		<tr <?php 
    echo helper_alternate_class();
    ?>
>
			<td class="category">
				<?php 
    echo lang_get('additional_information');
    ?>
			</td>
			<td colspan="9">
			  <?php 
    echo nl2br(string_display_links($usSumText[0]['additional_information']));
    ?>
			</td>
		</tr>
	</table>
</div>
<br>
<div class="table-container">
	<table align="center" class="width100" cellspacing="1">
		<tr>
			<td class="form-title" colspan="6">Tasks - <span
				style="font-weight: bold; color: grey;">"<?php 
    echo string_display_line_links($usSumText[0]['summary']);
    ?>
"</span>
			</td>
Exemple #11
0
require "css_faq.php";
html_page_top1();
if (OFF == plugin_config_get('faq_view_window')) {
    html_page_top2();
}
$f_id = gpc_get_int('f_id');
# Select the faq posts
$query = "SELECT *, UNIX_TIMESTAMP(date_posted) as date_posted\n\t\t\tFROM {$g_mantis_faq_table}\n\t\t\tWHERE  id='{$f_id}'";
$result = db_query_bound($query);
$faq_count = db_num_rows($result);
# Loop through results
for ($i = 0; $i < $faq_count; $i++) {
    $row = db_fetch_array($result);
    extract($row, EXTR_PREFIX_ALL, "v");
    $v_headline = string_display($v_headline);
    $v_answere = string_display_links($v_answere);
    $v_date_posted = date($g_normal_date_format, $v_date_posted);
    $t_poster_name = user_get_name($v_poster_id);
    $t_poster_email = user_get_email($v_poster_id);
    $t_project_name = "Sitewide";
    if ($v_project_id != 0) {
        $t_project_name = project_get_field($v_project_id, "name");
    }
    ?>
<p>
<div align="center">
<table class="width75" cellspacing="0">
<tr>
	<td class="faq-heading">
		<span class="faq-question"><?php 
    echo $v_question;
						<a href="manage_proj_edit_page.php?project_id=<?php echo $t_subproject['id'] ?>"><?php echo string_display( $t_subproject['name'] ) ?></a>
					</td>
					<td class="center">
						<?php echo get_enum_element( 'project_status', $t_subproject['status'] ) ?>
					</td>
					<td class="center">
						<?php echo trans_bool( $t_subproject['enabled'] ) ?>
					</td>
					<td class="center">
						<input type="checkbox" name="inherit_child_<?php echo $t_subproject_id ?>" <?php echo ( $t_inherit_parent ? 'checked="checked"' : '' ) ?> />
					</td>
					<td class="center">
						<?php echo get_enum_element( 'project_view_state', $t_subproject['view_state'] ) ?>
					</td>
					<td>
						<?php echo string_display_links( $t_subproject['description'] ) ?>
					</td>
					<td class="center"><?php
					print_bracket_link( 'manage_proj_edit_page.php?project_id=' . $t_subproject['id'], lang_get( 'edit_link' ) ); ?>
					</td>
					<td class="center"><?php
					print_bracket_link( "manage_proj_subproj_delete.php?project_id=$f_project_id&subproject_id=" . $t_subproject['id'] . form_security_param( 'manage_proj_subproj_delete' ), lang_get( 'unlink_link' ) );
				?>
					</td>
				</tr><?php
				} # End of foreach loop over subprojects ?>
			</table>
			<span class="submit-button"><input type="submit" value="<?php echo lang_get( 'update_subproject_inheritance' ) ?>" /></span>
		</fieldset>
	</form><?php
	} # End of hiding subproject listing if there are no subprojects ?>
Exemple #13
0
 function format_value($bug, $field_name)
 {
     $values = array('id' => function ($bug) {
         return sprintf('%s <%s>', $bug->id, string_get_bug_view_url_with_fqdn($bug->id));
     }, 'project_id' => function ($bug) {
         return project_get_name($bug->project_id);
     }, 'reporter_id' => function ($bug) {
         return '@' . user_get_name($bug->reporter_id);
     }, 'handler_id' => function ($bug) {
         return empty($bug->handler_id) ? plugin_lang_get('no_user') : '@' . user_get_name($bug->handler_id);
     }, 'duplicate_id' => function ($bug) {
         return sprintf('%s <%s>', $bug->duplicate_id, string_get_bug_view_url_with_fqdn($bug->duplicate_id));
     }, 'priority' => function ($bug) {
         return get_enum_element('priority', $bug->priority);
     }, 'severity' => function ($bug) {
         return get_enum_element('severity', $bug->severity);
     }, 'reproducibility' => function ($bug) {
         return get_enum_element('reproducibility', $bug->reproducibility);
     }, 'status' => function ($bug) {
         return get_enum_element('status', $bug->status);
     }, 'resolution' => function ($bug) {
         return get_enum_element('resolution', $bug->resolution);
     }, 'projection' => function ($bug) {
         return get_enum_element('projection', $bug->projection);
     }, 'category_id' => function ($bug) {
         return category_full_name($bug->category_id, false);
     }, 'eta' => function ($bug) {
         return get_enum_element('eta', $bug->eta);
     }, 'view_state' => function ($bug) {
         return $bug->view_state == VS_PRIVATE ? lang_get('private') : lang_get('public');
     }, 'sponsorship_total' => function ($bug) {
         return sponsorship_format_amount($bug->sponsorship_total);
     }, 'os' => function ($bug) {
         return $bug->os;
     }, 'os_build' => function ($bug) {
         return $bug->os_build;
     }, 'platform' => function ($bug) {
         return $bug->platform;
     }, 'version' => function ($bug) {
         return $bug->version;
     }, 'fixed_in_version' => function ($bug) {
         return $bug->fixed_in_version;
     }, 'target_version' => function ($bug) {
         return $bug->target_version;
     }, 'build' => function ($bug) {
         return $bug->build;
     }, 'summary' => function ($bug) {
         return HipChatPlugin::clean_summary(bug_format_summary($bug->id, SUMMARY_FIELD));
     }, 'last_updated' => function ($bug) {
         return date(config_get('short_date_format'), $bug->last_updated);
     }, 'date_submitted' => function ($bug) {
         return date(config_get('short_date_format'), $bug->date_submitted);
     }, 'due_date' => function ($bug) {
         return date(config_get('short_date_format'), $bug->due_date);
     }, 'description' => function ($bug) {
         return string_display_links($bug->description);
     }, 'steps_to_reproduce' => function ($bug) {
         return string_display_links($bug->steps_to_reproduce);
     }, 'additional_information' => function ($bug) {
         return string_display_links($bug->additional_information);
     });
     // Discover custom fields.
     $t_related_custom_field_ids = custom_field_get_linked_ids($bug->project_id);
     foreach ($t_related_custom_field_ids as $t_id) {
         $t_def = custom_field_get_definition($t_id);
         $values['custom_' . $t_def['name']] = function ($bug) use($t_id) {
             return custom_field_get_value($t_id, $bug->id);
         };
     }
     if (isset($values[$field_name])) {
         $func = $values[$field_name];
         return $func($bug);
     } else {
         return sprintf(plugin_lang_get('unknown_field'), $field_name);
     }
 }
Exemple #14
0
    /**
     * Show TimeTracking information when viewing bugs.
     * @param string Event name
     * @param int Bug ID
     */
    function view_bug_time($p_event, $p_bug_id)
    {
        $table = plugin_table('data');
        $t_user_id = auth_get_current_user_id();
        # Pull all Time-Record entries for the current Bug
        if (access_has_bug_level(plugin_config_get('view_others_threshold'), $p_bug_id)) {
            $query_pull_timerecords = "SELECT * FROM {$table} WHERE bug_id = {$p_bug_id} ORDER BY timestamp DESC";
        } else {
            if (access_has_bug_level(plugin_config_get('admin_own_threshold'), $p_bug_id)) {
                $query_pull_timerecords = "SELECT * FROM {$table} WHERE bug_id = {$p_bug_id} and user = {$t_user_id} ORDER BY timestamp DESC";
            } else {
                // User has no access
                return;
            }
        }
        $result_pull_timerecords = db_query($query_pull_timerecords);
        $num_timerecords = db_num_rows($result_pull_timerecords);
        # Get Sum for this bug
        $query_pull_hours = "SELECT SUM(hours) as hours FROM {$table} WHERE bug_id = {$p_bug_id}";
        $result_pull_hours = db_query($query_pull_hours);
        $row_pull_hours = db_fetch_array($result_pull_hours);
        ?>


   <a name="timerecord" id="timerecord" /><br />

<?php 
        collapse_open('timerecord');
        ?>
   <table class="width100" cellspacing="1">
   <tr>
      <td colspan="6" class="form-title">
<?php 
        collapse_icon('timerecord');
        echo plugin_lang_get('title');
        ?>
      </td>
   </tr>
   <tr class="row-category">
      <td><div align="center"><?php 
        echo plugin_lang_get('user');
        ?>
</div></td>
      <td><div align="center"><?php 
        echo plugin_lang_get('expenditure_date');
        ?>
</div></td>
      <td><div align="center"><?php 
        echo plugin_lang_get('hours');
        ?>
</div></td>
      <td><div align="center"><?php 
        echo plugin_lang_get('information');
        ?>
</div></td>
      <td><div align="center"><?php 
        echo plugin_lang_get('entry_date');
        ?>
</div></td>
      <td>&nbsp;</td>
   </tr>


<?php 
        if (access_has_bug_level(plugin_config_get('admin_own_threshold'), $p_bug_id)) {
            $current_date = explode("-", date("Y-m-d"));
            ?>


   <form name="time_tracking" method="post" action="<?php 
            echo plugin_page('add_record');
            ?>
" >
      <?php 
            echo form_security_field('plugin_TimeTracking_add_record');
            ?>

      <input type="hidden" name="bug_id" value="<?php 
            echo $p_bug_id;
            ?>
">

   <tr <?php 
            echo helper_alternate_class();
            ?>
>
     <td><?php 
            echo user_get_name(auth_get_current_user_id());
            ?>
</td>
     <td nowrap>
        <div align="center">
           <select tabindex="5" name="day"><?php 
            print_day_option_list($current_date[2]);
            ?>
</select>
           <select tabindex="6" name="month"><?php 
            print_month_option_list($current_date[1]);
            ?>
</select>
           <select tabindex="7" name="year"><?php 
            print_year_option_list($current_date[0]);
            ?>
</select>
        </div>
     </td>
     <td><div align="right"><input type="text" name="time_value" value="00:00" size="5"></div></td>
     <td><div align="center"><input type="text" name="time_info"></div></td>
     <td>&nbsp;</td>
     <td><input name="<?php 
            echo plugin_lang_get('submit');
            ?>
" type="submit" value="<?php 
            echo plugin_lang_get('submit');
            ?>
"></td>
   </tr>
</form>

<?php 
        }
        # END Access Control
        for ($i = 0; $i < $num_timerecords; $i++) {
            $row = db_fetch_array($result_pull_timerecords);
            ?>


   <tr <?php 
            echo helper_alternate_class();
            ?>
>
      <td><?php 
            echo user_get_name($row["user"]);
            ?>
</td>
      <td><div align="center"><?php 
            echo date(config_get("short_date_format"), strtotime($row["expenditure_date"]));
            ?>
 </div></td>
      <td><div align="right"><?php 
            echo db_minutes_to_hhmm($row["hours"] * 60);
            ?>
 </div></td>
      <td><div align="center"><?php 
            echo string_display_links($row["info"]);
            ?>
</div></td>
      <td><div align="center"><?php 
            echo date(config_get("complete_date_format"), strtotime($row["timestamp"]));
            ?>
 </div></td>

<?php 
            $user = auth_get_current_user_id();
            if ($user == $row["user"] && access_has_bug_level(plugin_config_get('admin_own_threshold'), $p_bug_id) || access_has_bug_level(plugin_config_get('admin_threshold'), $p_bug_id)) {
                ?>


      <td><a href="<?php 
                echo plugin_page('delete_record');
                ?>
&bug_id=<?php 
                echo $p_bug_id;
                ?>
&delete_id=<?php 
                echo $row["id"];
                echo form_security_param('plugin_TimeTracking_delete_record');
                ?>
"><?php 
                echo plugin_lang_get('delete');
                ?>
</a></td>

<?php 
            } else {
                ?>
      <td>&nbsp;</td>

<?php 
            }
            ?>
   </tr>


<?php 
        }
        # End for loop
        ?>


   <tr class="row-category">
      <td><?php 
        echo plugin_lang_get('sum');
        ?>
</td>
      <td>&nbsp;</td>
      <td><div align="right"><b><?php 
        echo db_minutes_to_hhmm($row_pull_hours['hours'] * 60);
        ?>
</b></div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
   </tr>
</table>

<?php 
        collapse_closed('timerecord');
        ?>

<table class="width100" cellspacing="1">
<tr>
   <td class="form-title" colspan="2">
          <?php 
        collapse_icon('timerecord');
        ?>
          <?php 
        echo plugin_lang_get('title');
        ?>
	</td>
</tr>
</table>

<?php 
        collapse_end('timerecord');
    }
    ?>
</td>
		<?php 
}
?>
	</tr>
		<tr <?php 
echo helper_alternate_class();
?>
>
			<td><?php 
echo string_display_line_links($product_backlog);
?>
</td>
			<td><?php 
echo nl2br(string_display_links($pb_info[0]['description']));
?>
</td>
		<?php 
if ($agilemantis_pb->checkProductBacklogMoreOneTeam($product_backlog)) {
    ?>
		<td><?php 
    echo $team_info[0]['name'];
    ?>
</td>
			<td><?php 
    echo $agilemantis_team->getUserName($agilemantis_team->getTeamProductOwner());
    ?>
</td>
			<td><?php 
    echo $agilemantis_team->getUserName($agilemantis_team->getTeamScrumMaster());
    if (!empty($backlogs)) {
        foreach ($backlogs as $num => $row) {
            ?>
	<?php 
            $agilemantis_pb->productBacklogHasStoriesLeft($row['name']);
            ?>
	<tr <?php 
            echo helper_alternate_class();
            ?>
>
		<td><?php 
            echo string_display_line_links($row['name']);
            ?>
</td>
		<td><?php 
            echo nl2br(string_display_links($row['description']));
            ?>
</td>
		<td class="right" width="205">
			<form action="<?php 
            echo plugin_page('edit_product_backlog.php');
            ?>
" method="post">
				<input type="submit" name="edit[<?php 
            echo $row['id'];
            ?>
]" 
					value="<?php 
            echo plugin_lang_get('button_edit');
            ?>
" style="width:100px;" />
		<?php 
echo $v2_additional_information;
?>
	</td>
</tr>
<?php 
# account profile description
if ($v_profile_id > 0) {
    $t_user_prof_table = config_get('mantis_user_profile_table');
    $query = "SELECT description\n\t\t\t\tFROM {$t_user_prof_table}\n\t\t\t\tWHERE id='{$v_profile_id}'";
    $result = db_query($query);
    $t_profile_description = '';
    if (db_num_rows($result) > 0) {
        $t_profile_description = db_result($result, 0);
    }
    $t_profile_description = string_display_links($t_profile_description);
    ?>
<tr class="print">
	<td class="print-category">
		<?php 
    echo lang_get('system_profile');
    ?>
:
	</td>
	<td class="print" colspan="5">
		<?php 
    echo $t_profile_description;
    ?>
	</td>
</tr>
<?php 
 /**
  * Prints a bug into the document
  *
  * @param $chapter_index
  * @param $sub_chapter_index
  * @param $bug_data
  * @param $option_show_duration
  * @param $print_flag
  */
 public function print_bug($chapter_index, $sub_chapter_index, $bug_data, $option_show_duration, $print_flag)
 {
     $this->print_bug_head($chapter_index, $sub_chapter_index, $bug_data, $option_show_duration, $print_flag);
     $this->print_bug_infos(string_display_links(trim($bug_data[2])));
     $this->print_bug_infos(string_display_links(trim($bug_data[3])));
     $this->print_bug_infos(string_display_links(trim($bug_data[4])));
     if (!empty($bug_data[5])) {
         $this->print_bug_attachments($bug_data[0]);
     }
     if (!is_null($bug_data[6]) && $bug_data[6] != 0) {
         $this->print_bugnote_note($bug_data[6]);
     }
 }
Exemple #19
0
$tpl_show_priority = in_array('priority', $t_fields);
$tpl_priority = $tpl_show_priority ? string_display_line(get_enum_element('priority', $tpl_bug->priority)) : '';
$tpl_show_severity = in_array('severity', $t_fields);
$tpl_severity = $tpl_show_severity ? string_display_line(get_enum_element('severity', $tpl_bug->severity)) : '';
$tpl_show_reproducibility = in_array('reproducibility', $t_fields);
$tpl_reproducibility = $tpl_show_reproducibility ? string_display_line(get_enum_element('reproducibility', $tpl_bug->reproducibility)) : '';
$tpl_show_status = in_array('status', $t_fields);
$tpl_status = $tpl_show_status ? string_display_line(get_enum_element('status', $tpl_bug->status)) : '';
$tpl_show_resolution = in_array('resolution', $t_fields);
$tpl_resolution = $tpl_show_resolution ? string_display_line(get_enum_element('resolution', $tpl_bug->resolution)) : '';
$tpl_show_summary = in_array('summary', $t_fields);
$tpl_show_description = in_array('description', $t_fields);
$tpl_summary = $tpl_show_summary ? bug_format_summary($f_bug_id, SUMMARY_FIELD) : '';
$tpl_description = $tpl_show_description ? string_display_links($tpl_bug->description) : '';
$tpl_steps_to_reproduce = $tpl_show_steps_to_reproduce ? string_display_links($tpl_bug->steps_to_reproduce) : '';
$tpl_additional_information = $tpl_show_additional_information ? string_display_links($tpl_bug->additional_information) : '';
$tpl_links = event_signal('EVENT_MENU_ISSUE', $f_bug_id);
#
# Start of Template
#
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<thead><tr class="bug-nav">';
# Form Title
echo '<td class="form-title" colspan="', $t_bugslist ? '3' : '4', '">';
echo $tpl_form_title;
echo '&#160;<span class="small">';
# Jump to Bugnotes
print_bracket_link("#bugnotes", lang_get('jump_to_bugnotes'), false, 'jump-to-bugnotes');
# Send Bug Reminder
if ($tpl_show_reminder_link) {
 function string_custom_field_value($p_field_def, $p_node_id, $p_value_field = 'value')
 {
     $t_value = isset($p_field_def[$p_value_field]) ? $p_field_def[$p_value_field] : null;
     $cfValue = htmlspecialchars($t_value);
     switch ($this->custom_field_types[intval($p_field_def['type'])]) {
         case 'email':
             return "<a href=\"mailto:{$cfValue}\">{$cfValue}</a>";
             break;
         case 'enum':
         case 'list':
         case 'multiselection list':
         case 'checkbox':
             return str_replace('|', ', ', $cfValue);
             break;
         case 'date':
             if ($cfValue != null) {
                 // must remove %
                 $t_date_format = str_replace("%", "", config_get('date_format'));
                 $xdate = date($t_date_format, $cfValue);
                 return $xdate;
             }
             break;
         case 'datetime':
             if ($cfValue != null) {
                 // must remove %
                 // $t_date_format=str_replace("%","",config_get( 'timestamp_format'));
                 // $datetime_format=$t_date_format;
                 $t_date_format = str_replace("%", "", config_get('date_format'));
                 $cfg = config_get('gui');
                 $datetime_format = $t_date_format . " " . $cfg->custom_fields->time_format;
                 $xdate = date($datetime_format, $cfValue);
                 return $xdate;
             }
             break;
         case 'text area':
             if ($cfValue != null) {
                 return nl2br($cfValue);
             }
             break;
         case 'string':
             return string_display_links($cfValue);
             break;
         default:
             // done this way in order to be able to debug if needed
             return string_display_links($cfValue);
             break;
     }
 }
    echo lang_get('bug_notes_title');
    ?>
		</td>
	</tr>
	<?php 
    for ($i = 0; $i < $t_num_notes; $i++) {
        # prefix all bugnote data with v3_
        $t_row = db_fetch_array($t_result);
        $t_date_submitted = date(config_get('normal_date_format'), $t_row['date_submitted']);
        $t_last_modified = date(config_get('normal_date_format'), $t_row['last_modified']);
        # grab the bugnote text and id and prefix with v3_
        $t_query = 'SELECT note, id FROM {bugnote_text} WHERE id=' . db_param();
        $t_result2 = db_query($t_query, array($t_row['bugnote_text_id']));
        $t_note = db_result($t_result2, 0, 0);
        $t_bugnote_text_id = db_result($t_result2, 0, 1);
        $t_note = string_display_links($t_note);
        ?>
	<tr>
		<td class="print-spacer" colspan="2">
			<hr />
		</td>
	</tr>
	<tr>
		<td class="nopad" width="20%">
			<table class="hide" cellspacing="1">
				<tr>
					<td class="print">
						(<?php 
        echo bugnote_format_id($t_row['id']);
        ?>
)
Exemple #22
0
if (plugin_config_get('notification_enable', PLUGINS_RELEASEMGT_NOTIFICATION_ENABLE_DEFAULT) == ON) {
    $t_subject = plugin_config_get('email_subject', PLUGINS_RELEASEMGT_EMAIL_SUBJECT_DEFAULT);
    $t_subject_replace = array('*P' => '*p', '*C' => '*c', '*V' => '*v', '*p' => project_get_name($t_project_id), '*v' => version_get_field($t_version, 'version'), '*c' => $t_file_count, '**' => '*');
    foreach ($t_subject_replace as $t_key => $t_value) {
        $t_subject = str_replace($t_key, $t_value, $t_subject);
    }
    $t_selected = plugin_config_get('email_template', PLUGINS_RELEASEMGT_EMAIL_TEMPLATE_DEFAULT);
    $t_template_dir = config_get_global('plugin_path') . plugin_get_current() . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $t_selected . DIRECTORY_SEPARATOR;
    $t_template = array();
    $t_template['files'] = array();
    $t_template['files_count'] = $t_file_count;
    for ($i = 0; $i < $t_file_count; $i++) {
        $t_template['files'][$i] = array();
        $t_template['files'][$i]['file_name'] = $t_file[$i]['name'];
        $t_template['files'][$i]['file_description'] = $t_description;
        $t_template['files'][$i]['file_html_description'] = string_display_links($t_description);
        $t_template['files'][$i]['file_url'] = config_get('path') . plugin_page('download', true) . '&id=' . $t_file_id[$i];
        $t_template['files'][$i]['file_size'] = number_format($t_file[$i]['size']);
        $t_template['files'][$i]['file_date'] = date(config_get('normal_date_format'), plugins_releasemgt_file_get_field($t_file_id[$i], 'date_added'));
    }
    $t_template['project_id'] = $t_project_id;
    $t_template['project_name'] = project_get_name($t_project_id);
    $t_template['version_id'] = $t_version;
    if ($t_version != 0) {
        $t_template['version_name'] = version_get_field($t_version, 'version');
        $t_template['version_description'] = version_get_field($t_version, 'description');
        $t_template['version_date_order'] = version_get_field($t_version, 'date_order');
        $t_template['version_date'] = date(config_get('normal_date_format'), $t_template['version_date_order']);
    } else {
        $t_template['version_name'] = '';
        $t_template['version_description'] = '';
Exemple #23
0
require "worklog_api.php";
html_page_top1();
if (OFF == plugin_config_get('worklog_view_window')) {
    html_page_top2();
}
$f_id = gpc_get_int('f_id');
# Select the faq posts
$query = "SELECT *, UNIX_TIMESTAMP(date_posted) as date_posted\n\t\t\tFROM {$g_mantis_worklog_table}\n\t\t\tWHERE  id='{$f_id}'";
$result = db_query_bound($query);
$worklog_count = db_num_rows($result);
# Loop through results
for ($i = 0; $i < $worklog_count; $i++) {
    $row = db_fetch_array($result);
    extract($row, EXTR_PREFIX_ALL, "v");
    $v_headline = string_display($v_headline);
    $v_content = string_display_links($v_content);
    $v_date_posted = date($g_normal_date_format, $v_date_posted);
    $t_poster_name = user_get_name($v_poster_id);
    $t_poster_email = user_get_email($v_poster_id);
    $t_project_name = " ";
    if ($v_project_id != 0) {
        $t_project_name = project_get_field($v_project_id, "name");
    }
    ?>
<p>
<div align="center">
<table class="width75" cellspacing="0">
<tr>
	<td class="worklog-heading">
		<span class="worklog-subject"><?php 
    echo '[' . worklog_type_display($v_log_type) . ']' . $v_subject;
function string_custom_field_value($p_def, $p_field_id, $p_bug_id)
{
    $t_custom_field_value = custom_field_get_value($p_field_id, $p_bug_id);
    switch ($p_def['type']) {
        case CUSTOM_FIELD_TYPE_EMAIL:
            return "<a href=\"mailto:{$t_custom_field_value}\">{$t_custom_field_value}</a>";
            break;
        case CUSTOM_FIELD_TYPE_ENUM:
        case CUSTOM_FIELD_TYPE_LIST:
        case CUSTOM_FIELD_TYPE_MULTILIST:
        case CUSTOM_FIELD_TYPE_CHECKBOX:
            return str_replace('|', ', ', $t_custom_field_value);
            break;
        case CUSTOM_FIELD_TYPE_DATE:
            if ($t_custom_field_value != null) {
                return date(config_get('short_date_format'), $t_custom_field_value);
            }
            break;
        default:
            return string_display_links($t_custom_field_value);
    }
}
function show_revision($t_revision)
{
    static $s_can_drop = null;
    static $s_drop_token = null;
    static $s_user_access = null;
    if (is_null($s_can_drop)) {
        $s_can_drop = access_has_bug_level(config_get('bug_revision_drop_threshold'), $t_revision['bug_id']);
        $s_drop_token = form_security_param('bug_revision_drop');
    }
    switch ($t_revision['type']) {
        case REV_DESCRIPTION:
            $t_label = lang_get('description');
            break;
        case REV_STEPS_TO_REPRODUCE:
            $t_label = lang_get('steps_to_reproduce');
            break;
        case REV_ADDITIONAL_INFO:
            $t_label = lang_get('additional_information');
            break;
        case REV_BUGNOTE:
            if (is_null($s_user_access)) {
                $s_user_access = access_has_bug_level(config_get('private_bugnote_threshold'), $t_revision['bug_id']);
            }
            if (!$s_user_access) {
                return null;
            }
            $t_label = lang_get('bugnote');
            break;
        default:
            $t_label = '';
    }
    $t_by_string = sprintf(lang_get('revision_by'), string_display_line(date(config_get('normal_date_format'), $t_revision['timestamp'])), string_display_line(user_get_name($t_revision['user_id'])));
    ?>
<tr class="spacer"><td><a id="revision-<?php 
    echo $t_revision['id'];
    ?>
"></a></td></tr>

<tr <?php 
    echo helper_alternate_class();
    ?>
>
<th class="category"><?php 
    echo lang_get('revision');
    ?>
</th>
<td colspan="2"><?php 
    echo $t_by_string;
    ?>
</td>
<td class="center" width="5%">
<?php 
    if ($s_can_drop) {
        print_bracket_link('bug_revision_drop.php?id=' . $t_revision['id'] . $s_drop_token, lang_get('revision_drop'));
    }
    ?>
</tr>

<tr <?php 
    echo helper_alternate_class();
    ?>
>
<th class="category"><?php 
    echo $t_label;
    ?>
</th>
<td colspan="3"><?php 
    echo string_display_links($t_revision['value']);
    ?>
</td>
</tr>

	<?php 
}
Exemple #26
0
?>
	</td>
	<td class="right">
		<?php 
print_doc_menu('proj_doc_page.php');
?>
	</td>
</tr>
<?php 
$i = 0;
while ($row = db_fetch_array($result)) {
    $i++;
    extract($row, EXTR_PREFIX_ALL, 'v');
    $v_filesize = number_format($v_filesize);
    $v_title = string_display($v_title);
    $v_description = string_display_links($v_description);
    $v_date_added = date(config_get('normal_date_format'), $v_date_added);
    ?>
<tr>
	<td>
<?php 
    $t_href = '<a href="file_download.php?file_id=' . $v_id . '&amp;type=doc">';
    echo $t_href;
    print_file_icon($v_filename);
    echo '</a>&#160;' . $t_href . $v_title . '</a> (' . $v_filesize . lang_get('word_separator') . lang_get('bytes') . ')';
    ?>
	<br />
	<span class="small">
<?php 
    if ($v_project_id == ALL_PROJECTS) {
        echo lang_get('all_projects') . '<br/>';
Exemple #27
0
function print_news_entry($p_headline, $p_body, $p_poster_id, $p_view_state, $p_announcement, $p_date_posted)
{
    $t_headline = string_display_links($p_headline);
    $t_body = string_display_links($p_body);
    $t_date_posted = date(config_get('normal_date_format'), $p_date_posted);
    if (VS_PRIVATE == $p_view_state) {
        $t_news_css = 'news-heading-private';
    } else {
        $t_news_css = 'news-heading-public';
    }
    ?>

	<div class="news-item">
		<h3 class="<?php 
    echo $t_news_css;
    ?>
">
			<span class="news-title"><?php 
    echo $t_headline;
    ?>
</span>
			<span class="news-date-posted"><?php 
    echo $t_date_posted;
    ?>
</span>
			<span class="news-author"><?php 
    echo prepare_user_name($p_poster_id);
    ?>
</span><?php 
    if (1 == $p_announcement) {
        ?>
				<span class="news-announcement"><?php 
        echo lang_get('announcement');
        ?>
</span><?php 
    }
    if (VS_PRIVATE == $p_view_state) {
        ?>
				<span class="news-private"><?php 
        echo lang_get('private');
        ?>
</span><?php 
    }
    ?>
		</h3>
		<p class="news-body"><?php 
    echo $t_body;
    ?>
</p>
	</div><?php 
}
Exemple #28
0
echo helper_alternate_class();
?>
>
<td class="category" rowspan="<?php 
echo count($t_changeset->files) + 1;
?>
">
	<?php 
echo plugin_lang_get('changeset');
?>
</td>
<td colspan="<?php 
echo $t_columns - 1;
?>
"><?php 
echo string_display_links($t_changeset->message);
?>
</td>
</tr>

<?php 
foreach ($t_changeset->files as $t_file) {
    ?>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
<td class="small mono" colspan="<?php 
    echo $t_columns - 2;
    ?>
"><?php 
        echo get_enum_element('project_status', $t_project['status']);
        ?>
	</td>
	<td>
		<?php 
        echo trans_bool($t_project['enabled']);
        ?>
	</td>
	<td>
		<?php 
        echo get_enum_element('project_view_state', $t_project['view_state']);
        ?>
	</td>
	<td>
		<?php 
        echo string_display_links($t_project['description']);
        ?>
	</td>
</tr>
<?php 
    }
    $t_subprojects = project_hierarchy_get_subprojects($t_project_id, true);
    if (0 < count($t_projects) || 0 < count($t_subprojects)) {
        array_unshift($t_stack, $t_projects);
    }
    if (0 < count($t_subprojects)) {
        $t_full_projects = array();
        foreach ($t_subprojects as $t_project_id) {
            $t_full_projects[] = project_get_row($t_project_id);
        }
        $t_subprojects = multi_sort($t_full_projects, $f_sort, $t_direction);
        }
        if ($resolved['user_id'] > 0) {
            echo '<task_resolved>' . $agilemantis_tasks->getUserName($resolved['user_id']);
            echo ' / ' . date('d.m.Y', $resolve_date) . '</task_resolved>';
        }
        if ($closed['user_id'] > 0) {
            echo '<task_closed>' . $agilemantis_tasks->getUserName($closed['user_id']);
            echo ' / ' . date('d.m.Y', $close_date) . '</task_closed>';
        }
        if ($reopened['user_id'] > 0) {
            echo '<task_reopened>' . $agilemantis_tasks->getUserName($reopened['user_id']);
            echo ' / ' . date('d.m.Y', $reopen_date) . '</task_reopened>';
        }
        echo '</task>';
    }
    echo '</tasks>';
}
$notices = $agilemantis_tasks->getNotices($id);
if (!empty($notices)) {
    echo '<notices>';
    foreach ($notices as $num => $row) {
        echo '<notice>';
        echo '<note_id>' . $row['id'] . '</note_id>';
        echo '<note_description>' . $agilemantis_commonlib->safeCData(string_display_links($row['note'])) . '</note_description>';
        echo '<note_reporter><![CDATA[' . $agilemantis_tasks->getUserName($row['reporter_id']) . ']]></note_reporter>';
        echo '<note_date>' . date('d.m.Y', $row['date_submitted']) . '</note_date>';
        echo '</notice>';
    }
    echo '</notices>';
}
echo '</userstory>';