本文整理汇总了PHP中Project::get_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::get_name方法的具体用法?PHP Project::get_name怎么用?PHP Project::get_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::get_name方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructor
function testConstructor()
{
$test_project = new Project("03-12-14", "Address", null, "Food Delivery", 10, 13, 5, "malcom1234567890+Malcom+Jones", 18, "hiya");
echo "Testing mm_dd_yy" . '</br>';
if ($test_project->get_mm_dd_yy() == "03-12-14") {
echo 'mm_dd_yy test succeeded </br>';
} else {
echo 'mm_dd_yy test failed </br>';
}
if ($test_project->get_name() == "Food Delivery") {
echo 'name test succeeded </br>';
} else {
echo 'name test failed </br>';
}
if ($test_project->get_start_time() == 10) {
echo 'start time test succeeded </br>';
} else {
echo 'start time test failed </br>';
}
if ($test_project->get_end_time() == 13) {
echo 'end time test succeeded </br>';
} else {
echo 'end time test failed </br>';
}
if ($test_project->get_vacancies() == 5) {
echo 'vacancies test succeeded </br>';
} else {
echo 'vacancies test failed </br>';
}
if ($test_project->get_persons() == "malcom1234567890+Malcom+Jones") {
echo 'persons test succeeded </br>';
} else {
echo 'persons test failed </br>';
}
}
示例2: move
/**
* @throws ProjectIDMissingException
* @throws ProjectSecurityAccessDeniedException
*/
public static function move()
{
global $project_security, $user;
if ($_GET['project_id']) {
$project = new Project($_GET['project_id']);
if ($user->get_user_id() == $project->get_owner_id() or $project_security->is_access(7, false) == true) {
if ($_GET['nextpage'] == 1) {
if (is_numeric($_POST['type'])) {
$page_1_passed = true;
} else {
$page_1_passed = false;
$error = "You must make a selection.";
}
} elseif ($_GET['nextpage'] > 1) {
$page_1_passed = true;
} else {
$page_1_passed = false;
$error = "";
}
if ($page_1_passed == false) {
$template = new HTMLTemplate("project/admin/move_page_1.html");
$paramquery = $_GET;
$paramquery['nextpage'] = "1";
$params = http_build_query($paramquery, '', '&');
$template->set_var("params", $params);
$template->set_var("error", $error);
$template->output();
} else {
if ($_POST['type'] == 1) {
if ($_GET['nextpage'] == 2) {
if (is_numeric($_POST['ou'])) {
$page_2_passed = true;
} else {
$page_2_passed = false;
$error = "You must select an organisation unit.";
}
} elseif ($_GET['nextpage'] > 3) {
$page_2_passed = true;
} else {
$page_2_passed = false;
$error = "";
}
if ($page_2_passed == false) {
$template = new HTMLTemplate("project/admin/move_page_2_ou.html");
$paramquery = $_GET;
$paramquery['nextpage'] = "2";
$params = http_build_query($paramquery, '', '&');
$template->set_var("params", $params);
$template->set_var("error", $error);
$organisation_unit_array = OrganisationUnit::list_entries();
$result = array();
$counter = 0;
foreach ($organisation_unit_array as $key => $value) {
$organisation_unit = new OrganisationUnit($value);
$result[$counter]['value'] = $value;
$result[$counter]['content'] = $organisation_unit->get_name();
$counter++;
}
$template->set_var("option", $result);
$template->set_var("type", $_POST['type']);
$template->output();
} else {
$project = new Project($_GET['project_id']);
$paramquery = $_GET;
unset($paramquery['nextpage']);
$paramquery['run'] = "admin";
$params = http_build_query($paramquery);
if ($project->move_to_organisation_unit($_POST['ou'])) {
Common_IO::step_proceed($params, "Move Project", "Operation Successful", null);
} else {
Common_IO::step_proceed($params, "Move Project", "Operation Failed", null);
}
}
} else {
if ($_GET['nextpage'] == 2) {
if (is_numeric($_POST['project'])) {
$page_2_passed = true;
} else {
$page_2_passed = false;
$error = "You must select a project.";
}
} elseif ($_GET['nextpage'] > 3) {
$page_2_passed = true;
} else {
$page_2_passed = false;
$error = "";
}
if ($page_2_passed == false) {
$template = new HTMLTemplate("project/admin/move_page_2_project.html");
$paramquery = $_GET;
$paramquery['nextpage'] = "2";
$params = http_build_query($paramquery, '', '&');
$template->set_var("params", $params);
$template->set_var("error", $error);
$result = array();
$counter = 0;
//.........这里部分代码省略.........
示例3: get_project_admin_menu
/**
* @param string $get_array
* @return string
* @throws ProjectSecurityAccessDeniedException
* @throws ProjectIDMissingException
*/
public static function get_project_admin_menu($get_array)
{
global $user;
if ($get_array) {
$_GET = unserialize($get_array);
}
if ($_GET['project_id']) {
$project = new Project($_GET['project_id']);
$project_security = new ProjectSecurity($_GET['project_id']);
$project_owner = new User($project->get_owner_id());
$organisation_unit_id = $project->get_organisation_unit_id();
$parent_project_id = $project->get_project_toid();
if ($user->get_user_id() == $project->get_owner_id() or $project_security->is_access(2, false) == true or $project_security->is_access(3, false) == true or $project_security->is_access(4, false) == true or $project_security->is_access(5, false) == true or $project_security->is_access(6, false) == true or $project_security->is_access(7, false) == true) {
if ($organisation_unit_id) {
$organisation_unit = new OrganisationUnit($organisation_unit_id);
$parent = $organisation_unit->get_name();
$parent_type = "Organisation Unit";
} else {
$parent_project = new Project($parent_project_id);
$parent = $parent_project->get_name();
$parent_type = "Project";
}
$template = new HTMLTemplate("project/ajax/admin/menu.html");
$template->set_var("name", $project->get_name());
$template->set_var("owner", $project_owner->get_full_name(false));
$template->set_var("parent", $parent);
$template->set_var("parent_type", $parent_type);
if ($user->is_admin()) {
$template->set_var("admin", true);
} else {
$template->set_var("admin", false);
}
if ($project_security->is_access(7, false) == true or $project->get_owner_id() == $user->get_user_id()) {
$template->set_var("owner_permission", true);
} else {
$template->set_var("owner_permission", false);
}
if ($project_security->is_access(6, false) == true) {
$template->set_var("delete", true);
} else {
$template->set_var("delete", false);
}
if ($project_security->is_access(3, false) == true) {
$template->set_var("write", true);
} else {
$template->set_var("write", false);
}
if ($project->get_current_status_id() == 0) {
$template->set_var("project_canceled", true);
} else {
$template->set_var("project_canceled", false);
}
if ($project->get_deleted() == true) {
$template->set_var("project_deleted", true);
} else {
$template->set_var("project_deleted", false);
}
if ($project->get_quota() == 0) {
$template->set_var("quota", "unlimited");
} else {
$template->set_var("quota", Convert::convert_byte_1024($project->get_quota()));
}
$permission_paramquery = $_GET;
$permission_paramquery['run'] = "admin_permission";
unset($permission_paramquery['nextpage']);
unset($permission_paramquery['sure']);
$permission_params = http_build_query($permission_paramquery, '', '&');
$template->set_var("permission_params", $permission_params);
$rename_paramquery = $_GET;
$rename_paramquery['run'] = "admin_rename";
unset($rename_paramquery['nextpage']);
unset($rename_paramquery['sure']);
$rename_params = http_build_query($rename_paramquery, '', '&');
$template->set_var("rename_params", $rename_params);
$chown_paramquery = $_GET;
$chown_paramquery['run'] = "admin_chown";
unset($chown_paramquery['nextpage']);
unset($chown_paramquery['sure']);
$chown_params = http_build_query($chown_paramquery, '', '&');
$template->set_var("chown_params", $chown_params);
$move_paramquery = $_GET;
$move_paramquery['run'] = "admin_move";
unset($move_paramquery['nextpage']);
unset($move_paramquery['sure']);
$move_params = http_build_query($move_paramquery, '', '&');
$template->set_var("move_params", $move_params);
$chquota_paramquery = $_GET;
$chquota_paramquery['run'] = "admin_quota";
unset($chquota_paramquery['nextpage']);
unset($chquota_paramquery['sure']);
$chquota_params = http_build_query($chquota_paramquery, '', '&');
$template->set_var("chquota_params", $chquota_params);
return $template->get_string();
} else {
//.........这里部分代码省略.........
示例4: search
/**
* @todo search on read-only projects
*/
public static function search()
{
global $user, $session;
if ($_GET['nextpage']) {
if ($_GET['sortvalue'] and $_GET['sortmethod']) {
if ($_GET['nextpage'] == "2" and $_POST['string']) {
$string = $_POST['string'];
$item_type_array = $session->read_value("SEARCH_DATA_ITEM_TYPE");
$project_id_array = $session->read_value("SEARCH_DATA_PROJECT_ID");
} else {
$string = $session->read_value("SEARCH_DATA_STRING");
$item_type_array = $session->read_value("SEARCH_DATA_ITEM_TYPE");
$project_id_array = $session->read_value("SEARCH_DATA_PROJECT_ID");
}
} else {
if ($_GET['page']) {
$string = $session->read_value("SEARCH_DATA_STRING");
$item_type_array = $session->read_value("SEARCH_DATA_ITEM_TYPE");
$project_id_array = $session->read_value("SEARCH_DATA_PROJECT_ID");
} else {
if ($_GET['nextpage'] == "1") {
$string = $_POST['string'];
$session->delete_value("SEARCH_DATA_STRING");
$session->delete_value("SEARCH_DATA_ITEM_TYPE");
$session->delete_value("SEARCH_DATA_PROJECT_ID");
} else {
$string = $_POST['string'];
$item_type_array = $session->read_value("SEARCH_DATA_ITEM_TYPE");
$project_id_array = $session->read_value("SEARCH_DATA_PROJECT_ID");
}
}
}
$no_error = true;
} else {
$no_error = false;
}
if ($no_error == false) {
$template = new HTMLTemplate("project/search/data_search.html");
$template->set_var("error", "");
$paramquery = $_GET;
unset($paramquery['page']);
$paramquery['nextpage'] = "1";
$params = http_build_query($paramquery, '', '&');
$template->set_var("params", $params);
$result = array();
$counter = 0;
$project_array = Project::list_user_related_projects($user->get_user_id(), false);
if (is_array($project_array) and count($project_array) >= 1) {
foreach ($project_array as $key => $value) {
$project = new Project($value);
$organisation_unit = new OrganisationUnit($project->get_organisation_unit_id());
$result[$counter]['value'] = $value;
$result[$counter]['content'] = $project->get_name() . " (" . $organisation_unit->get_name() . ")";
$result[$counter]['selected'] = "";
$counter++;
}
}
$template->set_var("project_array", $result);
$result = array();
$counter = 0;
$item_type_array = Item::list_types();
if (is_array($item_type_array)) {
foreach ($item_type_array as $key => $value) {
if (class_exists($value)) {
if ($value::get_sql_select_array($key) != null) {
$result[$counter]['title'] = $value::get_generic_name($key, null);
$result[$counter]['name'] = "item-" . $key;
$result[$counter]['value'] = $key;
$result[$counter]['checked'] = "checked='checked'";
$counter++;
}
}
}
}
$template->set_var("item_type_array", $result);
$template->output();
} else {
if (!$project_id_array) {
if ($_POST['project_id'] == 0) {
$project_id_array = array();
$tmp_id_array = Project::list_user_related_projects($user->get_user_id(), false);
if (is_array($tmp_id_array) and count($tmp_id_array) >= 1) {
foreach ($tmp_id_array as $key => $value) {
array_push($project_id_array, $value);
}
}
} else {
$project_id_array = array();
$project_id_array[0] = $_POST['project_id'];
$project = new Project($_POST['project_id']);
$search_name = $project->get_name();
}
} else {
if (count($project_id_array) == 1) {
$project = new Project($project_id_array[0]);
$search_name = $project->get_name();
} else {
//.........这里部分代码省略.........
示例5: get_content
/**
* @param integer $page
* @return string
* @throws BaseAssistantRequestedPageNotExistsException
*/
public static function get_content($page)
{
global $session, $user;
switch ($page) {
case "0":
$template = new HTMLTemplate("project/new_project_page_0.html");
return $template->get_string();
break;
case "1":
$template = new HTMLTemplate("project/new_project_page_1.html");
if ($session->read_value("PROJECT_TYPE") == 1 or $session->read_value("PROJECT_TYPE") == 2) {
$project_organ_unit = $session->read_value("PROJECT_ORGANISATION_UNIT");
$template->set_var("organunit", true);
$result = array();
$counter = 0;
$organisation_unit_array = OrganisationUnit::list_entries();
if (is_array($organisation_unit_array) and count($organisation_unit_array) >= 1) {
foreach ($organisation_unit_array as $key => $value) {
$organisation_unit = new OrganisationUnit($value);
if ($organisation_unit->is_permission($user->get_user_id()) and $organisation_unit->get_stores_data() == true) {
$result[$counter]['value'] = $value;
$result[$counter]['content'] = $organisation_unit->get_name();
if ($project_organ_unit == $value) {
$result[$counter]['selected'] = "selected";
} else {
$result[$counter]['selected'] = "";
}
$result[$counter]['disabled'] = "";
$counter++;
}
}
}
if (!$result) {
$result[$counter]['value'] = "0";
$result[$counter]['content'] = "NO ORGANISATION UNIT FOUND!";
$result[$counter]['selected'] = "";
$result[$counter]['disabled'] = "disabled='disabled'";
}
$template->set_var("option", $result);
} else {
$project_toid = $session->read_value("PROJECT_TOID");
$template->set_var("organunit", false);
$result = array();
$counter = 0;
$project = new Project(null);
$project_array = $project->get_project_tree();
if (is_array($project_array) and count($project_array) >= 1) {
foreach ($project_array as $key => $value) {
$project = new Project($value['id']);
for ($i = 1; $i <= $value['layer']; $i++) {
$pre_content .= " ";
}
$result[$counter]['value'] = $value['id'];
$result[$counter]['content'] = $pre_content . "" . $project->get_name();
if ($project_toid == $value['id']) {
$result[$counter]['selected'] = "selected";
} else {
$result[$counter]['selected'] = "";
}
$result[$counter]['disabled'] = "";
$counter++;
unset($pre_content);
}
} else {
$result[$counter]['value'] = "0";
$result[$counter]['content'] = "NO PROJECT FOUND!";
$result[$counter]['selected'] = "";
$result[$counter]['disabled'] = "disabled='disabled'";
}
$template->set_var("option", $result);
}
return $template->get_string();
break;
case "2":
$project_name = $session->read_value("PROJECT_NAME");
$project_desc = $session->read_value("PROJECT_DESCRIPTION");
$template = new HTMLTemplate("project/new_project_page_2.html");
if ($project_name) {
$template->set_var("project_name", $project_name);
} else {
$template->set_var("project_name", "");
}
if ($project_desc) {
$template->set_var("project_description", $project_desc);
} else {
$template->set_var("project_description", "");
}
return $template->get_string();
break;
case "3":
$project_template = $session->read_value("PROJECT_TEMPLATE");
$template = new HTMLTemplate("project/new_project_page_3.html");
$result = array();
$counter = 0;
$project_template_array = ProjectTemplateCat::list_entries();
//.........这里部分代码省略.........
示例6: structure
/**
* @throws ProjectIDMissingException
* @throws ProjectSecuriyAccessDeniedException
*/
public static function structure()
{
global $project_security;
if ($_GET['project_id']) {
if ($project_security->is_access(1, false) == true) {
$project = new Project($_GET['project_id']);
$project_structure_array = $project->get_project_tree();
$template = new HTMLTemplate("project/structure.html");
if (is_array($project_structure_array) and count($project_structure_array) >= 1) {
$result = array();
$counter = 0;
foreach ($project_structure_array as $key => $value) {
$project = new Project($value['id']);
$project_security = new ProjectSecurity($value['id']);
$project_owner = new User($project->get_owner_id());
$paramquery['username'] = $_GET['username'];
$paramquery['session_id'] = $_GET['session_id'];
$paramquery['nav'] = "project";
$paramquery['run'] = "detail";
$paramquery['project_id'] = $value['id'];
$params = http_build_query($paramquery, '', '&');
$result[$counter]['link'] = $params;
$result[$counter]['name'] = $project->get_name();
$result[$counter]['status'] = $project->get_current_status_name();
$result[$counter]['template'] = $project->get_template_name();
$result[$counter]['owner'] = $project_owner->get_full_name(false);
$involved_array = $project_security->list_involved_users();
if (is_array($involved_array) and count($involved_array) >= 1) {
foreach ($involved_array as $involved_key => $involved_value) {
$involved_user = new User($involved_value);
if ($result[$counter]['involved'] == "") {
$result[$counter]['involved'] = $involved_user->get_full_name(false);
} else {
$result[$counter]['involved'] .= ", " . $involved_user->get_full_name(false);
}
}
} else {
$result[$counter]['involved'] = "";
}
$subproject_paramquery = $_GET;
$subproject_paramquery['run'] = "new_subproject";
$subproject_paramquery['id'] = $value['id'];
unset($subproject_paramquery['nextpage']);
$subproject_params = http_build_query($subproject_paramquery, '', '&');
$result[$counter]['add_subproject'] = $subproject_params;
$result[$counter]['padding'] = $value['layer'];
$counter++;
}
$template->set_var("structure", $result);
}
$template->output();
} else {
throw new ProjectSecurityAccessDeniedException();
}
} else {
throw new ProjectIDMissingException();
}
}
示例7: create
/**
* Creates a new Project Folder including Folder
* @param integer $project_id
* @return integer
*/
public function create($project_id, $base_folder_id)
{
if (is_numeric($project_id)) {
$project = new Project($project_id);
// Folder
if ($base_folder_id == null) {
$project_folder_id = constant("PROJECT_FOLDER_ID");
} else {
$project_folder_id = $base_folder_id;
}
$folder = new Folder($project_folder_id);
$path = new Path($folder->get_path());
$path->add_element($project_id);
if (($folder_id = parent::create($project->get_name(), $project_folder_id, $path->get_path_string(), $project->get_owner_id(), null)) != null) {
$project_has_folder_access = new ProjectHasFolder_Access(null);
if ($project_has_folder_access->create($project_id, $folder_id) == null) {
return null;
}
// Virtual Folder
$project_folder_create_event = new ProjectFolderCreateEvent($folder_id);
$event_handler = new EventHandler($project_folder_create_event);
if ($event_handler->get_success() == false) {
$this->delete();
return false;
} else {
return $folder_id;
}
} else {
return null;
}
} else {
return null;
}
}
示例8: list_upcoming_tasks
/**
* @see ProjectTaskInterface::list_upcoming_tasks()
* @return array
* @todo tasks ending today
* @todo tasks ending this week
* @todo tasks ending next 30 days
*/
public static function list_upcoming_tasks()
{
global $user;
$upcoming_task_array = array();
$over_time_task_array = Project_Wrapper_Access::list_not_finished_over_time_project_tasks_by_user_id($user->get_user_id(), date("Y-m-d H:i:s"));
if (is_array($over_time_task_array) and count($over_time_task_array) >= 1) {
foreach ($over_time_task_array as $key => $value) {
$project_task = new ProjectTask($value);
$project = new Project($project_task->get_project_id());
if ($project_task->get_uf_end_time() == -1) {
$end_task_datetime = new DatetimeHandler($project_task->get_end_date() . " 23:59:59");
} else {
$end_task_datetime = new DatetimeHandler($project_task->get_end_date() . " " . $project_task->get_uf_end_time());
}
if ($project_task->get_over_time() == true) {
$temp_array = array();
$temp_array['project_id'] = $project_task->get_project_id();
$temp_array['project_name'] = $project->get_name();
$temp_array['task_name'] = $project_task->get_name();
$temp_array['end_date'] = $end_task_datetime->get_formatted_string("d/m/Y");
$temp_array['status'] = 1;
array_push($upcoming_task_array, $temp_array);
unset($temp_array);
} else {
if ($project_task->get_progress() < 100) {
$temp_array = array();
$temp_array['project_id'] = $project_task->get_project_id();
$temp_array['project_name'] = $project->get_name();
$temp_array['task_name'] = $project_task->get_name();
$temp_array['end_date'] = $end_task_datetime->get_formatted_string("d/m/Y");
$temp_array['status'] = 1;
array_push($upcoming_task_array, $temp_array);
unset($temp_array);
$project_task->set_over_time(true);
} else {
$project_task->set_finished(true);
}
}
}
}
return $upcoming_task_array;
}
示例9: get_children
/**
* @param integer $id
*/
public static function get_children($id)
{
if (is_numeric($id)) {
$return_array = array();
$project = new Project($id);
$project_array = $project->list_project_related_projects();
if (is_array($project_array) and count($project_array) >= 1) {
$counter = 0;
foreach ($project_array as $key => $value) {
$project = new Project($value);
$return_array[$counter][0] = -1;
$return_array[$counter][1] = $value;
$return_array[$counter][2] = $project->get_name();
$return_array[$counter][3] = "project.png";
$return_array[$counter][4] = true;
// Permission
$return_array[$counter][5] = true;
$paramquery['username'] = $_GET['username'];
$paramquery['session_id'] = $_GET['session_id'];
$paramquery['nav'] = "project";
$paramquery['run'] = "detail";
$paramquery['project_id'] = $value;
$params = http_build_query($paramquery, '', '&');
$return_array[$counter][6] = $params;
//link
$return_array[$counter][7] = false;
//open
$counter++;
}
echo json_encode($return_array);
}
}
}