/** * @param string $request_uri '/plugins/agiledashboard/?group_id=1&action=show&.... */ public function __construct($request_uri) { $proto = Config::get('sys_force_ssl') ? 'https' : 'http'; $url = $proto . '://' . Config::get('sys_default_domain') . $request_uri; $dimensions = $this->width . 'x' . $this->height; $this->class = Toggler::getClassname('plugin_cardwall_qrcode_toggler', false, true); $this->url = 'http://chart.apis.google.com/chart?' . http_build_query(array('chs' => $dimensions, 'cht' => 'qr', 'chld' => 'L|0', 'chl' => $url)); }
/** * @param Cardwall_Board $board The board * @param string $redirect_parameter the redirect paramter to add to various url * @param Tracker_FormElement_Field_Selectbox $field form to choose the column. false if no form (in widget) (thus no typehinting) * @param $form */ public function __construct(Cardwall_Board $board, $redirect_parameter, $field, $form) { parent::__construct($board, $redirect_parameter); $hp = Codendi_HTMLPurifier::instance(); $this->nifty = Toggler::getClassname('cardwall_board-nifty') == 'toggler' ? 'nifty' : false; $this->swimline_title = ''; $this->has_swimline_header = false; $this->field = $field ? $field : false; $this->form = $form ? $form : false; $this->has_columns = count($this->board->columns) > 0; $this->warn_please_choose = $GLOBALS['Language']->getText('plugin_cardwall', 'warn_please_choose'); $field_label = $field ? $hp->purify($this->field->getLabel()) : '###'; $this->warn_no_values = $GLOBALS['Language']->getText('plugin_cardwall', 'warn_no_values', $field_label); }
/** * Compute the content of the widget * * @return String */ public function getContent() { $dao = new Git_LogDao(); $um = UserManager::instance(); $user = $um->getCurrentUser(); $date = $_SERVER['REQUEST_TIME'] - $this->pastDays * 24 * 60 * 60; $result = $dao->getLastPushesRepositories($user->getId(), $date); $content = ''; $project = ''; $dh = new DateHelper(); if ($result && !$result->isError()) { foreach ($result as $entry) { if (!empty($entry['repository_namespace'])) { $namespace = $entry['repository_namespace'] . "/"; } else { $namespace = ''; } $dar = $dao->getLastPushesByUser($user->getId(), $entry['repository_id'], $this->offset, $date); if ($dar && !$dar->isError() && $dar->rowCount() > 0) { if ($project != $entry['group_name']) { if (!empty($project)) { $content .= '</fieldset>'; } $project = $entry['group_name']; $content .= '<fieldset> <legend id="plugin_git_user_pushes_widget_project_' . $project . '" class="' . Toggler::getClassname('plugin_git_user_pushes_widget_project_' . $project) . '"> <span title="' . $GLOBALS['Language']->getText('plugin_git', 'tree_view_project') . '"> <b>' . $project . '</b> </span> </legend> <a href="' . $this->pluginPath . '/index.php?group_id=' . $entry['group_id'] . '">[ ' . $GLOBALS['Language']->getText('plugin_git', 'widget_user_pushes_details') . ' ]</a>'; } $content .= '<fieldset> <legend id="plugin_git_user_pushes_widget_repo_' . $project . $namespace . $entry['repository_name'] . '" class="' . Toggler::getClassname('plugin_git_user_pushes_widget_repo_' . $project . $namespace . $entry['repository_name']) . '"> <span title="' . $GLOBALS['Language']->getText('plugin_git', 'tree_view_repository') . '"> ' . $namespace . $entry['repository_name'] . ' </span> </legend> ' . html_build_list_table_top(array($GLOBALS['Language']->getText('plugin_git', 'tree_view_date'), $GLOBALS['Language']->getText('plugin_git', 'tree_view_commits'))); $i = 0; $hp = Codendi_HTMLPurifier::instance(); foreach ($dar as $row) { $content .= '<tr class="' . html_get_alt_row_color(++$i) . '"> <td><span title="' . $dh->timeAgoInWords($row['push_date'], true) . '">' . $hp->purify(format_date($GLOBALS['Language']->getText('system', 'datefmt'), $row['push_date'])) . '</span></td> <td> <a href="' . $this->pluginPath . '/index.php/' . $entry['group_id'] . '/view/' . $entry['repository_id'] . '/"> ' . $hp->purify($row['commits_number']) . ' </a> </td> </tr>'; } $content .= "</table>\n </fieldset>"; } else { $content .= $GLOBALS['Language']->getText('plugin_git', 'widget_user_pushes_no_content'); } } } else { $content = $GLOBALS['Language']->getText('plugin_git', 'widget_user_pushes_no_content'); } return $content; }
/** * Display debug info gathered along the execution * * @return void */ public static function showDebugInfo() { global $Language; echo '<div id="footer_debug_separator"/>'; echo '<div id="footer_debug">'; echo '<div class="alert alert-info"> <h4> Development useful information! </h4> The section above will show you some useful information about Tuleap for development purpose. </div>'; echo '<div id="footer_debug_content">'; $debug_compute_tile = microtime(true) - $GLOBALS['debug_time_start']; if (function_exists('xdebug_time_index')) { $xdebug_time_index = xdebug_time_index(); } $query_time = 0; foreach ($GLOBALS['DBSTORE'] as $d) { foreach ($d['trace'] as $trace) { $query_time += $trace[2] - $trace[1]; } } $purifier = Codendi_HTMLPurifier::instance(); echo '<span class="debug">' . $Language->getText('include_layout', 'query_count') . ": "; echo $GLOBALS['DEBUG_DAO_QUERY_COUNT'] . "</span>"; $percent = (int) ($GLOBALS['DEBUG_TIME_IN_PRE'] * 100 / $debug_compute_tile); $sql_percent = (int) ($query_time * 100 / $debug_compute_tile); echo '<table border=1><thead><tr><th></th><th>Page generated in</th></tr></thead><tbody>'; echo '<tr><td>pre.php</td><td>' . number_format(1000 * $GLOBALS['DEBUG_TIME_IN_PRE'], 0, '.', "'") . ' ms (' . $percent . '%)</td>'; echo '<tr><td>remaining</td><td>' . number_format(1000 * ($debug_compute_tile - $GLOBALS['DEBUG_TIME_IN_PRE']), 0, '.', "'") . ' ms</td>'; echo '<tr><td><b>total</td><td><b>' . number_format(1000 * $debug_compute_tile, 0, '.', "'") . ' ms</td>'; if (function_exists('xdebug_time_index')) { echo '<tr><td>xdebug</td><td>' . number_format(1000 * $xdebug_time_index, 0, '.', "'") . ' ms</tr>'; } echo '<tr><td>sql</td><td>' . number_format(1000 * $query_time, 0, '.', "'") . ' ms (' . $sql_percent . '%)</tr>'; echo '</tbody></table>'; if (function_exists('xdebug_get_profiler_filename')) { if ($file = xdebug_get_profiler_filename()) { echo '<div>Profiler info has been written in: ' . $file . '</div>'; } } $hook_params = array(); EventManager::instance()->processEvent('layout_footer_debug', $hook_params); //Display the config // Uncomment this only if you know what you are doing. This may lead to sensitive information leakage /!\ //echo '<fieldset><legend id="footer_debug_config" class="'. Toggler::getClassname('footer_debug_config') .'">Config:</legend>'; //echo '<pre>'; //Config::dump(); //echo '</pre>'; //echo '</fieldset>'; // Display all queries used to generate the page echo '<fieldset><legend id="footer_debug_allqueries" class="' . Toggler::getClassname('footer_debug_allqueries') . '">All queries:</legend>'; echo '<pre>'; $queries = array(); $queries_by_time_taken = array(); $i = 0; foreach ($GLOBALS['QUERIES'] as $sql) { $t = 0; foreach ($GLOBALS['DBSTORE'][md5($sql)]['trace'] as $trace) { $t += $trace[2] - $trace[1]; } $q = array('sql' => $purifier->purify($sql), 'total time' => number_format(1000 * $t, 0, '.', "'") . ' ms'); $queries[] = $q; $queries_by_time_taken[] = array('n°' => $i++, 't' => $t) + $q; } print_r($queries); echo '</pre>'; echo '</fieldset>'; // Display all queries used to generate the page ordered by time taken usort($queries_by_time_taken, array(__CLASS__, 'sort_queries_by_time_taken')); echo '<fieldset><legend id="footer_debug_allqueries_time_taken" class="' . Toggler::getClassname('footer_debug_allqueries_time_taken') . '">All queries by time taken:</legend>'; echo '<table border="1" style="border-collapse:collapse" cellpadding="2" cellspacing="0">'; echo '<thead><tr><th>n°</th><th style="white-space:nowrap;">time taken</th><th>sum</th><th>sql</th></tr></thead>'; $i = 0; $sum = 0; foreach ($queries_by_time_taken as $q) { echo '<tr valign="top" class="' . html_get_alt_row_color($i++) . '">'; echo '<td>' . $q['n°'] . '</td>'; echo '<td style="white-space:nowrap;">' . $q['total time'] . '</td>'; echo '<td style="white-space:nowrap;">' . number_format(1000 * ($sum += $q['t']), 0, '.', "'") . ' ms' . '</td>'; echo '<td><pre>' . $q['sql'] . '</pre></td>'; echo '</tr>'; } echo '</table>'; echo '</fieldset>'; echo '<fieldset><legend id="footer_debug_queriespaths" class="' . Toggler::getClassname('footer_dubug_queriespaths') . '">Path of all queries:</legend>'; $max = 0; foreach ($GLOBALS['DBSTORE'] as $d) { foreach ($d['trace'] as $trace) { $time_taken = 1000 * round($trace[2] - $trace[1], 3); if ($max < $time_taken) { $max = $time_taken; } } } $paths = array(); $time = $GLOBALS['debug_time_start']; foreach ($GLOBALS['DBSTORE'] as $d) { foreach ($d['trace'] as $trace) { $time_taken = 1000 * round($trace[2] - $trace[1], 3); self::_debug_backtrace_rec($paths, array_reverse($trace[0]), '[' . 1000 * round($trace[1] - $GLOBALS['debug_time_start'], 3) . '/' . $time_taken . '] ' . ($time_taken >= $max ? ' <span style="background:yellow; padding-left:4px; padding-right:4px; color:red;">top!</span> ' : '') . $purifier->purify($d['sql'])); } } echo '<table>'; self::_debug_display_paths($paths, false); echo '</table>'; echo '</fieldset>'; //Print the backtrace of specific queries /* echo '<pre>'; $specific_queries = array(48,49); $i = 0; foreach($GLOBALS['DBSTORE'] as $d) { //echo $i ."\t". $d['sql'] ."\n"; if (in_array($i++, $specific_queries)) { $traces = $d['trace'][0]; foreach($traces as $trace) { echo '<code>'. $trace['file']. ' #'. $trace['line'] .' ('. (isset($trace['class']) ? $trace['class'] .'::' : '') . $trace['function'] ."</code>\n"; } echo "\n"; } } echo '</pre>'; /**/ // Display queries executed more than once $title_displayed = false; foreach ($GLOBALS['DBSTORE'] as $key => $value) { if ($GLOBALS['DBSTORE'][$key]['nb'] > 1) { if (!$title_displayed) { echo '<fieldset><legend>Queries executed more than once :</legend>'; $title_displayed = true; } echo "<fieldset>"; echo '<legend id="footer_debug_doublequery_' . $key . '" class="' . Toggler::getClassname('footer_debug_doublequery_' . $key) . '">'; echo '<b>Run ' . $GLOBALS['DBSTORE'][$key]['nb'] . " times: </b>"; echo $purifier->purify($GLOBALS['DBSTORE'][$key]['sql']) . "\n"; echo '</legend>'; self::_debug_backtraces($GLOBALS['DBSTORE'][$key]['trace']); echo "</fieldset>"; } } if ($title_displayed) { echo '</fieldset>'; } echo '<fieldset>'; echo '<legend id="footer_debug_session" class="' . Toggler::getClassname('footer_debug_session') . '">Session</legend>'; echo "<div>"; echo '<a href="#" onclick="new Ajax.Updater(\'footer_debug_session_data\', \'/include/debug_session.php?reload\');return false;">reload</a>'; echo ' | '; echo '<a href="#" onclick="new Ajax.Updater(\'footer_debug_session_data\', \'/include/debug_session.php?reset\');return false;">reset</a>'; echo '<pre id="footer_debug_session_data">' . print_r($_SESSION, 1) . '</pre>'; echo "</div>"; echo '</fieldset>'; echo "</pre>\n"; echo '</div>'; echo '</div>'; }
function _display_artifacts($artifacts) { $request = HTTPRequest::instance(); $hp = Codendi_HTMLPurifier::instance(); $html_my_artifacts = ''; $html_current_tracker_header = ''; $html_current_tracker_arts = ''; $tracker_artifacts_counter = 0; $tracker = false; foreach ($artifacts as $tracker_id => $tracker_and_its_artifacts) { if (count($tracker_and_its_artifacts['artifacts'])) { $tracker = $tracker_and_its_artifacts['tracker']; //header (project name - tracker name) $div_id = 'plugin_tracker_my_artifacts_tracker_' . $tracker->getId(); $classname = Toggler::getClassname($div_id); $group_id = $tracker->getGroupId(); $project = ProjectManager::instance()->getProject($group_id); $project_and_tracker = $project->getPublicName() . ' - ' . $tracker->getName(); $html_my_artifacts .= '<div>'; $html_my_artifacts .= '<div class="' . $classname . '" id="' . $div_id . '">'; $html_my_artifacts .= '<a href="/plugins/tracker/?tracker=' . $tracker->getId() . '">'; $html_my_artifacts .= '<strong>' . $hp->purify($project_and_tracker, CODENDI_PURIFIER_CONVERT_HTML) . '</strong>'; $html_my_artifacts .= '</a>'; $html_my_artifacts .= ' [' . count($tracker_and_its_artifacts['artifacts']) . ']'; $html_my_artifacts .= ' </div>'; $html_my_artifacts .= '<ul class="plugin_tracker_my_artifacts_list">'; foreach ($tracker_and_its_artifacts['artifacts'] as $artifact_and_its_title) { // Display artifact $html_my_artifacts .= '<li>'; $html_my_artifacts .= $artifact_and_its_title['artifact']->fetchWidget($tracker->getItemName(), $artifact_and_its_title['title']); $html_my_artifacts .= '</li>'; } $html_my_artifacts .= '</ul>'; $html_my_artifacts .= '</div>'; } } return $html_my_artifacts; }
echo '<h2>' . $hp->purify($title, CODENDI_PURIFIER_CONVERT_HTML) . '</h2>'; $se = SystemEventManager::instance(); $offset = $request->get('offset') && !$request->exist('filter') ? (int) $request->get('offset') : 0; $limit = 50; $full = true; $filter_status = $request->get('filter_status'); if (!$filter_status) { $filter_status = array(SystemEvent::STATUS_NEW, SystemEvent::STATUS_RUNNING, SystemEvent::STATUS_DONE, SystemEvent::STATUS_WARNING, SystemEvent::STATUS_ERROR); } $filter_type = $request->get('filter_type'); if (!$filter_type) { $filter_type = $se->getTypes(); } echo '<form action="" method="POST">'; echo '<fieldset>'; echo '<legend id="system_events_filter" class="' . Toggler::getClassname('system_events_filter') . '">Filter:</legend>'; echo '<strong>' . 'Status:' . '</strong> <input type="hidden" name="filter_status[]" value="' . $hp->purify(SystemEvent::STATUS_NONE, CODENDI_PURIFIER_CONVERT_HTML) . '" />'; echo '<br />'; foreach (array(SystemEvent::STATUS_NEW, SystemEvent::STATUS_RUNNING, SystemEvent::STATUS_DONE, SystemEvent::STATUS_WARNING, SystemEvent::STATUS_ERROR) as $status) { echo '<input type="checkbox" name="filter_status[]" value="' . $hp->purify($status, CODENDI_PURIFIER_CONVERT_HTML) . '" id="filter_' . $hp->purify($status, CODENDI_PURIFIER_CONVERT_HTML) . '" ' . (in_array($status, $filter_status) ? 'checked="checked"' : '') . ' />'; echo '<label for="filter_' . $hp->purify($status, CODENDI_PURIFIER_CONVERT_HTML) . '">' . $hp->purify($status, CODENDI_PURIFIER_CONVERT_HTML) . '</label> '; } echo '<hr size="1" />'; echo '<strong>' . 'Types:' . '</strong> <input type="hidden" name="filter_type[]" value="-" />'; echo '<table>'; $types = $se->getTypes();
public function toggler_class_name() { return Toggler::getClassname('history_search_title'); }
public function fetchDisplayQuery(array $criteria, array $additional_criteria, $report_can_be_modified, PFUser $current_user) { $hp = Codendi_HTMLPurifier::instance(); $html = ''; $html .= '<div id="tracker_report_query" data-report-id="' . $this->id . '">'; $html .= '<form action="" method="POST" id="tracker_report_query_form">'; $html .= '<input type="hidden" name="report" value="' . $this->id . '" />'; $id = 'tracker_report_query_' . $this->id; $html .= '<h4 class="backlog-planning-search-title ' . Toggler::getClassname($id, $this->is_query_displayed ? true : false) . '" id="' . $id . '">'; // Query title $html .= $GLOBALS['Language']->getText('plugin_tracker_report', 'search') . '</h4>'; $used = array(); $criteria_fetched = array(); foreach ($criteria as $criterion) { if ($criterion->field->isUsed()) { $li = '<li id="tracker_report_crit_' . $criterion->field->getId() . '">'; if ($current_user->isAnonymous()) { $li .= $criterion->fetchWithoutExpandFunctionnality(); } else { $li .= $criterion->fetch(); } $li .= '</li>'; $criteria_fetched[] = $li; $used[$criterion->field->getId()] = $criterion->field; } } if ($report_can_be_modified && !$current_user->isAnonymous()) { $html .= '<div class="pull-right">'; $html .= $this->getAddCriteriaDropdown($used); $html .= '</div>'; } $array_of_html_criteria = array(); EventManager::instance()->processEvent(TRACKER_EVENT_REPORT_DISPLAY_ADDITIONAL_CRITERIA, array('array_of_html_criteria' => &$array_of_html_criteria, 'tracker' => $this->getTracker(), 'additional_criteria' => $additional_criteria, 'user' => $current_user)); foreach ($array_of_html_criteria as $additional_criteria) { $criteria_fetched[] = '<li>' . $additional_criteria . '</li>'; } $html .= '<ul id="tracker_query">' . implode('', $criteria_fetched) . '</ul>'; $html .= '<div align="center">'; $html .= '<button type="submit" name="tracker_query_submit" class="btn btn-primary">'; $html .= '<i class="icon-search"></i> '; $html .= $GLOBALS['Language']->getText('global', 'btn_search'); $html .= '</button>'; $html .= '</div>'; $html .= '</form>'; $html .= '</div>'; return $html; }
public function system_events_filter_classname() { return Toggler::getClassname('system_events_filter'); }
/** * Nicely html-formatted output of this group's audit trail * * @param Integer $group_id Id of the project * @param Integer $offset Offset used for pagination * @param Integer $limit Number of events by page * @param String $event Events category used to filter results * @param String $subEventsBox Event used to filter results * @param String $value Value used to filter results * @param Integer $startDate Start date used to filter results * @param Integer $endDate End date used to filter results * @param String $by User name used to filter results * * @return void */ function show_grouphistory($group_id, $offset, $limit, $event = null, $subEventsBox = null, $value = null, $startDate = null, $endDate = null, $by = null) { /* show the group_history rows that are relevant to this group_id */ global $Language; $dao = new ProjectHistoryDao(CodendiDataAccess::instance()); $history_filter = build_grouphistory_filter($event, $subEventsBox, $value, $startDate, $endDate, $by); $res = $dao->groupGetHistory($offset, $limit, $group_id, $history_filter); if (isset($subEventsBox)) { $subEventsString = implode(",", array_keys($subEventsBox)); $forwardSubEvents = '&event=' . $event . '&subEventsBox=' . $subEventsString; } else { $forwardSubEvents = '&event=' . $event; } echo ' <H2>' . $Language->getText('project_admin_utils', 'g_change_history') . '</H2>'; echo '<FORM METHOD="POST" ACTION="?group_id=' . $group_id . '" id="project_history_form" name="project_history_form">'; echo '<div>'; echo '<SPAN title="' . $Language->getText('project_admin_utils', 'toggle_search') . '" id="history_search_title" class="' . Toggler::getClassname('history_search_title') . '"><B>' . $Language->getText('project_admin_utils', 'history_search_title') . '</B></SPAN>'; echo '<TABLE ID="project_history_search">'; echo '<TH colspan="2" style="text-align:left">' . $Language->getText('project_admin_utils', 'event') . '</TH> <TH style="text-align:left">' . $Language->getText('project_admin_utils', 'val') . '</TH> <TH style="text-align:left">' . $Language->getText('project_admin_utils', 'from') . '</TH> <TH style="text-align:left">' . $Language->getText('project_admin_utils', 'to') . '</TH> <TH style="text-align:left">' . $Language->getText('global', 'by') . '</TH> <TR VALIGN="TOP"><TD>'; //Event select Box $events = array('any' => $GLOBALS["Language"]->getText('global', 'any'), 'event_permission' => $GLOBALS["Language"]->getText("project_admin_utils", "event_permission"), 'event_project' => $GLOBALS["Language"]->getText("project_admin_utils", "event_project"), 'event_user' => $GLOBALS["Language"]->getText("project_admin_utils", "event_user"), 'event_ug' => $GLOBALS["Language"]->getText("project_admin_utils", "event_ug"), 'event_others' => $GLOBALS["Language"]->getText("project_admin_utils", "event_others")); $select = new HTML_Element_Selectbox('', 'events_box', ''); $select->setId('events_box'); $select->addMultipleOptions($events, $event); echo $select->renderValue(); //SubEvent select Box echo '</TD><TD><select id="sub_events_box" name="sub_events_box[]" multiple> <Option value="choose_event" disabled="disabled">' . $GLOBALS['Language']->getText('project_admin_utils', 'choose_event') . '</Option> </select>'; echo '</TD><TD><input type="text" name="value" value="' . $value . '"></TD> <TD>'; echo html_field_date('start', $startDate, false, 10, 10, 'project_history_form', false); echo '</TD> <TD>'; echo html_field_date('end', $endDate, false, 10, 10, 'project_history_form', false); echo '</TD> <TD><input type="text" name="by" id="by" value="' . $by . '"></TD> </TR>'; echo '<TR><TD id="events_array"></TD></TR>'; echo '<TR><TD><input type="submit" name="filter"></TD></TR> </TABLE>'; echo '</div>'; echo '<P>'; if ($res['numrows'] > 0) { $title_arr = array(); $title_arr[] = $Language->getText('project_admin_utils', 'event'); $title_arr[] = $Language->getText('project_admin_utils', 'val'); $title_arr[] = $Language->getText('project_admin_utils', 'date'); $title_arr[] = $Language->getText('global', 'by'); echo html_build_list_table_top($title_arr); $i = 1; displayProjectHistoryResults($group_id, $res, false, $i); echo '</TABLE>'; echo '<div style="text-align:center" class="' . util_get_alt_row_color($i++) . '">'; if ($offset > 0) { echo '<a href="?group_id=' . $group_id . '&offset=' . ($offset - $limit) . $forwardSubEvents . '&value=' . $value . '&start=' . $startDate . '&end=' . $endDate . '&by=' . $by . '">[ ' . $Language->getText('project_admin_utils', 'previous') . ' ]</a>'; echo ' '; } if ($offset + $limit < $res['numrows']) { echo ' '; echo '<a href="?group_id=' . $group_id . '&offset=' . ($offset + $limit) . $forwardSubEvents . '&value=' . $value . '&start=' . $startDate . '&end=' . $endDate . '&by=' . $by . '">[ ' . $Language->getText('project_admin_utils', 'next') . ' ]</a>'; } echo '</div>'; echo '<div style="text-align:center" class="' . util_get_alt_row_color($i++) . '">'; echo $offset + $i - 3 . '/' . $res['numrows']; echo '</div>'; echo '<BR><TABLE align="left"><TR><TD> <input type="submit" name="export" value="' . $GLOBALS['Language']->getText('project_admin_utils', 'export_history') . '"> </TD></TR></TABLE></FORM><BR><P>'; } else { echo '<H3>' . $Language->getText('project_admin_utils', 'no_g_change') . '</H3>'; } $translatedEvents = convert_project_history_events(get_history_entries(), false); if (isset($subEventsString)) { $selectedSubEvents = explode(",", $subEventsString); foreach ($selectedSubEvents as $element) { $subEventsBox[] = $element; } } $translatedSelectedEvents = convert_project_history_events($subEventsBox, true); $js = "options = new Array();\n options['defaultValueActsAsHint'] = false;\n new UserAutoCompleter('by', '" . util_get_dir_image_theme() . "', true, options);\n new ProjectHistory(" . $translatedEvents . ", " . $translatedSelectedEvents . ");"; $GLOBALS['HTML']->includeFooterJavascriptFile('/scripts/codendi/ProjectHistory.js'); $GLOBALS['Response']->includeFooterJavascriptSnippet($js); }
public function fetchDisplayQuery(array $criteria, $report_can_be_modified, User $current_user = null) { $hp = Codendi_HTMLPurifier::instance(); $html = ''; $html .= '<div class="tracker_report_query">'; $html .= '<form action="" method="POST" id="tracker_report_query_form">'; $html .= '<input type="hidden" name="report" value="' . $this->id . '" />'; $id = 'tracker_report_query_' . $this->id; $html .= '<h3 class="' . Toggler::getClassname($id, $this->is_query_displayed ? true : false) . '" id="' . $id . '">'; // Query title $html .= $hp->purify($this->name, CODENDI_PURIFIER_CONVERT_HTML) . '</h3>'; $used = array(); $criteria_fetched = array(); foreach ($criteria as $criterion) { if ($criterion->field->isUsed()) { $criteria_fetched[] = '<li id="tracker_report_crit_' . $criterion->field->getId() . '">' . $criterion->fetch() . '</li>'; $used[$criterion->field->getId()] = $criterion->field; } } if ($report_can_be_modified && $this->userCanUpdate($current_user)) { $html .= '<div id="tracker_report_addcriteria_panel">' . $this->_fetchAddCriteria($used) . '</div>'; } $html .= '<ul id="tracker_query">' . implode('', $criteria_fetched) . '</ul>'; $html .= '<div align="center"><input type="submit" name="tracker_query_submit" value="' . $GLOBALS['Language']->getText('global', 'btn_submit') . '" /></div>'; $html .= '</form>'; $html .= '</div>'; return $html; }