function printnode($nodeid, $text, $depth = 0, $delete_ok = false) { global $Language; $purifier = Codendi_HTMLPurifier::instance(); // print current node, then all subnodes print '<BR>'; for ($i = 0; $i < $depth; $i++) { print " "; } html_image('ic/cfolder15.png', array()); print ' ' . $purifier->purify($text) . " "; if ($nodeid != 0) { print ' <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> '; } if ($delete_ok) { print ' <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> '; } if ($nodeid != 0) { print ' ' . help_button('trove_cat', $nodeid) . "\n"; } $res_child = db_query("SELECT trove_cat_id,fullname,parent FROM trove_cat " . "WHERE parent='" . db_ei($nodeid) . "' ORDER BY fullpath"); while ($row_child = db_fetch_array($res_child)) { $delete_ok = $row_child["parent"] != 0; printnode($row_child["trove_cat_id"], $row_child["fullname"], $depth + 1, $delete_ok); } }
function _toolbar($params) { // No toolbar in printer version if (isset($params['pv']) && $params['pv'] > 0) { return; } $tools = array(); $this->_addDocmanTool($params, $tools); $dPm =& Docman_PermissionsManager::instance($params['group_id']); $user =& $this->_controller->getUser(); $oneFolderWritable = $dPm->oneFolderIsWritable($user); if ($oneFolderWritable) { $url_params = array('action' => 'newGlobalDocument'); if (isset($params['item'])) { $url_params['id'] = $params['item']->accept(new Docman_View_ToolbarNewDocumentVisitor()); } $tools[] = '<b><a href="' . $this->buildUrl($params['default_url'], $url_params) . '">' . $GLOBALS['Language']->getText('plugin_docman', 'new_document') . '</a></b>'; if ($this->_controller->userCanAdmin()) { $tools[] = '<b><a href="' . $params['default_url'] . '&action=admin">' . $GLOBALS['Language']->getText('plugin_docman', 'toolbar_admin') . '</a></b>'; } } $tools[] = help_button('DocumentManagerPlugin.html', false, $GLOBALS['Language']->getText('global', 'help')); echo implode(' | ', $tools); echo "\n"; }
function project_admin_header($params) { global $group_id, $feedback, $Language; $params['toptab'] = 'admin'; $params['group'] = $group_id; site_project_header($params); echo ' <P><TABLE width="100%"><TR>'; echo '<TD width="1"><b>' . $Language->getText('project_admin_utils', 'menu_config') . '</b></td><td><b> <A HREF="/project/admin/editgroupinfo.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_utils', 'edit_public_info') . '</A> | <A HREF="/project/admin/servicebar.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_editservice', 's_conf') . '</A> | <A HREF="/project/admin/reference.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_utils', 'references') . '</A>'; $em = EventManager::instance(); $em->processEvent('admin_toolbar_configuration', array('group_id' => $group_id)); echo '</td><td>'; if (isset($params['help'])) { echo help_button($params['help'], false, $Language->getText('global', 'help')); } echo '</td></tr>'; echo '</td></tr><tr><td><b>' . $Language->getText('project_admin_utils', 'menu_permissions') . '</b></td><td><b> <A HREF="/project/admin/userperms.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_utils', 'user_perms') . '</A> | <A HREF="/project/admin/ugroup.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_utils', 'ug_admin') . '</A> | <A HREF="/project/admin/permission_request.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_ugroup', 'permission_request') . '</A>'; echo '</td><td></td></tr><tr><td><b>' . $Language->getText('project_admin_utils', 'menu_data') . '</b></td><td><b> <A HREF="/project/export/index.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_utils', 'project_data_export') . '</A> | <A HREF="/tracker/import_admin.php?group_id=' . $group_id . '&mode=admin">' . $Language->getText('project_admin_utils', 'tracker_import') . '</A> | <A HREF="/project/admin/history.php?group_id=' . $group_id . '">' . $Language->getText('project_admin_history', 'proj_history') . '</A> | <A HREF="/project/stats/source_code_access.php/?group_id=' . $group_id . '">' . $Language->getText('project_admin_utils', 'access_logs') . '</A>'; //Call hook that can be displayed in this area $em->processEvent('admin_toolbar_data', array('group_id' => $group_id)); //<A HREF="/project/admin/?group_id='.$group_id.'&func=import">Tracker Import</A> echo '</td><td></td></tr></table>'; echo '</B> <P>'; }
function survey_header($params) { global $group_id, $is_admin_page, $Language; $params['toptab'] = 'survey'; $params['group'] = $group_id; $pm = ProjectManager::instance(); $project = $pm->getProject($group_id); if (!$project->usesSurvey()) { exit_error($Language->getText('global', 'error'), $Language->getText('survey_s_utils', 's_off')); } site_project_header($params); echo "<P><B>"; // Admin link is displayed only if the user is a project administrator if (user_ismember($group_id, 'A')) { echo "<A HREF=\"/survey/admin/?group_id={$group_id}\">" . $Language->getText('survey_s_utils', 'admin') . "</A>"; } if ($is_admin_page && $group_id && user_ismember($group_id, 'A')) { echo " | <A HREF=\"/survey/admin/add_survey.php?group_id={$group_id}\">" . $Language->getText('survey_admin_index', 'add_s') . "</A>"; echo " | <A HREF=\"/survey/admin/edit_survey.php?func=browse&group_id={$group_id}\">" . $Language->getText('survey_admin_browse_survey', 'edit_s') . "</A>"; echo " | <A HREF=\"/survey/admin/add_question.php?group_id={$group_id}\">" . $Language->getText('survey_admin_index', 'add_q') . "</A>"; echo " | <A HREF=\"/survey/admin/edit_question.php?func=browse&group_id={$group_id}\">" . $Language->getText('survey_admin_browse_question', 'edit_q') . "</A>"; echo " | <A HREF=\"/survey/admin/show_results.php?group_id={$group_id}\">" . $Language->getText('survey_s_utils', 'show_r') . "</A>"; } if (isset($params['help'])) { if (user_ismember($group_id, 'A')) { echo ' | '; } echo help_button($params['help'], false, $Language->getText('global', 'help')); } echo "</B><P>"; }
function printnode($nodeid, $text, $delete_ok = false) { global $Language; // print current node, then all subnodes print '<BR>'; for ($i = 0; $i < $GLOBALS['depth']; $i++) { print " "; } html_image('ic/cfolder15.png', array()); print ' ' . $text . " "; if ($nodeid != 0) { print ' <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> '; } if ($delete_ok) { print ' <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> '; } if ($nodeid != 0) { print ' ' . help_button('trove_cat', $nodeid) . "\n"; } $GLOBALS["depth"]++; $res_child = db_query("SELECT trove_cat_id,fullname,parent FROM trove_cat " . "WHERE parent='{$nodeid}' ORDER BY fullpath"); while ($row_child = db_fetch_array($res_child)) { $delete_ok = $row_child["parent"] != 0; printnode($row_child["trove_cat_id"], $row_child["fullname"], $delete_ok); } $GLOBALS["depth"]--; }
function _getHelp($section = '', $questionmark = false) { if (trim($section) !== '' && $section[0] !== '#') { $section = '#' . $section; } if ($questionmark) { $help_label = '[?]'; } else { $help_label = $GLOBALS['Language']->getText('global', 'help'); } return help_button('ci.html' . $section, false, $help_label); }
function people_header($params) { global $group_id, $HTML, $Language; echo $HTML->header($params); echo ' <H2>' . $GLOBALS['sys_name'] . ' - ' . $Language->getText('people_utils', 'people_skills') . '</H2> <P><B> <A HREF="/people/admin/">' . $Language->getText('people_utils', 'admin') . '</A>'; if (array_key_exists('help', $params) && $params['help']) { echo ' | ' . help_button($params['help'], false, $Language->getText('global', 'help')); } echo '</B>'; echo '<HR NoShade SIZE="1" SIZE="90%">'; }
function commits_header_admin($params) { global $group_id, $Language; //required params for site_project_header(); $params['group'] = $group_id; $params['toptab'] = 'cvs'; $pm = ProjectManager::instance(); $project = $pm->getProject($group_id); if (!$project->usesCVS()) { exit_error($Language->getText('global', 'error'), $Language->getText('cvs_commit_utils', 'error_off')); } echo site_project_header($params); if ($params['help']) { echo ' | <b>' . help_button($params['help'], false, $Language->getText('global', 'help')) . '</b>'; } echo ' <hr width="300" size="1" align="left" noshade>'; }
function printnode($nodeid, $text) { // print current node, then all subnodes print '<BR>'; for ($i = 0; $i < $GLOBALS[depth]; $i++) { print " "; } print html_image('images/ic/cfolder15.png', '15', '13', array()); print ' ' . $text . " "; print '<A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[Edit]</A> '; print help_button('trove_cat', $nodeid) . "\n"; $GLOBALS["depth"]++; $res_child = db_query("SELECT trove_cat_id,fullname FROM trove_cat " . "WHERE parent='{$nodeid}'"); while ($row_child = db_fetch_array($res_child)) { printnode($row_child["trove_cat_id"], $row_child["fullname"]); } $GLOBALS["depth"]--; }
function news_header($params) { global $HTML, $group_id, $news_name, $news_id, $Language; $params['toptab'] = 'news'; $params['group'] = $group_id; if (isset($params['project_id'])) { $params['group'] = $params['project_id']; $group_id = $params['project_id']; } /* Show horizontal links */ if ($group_id && $group_id != $GLOBALS['sys_news_group']) { site_project_header($params); } else { $HTML->header($params); echo ' <H2>' . $GLOBALS['sys_name'] . ' <A HREF="/news/">' . $Language->getText('news_index', 'news') . '</A></H2>'; } if (!isset($params['pv']) || !$params['pv']) { echo '<P><B>'; // 'Admin' tab is only displayed if the user is News admin or project admin if ($group_id) { if (user_ismember($group_id, 'A') || user_ismember($group_id, 'N2')) { echo '<A HREF="/news/submit.php?group_id=' . $group_id . '">' . $Language->getText('news_utils', 'submit_news') . '</A> | <A HREF="/news/admin/?group_id=' . $group_id . '">' . $Language->getText('news_utils', 'admin') . '</A>'; } else { if (user_ismember($group_id, 'A') || user_ismember($group_id, 'N1')) { // 'Submit News' tab is only displayed if the user is News writer, or project admin echo '<A HREF="/news/submit.php?group_id=' . $group_id . '">' . $Language->getText('news_utils', 'submit_news') . '</A>'; } } if (user_ismember($group_id, 'A') || user_ismember($group_id, 'N2') || user_ismember($group_id, 'N1')) { if (isset($params['help'])) { echo ' | '; } } } if (isset($params['help'])) { echo help_button($params['help'], false, $Language->getText('global', 'help')); } echo '</b><P>'; } }
function file_utils_admin_header($params) { global $group_id, $Language; $params['toptab'] = 'file'; $params['group'] = $group_id; site_project_header($params); if (user_ismember($group_id, "R2")) { $pm = ProjectManager::instance(); $p = $pm->getProject($group_id); echo '<strong>'; echo '<a href="/file/?group_id=' . $group_id . '">' . $Language->getText('project_admin_editservice', $p->services['file']->getLabel()) . '</a>'; echo ' | <a href="/file/admin/?group_id=' . $group_id . '">' . $Language->getText('file_file_utils', 'admin') . '</a>'; echo ' | <a href="/file/admin/manageprocessors.php?group_id=' . $group_id . '">' . $Language->getText('file_file_utils', 'manage_proc') . '</a>'; if (!isset($params['help'])) { $params['help'] = "frs.html"; } echo ' | ' . help_button($params['help'], false, $Language->getText('global', 'help')); echo "</strong><br><hr>"; } }
function printnode($nodeid, $text) { global $Language; print '<br />'; for ($i = 0; $i < $GLOBALS[depth]; $i++) { print " "; } print html_image('ic/cfolder15.png', '15', '13', array()); print ' ' . $text . " "; print url_make_link("trove_cat_add.php?parent_trove_cat_id='.{$nodeid}.'", "[" . _('Add') . "]"); if ($nodeid != 0) { print url_make_link("trove_cat_edit.php?parent_trove_cat_id='.{$nodeid}.'", "[" . _('Edit') . "]"); print help_button('trove_cat', $nodeid) . "\n"; } $GLOBALS['depth']++; $res_child = db_query("\n\t\tSELECT trove_cat_id,fullname FROM trove_cat \n\t\tWHERE parent='{$nodeid}'\n\t\tAND trove_cat_id!=0;\n\t"); while ($row_child = db_fetch_array($res_child)) { printnode($row_child["trove_cat_id"], $row_child["fullname"]); } $GLOBALS["depth"]--; }
function mail_header_admin($params) { global $group_id, $Language; //required for site_project_header $params['group'] = $group_id; $params['toptab'] = 'mail'; $pm = ProjectManager::instance(); $project = $pm->getProject($group_id); if (!$project->usesMail()) { exit_error($Language->getText('global', 'error'), $Language->getText('mail_utils', 'mail_turned_off')); } site_project_header($params); echo ' <P><B><A HREF="/mail/admin/?group_id=' . $group_id . '">' . $Language->getText('mail_utils', 'admin') . '</A></B> | <B><A HREF="/mail/admin/?group_id=' . $group_id . '&add_list=1">' . $Language->getText('mail_utils', 'add_list') . '</A></B> | <B><A HREF="/mail/admin/?group_id=' . $group_id . '&change_status=1">' . $Language->getText('mail_utils', 'update_list') . '</A></B> '; if ($params['help']) { echo ' | <B>' . help_button($params['help'], false, $Language->getText('global', 'help')) . '</B>'; } }
function snippet_header($params) { global $is_snippet_page, $HTML, $feedback, $Language; if ($GLOBALS['sys_use_snippet'] == 0) { exit_permission_denied(); } // LJ used so the search box will add the necessary element to the pop-up box // Codendi Specific $is_snippet_page = 1; $HTML->header($params); /* Show horizontal links */ echo '<H2>' . $params['title'] . '</H2>'; echo '<P><B>'; echo '<A HREF="/snippet/">' . $Language->getText('snippet_utils', 'browse') . '</A> | <A HREF="/snippet/submit.php">' . $Language->getText('snippet_utils', 'create_s') . '</A> | <A HREF="/snippet/package.php">' . $Language->getText('snippet_utils', 'create_p') . '</A></B>'; if (isset($params['help']) && $params['help']) { echo ' | ' . help_button($params['help'], false, $Language->getText('global', 'help')); } echo '<P>'; html_feedback_top($feedback); }
function _getHelp() { return help_button('communication.html#instant-messaging-plug-in', false, $GLOBALS['Language']->getText('global', 'help')); }
/** * displayMenu - public */ function displayMenu() { print ' <table class="ServiceMenu"> <tr> <td>'; switch (DEFAULT_LANGUAGE) { case 'fr_FR': $attatch_page = "DéposerUnFichier"; $preferences_page = "PréférencesUtilisateurs"; break; case 'en_US': default: $attatch_page = 'UpLoad'; $preferences_page = 'UserPreferences'; break; } $attatch_menu = $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menuattch'); $preferences_menu = $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menuprefs'); $help_menu = $GLOBALS['Language']->getText('global', 'help'); print ' <ul class="ServiceMenu"> <li><a href="' . $this->wikiLink . '&view=browsePages">' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menupages') . '</a> | </li>'; if (UserManager::instance()->getCurrentUser()->isLoggedIn()) { print '<li><a href="javascript:help_window(\'' . $this->wikiLink . '&pagename=' . $attatch_page . '&pv=1\')">' . $attatch_menu . '</a> | </li>'; print '<li><a href="' . $this->wikiLink . '&pagename=' . $preferences_page . '">' . $preferences_menu . '</a> | </li>'; } if (user_ismember($this->gid, 'W2')) { print '<li><a href="' . $this->wikiAdminLink . '">' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menuadmin') . '</a> | </li>'; } print '<li>' . help_button('WikiService.html', false, $help_menu) . '</li> </ul>'; print ' </td> <td align="right" valign="top">'; if (user_ismember($this->gid, 'W2')) { $wiki = new Wiki($this->gid); $permInfo = ""; if ('wiki' == $this->view) { // User is browsing a wiki page $wp = new WikiPage($this->gid, $_REQUEST['pagename']); $permLink = $this->wikiAdminLink . '&view=pagePerms&id=' . $wp->getId(); if ($wp->permissionExist()) { $permInfo = '<a href="' . $permLink . '"> ' . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_alt') . '" title="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_title_spec') . '"/></a>'; } } if ($wiki->permissionExist()) { $permInfo .= '<a href="/wiki/admin/index.php?group_id=' . $this->gid . '&view=wikiPerms"> ' . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_alt') . '" title="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_title_set') . '"/>' . '</a>'; } if ($permInfo) { print $permInfo; } } //Display printer_version link only in wiki pages if (isset($_REQUEST['pagename'])) { print ' (<a href="' . $_SERVER['REQUEST_URI'] . '&pv=1" title="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lighter_display') . '"> <img src="' . util_get_image_theme("msg.png") . '" border="0"> ' . $GLOBALS['Language']->getText('global', 'printer_version') . '</A> ) </li>'; } print ' </td> </tr> </table>'; }
$params = array('title' => $Language->getText('file_showfiles', 'file_p_for', $pm->getProject($group_id)->getPublicName()), 'pv' => $pv); file_utils_header($params); $hp =& Codendi_HTMLPurifier::instance(); if ($num_packages < 1) { echo '<h3>' . $Language->getText('file_showfiles', 'no_file_p') . '</h3><p>' . $Language->getText('file_showfiles', 'no_p_available'); if ($frspf->userCanAdmin($user, $group_id)) { echo '<p><a href="admin/package.php?func=add&group_id=' . $group_id . '">[' . $GLOBALS['Language']->getText('file_admin_editpackages', 'create_new_p') . ']</a></p>'; } file_utils_footer($params); exit; } if ($pv) { echo '<h3>' . $Language->getText('file_showfiles', 'p_releases') . ':</h3>'; } else { echo "<TABLE width='100%'><TR><TD>"; echo '<h3>' . $Language->getText('file_showfiles', 'p_releases') . ' ' . help_button('FileReleaseJargon.html') . '</h3>'; echo "</TD>"; echo "<TD align='left'> ( <A HREF='showfiles.php?group_id={$group_id}&pv=1'><img src='" . util_get_image_theme("msg.png") . "' border='0'> " . $Language->getText('global', 'printer_version') . "</A> ) </TD>"; echo "</TR></TABLE>"; echo '<p>' . $Language->getText('file_showfiles', 'select_release') . '</p>'; ?> <SCRIPT language="JavaScript"> <!-- function showConfirmDownload(group_id,file_id,filename) { url = "/file/confirm_download.php?popup=1&group_id=" + group_id + "&file_id=" + file_id + "&filename=" + filename; wConfirm = window.open(url,"confirm","width=520,height=450,resizable=1,scrollbars=1"); wConfirm.focus(); } function download(group_id,file_id,filename) { url = "/file/download.php/" + group_id + "/" + file_id +"/"+filename;
protected function displayAdminNotifications_Personnal($current_user) { $user_id = $current_user->getId(); $hp = Codendi_HTMLPurifier::instance(); // Build Wachees UI $arr_watchees = array(); foreach ($this->getWatcherDao()->searchWatchees($this->tracker->id, $current_user->getId()) as $row) { $arr_watchees[] = user_getname($row['watchee_id']); } $watchees = join(',', $arr_watchees); echo '<h3>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'perso_mail_notif') . '</h3>'; if ($this->tracker->userIsAdmin()) { // To watch other users you must have at least admin rights on the tracker echo ' <h4>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'users_to_watch') . ' ' . help_button('TrackerV5Administration.html#TrackerV5Watchers') . '</h4> <P>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'backup_person') . ' <p><INPUT TYPE="TEXT" NAME="watchees" VALUE="' . $hp->purify($watchees, CODENDI_PURIFIER_CONVERT_HTML) . '" SIZE="55" MAXLENGTH="255"><br></p> '; $watchers = ""; foreach ($this->getWatcherDao()->searchWatchers($this->tracker->id, $current_user->getId()) as $row) { $watcher_name = user_getname($row_watcher['user_id']); $watchers .= '<a href="/users/' . urlencode($watcher_name) . '">' . $hp->purify($watcher_name, CODENDI_PURIFIER_CONVERT_HTML) . '</a>,'; } $watchers = substr($watchers, 0, -1); // remove extra comma at the end if ($watchers) { echo "<p>" . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'watchers', $hp->purify($watchers, CODENDI_PURIFIER_CONVERT_HTML)); } else { echo "<p>" . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'no_watcher'); } echo '<br><br>'; } // Build Role/Event table $dar_roles = $this->getNotificationDao()->searchRoles($this->tracker->id); $num_roles = $dar_roles->rowCount(); $dar_events = $this->getNotificationDao()->searchEvents($this->tracker->id); $num_events = $dar_events->rowCount(); $arr_notif = array(); // By default it's all 'yes' foreach ($dar_roles as $role) { foreach ($dar_events as $event) { $arr_notif[$role['role_label']][$event['event_label']] = 1; } } foreach ($this->getNotificationDao()->searchNotification($this->tracker->id, $current_user->getId()) as $arr) { $arr_notif[$arr['role_label']][$arr['event_label']] = $arr['notify']; } // Rk: Can't use html_build_list_table_top because of the specific layout echo '<h4>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'event_settings') . ' ' . help_button('TrackerV5Administration.html#TrackerV5EventRoleBasedEmailNotification') . '</h4> <P>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'tune_settings'); echo ' <table BORDER="0" CELLSPACING="1" CELLPADDING="2" class="small"> <tr class="boxtitle"> <td colspan="' . (int) $num_roles . '" align="center" width="50%"><b>' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'role_is') . '</b></td> <td rowspan="2" width="50%"><b> ' . $GLOBALS['Language']->getText('plugin_tracker_include_type', 'notify_me') . '</b></td> </tr>'; $dar_roles->rewind(); foreach ($dar_roles as $role) { echo '<td align="center" width="10%"><b>' . $GLOBALS['Language']->getText('plugin_tracker_common_types', $role['short_description_msg']) . "</b></td>\n"; } echo "</tr>\n"; $dar_events->rewind(); $dar_roles->rewind(); $i = 0; foreach ($dar_events as $event) { $event_label = $event['event_label']; echo "<tr class=\"" . util_get_alt_row_color($i++) . "\">\n"; foreach ($dar_roles as $role) { $role_label = $role['role_label']; $cbox_name = 'cb_' . $role['role_id'] . '_' . $event['event_id']; if ($event_label == 'NEW_ARTIFACT' && $role_label != 'ASSIGNEE' && $role_label != 'SUBMITTER' || $event_label == 'ROLE_CHANGE' && $role_label != 'ASSIGNEE' && $role_label != 'CC') { // if the user is not a member then the ASSIGNEE column cannot // be set. If it's not an assignee or a submitter the new_artifact event is meaningless echo ' <td align="center"><input type="hidden" name="' . $cbox_name . '" value="1">-</td>' . "\n"; } else { echo ' <td align="center"><input type="checkbox" name="' . $cbox_name . '" value="1" ' . ($arr_notif[$role_label][$event_label] ? 'checked' : '') . "></td>\n"; } } echo ' <td> ' . $GLOBALS['Language']->getText('plugin_tracker_common_types', $event['description_msg']) . "</td>\n"; echo "</tr>\n"; } echo ' </table>'; }
$HTML->header(array('title' => $Language->getText('register_index', 'project_registration') . ' - ' . $steps[$current_step]->name)); echo '<style> .current_step { font-weight:bold; } .next_step { color:#999; } </style>'; echo '<form action="" method="POST">'; echo $csrf->fetchHTMLInput(); echo '<table>'; echo '<tr style="vertical-align:top;">'; echo '<td>'; echo '<h2>' . $steps[$current_step]->name . ' '; echo help_button($steps[$current_step]->help); echo '</h2>'; $steps[$current_step]->display($data); echo '</td>'; echo '<td rowspan="2"><ol>'; foreach ($steps as $key => $step) { $classname = $key == $current_step ? 'current_step' : ($key < $current_step ? 'previous_step' : 'next_step'); echo '<li class="' . $classname . '">' . $step->name . '</li>'; } echo '</ol></td>'; echo '</tr><tr>'; echo '<td style="text-align:center">'; echo '<input type="submit" name="cancel" value="' . $GLOBALS['Language']->getText('register_form', 'cancel') . '" /> '; echo '<input type="hidden" name="current_step" value="' . $current_step . '" />'; echo '<input type="hidden" name="data" value="' . htmlentities(serialize($data), ENT_QUOTES, 'UTF-8') . '" />'; echo '<input type="submit" name="next" id="project_register_next" value="' . ($current_step < count($steps) - 1 ? $GLOBALS['Language']->getText('register_form', 'next') : $GLOBALS['Language']->getText('register_title', 'intro')) . '" />';
function displayAdd($user_id) { global $art_field_fact, $art_fieldset_fact, $sys_max_size_attachment, $Language; $hp = Codendi_HTMLPurifier::instance(); $fields_per_line = 2; // the column number is the number of field per line * 2 (label + value) // + the number of field per line -1 (a blank column between each pair "label-value" to give more space) $columns_number = $fields_per_line * 2 + ($fields_per_line - 1); $max_size = 40; $group = $this->ArtifactType->getGroup(); $group_artifact_id = $this->ArtifactType->getID(); $group_id = $group->getGroupId(); $result_fieldsets = $art_fieldset_fact->getAllFieldSetsContainingUsedFields(); // Display submit informations if any if ($this->ArtifactType->getSubmitInstructions()) { echo $hp->purify(util_unconvert_htmlspecialchars($this->ArtifactType->getSubmitInstructions()), CODENDI_PURIFIER_FULL); } // Beginning of the submission form with fixed fields echo '<FORM ACTION="" METHOD="POST" enctype="multipart/form-data" NAME="artifact_form"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="' . $sys_max_size_attachment . '"> <INPUT TYPE="HIDDEN" NAME="func" VALUE="postadd"> <INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . (int) $group_id . '"> <INPUT TYPE="HIDDEN" NAME="atid" VALUE="' . (int) $group_artifact_id . '">'; echo '<TABLE><TR><TD class="artifact">'; $pm = ProjectManager::instance(); $html = ''; $html .= ' <TABLE width="100%"> <TR><TD VALIGN="TOP" COLSPAN="' . $columns_number . '"> <B>' . $Language->getText('tracker_include_artifact', 'group') . ':</B> ' . $hp->purify(util_unconvert_htmlspecialchars($pm->getProject($group_id)->getPublicName()), CODENDI_PURIFIER_CONVERT_HTML) . '</TD></TR>'; // Now display the variable part of the field list (depend on the project) foreach ($result_fieldsets as $fieldset_id => $result_fieldset) { // this variable will tell us if we have to display the fieldset or not (if there is at least one field to display or not) $display_fieldset = false; $fieldset_html = ''; $i = 0; $fields_in_fieldset = $result_fieldset->getAllUsedFields(); while (list($key, $field) = each($fields_in_fieldset)) { $field_html = new ArtifactFieldHtml($field); // if the field is a special field (except summary and original description) // or if not used by this project then skip it. // Plus only show fields allowed on the artifact submit_form if (!$field->isSpecial() || $field->getName() == 'summary' || $field->getName() == 'details') { if ($field->userCanSubmit($group_id, $group_artifact_id, $user_id)) { // display the artifact field with its default value // if field size is greatest than max_size chars then force it to // appear alone on a new line or it won't fit in the page // if the user can submit at least one field, we can display the fieldset this field is within $display_fieldset = true; $field_value = $field->getDefaultValue(); list($sz, ) = $field->getGlobalDisplaySize(); $label = $field_html->labelDisplay(false, false, true); $value = $field_html->display($group_artifact_id, $field_value, false, false); $star = $field->isEmptyOk() ? '' : '<span class="highlight"><big>*</big></b></span>'; if ($sz > $max_size || $field->getName() == 'details') { $fieldset_html .= "\n<TR>" . '<TD valign="top"><a class="artifact_field_tooltip" href="#" title="' . $hp->purify(SimpleSanitizer::unsanitize($field->getDescription()), CODENDI_PURIFIER_CONVERT_HTML) . '">' . $label . $star . '</a></td>' . '<TD valign="middle" colspan="' . ($columns_number - 1) . '">' . $value . '</TD>' . "\n</TR>"; $i = 0; } else { $fieldset_html .= $i % $fields_per_line ? '' : "\n<TR>"; $fieldset_html .= '<TD valign="middle"><a class="artifact_field_tooltip" href="#" title="' . $hp->purify(SimpleSanitizer::unsanitize($field->getDescription()), CODENDI_PURIFIER_CONVERT_HTML) . '">' . $label . $star . '</a></td>' . '<TD valign="middle">' . $value . '</TD>'; $i++; $fieldset_html .= $i % $fields_per_line ? '<td class="artifact_spacer"> </td>' : "\n</TR>"; } } } } // while // We display the fieldset only if there is at least one field inside that we can display if ($display_fieldset) { $html .= '<TR><TD COLSPAN="' . (int) $columns_number . '"> </TD></TR>'; $html .= '<TR class="boxtitle"><TD class="left" COLSPAN="' . (int) $columns_number . '"> <span title="' . $hp->purify(SimpleSanitizer::unsanitize($result_fieldset->getDescriptionText()), CODENDI_PURIFIER_CONVERT_HTML) . '">' . $hp->purify(SimpleSanitizer::unsanitize($result_fieldset->getLabel()), CODENDI_PURIFIER_CONVERT_HTML) . '</span></TD></TR>'; $html .= $fieldset_html; } } $html .= '</TABLE>'; echo $this->_getSection('artifact_section_details', $Language->getText('tracker_include_artifact', 'details'), $html, true); // // CC List // $html = ''; $html .= $Language->getText('tracker_include_artifact', 'fill_cc_list_msg'); $html .= $Language->getText('tracker_include_artifact', 'fill_cc_list_lbl'); $html .= '<textarea type="text" name="add_cc" id="tracker_cc" rows="2" cols="60" wrap="soft"></textarea>'; $html .= '<B> ' . $Language->getText('tracker_include_artifact', 'fill_cc_list_cmt') . ": </b>"; $html .= '<input type="text" name="cc_comment" size="40" maxlength="255">'; echo $this->_getSection('artifact_section_cc', $Language->getText('tracker_include_artifact', 'cc_list') . ' ' . help_button('tracker-v3.html#cc-list'), $html, true); // // File attachments // $html = ''; $html .= '<input type="file" name="input_file" size="40">'; $html .= $Language->getText('tracker_include_artifact', 'upload_file_msg', formatByteToMb($sys_max_size_attachment)); $html .= $Language->getText('tracker_include_artifact', 'upload_file_desc'); $html .= '<input type="text" name="file_description" size="60" maxlength="255">'; echo $this->_getSection('artifact_section_attachments', $Language->getText('tracker_include_artifact', 'attachment') . ' ' . help_button('tracker-v3.html#artifact-attachments'), $html, true); // // Artifact permissions // if ($this->ArtifactType->userIsAdmin()) { $checked = ''; if ($this->useArtifactPermissions()) { $checked = 'checked="checked"'; } $html = ''; $html .= '<p>'; $html .= '<label class="checkbox" for="use_artifact_permissions"><input type="hidden" name="use_artifact_permissions_name" value="0" />'; $html .= '<input type="checkbox" name="use_artifact_permissions_name" id="use_artifact_permissions" value="1" ' . $checked . ' />'; $html .= $GLOBALS['Language']->getText('tracker_include_artifact', 'permissions_label') . '</label>'; $html .= '</p>'; $html .= permission_fetch_selection_field('TRACKER_ARTIFACT_ACCESS', $this->getId(), $group_id); $html .= '<script type="text/javascript">'; $html .= "\n document.observe('dom:loaded', function() {\n if ( ! \$('use_artifact_permissions').checked) {\n \$('ugroups').disable();\n }\n \$('use_artifact_permissions').observe('click', function(evt) {\n if (this.checked) {\n \$('ugroups').enable();\n } else {\n \$('ugroups').disable();\n }\n });\n });\n </script>"; echo $this->_getSection('artifact_section_permissions', $Language->getText('tracker_include_artifact', 'permissions') . ' ' . help_button('tracker-v3.html#permissions-on-artifacts'), $html, false, $GLOBALS['Language']->getText('tracker_include_artifact', 'permissions_use_default')); } // // Final submit button // echo '<p><B><span class="highlight">' . $Language->getText('tracker_include_artifact', 'check_already_submitted') . '</b></p>'; echo '<div style="text-align:center"><INPUT CLASS="btn btn-primary" TYPE="SUBMIT" NAME="SUBMIT" VALUE="' . $Language->getText('tracker_include_artifact', 'submit') . '"></div>'; echo '</td></tr>'; echo '</table>'; echo '</form>'; }
function helpButton($params) { echo ' | '; echo help_button($params, false, _('Help')); }
$params['title'] = $Language->getText('tracker_index', 'trackers_for', $group->getPublicName()); $params['sectionvals'] = array($group->getPublicName()); $params['help'] = 'TrackerService.html'; $params['pv'] = $pv ? $pv : ''; echo site_project_header($params); echo '<strong>'; // Admin link and create link are only displayed if the user is a project administrator if (user_ismember($group_id, 'A')) { echo '<a href="/tracker/admin/?group_id=' . (int) $group_id . '">' . $Language->getText('tracker_index', 'admin_all_trackers') . '</a>'; echo ' | <a href="/tracker/admin/?group_id=' . (int) $group_id . '&func=create">' . $Language->getText('tracker_index', 'create_new_tracker') . '</a>'; if ($params['help']) { echo ' | '; } } if ($params['help']) { echo help_button($params['help'], false, $Language->getText('global', 'help')); } echo "</strong><p>"; if (!$at_arr || count($at_arr) < 1) { echo '<h2>' . $Language->getText('tracker_index', 'no_accessible_trackers_hdr') . '</h2>'; echo '<p>' . $Language->getText('tracker_index', 'no_accessible_trackers_msg') . '</p>'; } else { echo "<p>" . $Language->getText('tracker_index', 'choose_tracker'); if (!$pv) { echo " ( <A HREF='?group_id=" . (int) $group_id . "&pv=1'><img src='" . util_get_image_theme("ic/printer.png") . "' border='0'> " . $Language->getText('global', 'printer_version') . "</A> )"; } echo "<p>"; // // Put the result set (list of trackers for this group) into a column with folders // for ($j = 0; $j < count($at_arr); $j++) {
$form_cat = $GLOBALS['sys_default_trove_cat']; } else { $form_cat = 18; } } $form_cat = intval($form_cat); // get info about current folder $res_trove_cat = db_query('SELECT * FROM trove_cat WHERE trove_cat_id=' . $form_cat); if (db_numrows($res_trove_cat) < 1) { echo db_error(); exit_error($Language->getText('softwaremap_trove_list', 'invalid_cat'), $Language->getText('softwaremap_trove_list', 'cat_not_exist')); } $row_trove_cat = db_fetch_array($res_trove_cat); $HTML->header(array('title' => $Language->getText('softwaremap_trove_list', 'map'))); echo ' <h2>' . $Language->getText('softwaremap_trove_list', 'map') . ' ' . help_button('TheMainMenu.html#SoftwareMap') . '</h2> <HR NoShade> '; // ##################################### // this section limits search and requeries if there are discrim elements unset($discrim_url); unset($discrim_desc); if (isset($discrim)) { $discrim_queryalias = ''; $discrim_queryand = ''; $discrim_url_b = ''; // commas are ANDs $expl_discrim = explode(',', $discrim); // need one link for each "get out of this limit" links $discrim_url = '&discrim='; $lims = sizeof($expl_discrim);
/** * Display screen accepting the CSV file to be parsed * * */ function displayCSVInput($atid, $user_id) { global $Language, $sys_max_size_upload; $this->ath->header(array('title' => $Language->getText('tracker_import', 'art_import') . ' ' . $this->ath->getID() . ' - ' . $this->ath->getName(), 'pagename' => 'tracker', 'atid' => $this->ath->getID(), 'sectionvals' => array($this->group->getPublicName()), 'help' => 'tracker-v3.html#tracker-artifact-import')); echo '<div id="tracker_toolbar_clear"></div>' . PHP_EOL; echo '<h3>' . $Language->getText('tracker_import', 'import_new_hdr', array(help_button('tracker-v3.html#tracker-artifact-import'))) . '</h3>'; echo '<p>' . $Language->getText('tracker_import', 'import_new_msg', array('/tracker/index.php?group_id=' . (int) $this->group->group_id . '&atid=' . (int) $atid . '&user_id=' . (int) $user_id . '&mode=showformat&func=import')) . '</p>'; $_pref_notify = user_get_preference('tracker_import_notify_' . $atid); $notifychecked = ''; if ($_pref_notify === '1') { $notifychecked = 'checked="checked"'; } echo ' <FORM NAME="importdata" id="tracker-import-data" action="" method="POST" enctype="multipart/form-data"> <INPUT TYPE="hidden" name="group_id" value="' . (int) $this->group->group_id . '"> <INPUT TYPE="hidden" name="atid" value="' . (int) $atid . '"> <INPUT TYPE="hidden" name="func" value="import"> <INPUT TYPE="hidden" name="mode" value="parse"> <table border="0"> <tr> <th> '; //<input type="checkbox" name="file_upload" value="1"> echo '<B>' . $Language->getText('tracker_import', 'upload_file') . '</B></th> <td> <input type="file" name="csv_filename" size="50"> </td> <td> <span class="help"><i>' . $Language->getText('tracker_import', 'max_upload_size', formatByteToMb($sys_max_size_upload)) . '</i></span> </td> </tr> <tr> <th> ' . $Language->getText('tracker_import', 'send_notifications') . ' </th> <td colspan="2"> <input type="checkbox" name="notify" value="ok" "' . $notifychecked . '"/> </td> </tr>'; //<tr> //<th>OR Paste Artifact Data (in CSV format):</th> //<td><textarea cols="60" rows="10" name="data"></textarea></td> //</tr> echo ' </table> <br> <input class="btn btn-primary" type="submit" value="' . $Language->getText('tracker_import', 'submit_info') . '"> </FORM> '; $this->ath->footer(array()); }
/** * returns the html code for the full select * for all categories, for a specific group * * @param int group_id the group for categorization * @return string html code for the full select */ function trove_get_html_allcat_selectfull($group_id) { $html = ""; $CATROOTS = trove_getallroots(); while (list($catroot, $fullname) = each($CATROOTS)) { $html .= "\n<HR>\n<P><B>{$fullname}</B> " . help_button('trove_cat', $catroot) . "\n"; $res_grpcat = db_query('SELECT trove_cat_id FROM trove_group_link WHERE ' . 'group_id=' . db_ei($group_id) . ' AND trove_cat_root=' . db_ei($catroot) . ' ORDER BY trove_group_id'); for ($i = 1; $i <= $GLOBALS['TROVE_MAXPERROOT']; $i++) { // each drop down, consisting of all cats in each root $name = "root{$i}" . "[{$catroot}]"; // see if we have one for selection if ($row_grpcat = db_fetch_array($res_grpcat)) { $selected = $row_grpcat["trove_cat_id"]; } else { $selected = 0; } $html .= trove_get_html_cat_selectfull($catroot, $selected, $name); } } return $html; }
function edit() { global $sys_default_domain, $Language; $request =& HTTPRequest::instance(); $group_id = $request->get('group_id'); $purifier = Codendi_HTMLPurifier::instance(); $pm = ProjectManager::instance(); $project = $pm->getProject($group_id); $refid = $request->get('reference_id'); if (!$refid) { exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_reference', 'missing_parameter')); } $referenceManager =& ReferenceManager::instance(); $ref =& $referenceManager->loadReference($refid, $group_id); $su = false; if (user_is_super_user()) { $su = true; } $star = ' <font color="red">*</font>'; // "Read-only" -> can only edit reference availability (system reference) $ro = false; if ($ref->isSystemReference() && $ref->getGroupId() != 100) { $ro = true; $star = ""; } echo ' <h3>' . $Language->getText('project_reference', 'edit_r') . '</h3> <form name="form_create" method="post" action="/project/admin/reference.php?group_id=' . $group_id . '"> <input type="hidden" name="action" VALUE="do_edit"> <input type="hidden" name="view" VALUE="browse"> <input type="hidden" name="group_id" VALUE="' . $group_id . '"> <input type="hidden" name="reference_id" VALUE="' . $refid . '"> <table width="100%" cellspacing=0 cellpadding=3 border=0> <tr><td width="10%"><a href="#" title="' . $Language->getText('project_reference', 'r_keyword_desc') . '">' . $Language->getText('project_reference', 'r_keyword') . ':</a>' . $star . '</td> <td>'; if ($ro) { echo $purifier->purify($ref->getKeyWord()); } else { echo '<input type="text" name="keyword" size="25" maxlength="25" value="' . $purifier->purify($ref->getKeyWord()) . '">'; } echo '</td></tr>'; echo ' <tr><td><a href="#" title="' . $Language->getText('project_reference', 'r_desc_in_tooltip') . '">' . $Language->getText('project_reference', 'r_desc') . '</a>: </td> <td>'; if ($ro) { if ($ref->getDescription() == "reference_" . $ref->getKeyWord() . "_desc_key") { echo $purifier->purify($Language->getText('project_reference', $ref->getDescription())); } else { echo $purifier->purify($ref->getDescription()); } } else { echo '<input type="text" name="description" size="70" maxlength="255" value="' . $purifier->purify($ref->getDescription()) . '">'; } echo '</td></tr>'; echo ' <tr><td><a href="#" title="' . $Language->getText('project_reference', 'r_nature_desc') . '">' . $Language->getText('project_reference', 'r_nature') . '</a>: </td> <td>'; if ($ro) { echo $purifier->purify($ref->getNature()); } else { echo '<select name="nature" >'; foreach ($this->natures as $nature_key => $nature_desc) { if ($ref->getNature() == $nature_key) { $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option value="' . $purifier->purify($nature_key) . '" ' . $selected . '>' . $purifier->purify($nature_desc['label']) . '</option>'; } echo '</select>'; } echo '</td></tr>'; echo ' <tr><td><a href="#" title="' . $Language->getText('project_reference', 'url') . '">' . $Language->getText('project_reference', 'r_link') . '</a>:' . $star . '</td> <td>'; if ($ro) { echo $purifier->purify($ref->getLink()); } else { echo '<input type="text" name="link" size="70" maxlength="255" value="' . $purifier->purify($ref->getLink()) . '"> '; echo help_button('project-admin.html#creating-or-updating-a-reference-pattern'); } echo '</td></tr>'; if ($group_id == 100) { echo ' <tr><td><a href="#" title="' . $Language->getText('project_reference', 'r_service_desc') . '">' . $Language->getText('project_reference', 'r_service') . '</a>:</td> <td>'; // Get list of services $result = db_query("SELECT * FROM service WHERE group_id=100 ORDER BY rank"); $serv_label = array(); $serv_short_name = array(); while ($serv = db_fetch_array($result)) { $label = $serv['label']; if ($label == "service_" . $serv['short_name'] . "_lbl_key") { $label = $Language->getText('project_admin_editservice', $label); } $serv_short_name[] = $serv['short_name']; $serv_label[] = $label; } echo html_build_select_box_from_arrays($serv_short_name, $serv_label, "service_short_name", $ref->getServiceShortName()); echo '</td></tr>'; echo ' <tr><td><a href="#" title="' . $Language->getText('project_reference', 'r_scope') . '">' . $Language->getText('project_reference', 'scope') . ':</a></td> <td><FONT size="-1">' . ($ref->getScope() == 'S' ? $Language->getText('project_reference', 'system') : $Language->getText('project_reference', 'project')) . '</FONT></td></tr>'; } echo ' <tr><td><a href="#" title="' . $Language->getText('project_reference', 'enabled_desc') . '">' . $Language->getText('project_reference', 'enabled') . ':</a> </td> <td><input type="CHECKBOX" NAME="is_used" VALUE="1"' . ($ref->isActive() ? " CHECKED" : '') . '></td></tr>'; if ($su) { echo '<tr><td><a href="#" title="' . $Language->getText('project_reference', 'force_desc') . '">' . $Language->getText('project_reference', 'force') . '</a> </td> <td><input type="CHECKBOX" NAME="force"></td></tr>'; } echo ' </table> <P><INPUT type="submit" name="Create" value="' . $Language->getText('global', 'btn_update') . '"> </form>'; if (!$ro) { echo '<p>' . $star . ': ' . $Language->getText('project_reference', 'fields_required') . '</p>'; } }
function showChartForm($chart) { $hp =& Codendi_HTMLPurifier::instance(); $group_id = (int) $chart->getGraphicReport()->getGroupId(); $atid = (int) $chart->getGraphicReport()->getAtid(); echo '<H2>' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'tracker') . ' \'<A href="/tracker/admin/?group_id=' . $group_id . '&atid=' . $atid . '">' . $hp->purify($GLOBALS['ath']->getName()) . '</A>\' - ' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'modify_chart', array($hp->purify($chart->getTitle()))); echo ' ' . help_button('TrackerAdministration.html#GraphTrackerReportSetting') . '</H2>'; echo '<script type="text/javascript" src="/plugins/graphontrackers/dependencies.js"></script>'; $url = '/tracker/admin/?func=reportgraphic&group_id=' . $group_id . '&atid=' . $atid . '&report_graphic_id=' . (int) $chart->getGraphicReport()->getId(); echo '<p><a href="' . $url . '">« ' . $GLOBALS['Language']->getText('plugin_graphontrackers_include_report', 'return_report') . ' ' . $chart->getgraphicReport()->getName() . '</a></p>'; echo '<form action="' . $url . '&edit_chart=' . $chart->getId() . '" name="edit_chart_form" method="post">'; echo '<table>'; echo '<thead><tr class="boxtable"><th class="boxtitle">' . $GLOBALS['Language']->getText('plugin_graphontrackers_boxtable', 'chart_properties') . '</th><th class="boxtitle">' . $GLOBALS['Language']->getText('plugin_graphontrackers_boxtable', 'preview') . '</th></tr></thead>'; echo '<tbody><tr valign="top"><td>'; //{{{ Chart Properties foreach ($chart->getProperties() as $prop) { echo '<p>' . $prop->render() . "</p>\n"; } echo '<p style="text-align:center;"><input type="submit" name="update_chart" value="' . $GLOBALS['Language']->getText('global', 'btn_submit') . '" /></p>'; //}}} echo '</td><td style="text-align:center">'; //{{{ Chart Preview $chart->display(); //}}} echo '</tr>'; if ($help = $chart->getHelp()) { echo '<tr><td colspan="2" class="inline_help">' . $help . '</td></tr>'; } echo '</tbody></table>'; echo '</form>'; }
public function displayAdminCSVImport(Tracker_IDisplayTrackerLayout $layout, $request, $current_user) { $hp = Codendi_HTMLPurifier::instance(); $items = $this->getAdminItems(); $title = $items['csvimport']['title']; $this->displayAdminCSVImportHeader($layout, $title, array()); echo '<h2>' . $title . ' ' . help_button('TrackerV5ArtifactImport') . '</h2>'; echo '<form name="form1" method="POST" enctype="multipart/form-data" action="' . TRACKER_BASE_URL . '/?tracker=' . (int) $this->id . '&func=admin-csvimport">'; echo '<input type="file" name="csv_filename" size="50">'; echo '<br>'; echo '<span class="smaller"><em>' . $GLOBALS['Language']->getText('plugin_tracker_import', 'max_upload_size', formatByteToMb($GLOBALS['sys_max_size_upload'])) . '</em></span>'; echo '<br>'; echo $GLOBALS['Language']->getText('plugin_tracker_admin_import', 'send_notifications'); echo '<input type="checkbox" name="notify" value="ok" />'; echo '<br>'; echo '<input type="hidden" name="action" value="import_preview">'; echo '<input type="submit" value="' . $GLOBALS['Language']->getText('plugin_tracker_import', 'submit_info') . '">'; echo '</form>'; $this->displayFooter($layout); }
/** * Display the artifact to do mass changes * * @param ro: read only parameter - Display mode or update mode * @param pv: printer version * @param query: only in the case of func=masschange, the query that retrieves all the artifacts to be changed * @param $mass_change_ids[]: only in the case of func=masschange_selected, an array containing all the artifact ids to be changed * * @return void */ function displayMassChange($ro, $mass_change_ids = null, $query = null, $art_report_html = null, $advsrch = 0) { global $art_field_fact, $sys_max_size_attachment, $Language; $hp = Codendi_HTMLPurifier::instance(); $fields_per_line = 2; $max_size = 40; $group = $this->getGroup(); $atid = $this->getID(); $group_id = $group->getGroupId(); if ($query) { $art_report_html->getQueryElements($query, $advsrch, $from, $where); $sql = "select distinct a.artifact_id " . $from . " " . $where; $result = db_query($sql); while ($row = db_fetch_array($result)) { $mass_change_ids[] = $row['artifact_id']; } } //if ($mass_change_ids) { echo '<H2>' . $Language->getText('tracker_include_type', 'changing_items', count($mass_change_ids)) . ' </H2>'; reset($mass_change_ids); while (list($key, $val) = each($mass_change_ids)) { $url = '/tracker/?func=detail&group_id=' . (int) $group_id . '&aid=' . (int) $val . '&atid=' . (int) $atid; if ($key == 0) { echo '<a href="' . $url . '">' . $hp->purify($this->getItemName(), CODENDI_PURIFIER_CONVERT_HTML) . ' #' . (int) $val . '</a>'; } if ($key > 0) { echo ', <a href="' . $url . '"> #' . (int) $val . '</a>'; } if ($key == 100) { echo ", .."; break; } } echo ' <br><br>'; echo ' <FORM ACTION="' . $_SERVER['PHP_SELF'] . '" METHOD="POST" enctype="multipart/form-data" NAME="masschange_form"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="' . $sys_max_size_attachment . '"> <INPUT TYPE="HIDDEN" NAME="func" VALUE="postmasschange"> <INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . (int) $group_id . '"> <INPUT TYPE="HIDDEN" NAME="atid" VALUE="' . (int) $atid . '">'; reset($mass_change_ids); while (list(, $val) = each($mass_change_ids)) { echo ' <INPUT TYPE="HIDDEN" NAME="mass_change_ids[]" VALUE="' . $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) . '">'; } echo ' <TABLE cellpadding="0">'; //first special case for submitted_by $field = $art_field_fact->getFieldFromName('submitted_by'); $field_html = new ArtifactFieldHtml($field); $field_value = $Language->getText('global', 'unchanged'); list($sz, ) = explode("/", $field->getDisplaySize()); $label = $field_html->labelDisplay(false, false, !$ro); // original submission field must be displayed read-only $value = $field_html->display($this->getID(), $field_value, false, false, $ro, false, false, $Language->getText('global', 'none'), false, 'Any', true, $Language->getText('global', 'unchanged')); echo "\n<TR>"; echo ' <TD valign="top">' . $label . ' </TD> <TD valign="top">' . $value . ' </TD> <TD colspan="2"><FONT SIZE="-1"><INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="' . $Language->getText('tracker_include_type', 'submit_mass_change') . '"></TD>'; echo ' </TR> <TR><TD COLSPAN="' . $fields_per_line * 2 . '"> </TD></TR>'; // Now display the variable part of the field list (depend on the project) $i = 0; $result_fields = $art_field_fact->getAllUsedFields(); while (list($key, $field) = each($result_fields)) { $field_html = new ArtifactFieldHtml($field); // if the field is a special field (except summary and details) // then skip it. if (!$field->isSpecial() && $field->getName() != 'summary' && $field->getName() != 'details') { // display the artifact field // if field size is greatest than max_size chars then force it to // appear alone on a new line or it won't fit in the page $field_value = $Language->getText('global', 'unchanged'); list($sz, ) = explode("/", $field->getDisplaySize()); $label = $field_html->labelDisplay(false, false, !$ro); $value = $field_html->display($this->getID(), $field_value, false, false, $ro, false, false, $Language->getText('global', 'none'), false, $Language->getText('global', 'any'), true, $Language->getText('global', 'unchanged')); // Details field must be on one row if ($sz > $max_size) { echo "\n<TR>" . '<TD valign="top">' . $label . '</td>' . '<TD valign="top" colspan="' . (2 * $fields_per_line - 1) . '">' . $value . '</TD>' . "\n</TR>"; $i = 0; } else { echo $i % $fields_per_line ? '' : "\n<TR>"; echo '<TD valign="top">' . $label . '</td>' . '<TD valign="top">' . $value . '</TD>'; $i++; echo $i % $fields_per_line ? '' : "\n</TR>"; } } } // while echo ' </TABLE> <table cellspacing="0">'; // // Followups comments // echo ' <TR><TD colspan="2" align="top"><HR></td></TR> <TR><TD> <h3>' . $Language->getText('tracker_include_artifact', 'follow_ups') . ' ' . help_button('ArtifactUpdate.html#ArtifactComments') . '</h3></td> <TD> <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="' . $Language->getText('tracker_include_type', 'submit_mass_change') . '"> </td></tr>'; echo ' <tr><TD colspan="2" align="top"> <B>' . $Language->getText('tracker_include_artifact', 'use_canned') . '</B> '; echo $this->cannedResponseBox(); echo ' <A HREF="/tracker/admin/?func=canned&atid=' . (int) $atid . '&group_id=' . (int) $group_id . '&create_canned=1">' . $Language->getText('tracker_include_artifact', 'define_canned') . '</A> </TD></TR>'; echo ' <TR><TD colspan="2">'; $field = $art_field_fact->getFieldFromName('comment_type_id'); if ($field) { $field_html = new ArtifactFieldHtml($field); echo '<P><B>' . $Language->getText('tracker_include_artifact', 'comment_type') . '</B>' . $field_html->fieldBox('', $atid, $field->getDefaultValue(), true, $Language->getText('global', 'none')) . '<BR>'; } // This div id used just to show the toggle of html format echo '<DIV ID="tracker_artifact_comment_label"></DIV>'; echo '<TEXTAREA NAME="comment" ID="tracker_artifact_comment" ROWS="10" style="width:100%" WRAP="SOFT"></TEXTAREA><p>'; echo '</td></tr>'; // // CC List // echo ' <TR><TD colspan="2"><hr></td></tr> <TR><TD colspan="2"> <h3>' . $Language->getText('tracker_include_artifact', 'cc_list') . ' ' . help_button('ArtifactUpdate.html#ArtifactCCList') . '</h3>'; if (!$ro) { echo ' ' . $Language->getText('tracker_include_artifact', 'fill_cc_list_msg'); echo $Language->getText('tracker_include_artifact', 'fill_cc_list_lbl'); echo '<input type="text" name="add_cc" id="tracker_cc" size="30">'; echo $Language->getText('tracker_include_artifact', 'fill_cc_list_cmt'); echo '<input type="text" name="cc_comment" size="40" maxlength="255">'; //echo autocomplete_for_lists_users('tracker_cc', 'tracker_cc_autocomplete'); } echo $this->showCCList($mass_change_ids); echo '</TD></TR>'; // // File attachments // echo ' <TR><TD colspan="2"><hr></td></tr> <TR><TD colspan="2"> <h3>' . $Language->getText('tracker_include_artifact', 'attachment') . ' ' . help_button('ArtifactUpdate.html#ArtifactAttachments') . '</h3>'; echo $Language->getText('tracker_include_artifact', 'upload_checkbox'); echo ' <input type="checkbox" name="add_file" VALUE="1">'; echo $Language->getText('tracker_include_artifact', 'upload_file_lbl'); echo '<input type="file" name="input_file" size="40">'; echo $Language->getText('tracker_include_artifact', 'upload_file_msg', formatByteToMb($sys_max_size_attachment)); echo $Language->getText('tracker_include_artifact', 'upload_file_desc'); echo '<input type="text" name="file_description" size="60" maxlength="255">'; reset($mass_change_ids); echo $this->showAttachedFiles($mass_change_ids); echo '</TD></TR>'; // // Artifact dependencies // echo ' <TR><TD colspan="2"><hr></td></tr> <TR ><TD colspan="2">'; echo '<h3>' . $Language->getText('tracker_include_artifact', 'dependencies') . ' ' . help_button('ArtifactUpdate.html#ArtifactDependencies') . '</h3> <B>' . $Language->getText('tracker_include_artifact', 'dependent_on') . '</B><BR> <P>'; if (!$ro) { echo ' <B>' . $Language->getText('tracker_include_artifact', 'aids') . '</B> <input type="text" name="artifact_id_dependent" size="20" maxlength="255"> <i>' . $Language->getText('tracker_include_artifact', 'fill') . '</i><p>'; } echo $this->showDependencies($mass_change_ids); echo '</TD></TR>'; // // Artifact permissions // if ($this->userIsAdmin()) { echo ' <TR><TD colspan="2"><hr></td></tr> <TR ><TD colspan="2">'; echo '<h3>' . $Language->getText('tracker_include_artifact', 'permissions') . ' ' . help_button('ArtifactUpdate.html#ArtifactPermissions') . '</h3>'; echo '<input type="hidden" name="change_permissions" value="0" />'; echo '<input type="checkbox" name="change_permissions" value="1" id="change_permissions" />'; echo '<label for="change_permissions">' . $GLOBALS['Language']->getText('tracker_include_type', 'mass_change_permissions') . '</label>'; echo '<blockquote>'; $checked = ''; $html = ''; $html .= '<p>'; $html .= '<input type="hidden" name="use_artifact_permissions_name" value="0" />'; $html .= '<input type="checkbox" name="use_artifact_permissions_name" id="use_artifact_permissions" value="1" ' . $checked . ' />'; $html .= '<label for="use_artifact_permissions">' . $GLOBALS['Language']->getText('tracker_include_artifact', 'permissions_label') . '</label>'; $html .= '</p>'; $html .= permission_fetch_selection_field('TRACKER_ARTIFACT_ACCESS', 0, $group_id); $html .= '<script type="text/javascript">'; $html .= "\n document.observe('dom:loaded', function() {\n //init\n if ( ! \$('use_artifact_permissions')|| ! \$('use_artifact_permissions').checked ) {\n \$('ugroups').disable();\n }\n if ( ! \$('change_permissions').checked) {\n \$('use_artifact_permissions').disable();\n }\n \n //event handlers\n \$('change_permissions').observe('change', function(evt) {\n if (this.checked) {\n \$('use_artifact_permissions').enable();\n if (\$('use_artifact_permissions').checked) {\n \$('ugroups').enable();\n }\n } else {\n \$('use_artifact_permissions').disable();\n \$('ugroups').disable();\n }\n });\n \n \$('use_artifact_permissions').observe('change', function(evt) {\n if (this.checked) {\n \$('ugroups').enable();\n } else {\n \$('ugroups').disable();\n }\n });\n });\n </script>"; echo $html; echo '</blockquote>'; echo '</TD></TR>'; } echo '<TR><TD colspan="2"><hr></td></tr>'; echo '</TD></TR> <TR><TD colspan="2" ALIGN="center"> <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="' . $Language->getText('tracker_include_type', 'submit_mass_change') . '"> </FORM> </TD></TR>'; echo '</table>'; }
$user = $um->getCurrentUser(); $request = HTTPRequest::instance(); if ($request->isPost() && $request->exist('Submit') && $request->exist('form_authorized_keys')) { $form_authorized_keys = trim($request->get('form_authorized_keys')); $form_authorized_keys = ereg_replace("(\r\n)|(\n)", "###", $form_authorized_keys); $user->setAuthorizedKeys($form_authorized_keys); $um->updateDb($user); $em = EventManager::instance(); $em->processEvent(Event::EDIT_SSH_KEYS, array('user_id' => $user->getId())); $GLOBALS['Response']->redirect('/account'); } $HTML->header(array('title' => $Language->getText('account_editsshkeys', 'title'))); ?> <h2><?php echo $Language->getText('account_editsshkeys', 'title') . ' ' . help_button('OtherServices.html#ShellAccount'); ?> </h2> <?php echo $Language->getText('account_editsshkeys', 'message'); ?> <form action="editsshkeys.php" method="post"> <p><?php echo $Language->getText('account_editsshkeys', 'keys'); ?> <br> <textarea rows="10" cols="60" name="form_authorized_keys"> <?php $purifier = Codendi_HTMLPurifier::instance(); foreach ($user->getAuthorizedKeys(true) as $key) {