} else { $bx->box_begin(); $bx->box_body_begin(); $bx->box_columns_begin(2); $bx->box_column("left", "60%", "", $t->translate('Hi') . ', <b>' . $auth->auth["uname"] . '</b>.<br>' . $t->translate('This is your personal page') . '.<br>' . $t->translate("Here you will find all the " . 'information related to you') . '.'); $bx->box_column_start("right", "40%", ""); personal_ratings_short($auth->auth["uname"]); $bx->box_column_finish(); $bx->box_columns_end(); $bx->box_body_end(); $bx->box_end(); $bx->box_begin(); $bx->box_body_begin(); $bx->box_columns_begin(3, 'top'); $bx->box_column_start("center", "34%", ""); personal_my_projects($auth->auth["uname"]); $bx->box_column_finish(); $bx->box_column_start("center", "33%", ""); personal_monitored_projects($auth->auth["uname"]); $bx->box_column_finish(); $bx->box_column_start("center", "33%", ""); # WISH: It would be nice to have here a list of actions that may # WISH: interest the user # WISH: these actions correspond to actions in projects that he # WISH: is related in or in projects he is monitoring # WISH: print "(Possible actions)\n"; $bx->box_column_finish(); $bx->box_columns_end(); $bx->box_body_end(); $bx->box_end(); if ($auth->auth["perm"] != "sponsor_pending" && $auth->auth["perm"] != "devel_pending" && $auth->auth["perm"] != "editor" && $auth->auth["perm"] != "admin" && $auth->auth["perm"] != "editor,admin") {
function testPersonal_my_projects() { global $bx; $db_config = new mock_db_configure(3); $db_q = "SELECT * FROM description WHERE " . "description_user='******' ORDER BY " . "description_creation DESC"; $db_config->add_query(sprintf($db_q, "fubar"), 0); $db_config->add_query(sprintf($db_q, "snafu"), 1); $db_config->add_query(sprintf($db_q, "fritz"), 2); $db_config->add_num_row(0, 0); $db_config->add_num_row(1, 1); $db_config->add_num_row(2, 2); $cols = array('status', 'proid', 'project_title'); // fubar query does not call next_record() // this is for the snafu query $row1 = $this->_generate_array($cols, 1); $db_config->add_record($row1, 1); $db_config->add_record(false, 1); // this is for the fritz query $row2 = $this->_generate_array($cols, 2); $db_config->add_record($row2, 2); $row3 = $this->_generate_array($cols, 3); $db_config->add_record($row3, 2); $db_config->add_record(false, 2); // test one $bx = $this->_create_default_box(); capture_reset_and_start(); // here next_record will not be called personal_my_projects("fubar"); $this->set_text(capture_stop_and_get()); $this->set_msg('test 1'); $this->_testFor_string_length(688); $this->_testFor_pattern("My Projects"); // title $this->_testFor_pattern("No personal projects\n"); // test two $bx = $this->_create_default_box(); capture_reset_and_start(); // here next_record should be called once --> num_row == 1 personal_my_projects("snafu"); $this->set_text(capture_stop_and_get()); $this->set_msg('test 2'); $this->_testFor_string_length(769); $this->_testFor_pattern("My Projects"); // title $this->_testFor_project_link($row1['proid'], $row1['project_title'], $row1['status']); // test three $bx = $this->_create_default_box(); capture_reset_and_start(); // here next_record should be called once --> num_row == 1 personal_my_projects("fritz"); $this->set_text(capture_stop_and_get()); $this->set_msg('test 3'); $this->_testFor_string_length(871); $this->_testFor_pattern("My Projects"); // title $this->_testFor_project_link($row2['proid'], $row2['project_title'], $row2['status']); $this->_testFor_project_link($row3['proid'], $row3['project_title'], $row3['status']); // if using a database, then ensure that it didn't fail $this->_check_db($db_config); }