Beispiel #1
0
        echo $Language->getText('admin_groupedit', 'proj_admin');
        ?>
</b></A> | 
        <A href="userlist.php?group_id=<?php 
        print $row_grp['group_id'];
        ?>
"><b><?php 
        echo $Language->getText('admin_groupedit', 'proj_member');
        ?>
</b></A>
    
        <p>

        <B><?php 
        // Get project type label
        $template =& TemplateSingleton::instance();
        echo $Language->getText('admin_groupedit', 'group_type');
        ?>
: <?php 
        echo $template->getLabel($row_grp['type']);
        ?>
</B>
        <BR><B><?php 
        echo $Language->getText('admin_groupedit', 'home_box');
        ?>
: <?php 
        print $row_grp['unix_box'];
        ?>
</B>
        <BR><B><?php 
        echo $Language->getText('admin_groupedit', 'http_domain');
Beispiel #2
0
 /**
  * Get template singleton
  *
  * @return TemplateSingleton
  */
 private function _getTemplateSingleton()
 {
     return TemplateSingleton::instance();
 }
/**
 * Display the retrieved reult set
 *
 * @param Integer $group_id Id of the project
 * @param Array   $res      Contains the retrieved results
 * @param Boolean $export   Switch CSV export mode or HTML display
 * @param unknown_type $i   Line number indicator
 *
 * @return string html
 */
function displayProjectHistoryResults($group_id, $res, $export = false, &$i = 1)
{
    global $Language;
    $html = '';
    $hp = Codendi_HTMLPurifier::instance();
    while ($row = $res['history']->getRow()) {
        $field = $row['field_name'];
        // see if there are any arguments after the message key
        // format is "msg_key ## arg1||arg2||...
        // If msg_key cannot be found in the localized message
        // catalog then display the msg has is because this is very
        // likely a legacy message (pre-localization version)
        if (strpos($field, " %% ") !== false) {
            list($msg_key, $args) = explode(" %% ", $field);
            if ($args) {
                $arr_args = explode('||', $args);
            }
        } else {
            $msg_key = $field;
            $arr_args = "";
        }
        $msg = $Language->getText('project_admin_utils', $msg_key, $arr_args);
        if (!(strpos($msg, "*** Unkown msg") === false)) {
            $msg = $field;
        }
        if (!$export) {
            $html .= '<TR class="' . html_get_alt_row_color($i++) . '"><TD>' . $hp->purify($msg, CODENDI_PURIFIER_BASIC, $group_id) . '</TD><TD>';
        }
        $val = $row['old_value'];
        //Translate dynamic ugroup name for permission entries
        if (strstr($msg_key, "perm_granted_for_") || strstr($msg_key, "perm_reset_for_") || strstr($msg_key, "membership_request_updated")) {
            $ugroupList = explode(",", $val);
            $val = '';
            foreach ($ugroupList as $ugroup) {
                if ($val) {
                    $val .= ', ';
                }
                $val .= util_translate_name_ugroup($ugroup);
            }
        } else {
            if ($msg_key == "group_type") {
                $template =& TemplateSingleton::instance();
                $val = $template->getLabel($val);
            }
        }
        if ($export) {
            $documents_body = array('event' => $hp->purify($msg, CODENDI_PURIFIER_BASIC, $group_id), 'val' => $hp->purify($val), 'date' => format_date($GLOBALS['Language']->getText('system', 'datefmt'), $row['date']), 'by' => UserHelper::instance()->getDisplayNameFromUserName($row['user_name']));
            $html .= build_csv_record(array('event', 'val', 'date', 'by'), $documents_body) . "\n";
        } else {
            $html .= $hp->purify($val);
            $user = UserManager::instance()->getUserByUserName($row['user_name']);
            $html .= '</TD><TD>' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), $row['date']) . '</TD><TD>' . UserHelper::instance()->getLinkOnUser($user) . '</TD></TR>';
        }
    }
    return $html;
}
Beispiel #4
0
 /** return true, if this group is a template to create other groups */
 function isTemplate()
 {
     $template =& TemplateSingleton::instance();
     return $template->isTemplate($this->data_array['type']);
 }
 function RegisterProjectStep_Template()
 {
     $this->RegisterProjectStep($GLOBALS['Language']->getText('register_title', 'template'), 'CreatingANewProject.html');
     $template =& TemplateSingleton::instance();
     $this->db_templates = $template->getTemplates();
 }