public static function list_manufacturers() { $list = new List_IO("Manufacturer", "ajax.php?nav=manufacturer", "list_manufacturers", "count_manufacturers", "0", "ManufacturerListPage"); $list->add_column("", "symbol", false, "16px"); $list->add_column(Language::get_message("ManufacturerGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("ManufacturerGeneralListColumnUser", "general"), "user", true, null); $list->add_column("", "delete", false, "16px"); $template = new HTMLTemplate("manufacturer/list.html"); $template->set_var("ADD_DIALOG", self::add()); $template->set_var("list", $list->get_list()); $template->output(); }
public static function samples() { global $user; $template = new HTMLTemplate("sample/home/summary/my_samples.html"); $template->set_var("samples", Sample_Wrapper::count_user_samples($user->get_user_id())); return $template->get_string(); }
public static function home() { $template = new HTMLTemplate("base/admin/home.html"); $module_dialog_array = ModuleDialog::list_dialogs_by_type("admin_home_box"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { $content = ""; foreach ($module_dialog_array as $key => $value) { require_once $value['class_path']; $content .= $value['class']::$value['method'](); } $template->set_var("content", $content); } else { $template->set_var("content", ""); } $template->output(); }
public static function used_diskspace() { global $user; $user_data = new DataUserData($user->get_user_id()); $user_filesize = $user_data->get_filesize(); $user_quota = $user_data->get_quota(); if ($user_quota != 0) { $diskspace_per = $user_filesize / $user_quota * 100; if ($diskspace_per == 0) { $diskspace_per_display = "(0%)"; } else { $diskspace_per = floor($diskspace_per); if ($diskspace_per == 0) { $diskspace_per_display = "(> 1%)"; } else { $diskspace_per_display = "(" . $diskspace_per . "%)"; } } if (round($user_filesize / $user_quota * 100, 0) >= (int) Registry::get_value("data_quota_warning")) { $quotaWarn = " <img src='images/icons/notice.png' alt='W' />"; } else { $quotaWarn = ""; } } else { $quotaWarn = ""; $diskspace_per_display = ""; } $act_filesize = Convert::convert_byte_1024($user_filesize); $template = new HTMLTemplate("data/home/summary/used_diskspace.html"); $template->set_var("used_diskspace", $act_filesize . " " . $diskspace_per_display . "" . $quotaWarn); return $template->get_string(); }
public static function list_batches() { global $user; $list = new List_IO("BaseBatchList", "ajax.php?nav=base", "batch_list_batches", "batch_count_batches", $argument_array, "BatchList"); $list->add_column("", "symbol", false, "16px"); $list->add_column(Language::get_message("BaseGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnStatus", "general"), "status", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnUser", "general"), "user", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnCreatedAt", "general"), "created_at", true, null); $template = new HTMLTemplate("base/batch/list.html"); if ($user->is_admin() and Batch::get_type_id_by_internal_name("TEST") != null) { $template->set_var("test_batch", true); } else { $template->set_var("test_batch", false); } $template->set_var("list", $list->get_list()); $template->output(); }
public static function finished_projects() { global $user; $sum_projects = Project_Wrapper::count_user_projects($user->get_user_id()); $sum_finished_projects = Project_Wrapper::count_user_finished_projects($user->get_user_id()); $template = new HTMLTemplate("project/home/summary/my_finished_projects.html"); $template->set_var("finished_projects", $sum_finished_projects . "/" . $sum_projects); return $template->get_string(); }
public static function home() { $list = new List_IO("BaseAdminIncludeHome", "ajax.php?nav=base.admin", "admin_list_includes", "admin_count_includes", "0", "BaseAdminIncludeAjax"); $list->add_column(Language::get_message("BaseGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnFolder", "general"), "folder", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnEventListerns", "general"), "eventlisteners", true, null); $template = new HTMLTemplate("base/admin/base_include/list.html"); $template->set_var("list", $list->get_list()); $template->output(); }
public static function home() { $list = new List_IO("DataAdminParameterMethod", "ajax.php?nav=data", "admin_list_parameter_methods", "admin_count_parameter_methods", "0", "DataAdminParameterMethod"); $list->add_column("", "symbol", false, "20px"); $list->add_column(Language::get_message("DataGeneralListColumnName", "general"), "name"); $list->add_column("", "edit", false, "20px"); $list->add_column("", "delete", false, "20px"); $template = new HTMLTemplate("data/admin/parameter_method/list.html"); $template->set_var("list", $list->get_list()); $template->output(); }
public static function home() { $list = new List_IO("BaseAdminModuleHome", "ajax.php?nav=base.admin", "admin_list_modules", "admin_count_modules", "0", "BaseAdminModuleHome"); $list->add_column(Language::get_message("BaseGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnDialogs", "general"), "dialogs", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnLinks", "general"), "links", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnDisable", "general"), "disable", false, "80px"); $template = new HTMLTemplate("base/admin/base_module/list.html"); $template->set_var("list", $list->get_list()); $template->output(); }
public static function home() { $list = new List_IO("BaseAdminServiceHome", "ajax.php?nav=base.admin", "admin_list_service", "admin_count_service", "0", "BaseAdminServiceHome"); $list->add_column("", "icon", false, "16px"); $list->add_column(Language::get_message("BaseGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnStatus", "general"), "status", true, null); $list->add_column("", "start", false, "16px"); $list->add_column("", "stop", false, "16px"); $template = new HTMLTemplate("base/admin/service/list.html"); $template->set_var("list", $list->get_list()); $template->output(); }
public static function home() { $list = new List_IO("BaseAdminRegistryHome", "ajax.php?nav=base.admin", "admin_list_registry", "admin_count_registry", "0", "BaseAdminRegistryHome"); $list->add_column("", "icon", false, "16px"); $list->add_column(Language::get_message("BaseGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnValue", "general"), "value", true, null); $list->add_column(Language::get_message("BaseGeneralListColumnInclude", "general"), "include", true, null); $list->add_column("", "edit", false, "16px", "BaseAdminRegistryEditButton"); $template = new HTMLTemplate("base/admin/base_registry/list.html"); $template->set_var("list", $list->get_list()); $template->output(); }
public static function home() { $list = new List_IO("BaseAdminNavigationHome", "ajax.php?nav=base.admin", "admin_list_navigation", "admin_count_navigation", "0", "BaseAdminNavigationHome"); $list->add_column(Language::get_message("BaseGeneralListColumnName", "general"), "name", false, null); $list->add_column(Language::get_message("BaseGeneralListColumnModule", "general"), "module", false, null); $list->add_column(Language::get_message("BaseGeneralListColumnColour", "general"), "colour", false, null); $list->add_column(Language::get_message("BaseGeneralListColumnUW", "general"), "uw", false, null); $list->add_column(Language::get_message("BaseGeneralListColumnDW", "general"), "dw", false, null); $list->add_column(Language::get_message("BaseGeneralListColumnShowHide", "general"), "hide", false, "80px"); $template = new HTMLTemplate("base/admin/base_navigation/list.html"); $template->set_var("list", $list->get_list()); $template->output(); }
public static function create_left_navigation() { global $session; if ($session->is_value("LEFT_NAVIGATION_ACTIVE")) { $active_id = $session->read_value("LEFT_NAVIGATION_ACTIVE"); } else { $active_id = "LeftNavigationSymbol0"; } $counter = 0; $js_array = array(); $symbols_array = array(); $module_dialog_array = ModuleDialog::list_dialogs_by_type("base_left_navigation"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { foreach ($module_dialog_array as $key => $value) { if (file_exists($value['class_path'])) { require_once $value['class_path']; if (class_exists($value['class'])) { $js_array[$counter]['ajax_url'] = $value['class']::get_ajax_url(); $js_array[$counter]['id'] = "LeftNavigationSymbol" . $key; if ($js_array[$counter]['id'] == $active_id) { $active_js_array['ajax_url'] = $js_array[$counter]['ajax_url']; $active_js_array['id'] = $js_array[$counter]['id']; } $symbols_array[$counter]['icon'] = $value['class']::get_icon(); $symbols_array[$counter]['active'] = $value['class']::get_active(); $symbols_array[$counter]['id'] = "LeftNavigationSymbol" . $key; $counter++; } } } } $template = new HTMLTemplate("base/navigation/left/main.html"); $template->set_var("symbols", $symbols_array); $template->set_var("js", $js_array); $template->set_var("active_js_ajax_url", $active_js_array['ajax_url']); $template->set_var("active_js_id", $active_js_array['id']); $template->output(); }
/** * @throws ProjectIDMissingException * @throws ProjectSecurityAccessDeniedException */ public static function list_project_related_logs() { global $project_security; if ($_GET['project_id']) { if ($project_security->is_access(1, false) == true) { $template = new HTMLTemplate("project/log.html"); $template->set_var("get_array", serialize($_GET)); if ($project_security->is_access(3, false) == true) { $template->set_var("write", true); } else { $template->set_var("write", false); } $project_log_array = ProjectLog::list_entries_by_project_id($_GET['project_id']); $entry_count = count($project_log_array); $number_of_pages = ceil($entry_count / constant("PROJECT_LOG_ENTRIES_PER_PAGE")); $template->output(); } else { throw new ProjectSecurityAccessDeniedException(); } } else { throw new ProjectIDMissingException(); } }
public static function home() { $extension_handler = new ExtensionHandler(); $template = new HTMLTemplate("base/extension/home.html"); $extension_array = ExtensionHandler::list_extensions(); $display_array = array(); $counter = 0; if (is_array($extension_array) and count($extension_array) >= 1) { foreach ($extension_array as $key => $value) { $display_array[$counter]['name'] = $value['name']; $paramquery = $_GET; $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = $_GET['nav']; $paramquery['extension'] = $value['id']; $params = http_build_query($paramquery, '', '&'); $display_array[$counter]['link'] = $params; $counter++; } } $template->set_var("extension_array", $display_array); $template->output(); }
/** * @return string */ public function get_content() { $return = ""; $template = new HTMLTemplate("base/assistant/header.html"); $return .= $template->get_string(); $element_width = floor(730 / count($this->screen_array)); foreach ($this->screen_array as $key => $value) { $template = new HTMLTemplate("base/assistant/element.html"); $template->set_var("id", $key + 1); $template->set_var("width", $element_width); $template->set_var("image", $key + 1 . "_lgrey.png"); $template->set_var("text", $value); $return .= $template->get_string(); } $template = new HTMLTemplate("base/assistant/footer.html"); $return .= $template->get_string(); $template = new HTMLTemplate("base/assistant/content.html"); $template->set_var("ajax_handler", $this->ajax_handler); $template->set_var("ajax_page", $this->init_page); $template->set_var("max_page", count($this->screen_array)); $template->set_var("form_field_name", $this->form_field_name); $return .= $template->get_string(); return $return; }
public static function home_dialog() { $template = new HTMLTemplate("data/admin/home_dialog.html"); $template->set_var("base_dir", System::get_base_directory()); $template->set_var("system_space", Convert::convert_byte_1024(System::get_system_space())); $template->set_var("user_used_space", Convert::convert_byte_1024(DataUserData::get_used_space())); $additional_quota_dialog_array = ModuleDialog::list_dialogs_by_type("additional_quota"); if (is_array($additional_quota_dialog_array) and count($additional_quota_dialog_array) >= 1) { $additional_quota_array = array(); $additional_quota_counter = 0; foreach ($additional_quota_dialog_array as $key => $value) { if (file_exists($value['class_path'])) { require_once $value['class_path']; $additional_quota_array[$additional_quota_counter]['title'] = Language::get_message($value['language_address'], "dialog"); $additional_quota_array[$additional_quota_counter]['value'] = $value['class']::$value['method'](); $additional_quota_counter++; } } $template->set_var("additional_quota_array", $additional_quota_array); } $template->set_var("db_used_space", Convert::convert_byte_1024(System::get_used_database_space())); $template->set_var("free_space", Convert::convert_byte_1024(System::get_free_space())); return $template->get_string(); }
$module_link_array = ModuleLink::list_links_by_type("home_button"); if (is_array($module_link_array) and count($module_link_array) >= 1) { $content_array = array(); $counter = 0; foreach ($module_link_array as $key => $value) { $button_template = new HTMLTemplate($value['file']); $button_paramquery = array(); $button_paramquery['username'] = $_GET['username']; $button_paramquery['session_id'] = $_GET['session_id']; if (is_array($value['array']) and count($value['array']) >= 1) { foreach ($value['array'] as $array_key => $array_value) { $button_paramquery[$array_key] = $array_value; } } $button_params = http_build_query($button_paramquery, '', '&'); $button_template->set_var("params", $button_params); $content_array[$counter]['content'] = $button_template->get_string(); $counter++; } $template->set_var("I_WANT_TO_ARRAY", $content_array); } $paramquery = $_GET; $paramquery['nav'] = "help"; unset($paramquery['nextpage']); unset($paramquery['sure']); unset($paramquery['id']); unset($paramquery['aspect']); unset($paramquery['sortvalue']); unset($paramquery['sortby']); unset($paramquery['page']); unset($paramquery['pageref']);
public static function install() { global $db; $module_array = array(); $module_array[] = "base"; $module_array[] = "data"; $module_array[] = "equipment"; $module_array[] = "item"; $module_array[] = "location"; $module_array[] = "manufacturer"; $module_array[] = "organisation_unit"; $module_array[] = "parser"; $module_array[] = "project"; $module_array[] = "sample"; $module_array[] = "template"; $template = new HTMLTemplate("table.html", "install/template"); if (is_array($module_array) and count($module_array) >= 1) { try { // Version >= 0.3.9.9-5 $installed_module_array = array(); $sql = "SELECT name,db_version FROM core_base_includes"; $res = @$db->db_query($sql); while ($data = $db->db_fetch_assoc($res)) { $installed_module_array[$data['name']] = $data['db_version']; } } catch (DatabaseQueryFailedException $e) { // Version < 0.3.9.9-5 } $install = false; $update = false; foreach ($module_array as $key => $value) { if (file_exists("information/" . $value . ".php")) { include "information/" . $value . ".php"; } else { $version = "not available"; } if (file_exists("install/postgres/structure/" . $value . ".php")) { include "install/postgres/structure/" . $value . ".php"; try { $sql = $check_statement; $res = @$db->db_query($sql); if ($installed_module_array[$value]) { if ($installed_module_array[$value] != $version) { $update = true; } } else { $update = true; } } catch (DatabaseQueryFailedException $e) { $install = true; } $module_display_array[$counter]['av'] = $version; } } if ($install == true and $update == true) { $template->set_var("template_disabled", "disabled='disabled'"); $template->set_var("button_disabled", ""); $template->set_var("button", "Start Update/Installation"); } elseif ($install == true and $update == false) { $template->set_var("template_disabled", "disabled='disabled'"); $template->set_var("button_disabled", ""); $template->set_var("button", "Start Installation"); } elseif ($install == false and $update == true) { $template->set_var("template_disabled", "disabled='disabled'"); $template->set_var("button_disabled", ""); $template->set_var("button", "Start Update"); } else { $template->set_var("template_disabled", "disabled='disabled'"); $template->set_var("button_disabled", "disabled='disabled'"); $template->set_var("button", "Everything is up to date"); } $template->set_var("version", constant("PRODUCT_VERSION")); } $template->output(); }
/** * @throws EquipmentTypeIDMissingException */ public static function change_location() { if ($_GET['id']) { if ($_GET['nextpage'] == 1) { $page_1_passed = true; } else { $page_1_passed = false; } if ($page_1_passed == false) { $template = new HTMLTemplate("equipment/admin/equipment_type/change_location.html"); $paramquery = $_GET; $paramquery['nextpage'] = "1"; $params = http_build_query($paramquery, '', '&'); $template->set_var("params", $params); $location_array = Location::list_entries(); $result = array(); $counter = 1; $location = new Location($value); $result[0]['value'] = 0; $result[0]['content'] = "none"; foreach ($location_array as $key => $value) { $location = new Location($value); $result[$counter]['value'] = $value; $result[$counter]['content'] = $location->get_name(true); $counter++; } $template->set_var("option", $result); $template->output(); } else { $equipment_type = new EquipmentType($_GET['id']); $paramquery = $_GET; $paramquery['action'] = "detail"; unset($paramquery['nextpage']); $params = http_build_query($paramquery, '', '&'); if ($equipment_type->set_location_id($_POST['location'])) { Common_IO::step_proceed($params, "Equipment Type", "Operation Successful", null); } else { Common_IO::step_proceed($params, "Equipment Type", "Operation Failed", null); } } } else { throw new EquipmentTypeIDMissingException(); } }
/** * @throws ProjectIDMissingException * @throws ProjectSecurityAccessDeniedException */ public static function menu() { $template = new HTMLTemplate("project/admin/menu.html"); $template->set_var("get_array", serialize($_GET)); $template->output(); }
public static function history() { if ($_GET['parameter_id']) { $parameter = Parameter::get_instance($_GET['parameter_id']); if ($parameter->is_read_access()) { $argument_array = array(); $argument_array[0] = "parameter_id"; $argument_array[1] = $_GET['parameter_id']; $list = new List_IO("DataParameterVersionHistory", "ajax.php?nav=data", "parameter_list_versions", "parameter_count_versions", $argument_array, "DataParameterVersionHistory"); $list->add_column("", "symbol", false, "16px"); $list->add_column(Language::get_message("DataGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("DataGeneralListColumnVersion", "general"), "version", false, null); $list->add_column(Language::get_message("DataGeneralListColumnDateTime", "general"), "datetime", true, null); $list->add_column(Language::get_message("DataGeneralListColumnUser", "general"), "user", true, null); $list->add_column("", "delete", false, "16px"); $template = new HTMLTemplate("data/parameter_history.html"); $template->set_var("title", $parameter->get_name()); $template->set_var("list", $list->get_list()); $template->output(); } else { throw new DataSecurityAccessDeniedException(); } } else { throw new ParameterIDMissingException(); } }
public static function home_dialog() { $template = new HTMLTemplate("base/user/admin/group/home_dialog.html"); $paramquery = array(); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = $_GET['nav']; $paramquery['run'] = "organisation"; $paramquery['dialog'] = "groups"; $paramquery['action'] = "add"; $params = http_build_query($paramquery, '', '&'); $template->set_var("group_add_params", $params); $template->set_var("group_amount", Group::count_groups()); return $template->get_string(); }
/** * @todo remove code; merge with IO permission function (GET <-> POST) * @return string * @throws FolderIDMissingException */ public static function permission_window() { global $user; if ($_POST['file_id'] or $_POST['value_id'] or $_POST['parameter_id'] or $_POST['folder_id']) { if ($_POST['file_id']) { $id = $_POST['file_id']; $object = File::get_instance($id); $type = "file"; $title = $object->get_name(); } if ($_POST['value_id']) { $id = $_POST['value_id']; $object = Value::get_instance($id); $type = "value"; $title = $object->get_type_name(); } if ($_POST['parameter_id']) { $id = $_POST['parameter_id']; $object = Parameter::get_instance($id); $type = "parameter"; $title = $object->get_name(); } if ($_POST['folder_id']) { $id = $_POST['folder_id']; $object = Folder::get_instance($id); $type = "folder"; $title = $object->get_name(); } } else { throw new FolderIDMissingException(); } $data_permission = new DataPermission($type, $id); $template = new HTMLTemplate("data/data_permission_window.html"); $template->set_var("title", $title); $user = new User($data_permission->get_owner_id()); $group = new Group($data_permission->get_owner_group_id()); $template->set_var("owner", $user->get_full_name(false)); $template->set_var("owner_group", $group->get_name()); if ($object->can_set_automatic()) { $disable_automatic = false; } else { $disable_automatic = true; } if ($object->can_set_data_entity()) { $disable_project = false; } else { $disable_project = true; } if ($object->can_set_control()) { $disable_control = false; } else { $disable_control = true; } if ($object->can_set_remain()) { $disable_remain = false; } else { $disable_remain = true; } if ($disable_automatic == true) { $template->set_var("disabled_automatic", "disabled='disabled'"); } else { $template->set_var("disabled_automatic", ""); } if ($data_permission->get_automatic() == true) { $template->set_var("checked_automatic", "checked='checked'"); if ($disable_automatic == true) { $template->set_var("hidden_automatic", "<input type='hidden' name='automatic' value='1' />"); } else { $template->set_var("hidden_automatic", ""); } } else { $template->set_var("checked_automatic", ""); $template->set_var("hidden_automatic", ""); } $permission_array = $data_permission->get_permission_array(); for ($i = 1; $i <= 4; $i++) { for ($j = 1; $j <= 4; $j++) { $checked_name = "checked_" . $i . "_" . $j; $disabled_name = "disabled_" . $i . "_" . $j; $hidden_name = "hidden_" . $i . "_" . $j; if ($i == 3 and $disable_project == true) { $template->set_var($disabled_name, "disabled='disabled'"); $disabled = true; } else { if (($j == 3 or $j == 4) and $disable_control == true) { $template->set_var($disabled_name, "disabled='disabled'"); $disabled = true; } else { if ($disable_remain == true) { $template->set_var($disabled_name, "disabled='disabled'"); $disabled = true; } else { $template->set_var($disabled_name, ""); $disabled = false; } } } if ($permission_array[$i][$j] == true) { $template->set_var($checked_name, "checked='checked'"); if ($disabled == true) { $template->set_var($hidden_name, "<input type='hidden' name='" . $checked_name . "' value='1' />"); } else { $template->set_var($hidden_name, ""); } } else { $template->set_var($checked_name, ""); $template->set_var($hidden_name, ""); } $disabled = false; } } $paramquery = $_GET; $paramquery['nav'] = "data"; unset($paramquery['action']); $params = http_build_query($paramquery, '', '&'); return $template->get_string(); }
/** * @todo permission check */ public static function search() { global $user, $session; if ($_GET['nextpage']) { if ($_GET['page'] or $_GET['sortvalue'] or $_GET['sortmethod']) { $name = $session->read_value("SEARCH_SAMPLE_NAME"); $organisation_unit_array = $session->read_value("SEARCH_SAMPLE_ORGANISATION_UNIT_ARRAY"); $template_array = $session->read_value("SEARCH_SAMPLE_TEMPLATE_ARRAY"); $in_id = $session->read_value("SEARCH_SAMPLE_IN_ID"); $in_name = $session->read_value("SEARCH_SAMPLE_IN_NAME"); } else { if ($_GET['nextpage'] == "1") { $name = $_POST['string']; $session->delete_value("SEARCH_SAMPLE_NAME"); $session->delete_value("SEARCH_SAMPLE_ORGANISATION_UNIT_ARRAY"); $session->delete_value("SEARCH_SAMPLE_TEMPLATE_ARRAY"); $session->delete_value("SEARCH_SAMPLE_IN_ID"); $session->delete_value("SEARCH_SAMPLE_IN_NAME"); } else { $name = $_POST['string']; $organisation_unit_array = $session->read_value("SEARCH_SAMPLE_ORGANISATION_UNIT_ARRAY"); $template_array = $session->read_value("SEARCH_SAMPLE_TEMPLATE_ARRAY"); $in_id = $session->read_value("SEARCH_SAMPLE_IN_ID"); $in_name = $session->read_value("SEARCH_SAMPLE_IN_NAME"); } } $no_error = true; } else { $no_error = false; } if ($no_error == false) { $template = new HTMLTemplate("sample/search/search.html"); $paramquery = $_GET; unset($paramquery['page']); $paramquery['nextpage'] = "1"; $params = http_build_query($paramquery, '', '&'); $template->set_var("params", $params); $template->set_var("error", ""); $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())) { $result[$counter]['value'] = $value; $result[$counter]['content'] = $organisation_unit->get_name(); $result[$counter]['selected'] = ""; $counter++; } } } if (!$result) { $result[$counter]['value'] = "0"; $result[$counter]['content'] = "NO ORGANISATION UNIT FOUND!"; } $template->set_var("organ_unit", $result); $result = array(); $counter = 0; $sample_template_array = SampleTemplateCat::list_entries(); if (is_array($sample_template_array)) { foreach ($sample_template_array as $key => $value) { $sample_template_cat = new SampleTemplateCat($value); $result[$counter]['value'] = ""; $result[$counter]['content'] = $sample_template_cat->get_name(); $result[$counter]['selected'] = ""; $counter++; $sample_template_sub_array = SampleTemplate::list_entries_by_cat_id($value); if (is_array($sample_template_sub_array)) { foreach ($sample_template_sub_array as $sub_key => $sub_value) { $sample_sub_template = new SampleTemplate($sub_value); $result[$counter]['value'] = $sub_value; $result[$counter]['content'] = " " . $sample_sub_template->get_name(); $result[$counter]['selected'] = ""; $counter++; } } unset($sample_template_sub_array); } } else { $result[$counter]['value'] = "0"; $result[$counter]['content'] = "NO TEMPLATES FOUND!"; } $template->set_var("template", $result); $template->output(); } else { if (!$organisation_unit_array) { if (!$_POST['organisation_unit']) { $organisation_unit_array = array(); $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())) { array_push($organisation_unit_array, $value); } } } $search_organisation_unit_name = "All"; } else { $organisation_unit_array = array(); $organisation_unit_array[0] = $_POST['organisation_unit']; $organisation_unit = new OrganisationUnit($_POST['organisation_unit']); $search_organisation_unit_name = $organisation_unit->get_name(); } } else { if (count($organisation_unit_array) == 1) { $organisation_unit = new OrganisationUnit($organisation_unit_array[0]); $search_organisation_unit_name = $organisation_unit->get_name(); } else { $search_organisation_unit_name = "All"; } } if (!$template_array) { if (!$_POST['template']) { $template_array = null; $search_template_name = "All"; } else { $template_array = array(); $template_array[0] = $_POST['template']; $sample_template = new SampleTemplate($_POST['template']); $search_template_name = $sample_template->get_name(); } } if (!isset($in_id)) { if ($_POST['in_id'] == 1) { $in_id = true; } else { $in_id = false; } } if (!isset($in_name)) { if ($_POST['in_name'] == 1) { $in_name = true; } else { $in_name = false; } } $session->write_value("SEARCH_SAMPLE_NAME", $name, true); $session->write_value("SEARCH_SAMPLE_ORGANISATION_UNIT_ARRAY", $organisation_unit_array, true); $session->write_value("SEARCH_SAMPLE_TEMPLATE_ARRAY", $template_array, true); $session->write_value("SEARCH_SAMPLE_IN_ID", $in_id, true); $session->write_value("SEARCH_SAMPLE_IN_NAME", $in_name, true); /* --------------- */ $argument_array = array(); $argument_array[0][0] = "name"; $argument_array[0][1] = $name; $argument_array[1][0] = "organisation_unit_array"; $argument_array[1][1] = $organisation_unit_array; $argument_array[2][0] = "template_array"; $argument_array[2][1] = $template_array; $argument_array[3][0] = "in_id"; $argument_array[3][1] = $in_id; $argument_array[4][0] = "in_name"; $argument_array[4][1] = $in_name; $list = new List_IO("SampleSearch", "ajax.php?nav=sample", "search_sample_list_samples", "search_sample_count_samples", $argument_array, "SampleSearch"); $list->add_column("", "symbol", false, "16px"); $list->add_column(Language::get_message("SampleGeneralListColumnSampleID", "general"), "id", true, "11%"); $list->add_column(Language::get_message("SampleGeneralListColumnSampleName", "general"), "name", true, null); $list->add_column(Language::get_message("SampleGeneralListColumnDate", "general"), "datetime", true, null); $list->add_column(Language::get_message("SampleGeneralListColumnTypeTemplate", "general"), "template", true, null); $list->add_column(Language::get_message("SampleGeneralListColumnCurrentLocation", "general"), "location", true, null); $list->add_column(Language::get_message("SampleGeneralListColumnAvailable", "general"), "av", false, "16px"); $template = new HTMLTemplate("sample/search/search_result.html"); $paramquery = $_GET; $paramquery['nextpage'] = "2"; unset($paramquery['page']); unset($paramquery['sortvalue']); unset($paramquery['sortmethod']); $params = http_build_query($paramquery, '', '&'); $template->set_var("params", $params); $template->set_var("name", $name); $template->set_var("organisation_units", $search_organisation_unit_name); $template->set_var("templates", $search_template_name); $template->set_var("list", $list->get_list()); $template->output(); } }
public static function software_info() { $template = new HTMLTemplate("base/software_info.html"); $template->set_var("product", constant("PRODUCT")); $template->set_var("product_version", constant("PRODUCT_VERSION")); $paramquery = $_GET; $paramquery['run'] = "license"; $params = http_build_query($paramquery, '', '&'); $template->set_var("license_params", $params); $template->output(); }
/** * @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 { throw new ProjectSecurityAccessDeniedException(); } } else { throw new ProjectIDMissingException(); } }
/** * @throws OrganisationUnitIDMissingException */ public static function list_groups() { if ($_GET['ou_id']) { $organisation_unit = new OrganisationUnit($_GET['ou_id']); $argument_array = array(); $argument_array[0] = "organisation_unit_id"; $argument_array[1] = $_GET['ou_id']; $list = new List_IO("OrganisationUnitListGroups", "ajax.php?nav=organisation_unit", "list_groups", "count_groups", $argument_array, "OrganisationUnitListGroups"); $list->add_column("", "symbol", false, "16px"); $list->add_column(Language::get_message("OrganisationUnitGeneralColoumnGroupName", "general"), "groupname", true, null, "OrganisationUnitListSortGroupname"); $template = new HTMLTemplate("organisation_unit/list_groups.html"); $template->set_var("TITLE", "(" . $organisation_unit->get_name() . ")"); $template->set_var("list", $list->get_list()); $template->output(); } else { throw new OrganisationUnitIDMissingException(); } }
/** * @param string $folder_id * @return string * @throws DataSecurityAccessDeniedException */ public static function add_file($folder_id) { $parent_folder = Folder::get_instance($folder_id); if ($parent_folder->is_write_access()) { $paramquery = array(); $unique_id = uniqid(); $paramquery['session_id'] = $_GET['session_id']; $paramquery['folder_id'] = $folder_id; $paramquery['unique_id'] = $unique_id; $params = http_build_query($paramquery); $template = new HTMLTemplate("data/file_upload_window.html"); $template->set_var("params", $params); $template->set_var("unique_id", $unique_id); $template->set_var("session_id", $_GET['session_id']); $button_handler_template = new JSTemplate("data/js/file_upload_window.js"); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Add"; $html_caption = "Add File"; $html = $template->get_string(); $additional_script_template = new JSTemplate("data/js/file_upload_window_additional.js"); $additional_script_template->set_var("session_id", $_GET['session_id']); $additional_script_template->set_var("unique_id", $unique_id); $additional_script = $additional_script_template->get_string(); $array = array("content" => $html, "content_caption" => $html_caption, "handler" => $button_handler, "handler_caption" => $button_handler_caption, "additional_script" => $additional_script); return json_encode($array); } else { throw new DataSecurityAccessDeniedException(); } }
/** * @return string */ public function get_string() { $return = ""; $template = new HTMLTemplate("base/tabs/small_tab_header.html"); $return .= $template->get_string(); if (is_array($this->tab_array) and count($this->tab_array) >= 1) { foreach ($this->tab_array as $key => $value) { if ($value['disabled']) { $template = new HTMLTemplate("base/tabs/generic_inactive.html"); $template->set_var("title", $value['name']); $return .= $template->get_string(); } else { if ($value['active'] == true) { $template = new HTMLTemplate("base/tabs/generic_active.html"); $template->set_var("title", $value['name']); $template->set_var("params", $value['target']); $return .= $template->get_string(); } else { $template = new HTMLTemplate("base/tabs/generic.html"); $template->set_var("title", $value['name']); $template->set_var("params", $value['target']); $return .= $template->get_string(); } } } } $template = new HTMLTemplate("base/tabs/small_tab_footer.html"); $return .= $template->get_string(); return $return; }