function getRankField($value = 'end')
 {
     $html = '';
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank') . '</td>';
     $vals = array('beg', 'end', '--');
     $texts = array($GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank_beg'), $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank_end'), '----');
     $i = 3;
     $vIter =& $this->md->getListOfValueIterator();
     $vIter->rewind();
     while ($vIter->valid()) {
         $e =& $vIter->current();
         if ($e->getStatus() == 'A' || $e->getStatus() == 'P') {
             $vals[$i] = $e->getRank() + 1;
             $texts[$i] = $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_val_create_rank_after') . ' ' . Docman_MetadataHtmlList::_getElementName($e);
             $i++;
         }
         $vIter->next();
     }
     $html .= '<td>';
     $html .= html_build_select_box_from_arrays($vals, $texts, 'rank', $value, false, '');
     $html .= '</td>';
     $html .= '</tr>';
     return $html;
 }
 function showTypeBox($name = 'group_type', $checked_val = 'xzxz')
 {
     $localizedTypes = array();
     foreach (array_keys($this->data_array) as $type_id) {
         $localizedTypes[] = $this->getLabel($type_id);
     }
     return html_build_select_box_from_arrays(array_keys($this->data_array), $localizedTypes, $name, $checked_val, false);
 }
예제 #3
0
function get_canned_responses()
{
    $result = db_query("SELECT response_id, response_title FROM canned_responses");
    while ($res_array = db_fetch_array($result)) {
        $ids[] = $res_array["response_id"];
        $texts[] = $res_array["response_title"];
    }
    return html_build_select_box_from_arrays($ids, $texts, "response_id");
}
예제 #4
0
 function showTypeBox($name = 'question_type', $checked_val = 'xzxz')
 {
     $ranked_ids = array();
     $localizedTypes = array();
     foreach ($this->ranked_array as $val) {
         $ranked_ids[] = $val;
         $localizedTypes[] = $this->getLabel($val);
     }
     return html_build_select_box_from_arrays($ranked_ids, $localizedTypes, $name, $checked_val, false);
 }
 /**
  * showSelectNestedGroups - Display the tree of document groups inside a <select> tag
  *
  * @param array	Array of groups.
  * @param string	The name that will be assigned to the input
  * @param bool	Allow selection of "None"
  * @param int	The ID of the group that should be selected by default (if any)
  * @param array	Array of IDs of groups that should not be displayed
  */
 function showSelectNestedGroups(&$group_arr, $select_name, $allow_none = true, $selected_id = 0, $dont_display = array())
 {
     // Build arrays for calling html_build_select_box_from_arrays()
     $id_array = array();
     $text_array = array();
     if ($allow_none) {
         // First option to be displayed
         $id_array[] = 0;
         $text_array[] = "(None)";
     }
     // Recursively build the document group tree
     $this->buildArrays($group_arr, $id_array, $text_array, $dont_display);
     echo html_build_select_box_from_arrays($id_array, $text_array, $select_name, $selected_id, false);
 }
예제 #6
0
function bug_user_project_box($name = 'project_id', $user_id = false, $checked = 'xyxy', $text_100 = 'None')
{
    /*
    	Returns a select box populated with projects that the user is bug admin of
    */
    if (!$user_id) {
        return 'ERROR - no user_id';
    } else {
        $result = bug_data_get_user_projects($user_id);
        if (!db_numrows($result)) {
            return html_build_select_box_from_arrays($group_id, $checked, $name, $checked, false);
        } else {
            return html_build_select_box($result, $name, $checked, false, $text_100);
        }
    }
}
예제 #7
0
function reports_header($group_id, $vals, $titles)
{
    global $what;
    global $period;
    global $span;
    print "<form method=\"GET\" action=\"{$PHP_SELF}#b\">";
    print html_build_select_box_from_arrays($vals, $titles, 'what', $what, false);
    $periods = array('day' => 'Last day', 'week' => 'Last week');
    $vals = array('day', 'week', 'month', 'year', 'lifespan');
    $texts = array('Last day(s)', 'Last week(s)', 'Last month(s)', 'Last year(s)', 'Project lifespan');
    if (!$period) {
        $period = "lifespan";
    }
    print " for ";
    print html_build_select_box_from_arrays(array('', '1', '4', '7', '12', '14', '30', '52'), array('', '1', '4', '7', '12', '14', '30', '52'), 'span', $span, false);
    print html_build_select_box_from_arrays($vals, $texts, 'period', $period, false);
    print "<input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\">";
    print ' <input type="submit" value="Show">';
    print "</form>\n";
}
예제 #8
0
/**
 * reports_header() - Show the reports header
 *
 * @param		int		The group ID
 * @param		array	Array of select box values
 * @param		string	The select box title
 * @param		string	Any additional HTML
 */
function reports_header($group_id, $vals, $titles, $html = '')
{
    global $what;
    global $period;
    global $span;
    print '<form method="get" action="' . getStringFromServer('PHP_SELF') . '#b">';
    print $html;
    print html_build_select_box_from_arrays($vals, $titles, 'what', $what, false);
    $periods = array('day' => 'Last day', 'week' => 'Last week');
    $vals = array('day', 'week', 'month', 'year', 'lifespan');
    $texts = array(_('Last day(s)'), _('Last week(s)'), _('Last month(s)'), _('Last year(s)'), _('Project lifespan'));
    if (!$period) {
        $period = "lifespan";
    }
    print _('for');
    print html_build_select_box_from_arrays(array('', '1', '4', '7', '12', '14', '30', '52'), array('', '1', '4', '7', '12', '14', '30', '52'), 'span', $span, false);
    print html_build_select_box_from_arrays($vals, $texts, 'period', $period, false);
    print "<input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\" />";
    print ' <input type="submit" value="' . _('Show') . '" />';
    print "</form>\n";
}
예제 #9
0
echo $typ;
?>
">
<table><tr>
<td><strong><?php 
echo _('Project');
?>
:</strong><br /><?php 
echo report_group_box('g_id', $g_id);
?>
</td>
<td><strong><?php 
echo _('Type');
?>
:</strong><br /><?php 
echo html_build_select_box_from_arrays($a2, $a, 'type', $type, false);
?>
</td>
<td><strong><?php 
echo _('Start');
?>
:</strong><br /><?php 
echo report_months_box($report, 'start', $start);
?>
</td>
<td><strong><?php 
echo _('End');
?>
:</strong><br /><?php 
echo report_months_box($report, 'end', $end);
?>
 function _getReviewerTable()
 {
     $html = '';
     $uh = UserHelper::instance();
     $html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_table_title') . '</h3>';
     $html .= '<div id="docman_approval_table_create_table">';
     if (!$this->table->isClosed()) {
         $html .= '<div class="docman_help">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_table_help') . '</div>';
     }
     $rIter = $this->table->getReviewerIterator();
     if ($rIter !== null) {
         $docmanIcons =& $this->_getDocmanIcons();
         $html .= html_build_list_table_top(array($GLOBALS['Language']->getText('plugin_docman', 'details_approval_select'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_reviewer'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_rank')), false, false, false);
         $isFirst = true;
         $isLast = false;
         $nbReviewers = $rIter->count();
         $i = 0;
         $rIter->rewind();
         while ($rIter->valid()) {
             $isLast = $i == $nbReviewers - 1;
             $reviewer = $rIter->current();
             // i+1 to start with 'white'
             $html .= '<tr class="' . html_get_alt_row_color($i + 1) . '">';
             // Select
             if (!$this->table->isClosed()) {
                 $checkbox = '<input type="checkbox" name="sel_user[]" value="' . $reviewer->getId() . '" />';
             } else {
                 $checkbox = '&nbsp;';
             }
             $html .= '<td align="center">' . $checkbox . '</td>';
             // Username
             $html .= '<td>' . $this->hp->purify($uh->getDisplayNameFromUserId($reviewer->getId())) . '</td>';
             // Review
             $html .= '<td>' . $this->atf->getReviewStateName($reviewer->getState()) . '</td>';
             // Rank
             if (!$this->table->isClosed()) {
                 $rank = $reviewer->getRank();
                 $baseUrl = '?group_id=' . $this->item->getGroupId() . '&action=approval_upd_user&id=' . $this->item->getId() . '&user_id=' . $reviewer->getId() . '&rank=';
                 $begLink = '';
                 $upLink = '';
                 if (!$isFirst) {
                     $begIcon = '<img src="' . $docmanIcons->getIcon('move-beginning') . '" alt="Beginning" />';
                     $begLink = '<a href="' . $baseUrl . 'beginning">' . $begIcon . '</a>';
                     $upIcon = '<img src="' . $docmanIcons->getIcon('move-up') . '" alt="Up" />';
                     $upLink = '<a href="' . $baseUrl . 'up">' . $upIcon . '</a>';
                 }
                 $endLink = '';
                 $downLink = '';
                 if (!$isLast) {
                     $endIcon = '<img src="' . $docmanIcons->getIcon('move-end') . '" alt="End" />';
                     $endLink = '<a href="' . $baseUrl . 'end">' . $endIcon . '</a>';
                     $downIcon = '<img src="' . $docmanIcons->getIcon('move-down') . '" alt="Down" />';
                     $downLink = '<a href="' . $baseUrl . 'down">' . $downIcon . '</a>';
                 }
                 $rankHtml = $upLink . '&nbsp;' . $downLink . '&nbsp;' . $begLink . '&nbsp;' . $endLink;
             } else {
                 $rankHtml = '&nbsp;';
             }
             $html .= '<td align="center">' . $rankHtml . '</td>';
             $html .= '</tr>';
             $isFirst = false;
             $i++;
             $rIter->next();
         }
         $html .= '</table>';
         // Action with selected reviewers
         if (!$this->table->isClosed()) {
             $html .= '<p>';
             $html .= $GLOBALS['Language']->getText('plugin_docman', 'details_approval_create_table_act');
             $vals = array('del', 'mail');
             $txts = array($GLOBALS['Language']->getText('plugin_docman', 'details_approval_create_table_act_rm'), $GLOBALS['Language']->getText('plugin_docman', 'details_approval_create_table_act_mail'));
             $html .= html_build_select_box_from_arrays($vals, $txts, 'sel_user_act', 100, true);
             $html .= '</p>';
         }
     }
     $html .= '</div>';
     return $html;
 }
예제 #11
0
function frs_show_release_popup($group_id, $name = 'release_id', $checked_val = "xzxz")
{
    /*
    	return a pop-up select box of releases for the project
    */
    global $FRS_RELEASE_ID_RES, $FRS_RELEASE_NAME_RES, $Language;
    $frsrf = new FRSReleaseFactory();
    if (!$group_id) {
        return $Language->getText('file_file_utils', 'g_id_err');
    } else {
        if (!isset($FRS_RELEASE_ID_RES)) {
            $res = $frsrf->getFRSReleasesInfoListFromDb($group_id);
            $FRS_RELEASE_ID_RES = array();
            $FRS_RELEASE_NAME_RES = array();
            foreach ($res as $release) {
                $FRS_RELEASE_ID_RES[] = $release['release_id'];
                $FRS_RELEASE_NAME_RES[] = $release['package_name'] . ':' . $release['release_name'];
            }
        }
        return html_build_select_box_from_arrays($FRS_RELEASE_ID_RES, $FRS_RELEASE_NAME_RES, $name, $checked_val, false);
    }
}
예제 #12
0
function handle_multi_edit($skill_ids)
{
    global $HTML;
    $numSkills = count($skill_ids);
    $SQL = "select * from skills_data where skills_data_id in(" . (int) $skill_ids[0];
    for ($i = 1; $i < $numSkills; $i++) {
        $SQL .= ", " . (int) $skill_ids[$i];
    }
    $SQL .= ")";
    $result = db_query($SQL);
    $rows = db_numrows($result);
    if (!$result || $rows < 1) {
        echo db_error();
    } else {
        $sql = "SELECT * FROM skills_data_types WHERE type_id > 0";
        $skills = db_query($sql);
        if (!$skills || db_numrows($skills) < 1) {
            echo db_error();
            $feedback .= _('User fetch FAILED');
            echo '<h2>' . _('No Such User') . '<h2>';
        }
        $yearArray = array();
        for ($years = date("Y"); $years >= 1980; $years--) {
            array_push($yearArray, $years);
        }
        $monthArray = array();
        $monthArrayVals = array();
        for ($i = 1; $i <= 12; $i++) {
            array_push($monthArrayVals, $i < 10 ? "0" . $i : $i);
            array_push($monthArray, date("M", mktime(0, 0, 0, $i, 1, 1980)));
        }
        for ($i = 0; $i < $rows; $i++) {
            $start = db_result($result, $i, 'start');
            $finish = db_result($result, $i, 'finish');
            $startY = substr($start, 0, 4);
            $startM = substr($start, 4, 2);
            $finishY = substr($finish, 0, 4);
            $finishM = substr($finish, 4, 2);
            echo '<table border="0">' . '<tr ' . $HTML->boxGetAltRowStyle($i + 1) . '>' . '<td><h3>' . db_result($result, $i, 'title') . '</h3></td></tr>' . '<tr><td>' . '<table border="0" >' . '<tr class="tableheading">' . '<td >' . _('Type') . '</td>' . '<td >' . _('Start Date') . '</td>' . '<td >' . _('End Date') . '</td>' . '</tr>';
            echo '<tr ' . $HTML->boxGetAltRowStyle($i + 1) . '>' . '<td>' . html_build_select_box($skills, 'type[]', db_result($result, $i, 'type'), false, '') . '</td>' . '<td>' . html_build_select_box_from_arrays($monthArrayVals, $monthArray, 'startM[]', $startM, false, '') . html_build_select_box_from_arrays($yearArray, $yearArray, 'startY[]', $startY, false, '') . '</td>' . '<td>' . html_build_select_box_from_arrays($monthArrayVals, $monthArray, 'endM[]', $finishM, false, '') . html_build_select_box_from_arrays($yearArray, $yearArray, 'endY[]', $finishY, false, '') . '</td>' . '</tr>' . '</table>' . '</td></tr>' . '<tr ' . $HTML->boxGetAltRowStyle($i + 1) . '><td>' . '<table border="0">' . '<tr class="tableheading">' . '<td>' . _('Title (max 100 characters)') . '</td>' . '</tr>' . '<tr>' . '<td><input type="hidden" name="skill_edit[]" value="' . db_result($result, $i, 'skills_data_id') . '" />' . '<input type="text" name="title[]" size="100" value="' . db_result($result, $i, 'title') . '" /></td>' . '</tr>' . '<tr>' . '<td class="tableheading">' . _('Keywords (max 255 characters)') . '</td>' . '</tr>' . '<tr>' . '<td><textarea name="keywords[]" rows="3" cols="85" wrap="soft">' . db_result($result, $i, 'keywords') . '</textarea></td>' . '</tr>' . '</table>';
            '</td></tr>';
            echo '</table><br />';
        }
    }
}
 function getReviewForm($user)
 {
     $html = '';
     $uh = UserHelper::instance();
     // Values
     $itemCurrentVersion = $this->_getReviewCurrentVersion();
     $reviewer = $this->table->getReviewer($user->getId());
     $reviewVersion = $reviewer->getVersion();
     // Output
     $html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_title') . '</h3>';
     $html .= '<table>';
     // Doc title
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_name') . '</td>';
     $html .= '<td>';
     $html .= $this->hp->purify($this->item->getTitle(), CODENDI_PURIFIER_CONVERT_HTML);
     if ($itemCurrentVersion == null) {
         $url = Docman_View_View::buildUrl($this->url, array('action' => 'show', 'id' => $this->item->getId()));
         $html .= ' - ';
         $html .= '<a href="' . $url . '">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_link') . '</a>';
     }
     $html .= '</td>';
     $html .= '</tr>';
     // Doc version
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_version') . '</td>';
     $html .= '<td>';
     if ($itemCurrentVersion !== null) {
         $html .= $this->_getItemVersionLink($itemCurrentVersion);
         if (!$this->atf->userAccessedSinceLastUpdate($user)) {
             // Warn user if he didn't access the last version of document
             $html .= '<span style="margin-left: 2em;">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_wo_access') . '</span>';
         }
     } else {
         $html .= $GLOBALS['Language']->getText('plugin_docman', 'details_approval_doc_review_version_na');
     }
     $html .= '</td>';
     $html .= '</tr>';
     $html .= '</table>';
     $html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_approval_title') . '</h3>';
     $html .= '<table>';
     // Requester name
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_requester') . '</td>';
     $html .= '<td>';
     $html .= $this->hp->purify($uh->getDisplayNameFromUserId($this->table->getOwner()));
     $html .= '</td>';
     $html .= '</tr>';
     // Notification type
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_notif_type') . '</td>';
     $html .= '<td>';
     $html .= $this->atf->getNotificationTypeName($this->table->getNotification());
     $html .= '</td>';
     $html .= '</tr>';
     // Cycle start date
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_cycle_start_date') . '</td>';
     $html .= '<td>';
     $html .= util_timestamp_to_userdateformat($this->table->getDate(), true);
     $html .= '</td>';
     $html .= '</tr>';
     // Owner comment
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_owner_comment') . '</td>';
     $html .= '<td>';
     $html .= $this->hp->purify($this->table->getDescription(), CODENDI_PURIFIER_BASIC, $this->item->getGroupId());
     $html .= '</td>';
     $html .= '</tr>';
     $html .= '</table>';
     $html .= '<h3>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_title') . '</h3>';
     $html .= '<div class="docman_help">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_help') . '</div>';
     $html .= '<form name="docman_approval_review" method="post" action="?" class="docman_form">';
     $html .= '<input type="hidden" name="group_id" value="' . $this->item->getGroupId() . '" />';
     $html .= '<input type="hidden" name="id" value="' . $this->item->getId() . '" />';
     $html .= '<input type="hidden" name="action" value="approval_user_commit" />';
     if ($itemCurrentVersion !== null) {
         // Add version here because someone can submit a new version while
         // current user is reviewing.
         $html .= '<input type="hidden" name="version" value="' . $itemCurrentVersion . '" />';
     }
     $html .= '<table>';
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_table') . '</td>';
     $url = $this->buildUrl($this->url, array('action' => 'details', 'section' => 'approval', 'id' => $this->item->getId()));
     $html .= '<td>';
     $html .= '<a href="' . $url . '">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_table_link') . '</a>';
     $html .= '</td>';
     $html .= '</tr>';
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_review') . '</td>';
     $vals = array(PLUGIN_DOCMAN_APPROVAL_STATE_NOTYET, PLUGIN_DOCMAN_APPROVAL_STATE_APPROVED, PLUGIN_DOCMAN_APPROVAL_STATE_REJECTED, PLUGIN_DOCMAN_APPROVAL_STATE_COMMENTED, PLUGIN_DOCMAN_APPROVAL_STATE_DECLINED);
     $txts = array($GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_NOTYET), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_APPROVED), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_REJECTED), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_COMMENTED), $GLOBALS['Language']->getText('plugin_docman', 'approval_review_state_' . PLUGIN_DOCMAN_APPROVAL_STATE_DECLINED));
     $html .= '<td>';
     $html .= html_build_select_box_from_arrays($vals, $txts, 'state', $reviewer->getState(), false);
     $html .= '</td>';
     $html .= '</tr>';
     // If reviewer already approved or reject, display date
     if ($reviewer->getReviewDate()) {
         $html .= '<tr>';
         $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_date') . '</td>';
         $html .= '<td>';
         $html .= util_timestamp_to_userdateformat($reviewer->getReviewDate(), true);
         $html .= '</td>';
         $html .= '</tr>';
     }
     // Review version
     if ($reviewVersion) {
         $html .= '<tr>';
         $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_version') . '</td>';
         $html .= '<td>';
         $html .= $this->_getItemVersionLink($reviewVersion, true);
         if ($reviewVersion != $itemCurrentVersion) {
             $html .= '<span style="margin-left: 2em;">' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_version_not_upd') . '</span>';
         }
         $html .= '</td>';
         $html .= '</tr>';
     }
     // Comment
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_comment') . '</td>';
     $html .= '<td>';
     $html .= '<textarea name="comment">' . $this->hp->purify($reviewer->getComment()) . '</textarea>';
     $html .= '</td>';
     $html .= '</tr>';
     // Notification
     $notifChecked = !$user->isAnonymous() && $this->notificationsManager->exist($user->getId(), $this->item->getId()) ? 'checked="checked"' : '';
     $html .= '<tr>';
     $html .= '<td>' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_notif') . '</td>';
     $html .= '<td>';
     $html .= '<input type="checkbox" name="monitor" value="1"' . $notifChecked . ' />';
     $html .= $GLOBALS['Language']->getText('plugin_docman', 'details_notifications_sendemail');
     $html .= '</td>';
     $html .= '</tr>';
     $html .= '<tr>';
     $html .= '<td colspan="2">';
     $html .= '<input type="submit" value="' . $GLOBALS['Language']->getText('plugin_docman', 'details_approval_review_submit') . '">';
     $html .= '</td>';
     $html .= '</tr>';
     $html .= '</table>';
     $html .= '</form>';
     return $html;
 }
예제 #14
0
function report_tracker_box($name = 'datatype', $selected = '1')
{
    $arr[] = _('Bugs');
    $arr[] = _('Support');
    $arr[] = _('Patches');
    $arr[] = _('Feature Requests');
    $arr[] = _('Other Trackers');
    $arr[] = _('Forum Messages');
    $arr[] = _('Tasks');
    $arr[] = _('Downloads');
    $arr2[] = '1';
    $arr2[] = '2';
    $arr2[] = '3';
    $arr2[] = '4';
    $arr2[] = '0';
    $arr2[] = '5';
    $arr2[] = '6';
    $arr2[] = '7';
    return html_build_select_box_from_arrays($arr2, $arr, $name, $selected, false);
}
예제 #15
0
echo $id;
?>
">
		<?php 
echo html_build_multiple_select_box_from_arrays($field_id_arr, $field_arr, 'copyid[]', array(), 10, false);
echo '</td><td><strong><center>';
//get a list of all extra fields in trackers and groups that you have perms to admin
$sql = "SELECT DISTINCT g.unix_group_name, agl.name AS tracker_name, aefl.field_name, aefl.extra_field_id\n\t\t\tFROM groups g, \n\t\t\tartifact_group_list agl, \n\t\t\tartifact_extra_field_list aefl,\n\t\t\tuser_group ug,\n                        role_setting rs\n\t\t\tWHERE\n                        (\n                           (rs.section_name = 'projectadmin' AND rs.value = 'A')\n                           OR (rs.section_name = 'trackeradmin' AND rs.value = '2')\n                           OR (rs.section_name = 'tracker' AND rs.value::integer >= 2 AND rs.ref_id = agl.group_artifact_id)\n                        )\n\t\t\tAND ug.user_id='" . user_getid() . "'\n\t\t\tAND ug.group_id=g.group_id\n\t\t\tAND g.group_id=agl.group_id \n\t\t\tAND rs.role_id=ug.role_id\n\t\t\tAND aefl.group_artifact_id=agl.group_artifact_id\n\t\t\tAND aefl.field_type IN (1,2,3,5)";
$res = db_query($sql);
//		echo db_error().$sql;
while ($arr = db_fetch_array($res)) {
    $name_arr[] = $arr['unix_group_name'] . '::' . $arr['tracker_name'] . '::' . $arr['field_name'];
    $id_arr[] = $arr['extra_field_id'];
}
echo '<td valign=top>';
echo html_build_select_box_from_arrays($id_arr, $name_arr, 'selectid', $selectid, false);
echo '</td></tr>';
echo '<tr><td>';
?>
		<br />
	 	<input type="submit" name="post_changes" value="<?php 
echo _('Submit');
?>
" />
		</td></tr></table></form>
		
		<?php 
$ath->footer(array());
// Local Variables:
// mode: php
// c-file-style: "bsd"
예제 #16
0
</h4>
		<p>
		<?php 
        echo _('You can unsubscribe user either from admin-initiated sitewide mailings or from all site mailings (admin-initiated and automated mailings, like forum and file release notifications).');
        ?>
		</p>
		<form action="<?php 
        echo getStringFromServer('PHP_SELF');
        ?>
" method="post">
		<input type="hidden" name="user_name" value="<?php 
        echo $user_name;
        ?>
" />
		Unsubscription type: <?php 
        echo html_build_select_box_from_arrays(array(_('MAIL'), _('ALL')), array(_('Admin-initiated mailings'), _('All site mailings')), 'type', false, false);
        ?>
		<input type="submit" name="submit" value="<?php 
        echo _('Unsubscribe');
        ?>
" />
		</form>

		<?php 
        site_admin_footer(array());
        exit;
    } else {
        /*
        	Perform unsubscription
        */
        $u =& user_get_object_by_name($user_name);
예제 #17
0
<table width="100%" class="tablecontent">
	<tr>
		<td>' . _('Assignee') . '</a><br />' . $tech_box . '</td>
		<td>';
if (!$ath->usesCustomStatuses()) {
    echo _('State') . ':&nbsp;<br />' . $ath->statusBox('_status', $_status, true, _('Any'));
}
echo '</td>
	</tr>';
$ath->renderExtraFields($extra_fields, true, 'None', true, 'Any', ARTIFACT_EXTRAFIELD_FILTER_INT, false, 'QUERY');
echo '
	<tr>
		<td colspan="2">' . _('Last Modified Date range') . ':<strong>(YYYY-MM-DD&nbsp;YYYY-MM-DD Format)</strong><br />
		<input type="text" name="_moddaterange" size="21" maxlength="21" value="' . htmlspecialchars($_moddaterange) . '"><p/>
		' . _('Open Date range') . ': <strong>(YYYY-MM-DD&nbsp;YYYY-MM-DD Format)</strong><br />
		<input type="text" name="_opendaterange" size="21" maxlength="21" value="' . htmlspecialchars($_opendaterange) . '"><p/>
		' . _('Close Date range') . ': <strong>(YYYY-MM-DD&nbsp;YYYY-MM-DD Format)</strong><br />
		<input type="text" name="_closedaterange" size="21" maxlength="21" value="' . htmlspecialchars($_closedaterange) . '">
		</td>
	</tr>
	<tr>
		<td>' . _('Order by') . '<br />
		' . html_build_select_box_from_arrays($order_arr, $order_name_arr, '_sort_col', $_sort_col, false) . '</td>
		<td>&nbsp;<br />
		' . html_build_select_box_from_arrays($sort_arr, $sort_name_arr, '_sort_ord', $_sort_ord, false) . '</td>
	</tr>
	</form></table></body></html>';
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
예제 #18
0
function html_build_select_box($result, $name, $checked_val = "xzxz", $show_100 = true, $text_100 = '', $show_any = false, $text_any = '', $show_unchanged = false, $text_unchanged = '', $purify_level = CODENDI_PURIFIER_CONVERT_HTML, $show_unknown_value = true)
{
    global $Language;
    /*
    	Takes a result set, with the first column being the "id" or value
    	and the second column being the text you want displayed
    
    	The second parameter is the name you want assigned to this form element
    
    	The third parameter is optional. Pass the value of the item that should be checked
    
    	The fourth parameter is an optional boolean - whether or not to show the '100 row'
    
    	The fifth parameter is optional - what to call the '100 row' defaults to none
    */
    // Position default values for special menu items
    if ($text_100 == '') {
        $text_100 = $Language->getText('global', 'none');
    }
    if ($text_any == '') {
        $text_any = $Language->getText('global', 'any');
    }
    if ($text_unchanged == '') {
        $text_unchanged = $Language->getText('global', 'unchanged');
    }
    return html_build_select_box_from_arrays(util_result_column_to_array($result, 0), util_result_column_to_array($result, 1), $name, $checked_val, $show_100, $text_100, $show_any, $text_any, $show_unchanged, $text_unchanged, $purify_level, $show_unknown_value);
}
예제 #19
0
//build page title to make bookmarking easier
//if a user was selected, add the user_name to the title
//same for status
support_header(array('title' => 'Browse Support Requests' . ($_assigned_to ? ' For: ' . user_getname($_assigned_to) : '') . ($_status && $_status != 100 ? ' By Status: ' . support_data_get_status_name($_status) : '')));
//now build the query using the criteria built above
$sql = "SELECT support.priority,support.group_id,support.support_id,support.summary," . "support_category.category_name,support_status.status_name," . "support.open_date AS date,users.user_name AS submitted_by,user2.user_name AS assigned_to_user " . "FROM support,support_category,support_status,users,users user2 " . "WHERE users.user_id=support.submitted_by " . " {$status_str} {$assigned_str} {$category_str} " . "AND user2.user_id=support.assigned_to " . "AND support_category.support_category_id=support.support_category_id " . "AND support_status.support_status_id=support.support_status_id " . "AND support.group_id='{$group_id}'" . $order_by;
/*
        creating a custom technician box which includes "any" and "unassigned"
*/
$res_tech = support_data_get_technicians($group_id);
$tech_id_arr = util_result_column_to_array($res_tech, 0);
$tech_id_arr[] = '0';
//this will be the 'any' row
$tech_name_arr = util_result_column_to_array($res_tech, 1);
$tech_name_arr[] = 'Any';
$tech_box = html_build_select_box_from_arrays($tech_id_arr, $tech_name_arr, '_assigned_to', $_assigned_to, true, 'Unassigned');
/*
	Show the new pop-up boxes to select assigned to and/or status
*/
echo '<H2>Browse Support Requests by</H2>
	<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="6"><FORM ACTION="' . $PHP_SELF . '" METHOD="GET">
	<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . $group_id . '">
	<INPUT TYPE="HIDDEN" NAME="set" VALUE="custom">
	<TR><TD><b>Assigned User:</b></TD><TD><b>Status:</b></TD><TD><b>Category:</b></TD></TR>
	<TR><TD><FONT SIZE="-1">' . $tech_box . '</TD><TD><FONT SIZE="-1">' . support_status_box('_status', $_status, 'Any') . '</TD>' . '<TD><FONT SIZE="-1">' . support_category_box($group_id, $name = '_category', $_category, 'Any') . '</TD>' . '<TD><FONT SIZE="-1"><INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Browse"></TD></TR></FORM></TABLE>';
//echo "<p>$sql\n";
$result = db_query($sql, 51, $offset);
if ($result && db_numrows($result) > 0) {
    echo '
		<P>
		<h3>' . $statement . '</H3>
예제 #20
0
)
</span>
<p><?php 
echo _('Upload a new file');
?>
: <input type="file" name="userfile"
 size="30" /></p>
	  <?php 
if (forge_get_config('use_manual_uploads')) {
    echo '<p>';
    printf(_('Alternatively, you can use a file you already uploaded (by SFTP or SCP) to the <a href="%2$s">project\'s incoming directory</a> (%1$s).'), $incoming, "sftp://" . forge_get_config('web_host') . $incoming . "/");
    echo ' ' . _('This direct <tt>sftp://</tt> link only works with some browsers, such as Konqueror.') . '<br />';
    $manual_files_arr = ls($incoming, true);
    if (count($manual_files_arr) > 0) {
        echo _('Choose an already uploaded file:') . '<br />';
        echo html_build_select_box_from_arrays($manual_files_arr, $manual_files_arr, 'manual_filename', '');
    } else {
        echo '<input type="hidden" name="manual_filename" value="">';
    }
    ?>
	     </p>
	  <?php 
}
?>
<p><input type="checkbox" name="logo_nuke" value="1" /><?php 
echo _("… or delete the currently uploaded logo and revert to the site default");
?>
</p>
<p><input type="submit" name="logo_submit" value="<?php 
echo _("Upload new logo");
?>
예제 #21
0
파일: index.php 프로젝트: vpylypv/taskboard
        $tech_box = html_build_select_box_from_arrays($tech_id_arr, $tech_name_arr, '_assigned_to', $_assigned_to, true, _('Unassigned'));
        // end of the stolen code
        $release_box = '';
        if ($taskboard->getReleaseField()) {
            $release_field_alias = $taskboard->getReleaseField();
            $current_release = '';
            //TODO - initialize with real current release
            $releases = $taskboard->getReleaseValues();
            if ($releases) {
                $release_id_arr = array();
                $release_name_arr = array();
                foreach ($releases as $release_name => $release_id) {
                    $release_id_arr[] = $release_name;
                    $release_name_arr[] = $release_name;
                }
                $release_box = html_build_select_box_from_arrays($release_id_arr, $release_name_arr, '_release', $current_release, false);
            }
        }
        ?>


<div class="tabbertab'.($af->query_type == 'custom' ? ' tabbertabdefault' : '').'" title="'._('Simple Filtering and Sorting').'">
	<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&amp;atid='.$ath->getID().'" method="post">
		<table cellspacing="0">
			<tr>
		<?php 
        if ($release_box) {
            ?>

				<td>
					<?php 
예제 #22
0
<tr>
<td>
<?php 
echo _('Web account status');
?>
</td>
<td>
<?php 
if ($u->getStatus() == 'D') {
    $status_letter = array('P', 'A', 'S', 'D');
    $status_text = array(_('Pending (P)'), _('Active (A)'), _('Suspended (S)'), _('Deleted (D)'));
} else {
    $status_letter = array('P', 'A', 'S');
    $status_text = array(_('Pending (P)'), _('Active (A)'), _('Suspended (S)'));
}
echo html_build_select_box_from_arrays($status_letter, $status_text, 'status', $u->getStatus(), false);
?>
</td>
</tr>

<?php 
global $sys_use_shell;
if ($sys_use_shell) {
    ?>
    
<tr>
	<td>
		<?php 
    echo _('Unix Account Status');
    ?>
<sup>2</sup>:
예제 #23
0
function svn_utils_technician_box($group_id, $name = '_commiter', $checked = 'xzxz', $text_100 = 'None')
{
    global $Language;
    if (!$group_id) {
        return $Language->getText('svn_utils', 'g_id_err');
    } else {
        $result = svn_data_get_technicians($group_id);
        if (!in_array($checked, util_result_column_to_array($result))) {
            // Selected 'my commits' but never commited
            $checked = 'xzxz';
        }
        $userids = util_result_column_to_array($result, 0);
        $usernames = util_result_column_to_array($result, 1);
        // Format user name according to preferences
        $UH = new UserHelper();
        foreach ($usernames as &$username) {
            $username = $UH->getDisplayNameFromUserName($username);
        }
        return html_build_select_box_from_arrays($userids, $usernames, $name, $checked, true, $text_100, false, '', false, '', CODENDI_PURIFIER_CONVERT_HTML);
    }
}
예제 #24
0
    $group_arr[] = $Language->getText('project_admin_editugroup', 'empty_g');
    $group_arr_value[] = 'cx_empty';
    $group_arr[] = '-------------------';
    $group_arr_value[] = 'cx_empty2';
    $group_arr[] = $Language->getText('project_admin_editugroup', 'proj_members');
    $group_arr_value[] = 'cx_members';
    $group_arr[] = $Language->getText('project_admin_editugroup', 'proj_admins');
    $group_arr_value[] = 'cx_admins';
    $group_arr[] = '-------------------';
    $group_arr_value[] = 'cx_empty2';
    $res = ugroup_db_get_existing_ugroups($group_id);
    while ($row = db_fetch_array($res)) {
        $group_arr[] = $row['name'];
        $group_arr_value[] = $row['ugroup_id'];
    }
    echo html_build_select_box_from_arrays($group_arr_value, $group_arr, "group_templates", 'cx_empty', false);
    echo '</td>
	</tr><tr><td><input type="submit" value="' . $Language->getText('project_admin_editugroup', 'create_ug') . '"></tr></td>
        </table>
      </form>';
}
if ($func == 'edit' || $func == 'do_create') {
    // Sanity check
    if (!$ugroup_id) {
        exit_error($Language->getText('global', 'error'), 'The ugroup ID is missing');
    }
    $res = ugroup_db_get_ugroup($ugroup_id);
    if (!$res) {
        exit_error($Language->getText('global', 'error'), $Language->getText('project_admin_editugroup', 'ug_not_found', array($ugroup_id, db_error())));
    }
    if (!isset($ugroup_name) || !$ugroup_name) {
예제 #25
0
require_once $gfcommon . 'include/cron_utils.php';
site_admin_header(array('title' => _('Site admin')));
$which = getIntFromRequest('which');
if (!$which || $which == 100) {
    $which = 100;
    $sql_str = '';
} else {
    $sql_str = " WHERE job='{$which}' ";
}
?>
<form action="<?php 
echo getStringFromServer('PHP_SELF');
?>
" method="get">
<?php 
echo html_build_select_box_from_arrays(array_keys($cron_arr), $cron_arr, 'which', $which, true, 'Any');
?>
<input type="submit" name="submit" value="<?php 
echo _('Submit');
?>
">
</form>
<?php 
$title_arr = array(_('Date'), _('Job'), _('Message'));
echo $HTML->listTableTop($title_arr);
$sql = 'SELECT COUNT(*) AS count FROM cron_history ' . $sql_str;
$res = db_query($sql);
$totalCount = db_result($res, 0, 'count');
$offset = getIntFromRequest('offset');
if ($offset > $totalCount) {
    $offset = 0;
예제 #26
0
function stats_site_projects_form($report = 'last_30', $orderby = 'downloads', $projects = 0, $trovecat = 0)
{
    print '<form action="projects.php" method="get">' . "\n";
    print '<table width="100%" cellpadding="0" cellspacing="0" class="tableheading">' . "\n";
    print '<tr><td><strong>' . _('Projects in trove category:') . '</strong></td><td>';
    stats_generate_trove_pulldown($trovecat);
    print '</td></tr>';
    print '<tr><td><strong>' . _('OR enter Special Project List:') . '</strong></td>';
    print '<td> <input type="text" width="100" name="projects" value="' . $projects . '" />';
    print '  (' . _('<strong>comma separated</strong> group_id\'s)') . '</td></tr>';
    print '<tr><td><strong>' . _('Report:') . '</strong></td><td>';
    $reports_ids = array();
    $reports_ids[] = 'last_30';
    $reports_ids[] = 'all';
    $reports_names = array();
    $reports_names[] = _('last_30');
    $reports_names[] = _('all');
    echo html_build_select_box_from_arrays($reports_ids, $reports_names, 'report', $report, false);
    print ' </td></tr>';
    print '<tr><td><strong>' . _('View by:') . '</strong></td><td>';
    $orderby_vals = array("downloads", "site_views", "subdomain_views", "msg_posted", "bugs_opened", "bugs_closed", "support_opened", "support_closed", "patches_opened", "patches_closed", "tasks_opened", "tasks_closed", "cvs_checkouts", "cvs_commits", "cvs_adds");
    print html_build_select_box_from_arrays($orderby_vals, $orderby_vals, "orderby", $orderby, false);
    print '</td></tr>';
    print '<tr><td colspan="2" style="text-align:center"> <input type="submit" value="' . _('Generate Report') . '" /> </td></tr>';
    print '</table>' . "\n";
    print '</form>' . "\n";
}
예제 #27
0
echo _('NOTE: In some browsers you must select the file in the file-upload dialog and click "OK".  Double-clicking doesn\'t register the file.');
?>
</span>
</span><br />
<?php 
echo _('Upload a new file');
?>
: <input type="file" name="userfile"  size="30" />
<?php 
if ($sys_use_ftpuploads) {
    echo '<p>';
    printf(_('Alternatively, you can use FTP to upload a new file at %1$s'), $sys_ftp_upload_host) . '<br />';
    echo _('Choose an FTP file instead of uploading:') . '<br />';
    $arr[] = '';
    $ftp_files_arr = array_merge($arr, ls($upload_dir, true));
    echo html_build_select_box_from_arrays($ftp_files_arr, $ftp_files_arr, 'ftp_filename', '', false);
    ?>
	</p>
<?php 
}
?>
<table width="60%">
<tr>
<td>
<h4><?php 
echo _('File Type');
?>
:</h4>
<?php 
print frs_show_filetype_popup('type_id');
?>
예제 #28
0
        }
        $ath->adminHeader(array('title' => _('Clone Tracker')));
        echo "<h1>" . _('Clone Tracker') . "</h1>";
        ?>
				<p><?php 
        echo _('Choose the template tracker to clone. The site administrator will have to set up trackers with default values and set permissions properly so you can access them.');
        ?>
</p>
				<p>
				<form action="<?php 
        echo getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&atid=' . $ath->getID();
        ?>
" method="post">
				<input type="hidden" name="clone_tracker" value="y" />
				<p><strong><?php 
        echo _('WARNING!!! Cloning this tracker will duplicate all the fields and all the elements from those fields into this tracker. There is nothing to prevent you from cloning multiple times or making a huge mess. You have been warned!');
        ?>
</strong></p>
				<p><?php 
        echo html_build_select_box_from_arrays($ids, $titles, 'clone_id', '', false);
        ?>
</p>
				<input type="submit" name="post_changes" value="<?php 
        echo _('Submit');
        ?>
" /></p>
				</form></p>
				<?php 
        $ath->footer(array());
    }
}
예제 #29
0
 /**
  *  Display a select box for the tracker list for a group
  *
  *  @param group_id: the project id
  *  @param name: the select box name
  *  @param checked: the default value
  * 
  *  @return void
  */
 function trackersSelectBox($group_id, $name, $checked = 'xzxz')
 {
     global $atf;
     $hp = Codendi_HTMLPurifier::instance();
     $tracker_names = array();
     $tracker_ids = array();
     $trackers_array = $atf->getArtifactTypesFromId($group_id);
     if ($trackers_array !== false) {
         foreach ($trackers_array as $tracker) {
             $tracker_names[] = $hp->purify(SimpleSanitizer::unsanitize($tracker->getName()), CODENDI_PURIFIER_CONVERT_HTML);
             $tracker_ids[] = $tracker->getId();
         }
     }
     return html_build_select_box_from_arrays($tracker_ids, $tracker_names, $name, $checked);
 }
    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 = '&nbsp;<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>:&nbsp;</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>:&nbsp;</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>';
        }
    }