public static function tab_header() { $tab_io = new Tab_IO(); // Main Page $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "sample"; $paramquery['run'] = "detail"; $paramquery['sample_id'] = $_GET['sample_id']; $params = http_build_query($paramquery, '', '&'); unset($paramquery); $tab_io->add("main", Language::get_message("SampleGeneralDetailTabMainPage", "general"), $params, false); // Parent Item Dialogs $module_dialog_array = ModuleDialog::list_dialogs_by_type("parent_item_list"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { foreach ($module_dialog_array as $key => $value) { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "sample"; $paramquery['run'] = "parent_item_list"; $paramquery['sample_id'] = $_GET['sample_id']; $paramquery['dialog'] = $value['internal_name']; $params = http_build_query($paramquery, '', '&'); $tab_io->add("pil_" . $value['internal_name'], Language::get_message($value['language_address'], "dialog"), $params, false); } } // Item Lister Dialogs $module_dialog_array = ModuleDialog::list_dialogs_by_type("item_list"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { foreach ($module_dialog_array as $key => $value) { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "sample"; $paramquery['run'] = "item_list"; $paramquery['sample_id'] = $_GET['sample_id']; $paramquery['dialog'] = $value['internal_name']; $params = http_build_query($paramquery, '', '&'); $tab_io->add("il_" . $value['internal_name'], Language::get_message($value['language_address'], "dialog"), $params, false); } } if ($_GET['run'] != "parent_item_list" and $_GET['run'] != "item_list") { $tab_io->activate("main"); } else { if ($_GET['run'] == "item_list" and $_GET['dialog']) { $tab_io->activate("il_" . $_GET['dialog']); } elseif ($_GET['run'] == "parent_item_list" and $_GET['dialog']) { $tab_io->activate("pil_" . $_GET['dialog']); } else { $tab_io->activate("main"); } } $tab_io->output(); }
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(); }
/** * @throws BaseModuleDialogMethodNotFoundException * @throws BaseModuleDialogClassNotFoundException * @throws BaseModuleDialogFileNotFoundException * @throws BaseModuleDialogMissingException */ public static function common_dialog() { if ($_GET['dialog']) { $module_dialog = ModuleDialog::get_by_type_and_internal_name("common_dialog", $_GET['dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $module_dialog['class']::$module_dialog['method'](); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogMissingException(); } }
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(); }
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(); }
/** * @throws BaseModuleDialogMethodNotFoundException * @throws BaseModuleDialogClassNotFoundException * @throws BaseModuleDialogFileNotFoundException * @throws GroupIDMissingException */ public static function detail() { if ($_GET['id']) { $tab_io = new Tab_IO(); $paramquery = $_GET; unset($paramquery['tab']); $params = http_build_query($paramquery, '', '&'); $tab_io->add("detail", "Group Details", $params, false); $paramquery = $_GET; $paramquery['tab'] = "users"; $params = http_build_query($paramquery, '', '&'); $tab_io->add("users", "Users", $params, false); $module_dialog_array = ModuleDialog::list_dialogs_by_type("group_admin_detail"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { foreach ($module_dialog_array as $key => $value) { $paramquery = $_GET; $paramquery['tab'] = "dialog"; $paramquery['sub_dialog'] = $value['internal_name']; $params = http_build_query($paramquery, '', '&'); $tab_io->add($value['internal_name'], Language::get_message($value['language_address'], "dialog"), $params, false); } } switch ($_GET['tab']) { case "users": $tab_io->activate("users"); break; case "dialog": $tab_io->activate($_GET['sub_dialog']); break; default: $tab_io->activate("detail"); break; } $tab_io->output(); switch ($_GET['tab']) { case "users": self::detail_users(); break; case "dialog": $module_dialog = ModuleDialog::get_by_type_and_internal_name("group_admin_detail", $_GET['sub_dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $module_dialog['class']::$module_dialog['method']($_GET['id']); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } break; default: self::detail_home(); break; } } else { throw new GroupIDMissingException(); } }
/** * @throws BaseModuleDialogMethodNotFoundException * @throws BaseModuleDialogClassNotFoundException * @throws BaseModuleDialogFileNotFoundException * @throws BaseModuleDialogNotFoundException */ private static function get_left_standard_navigation() { $dialog_array = ModuleDialog::list_dialogs_by_type("standard_navigation"); if (count($dialog_array) == 0) { return; } elseif (count($dialog_array) == 1) { if (file_exists($dialog_array[0]['class_path'])) { require_once $dialog_array[0]['class_path']; if (class_exists($dialog_array[0]['class'])) { if (method_exists($dialog_array[0]['class'], $dialog_array[0]['method'])) { $dialog_array[0]['class']::$dialog_array[0]['method'](); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogNotFoundException(); } }
/** * @todo reactivate schedule after workflow integration */ public static function tab_header() { if ($_GET['project_id']) { $tab_io = new Tab_IO(); // Main Page $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "project"; $paramquery['run'] = "detail"; $paramquery['project_id'] = $_GET['project_id']; $params = http_build_query($paramquery, '', '&'); unset($paramquery); $tab_io->add("main", Language::get_message("ProjectGeneralDetailTabMainPage", "general"), $params, false); // Log $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "project"; $paramquery['run'] = "log"; $paramquery['project_id'] = $_GET['project_id']; $params = http_build_query($paramquery, '', '&'); unset($paramquery); $tab_io->add("log", Language::get_message("ProjectGeneralDetailTabLog", "general"), $params, false); // Structure $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "project"; $paramquery['run'] = "structure"; $paramquery['project_id'] = $_GET['project_id']; $params = http_build_query($paramquery, '', '&'); unset($paramquery); $tab_io->add("structure", Language::get_message("ProjectGeneralDetailTabStructure", "general"), $params, false); // Schedule /* $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "project"; $paramquery['run'] = "schedule"; $paramquery['project_id'] = $_GET['project_id']; $params = http_build_query($paramquery,'','&'); unset($paramquery); $tab_io->add("schedule", Language::get_message("ProjectGeneralDetailTabSchedule", "general"), $params, false); */ // Item Lister Dialogs $module_dialog_array = ModuleDialog::list_dialogs_by_type("item_list"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { foreach ($module_dialog_array as $key => $value) { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "project"; $paramquery['run'] = "item_list"; $paramquery['project_id'] = $_GET['project_id']; $paramquery['dialog'] = $value['internal_name']; $params = http_build_query($paramquery, '', '&'); $tab_io->add($value['internal_name'], Language::get_message($value['language_address'], "dialog"), $params, false); } } // Administration $project_security = new ProjectSecurity($_GET['project_id']); if ($project_security->is_access(2, false) or $project_security->is_access(3, false) or $project_security->is_access(4, false) or $project_security->is_access(5, false) or $project_security->is_access(6, false) or $project_security->is_access(7, false)) { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "project"; $paramquery['run'] = "admin"; $paramquery['project_id'] = $_GET['project_id']; unset($paramquery['dialog']); $params = http_build_query($paramquery, '', '&'); unset($paramquery); $tab_io->add("admin", Language::get_message("ProjectGeneralDetailTabAdministration", "general"), $params, false, false); } if ($_GET['run'] != "item_add" and $_GET['run'] != "item_list") { switch ($_GET['run']) { case "log": case "log_detail": case "log_add": $tab_io->activate("log"); break; case "structure": $tab_io->activate("structure"); break; case "add_task": case "task_delete": case "task_detail": case "schedule": case "show_tasks": case "task_edit_start": case "task_edit_end": $tab_io->activate("schedule"); break; case "admin": $tab_io->activate("admin"); break; default: if (strpos($_GET['run'], "admin_") === 0) { $tab_io->activate("admin"); } else { $tab_io->activate("main"); } break; } } else { if ($_GET['run'] == "item_list" and $_GET['dialog']) { $tab_io->activate($_GET['dialog']); } else { $tab_io->activate("main"); } } $tab_io->output(); } }
public static function navigation() { $template = new HTMLTemplate("base/admin/navigation/administration.html"); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "general_admin"; $params = http_build_query($paramquery, '', '&'); $template->set_var("general_params", $params); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "include_admin"; $params = http_build_query($paramquery, '', '&'); $template->set_var("include_params", $params); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "module_admin"; $params = http_build_query($paramquery, '', '&'); $template->set_var("module_params", $params); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "navigation"; $params = http_build_query($paramquery, '', '&'); $template->set_var("navigation_params", $params); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "registry"; $params = http_build_query($paramquery, '', '&'); $template->set_var("registry_params", $params); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "services"; $params = http_build_query($paramquery, '', '&'); $template->set_var("services_params", $params); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "system_log"; $params = http_build_query($paramquery, '', '&'); $template->set_var("system_log_params", $params); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "system_message"; $params = http_build_query($paramquery, '', '&'); $template->set_var("system_message_params", $params); $organisation_admin_navigation_array = array(); $counter = 0; $organisation_dialog_array = ModuleDialog::list_dialogs_by_type("organisation_admin"); if (is_array($organisation_dialog_array) and count($organisation_dialog_array) >= 1) { foreach ($organisation_dialog_array as $key => $value) { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "organisation"; $paramquery['dialog'] = $value['internal_name']; $params = http_build_query($paramquery, '', '&'); require_once $value['class_path']; if (method_exists($value['class'], "get_icon")) { if (($icon = $value['class']::get_icon()) != null) { $organisation_admin_navigation_array[$counter]['icon'] = $icon; } else { $organisation_admin_navigation_array[$counter]['icon'] = "blank.png"; } } else { $organisation_admin_navigation_array[$counter]['icon'] = "blank.png"; } $organisation_admin_navigation_array[$counter]['params'] = $params; $organisation_admin_navigation_array[$counter]['title'] = Language::get_message($value['language_address'], "dialog"); $counter++; } } $template->set_var("organisation_admin", $organisation_admin_navigation_array); $module_admin_navigation_array = array(); $counter = 0; $module_dialog_array = ModuleDialog::list_dialogs_by_type("module_admin"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { foreach ($module_dialog_array as $key => $value) { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base.admin"; $paramquery['run'] = "module"; $paramquery['dialog'] = $value['internal_name']; $params = http_build_query($paramquery, '', '&'); require_once $value['class_path']; if (method_exists($value['class'], "get_icon")) { if (($icon = $value['class']::get_icon()) != null) { $module_admin_navigation_array[$counter]['icon'] = $icon; } else { $module_admin_navigation_array[$counter]['icon'] = "blank.png"; } } else { $module_admin_navigation_array[$counter]['icon'] = "blank.png"; } $module_admin_navigation_array[$counter]['params'] = $params; $module_admin_navigation_array[$counter]['title'] = Language::get_message($value['language_address'], "dialog"); $counter++; } } $template->set_var("module_admin", $module_admin_navigation_array); $template->output(); }
/** * @param string $alias * @throws BaseModuleDialogMethodNotFoundException * @throws BaseModuleDialogClassNotFoundException * @throws BaseModuleDialogFileNotFoundException * @throws BaseModuleDialogMissingException * @throws ProjectSecurityAccessDeniedException * @throws BaseModuleDialogNotFoundException * @throws ItemAddIOClassNotFoundException * @throws ItemAddIOFileNotFoundException * @throws ItemHandlerClassNotFoundException * @throws ItemPositionIDMissingException * @throws ItemParentIDMissingException * @throws ItemParentTypeMissingException * @throws ProjectStatusWithoutExtensionException * @throws BaseExtensionClassNotFoundException * @throws BaseExtensionFileNotFoundException * @throws BaseExtensionNotFoundException * @throws BaseExtensionMissingException */ public static function io_handler($alias) { global $project_security, $session, $transaction; if (isset($_GET['project_id']) and is_numeric($_GET['project_id'])) { $project_security = new ProjectSecurity($_GET['project_id']); if ($_GET['run'] != "new_subproject") { require_once "io/project_common.io.php"; ProjectCommon_IO::tab_header(); } } else { $project_security = new ProjectSecurity(null); } if (isset($_GET['run'])) { switch ($_GET['run']) { case "new": case "new_subproject": require_once "io/project.io.php"; ProjectIO::create(); break; case "myprojects": case "workon": case "accessdata": case "analyse": require_once "io/project.io.php"; ProjectIO::list_user_related_projects(null); break; case "userprojects": require_once "io/project.io.php"; ProjectIO::list_user_related_projects($_GET['id']); break; case "organ_unit": require_once "io/project.io.php"; ProjectIO::list_organisation_unit_related_projects(); break; case "detail": require_once "io/project.io.php"; ProjectIO::detail(); break; case "structure": require_once "io/project.io.php"; ProjectIO::structure(); break; // Project Log // Project Log case "log": require_once "io/project_log.io.php"; ProjectLogIO::list_project_related_logs(); break; // Tasks and Schedule // Tasks and Schedule case "add_task": require_once "io/project_task.io.php"; ProjectTaskIO::add(); break; case "schedule": case "show_tasks": require_once "io/project_task.io.php"; ProjectTaskIO::show(); break; case "task_detail": require_once "io/project_task.io.php"; ProjectTaskIO::detail(); break; case "task_delete": require_once "io/project_task.io.php"; ProjectTaskIO::delete(); break; case "task_edit_start": require_once "io/project_task.io.php"; ProjectTaskIO::edit_start(); break; case "task_edit_end": require_once "io/project_task.io.php"; ProjectTaskIO::edit_end(); break; // Administration // Administration case "admin": require_once "io/project_admin.io.php"; ProjectAdminIO::menu(); break; case "admin_rename": require_once "io/project_admin.io.php"; ProjectAdminIO::rename(); break; case "admin_chown": require_once "io/project_admin.io.php"; ProjectAdminIO::chown(); break; case "admin_move": require_once "io/project_admin.io.php"; ProjectAdminIO::move(); break; case "admin_quota": require_once "io/project_admin.io.php"; ProjectAdminIO::quota(); break; // Administration - Permission // Administration - Permission case "admin_permission": require_once "io/project_admin.io.php"; $project_admin_io = new ProjectAdminIO(); ProjectAdminIO::permission(); break; case "admin_permission_add_user": require_once "io/project_admin.io.php"; ProjectAdminIO::permission_add_user(); break; case "admin_permission_add_group": require_once "io/project_admin.io.php"; ProjectAdminIO::permission_add_group(); break; case "admin_permission_add_ou": require_once "io/project_admin.io.php"; ProjectAdminIO::permission_add_organisation_unit(); break; case "admin_permission_edit": require_once "io/project_admin.io.php"; ProjectAdminIO::permission_edit(); break; case "admin_permission_delete": require_once "io/project_admin.io.php"; ProjectAdminIO::permission_delete(); break; // Item Lister // Item Lister case "item_list": if ($project_security->is_access(1, false) == true) { if ($_GET['dialog']) { if ($_GET['dialog'] == "data") { $path_stack_array = array(); $folder_id = ProjectFolder::get_folder_by_project_id($_GET['project_id']); $folder = Folder::get_instance($folder_id); $init_array = $folder->get_object_id_path(); foreach ($init_array as $key => $value) { $temp_array = array(); $temp_array['virtual'] = false; $temp_array['id'] = $value; array_unshift($path_stack_array, $temp_array); } if (!$_GET['folder_id']) { $session->write_value("stack_array", $path_stack_array, true); } } $module_dialog = ModuleDialog::get_by_type_and_internal_name("item_list", $_GET['dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $module_dialog['class']::$module_dialog['method']("project", $_GET['project_id'], true); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogMissingException(); } } else { throw new ProjectSecurityAccessDeniedException(); } break; // Item Add // Item Add case "item_add": case "item_edit": if ($project_security->is_access(3, false) == true) { if ($_GET['dialog']) { if ($_GET['run'] == "item_add") { $module_dialog = ModuleDialog::get_by_type_and_internal_name("item_add", $_GET['dialog']); } elseif ($_GET['run'] == "item_edit") { $module_dialog = ModuleDialog::get_by_type_and_internal_name("item_edit", $_GET['dialog']); } if (is_array($module_dialog) and $module_dialog['class_path']) { if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $project = new Project($_GET['project_id']); $project_item = new ProjectItem($_GET['project_id']); $project_item->set_status_id($project->get_current_status_id()); $project_item->set_gid($_GET['key']); $description_required = $project_item->is_description_required(); $keywords_required = $project_item->is_keywords_required(); if ($description_required and !$_POST['description'] and !$_GET['idk_unique_id'] or $keywords_required and !$_POST['keywords'] and !$_GET['idk_unique_id']) { require_once "core/modules/item/io/item.io.php"; ItemIO::information(http_build_query($_GET), $description_required, $keywords_required); } else { $current_status_requirements = $project->get_current_status_requirements($project->get_current_status_id()); if ($_GET['run'] == "item_add") { $module_dialog['class']::$module_dialog['method']($current_status_requirements[$_GET['key']]['type_id'], $current_status_requirements[$_GET['key']]['category_id'], "Project", $_GET['project_id'], $_GET['key']); } elseif ($_GET['run'] == "item_edit") { $module_dialog['class']::$module_dialog['method']($current_status_requirements[$_GET['key']]['fulfilled'][0]['item_id']); } } } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogNotFoundException(); } } else { throw new BaseModuleDialogMissingException(); } } else { throw new ProjectSecurityAccessDeniedException(); } break; // Sub Item Add and Edit // Sub Item Add and Edit case "sub_item_add": case "sub_item_edit": if ($project_security->is_access(3, false) == true) { if ($_GET['parent']) { if (is_numeric($_GET['parent_id'])) { if (is_numeric($_GET['key'])) { $item_handling_class = Item::get_handling_class_by_type($_GET['parent']); if (class_exists($item_handling_class)) { $item_io_handling_class = $item_handling_class::get_item_add_io_handling_class(); if (file_exists("core/modules/" . $item_io_handling_class[0])) { require_once "core/modules/" . $item_io_handling_class[0]; if (class_exists($item_io_handling_class[1])) { if ($_GET['run'] == "sub_item_add") { $item_io_handling_class[1]::item_add_edit_handler("add"); } elseif ($_GET['run'] == "sub_item_edit") { $item_io_handling_class[1]::item_add_edit_handler("edit"); } } else { throw new ItemAddIOClassNotFoundException(); } } else { throw new ItemAddIOFileNotFoundException(); } } else { throw new ItemHandlerClassNotFoundException(); } } else { throw new ItemPositionIDMissingException(); } } else { throw new ItemParentIDMissingException(); } } else { throw new ItemParentTypeMissingException(); } } else { throw new ProjectSecurityAccessDeniedException(); } break; // Extension /** * @todo type filter */ // Extension /** * @todo type filter */ case "extension": if ($_GET['extension']) { $extension_id = Extension::get_id_by_identifier($_GET['extension']); if ($extension_id) { $extension = new Extension($extension_id); $main_file = constant("EXTENSION_DIR") . "/" . $extension->get_folder() . "/" . $extension->get_main_file(); $main_class = $extension->get_class(); if (file_exists($main_file)) { require_once $main_file; if (class_exists($main_class)) { $project = new Project($_GET['project_id']); $project_item = new ProjectItem($_GET['project_id']); $project_status_requirements = $project->get_current_status_requirements(); if (is_array($project_status_requirements) and count($project_status_requirements) >= 1) { foreach ($project_status_requirements as $key => $value) { if ($value['element_type'] == "extension" and $value['extension'] == $_GET['extension']) { if (is_array($value['filter']) and count($value['filter']) >= 1) { $filter_array = $value['filter']; } else { $filter_array = null; } break; } } } else { throw new ProjectStatusWithoutExtensionException(); } if ($filter_array) { $item_array = array(); foreach ($filter_array as $key => $value) { if (is_numeric($value['status'])) { $item_array = array_merge($item_array, $project_item->get_project_status_items($value['status'], true)); } } } else { $item_array = $project_item->get_project_items(true); } $event_identifier = uniqid("", true); if ($session->is_value("PROJECT_EXTENSION_EVENT_IDENTIFIER_ARRAY")) { $project_extension_event_identifier_array = $session->read_value("PROJECT_EXTENSION_EVENT_IDENTIFIER_ARRAY"); $project_extension_event_identifier_array[$event_identifier] = $_GET['project_id']; } else { $project_extension_event_identifier_array = array(); $project_extension_event_identifier_array[$event_identifier] = $_GET['project_id']; } $session->write_value("PROJECT_EXTENSION_EVENT_IDENTIFIER_ARRAY", $project_extension_event_identifier_array); $main_class::set_event_identifier($event_identifier); $main_class::set_target_folder_id(ProjectStatusFolder::get_folder_by_project_id_and_project_status_id($_GET['project_id'], $project->get_current_status_id())); $main_class::push_data($item_array); } else { throw new BaseExtensionClassNotFoundException(); } } else { throw new BaseExtensionFileNotFoundException(); } } else { throw new BaseExtensionNotFoundException(); } } else { throw new BaseExtensionMissingException(); } break; // Common Dialogs // Common Dialogs case "common_dialog": require_once "core/modules/base/common.request.php"; CommonRequest::common_dialog(); break; // Default // Default default: require_once "io/project.io.php"; ProjectIO::list_user_related_projects(null); break; } } else { require_once "io/project.io.php"; ProjectIO::list_user_related_projects(null); } }
/** * @param string $alias * @throws BaseModuleDialogMethodNotFoundException * @throws BaseModuleDialogClassNotFoundException * @throws BaseModuleDialogFileNotFoundException * @throws BaseModuleDialogMissingException * @throws BaseUserAccessDeniedException */ public static function io_handler($alias) { global $user; if ($user->is_admin()) { switch ($_GET['run']) { case "general_admin": require_once "core/modules/base/io/admin/admin_general.io.php"; AdminGeneralIO::handler(); break; case "include_admin": require_once "core/modules/base/io/admin/admin_base_include.io.php"; AdminBaseIncludeIO::handler(); break; case "module_admin": require_once "core/modules/base/io/admin/admin_base_module.io.php"; AdminBaseModuleIO::handler(); break; case "navigation": require_once "core/modules/base/io/admin/admin_base_navigation.io.php"; AdminBaseNavigationIO::handler(); break; case "registry": require_once "core/modules/base/io/admin/admin_base_registry.io.php"; AdminBaseRegistryIO::handler(); break; case "services": require_once "core/modules/base/io/admin/admin_base_service.io.php"; AdminBaseServiceIO::handler(); break; case "system_log": require_once "core/modules/base/io/admin/admin_system_log.io.php"; AdminSystemLogIO::handler(); break; case "system_message": require_once "core/modules/base/io/admin/admin_system_message.io.php"; AdminSystemMessageIO::handler(); break; // Organisation // Organisation case "organisation": if ($_GET['dialog']) { $module_dialog = ModuleDialog::get_by_type_and_internal_name("organisation_admin", $_GET['dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $module_dialog['class']::$module_dialog['method']($sql); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogMissingException(); } break; // Modules // Modules case "module": if ($_GET['dialog']) { $module_dialog = ModuleDialog::get_by_type_and_internal_name("module_admin", $_GET['dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $module_dialog['class']::$module_dialog['method']($sql); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogMissingException(); } break; // Module Value Change // Module Value Change case "module_value_change": if ($_GET['dialog']) { $module_dialog = ModuleDialog::get_by_type_and_internal_name("module_value_change", $_GET['dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $module_dialog['class']::$module_dialog['method']($sql); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogMissingException(); } break; default: require_once "io/admin.io.php"; AdminIO::home(); break; } } else { throw new BaseUserAccessDeniedException(); } }
/** * @param string $alias * @throws BaseModuleDialogMethodNotFoundException * @throws BaseModuleDialogClassNotFoundException * @throws BaseModuleDialogFileNotFoundException * @throws BaseModuleDialogMissingException */ public static function io_handler($alias) { global $user; if (isset($_GET['run']) and $_GET['run'] == "common_dialog" and isset($_GET['dialog'])) { require_once "common.request.php"; CommonRequest::common_dialog(); } else { switch ($alias) { case "search": switch ($_GET['run']) { case "search": require_once "io/search.io.php"; SearchIO::search($_GET['dialog']); break; case "header_search": require_once "io/search.io.php"; SearchIO::header_search($_POST['string'], $_POST['current_module']); break; default: require_once "io/search.io.php"; SearchIO::main(); break; } break; default: if (isset($_GET['run'])) { switch ($_GET['run']) { // BASE case "sysmsg": require_once "io/base.io.php"; BaseIO::list_system_messages(); break; case "system_info": require_once "io/base.io.php"; BaseIO::system_info(); break; case "software_info": require_once "io/base.io.php"; BaseIO::software_info(); break; case "license": require_once "io/base.io.php"; BaseIO::license(); break; case "base_user_lists": if ($_GET['dialog']) { $module_dialog = ModuleDialog::get_by_type_and_internal_name("base_user_lists", $_GET['dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $module_dialog['class']::$module_dialog['method'](); } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogMissingException(); } break; // USER // USER case "user_profile": require_once "io/user.io.php"; UserIO::profile(); break; case "user_details": require_once "io/user.io.php"; UserIO::details(); break; case "user_change_personal": require_once "io/user.io.php"; UserIO::change_personal(); break; case "user_change_my_settings": require_once "io/user.io.php"; UserIO::change_my_settings(); break; case "user_change_password": require_once "io/user.io.php"; UserIO::change_password(); break; default: require_once "io/home.io.php"; break; } } else { require_once "io/home.io.php"; } break; } } }
private static function detail_home() { global $user; $user_id = $_GET['id']; $template = new HTMLTemplate("base/user/admin/user/detail.html"); $current_user = new User($user_id); $current_user_regional = new Regional($user_id); // General if ($user_id == $user->get_user_id()) { $template->set_var("change_username", false); if ($user_id == 1) { $template->set_var("is_not_system", false); } else { $template->set_var("is_not_system", true); } } else { if ($user_id == 1) { $template->set_var("change_username", false); $template->set_var("is_not_system", false); } else { $template->set_var("change_username", true); $template->set_var("is_not_system", true); } } $paramquery = $_GET; $paramquery['action'] = "rename"; $params = http_build_query($paramquery, '', '&'); $template->set_var("username", $current_user->get_username()); $template->set_var("rename_params", $params); $template->set_var("fullname", $current_user->get_full_name(false)); $paramquery = $_GET; $paramquery['action'] = "change_mail"; $params = http_build_query($paramquery, '', '&'); $template->set_var("mail", $current_user->get_profile("mail")); $template->set_var("change_mail_params", $params); $paramquery = $_GET; $paramquery['action'] = "change_password"; $params = http_build_query($paramquery, '', '&'); $template->set_var("change_password_params", $params); // Administrative Settings $paramquery = $_GET; $paramquery['action'] = "change_boolean_entry"; $paramquery['aspect'] = "mc_password"; $params = http_build_query($paramquery, '', '&'); $template->set_var("mc_password_params", $params); if ($current_user->get_boolean_user_entry("must_change_password") == true) { $template->set_var("mc_password", "yes"); } else { $template->set_var("mc_password", "no"); } $paramquery = $_GET; $paramquery['action'] = "change_boolean_entry"; $paramquery['aspect'] = "cc_password"; $params = http_build_query($paramquery, '', '&'); $template->set_var("cc_password_params", $params); if ($current_user->get_boolean_user_entry("can_change_password") == true) { $template->set_var("cc_password", "yes"); } else { $template->set_var("cc_password", "no"); } $paramquery = $_GET; $paramquery['action'] = "change_boolean_entry"; $paramquery['aspect'] = "secure_password"; $params = http_build_query($paramquery, '', '&'); $template->set_var("secure_password_params", $params); if ($current_user->get_boolean_user_entry("secure_password") == true) { $template->set_var("secure_password", "yes"); } else { $template->set_var("secure_password", "no"); } $paramquery = $_GET; $paramquery['action'] = "change_boolean_entry"; $paramquery['aspect'] = "block_write"; $params = http_build_query($paramquery, '', '&'); $template->set_var("block_write_params", $params); if ($current_user->get_boolean_user_entry("block_write") == true) { $template->set_var("block_write", "yes"); } else { $template->set_var("block_write", "no"); } $paramquery = $_GET; $paramquery['action'] = "change_boolean_entry"; $paramquery['aspect'] = "create_folder"; $params = http_build_query($paramquery, '', '&'); $template->set_var("create_folder_params", $params); if ($current_user->get_boolean_user_entry("create_folder") == true) { $template->set_var("create_folder", "yes"); } else { $template->set_var("create_folder", "no"); } $paramquery = $_GET; $paramquery['action'] = "change_boolean_entry"; $paramquery['aspect'] = "user_locked"; $params = http_build_query($paramquery, '', '&'); $template->set_var("locked_params", $params); if ($current_user->get_boolean_user_entry("user_locked") == true) { $template->set_var("locked", "yes"); } else { $template->set_var("locked", "no"); } $paramquery = $_GET; $paramquery['action'] = "change_boolean_entry"; $paramquery['aspect'] = "user_inactive"; $params = http_build_query($paramquery, '', '&'); $template->set_var("inactive_params", $params); if ($current_user->get_boolean_user_entry("user_inactive") == true) { $template->set_var("inactive", "yes"); } else { $template->set_var("inactive", "no"); } // Module Settings $user_module_settings_dialog_array = ModuleDialog::list_dialogs_by_type("user_module_detail_setting"); if (is_array($user_module_settings_dialog_array) and count($user_module_settings_dialog_array) >= 1) { $module_settings_array = array(); $module_settings_counter = 0; foreach ($user_module_settings_dialog_array as $key => $value) { if (file_exists($value['class_path'])) { require_once $value['class_path']; $module_settings_return = $value['class']::$value['method']($user_id); $module_settings_array[$module_settings_counter]['title'] = Language::get_message($value['language_address'], "dialog"); $module_settings_array[$module_settings_counter]['value'] = $module_settings_return['value']; $module_settings_array[$module_settings_counter]['params'] = $module_settings_return['params']; $module_settings_counter++; } } $template->set_var("module_settings_array", $module_settings_array); $template->set_var("module_settings", true); } else { $template->set_var("module_settings", false); } // User Settings $paramquery = $_GET; $paramquery['action'] = "change_language"; $params = http_build_query($paramquery, '', '&'); $language = new Language($current_user_regional->get_language_id()); $template->set_var("language", $language->get_full_name()); $template->set_var("language_params", $params); $paramquery = $_GET; $paramquery['action'] = "change_timezone"; $params = http_build_query($paramquery, '', '&'); $timezone = new Timezone($current_user_regional->get_timezone_id()); $template->set_var("timezone", $timezone->get_name()); $template->set_var("timezone_params", $params); $template->output(); }
/** * Main Controller for reqeusts via index.php * @throws BaseModuleControllerClassNotFoundException * @throws BaseModuleControllerFileNotFoundException */ public static function io() { global $session, $user, $transaction; $template = new HTMLTemplate("index_header.html"); if (!isset($GLOBALS['fatal_error'])) { $unique_id = uniqid(); $css_directory = constant("WWW_DIR") . "/css"; if (file_exists($css_directory)) { $css_directory_array = scandir($css_directory); if (is_array($css_directory_array)) { $index_css = ""; foreach ($css_directory_array as $key => $value) { if (strpos(strrev($value), "ssc.") === 0 and strpos(strrev($value), "ssc.gubed") === false and $value != "main.css") { if (is_file($css_directory . "/" . $value)) { if (constant("AVOID_CSS_CACHE") == true) { $index_css .= "<link rel='stylesheet' type='text/css' href='css/" . $value . "?" . $unique_id . "' title='Style' />\n"; } else { $index_css .= "<link rel='stylesheet' type='text/css' href='css/" . $value . "' title='Style' />\n"; } } } } } $template->set_var("INDEX_CSS", $index_css); } $index_js = ""; $js_lib_directory = constant("WWW_DIR") . "/js/lib"; if (file_exists($js_lib_directory)) { $js_lib_directory_array = scandir($js_lib_directory); if (is_array($js_lib_directory_array)) { $index_js = ""; foreach ($js_lib_directory_array as $key => $value) { if (strpos(strrev($value), "sj.") === 0) { if (is_file($js_lib_directory . "/" . $value)) { if (constant("AVOID_JS_CACHE") == true) { $index_js .= "<script type='text/javascript' src='js/lib/" . $value . "?" . $unique_id . "'></script>\n"; } else { $index_js .= "<script type='text/javascript' src='js/lib/" . $value . "'></script>\n"; } } } } } } $js_modules_directory = constant("WWW_DIR") . "/js/modules"; if (file_exists($js_modules_directory)) { $js_modules_directory_array = scandir($js_modules_directory); if (is_array($js_modules_directory_array)) { foreach ($js_modules_directory_array as $key => $value) { if (strpos(strrev($value), "sj.") === 0) { if (is_file($js_modules_directory . "/" . $value)) { if (constant("AVOID_JS_CACHE") == true) { $index_js .= "<script type='text/javascript' src='js/modules/" . $value . "?" . $unique_id . "'></script>\n"; } else { $index_js .= "<script type='text/javascript' src='js/modules/" . $value . "'></script>\n"; } } } } } } if ($index_js) { $template->set_var("INDEX_JS", $index_js); } else { $template->set_var("INDEX_JS", " "); } } else { $template->set_var("INDEX_CSS", "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/base.css\" title=\"Style\" />\n<link rel=\"stylesheet\" type=\"text/css\" href=\"css/login.css\" title=\"Style\" />"); $template->set_var("INDEX_JS", ""); } if (!isset($GLOBALS['fatal_error'])) { $template->set_var("INDEX_TITLE", Registry::get_value("base_html_title")); if (Cron::check() == true) { $template->set_var("CRON", true); } else { $template->set_var("CRON", false); } $template->output(); $max_ip_errors = (int) Registry::get_value("base_max_ip_failed_logins"); if (!is_numeric($max_ip_errors) or $max_ip_errors < 3) { $max_ip_errors = 3; } if (Security::ip_error_count() < $max_ip_errors) { $session_valid_array = $session->is_valid(); if ($session_valid_array[0] === true) { $template = new HTMLTemplate("main_header.html"); $sub_menu = array(); $module_dialog_array = ModuleDialog::list_dialogs_by_type("base_user_lists"); if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) { foreach ($module_dialog_array as $key => $value) { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = "base"; $paramquery['run'] = "base_user_lists"; $paramquery['dialog'] = $value['internal_name']; $params = http_build_query($paramquery, '', '&'); $temp_array = array(); $temp_array['params'] = $params; $temp_array['title'] = Language::get_message($value['language_address'], "dialog"); array_push($sub_menu, $temp_array); unset($temp_array); } } $template->set_var("sub_menu", $sub_menu); $my_profile_paramquery['username'] = $_GET['username']; $my_profile_paramquery['session_id'] = $_GET['session_id']; $my_profile_paramquery['nav'] = "base"; $my_profile_paramquery['run'] = "user_profile"; $my_profile_params = http_build_query($my_profile_paramquery, '', '&'); $template->set_var("my_profile_params", $my_profile_params); $system_messages_paramquery['username'] = $_GET['username']; $system_messages_paramquery['session_id'] = $_GET['session_id']; $system_messages_paramquery['nav'] = "base"; $system_messages_paramquery['run'] = "sysmsg"; $system_messages_params = http_build_query($system_messages_paramquery, '', '&'); $template->set_var("system_messages_params", $system_messages_params); $about_paramquery['username'] = $_GET['username']; $about_paramquery['session_id'] = $_GET['session_id']; $about_paramquery['nav'] = "base"; $about_paramquery['run'] = "system_info"; $about_params = http_build_query($about_paramquery, '', '&'); $template->set_var("about_params", $about_params); $template->set_var("username", $user->get_full_name(true)); $header_search_paramquery['username'] = $_GET['username']; $header_search_paramquery['session_id'] = $_GET['session_id']; $header_search_paramquery['nav'] = "base.search"; $header_search_paramquery['run'] = "header_search"; $header_search_paramquery['nextpage'] = "1"; $header_search_params = http_build_query($header_search_paramquery, '', '&'); $template->set_var("header_search_params", $header_search_params); $template->set_var("header_search_current_module", $_GET['nav']); $template->output(); try { // Navigation require_once "base/io/navigation.io.php"; Navigation_IO::main(); Navigation_IO::left(); $template = new HTMLTemplate("content_header.html"); $template->output(); if ($session->read_value("must_change_password") == true) { require_once "core/modules/base/io/user.io.php"; UserIO::change_password_on_login(); } else { if ($_GET['nav']) { $module_controller_array = SystemHandler::get_module_controller($_GET['nav']); $module_controller_path = "core/modules/" . $module_controller_array['path']; if (file_exists($module_controller_path)) { require_once $module_controller_path; if (class_exists($module_controller_array['class'])) { $module_controller_array['class']::io_handler($module_controller_array['alias']); } else { throw new BaseModuleControllerClassNotFoundException(); } } else { throw new BaseModuleControllerFileNotFoundException(); } } else { include "core/modules/base/io/home.io.php"; } } } catch (DatabaseQueryFailedException $e) { $transaction->force_rollback(); $error_io = new Error_IO($e); $error_io->display_error(); } catch (BaseException $e) { $error_io = new Error_IO($e); $error_io->display_error(); } $template = new HTMLTemplate("content_footer.html"); $template->output(); $template = new HTMLTemplate("main_footer.html"); $template->output(); } else { require_once "base/io/login.io.php"; if ($session_valid_array[1] === true) { Login_IO::output(true); } else { Login_IO::output(false); } } } else { Error_IO::security_out_of_box_error("Your IP was blocked by server!"); } } else { $template->set_var("INDEX_TITLE", "Open-LIMS"); $template->output(); Error_IO::fatal_error($GLOBALS['fatal_error']); } $template = new HTMLTemplate("index_footer.html"); $template->output(); }
/** * @return object * @throws SampleIDMissingException * @throws BaseReportTCPDFClassMissingException */ public static function get_full_report() { if (class_exists("TCPDF")) { if ($_GET['sample_id']) { $sample_id = $_GET['sample_id']; $sample = new Sample($sample_id); $owner = new User($sample->get_owner_id()); $owner_name = str_replace(" ", " ", $owner->get_full_name(false)); $paper_size_info_array = PaperSize::get_standard_size(); $format = array($paper_size_info_array['width'], $paper_size_info_array['height']); if ($paper_size_info_array['width'] >= $paper_size_info_array['height']) { $orientation = "L"; } else { $orientation = "P"; } $pdf = new SamplePDF($sample_id, $sample->get_name(), $orientation, "mm", $format, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Open-LIMS'); $pdf->SetTitle('Sample Report'); $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins($paper_size_info_array['margin_left'], $paper_size_info_array['margin_top'] * 3, $paper_size_info_array['margin_right']); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, $paper_size_info_array['margin_bottom']); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setLanguageArray($l); $pdf->setFontSubsetting(true); $pdf->SetFont('dejavusans', '', 14, '', true); $pdf->AddPage(); $print_sample_id = "S" . str_pad($sample_id, 8, '0', STR_PAD_LEFT); $pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0); $pdf->SetFillColor(255, 255, 255); $pdf->SetTextColor(0, 0, 0); $pdf->MultiCell(90, 0, "ID", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); $pdf->MultiCell(100, 0, $print_sample_id, 1, '', 1, 1, '', '', true, 0, false, true, 0); $pdf->MultiCell(90, 0, "Name", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); $pdf->MultiCell(100, 0, $sample->get_name(), 1, '', 1, 1, '', '', true, 0, false, true, 0); $pdf->MultiCell(90, 0, "Type/Template", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); $pdf->MultiCell(100, 0, $sample->get_template_name(), 1, '', 1, 1, '', '', true, 0, false, true, 0); $pdf->MultiCell(90, 0, "Owner", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); $pdf->MultiCell(100, 0, $owner_name, 1, '', 1, 1, '', '', true, 0, false, true, 0); $pdf->MultiCell(90, 0, "Status", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); if ($sample->get_availability() == true) { $pdf->MultiCell(100, 0, "available", 1, '', 1, 1, '', '', true, 0, false, true, 0); } else { $pdf->MultiCell(100, 0, "not available", 1, '', 1, 1, '', '', true, 0, false, true, 0); } $pdf->MultiCell(90, 0, "Date/Time", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); $datetime = new DatetimeHandler($sample->get_datetime()); $pdf->MultiCell(100, 0, $datetime->get_datetime(false), 1, '', 1, 1, '', '', true, 0, false, true, 0); if ($sample->get_manufacturer_id()) { $manufacturer = new Manufacturer($sample->get_manufacturer_id()); $pdf->MultiCell(90, 0, "Manufacturer", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); $pdf->MultiCell(100, 0, $manufacturer->get_name(), 1, '', 1, 1, '', '', true, 0, false, true, 0); } if ($sample->get_date_of_expiry()) { $pdf->MultiCell(90, 0, "Date of Expiry", 1, 'L', 1, 0, '', '', true, 0, false, true, 0); $date_of_expiry = new DatetimeHandler($sample->get_date_of_expiry()); $pdf->MultiCell(100, 0, $date_of_expiry->get_date(), 1, '', 1, 1, '', '', true, 0, false, true, 0); } $module_dialog_array = ModuleDialog::list_dialogs_by_type("item_report"); 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'])) { if (method_exists($value['class'], $value['method'])) { $sql = " SELECT item_id FROM " . constant("SAMPLE_HAS_ITEM_TABLE") . " WHERE sample_id = " . $_GET['sample_id'] . ""; $pdf = $value['class']::$value['method']($sql, $sample->get_item_id(), $pdf); } } } } } return $pdf; } else { throw new SampleIDMissingException(); } } else { throw new BaseReportTCPDFClassMissingException(); } }
require_once "libraries/tcpdf/tcpdf.php"; } else { throw new BaseReportTCPDFFileMissingException(); } if ($_GET['session_id']) { $transaction = new Transaction(); $system_handler = new SystemHandler(false); Security::protect_session(); $session = new Session($_GET['session_id']); $user = new User($session->get_user_id()); $regional = new Regional(); $session_valid_array = $session->is_valid(); if ($session_valid_array[0] === true) { if ($_GET['dialog']) { require_once "core/modules/base/report/report_table.io.php"; $module_dialog = ModuleDialog::get_by_type_and_internal_name("report", $_GET['dialog']); if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $pdf = $module_dialog['class']::$module_dialog['method'](); if (is_object($pdf)) { $pdf->Output(); } else { throw new BaseReportException(); } } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException();
$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']); unset($paramquery['action']); unset($paramquery['run']); $params = http_build_query($paramquery, '', '&'); $template->set_var("GET_HELP", "index.php?" . $params); // Today Screen $module_dialog_array = ModuleDialog::list_dialogs_by_type("home_today_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();
/** * @param string $role * @throws ItemParentIDMissingException * @throws ItemPositionIDMissingException * @throws BaseModuleDialogMethodNotFoundException * @throws BaseModuleDialogClassNotFoundException * @throws BaseModuleDialogFileNotFoundException * @throws BaseModuleDialogNotFoundException * @throws SampleSecurityAccessDeniedException * @throws BaseModuleDialogMissingException */ public static function item_add_edit_handler($role = "add") { if ($_GET['dialog']) { if (!is_numeric($_GET['parent_id'])) { throw new ItemParentIDMissingException(); } if (!is_numeric($_GET['key'])) { throw new ItemPositionIDMissingException(); } $sample = new Sample($_GET['parent_id']); $sample_security = new SampleSecurity($_GET['parent_id']); if ($sample_security->is_access(2, false) == true) { if ($role == "add") { $module_dialog = ModuleDialog::get_by_type_and_internal_name("item_add", $_GET['dialog']); } elseif ($role == "edit") { $module_dialog = ModuleDialog::get_by_type_and_internal_name("item_edit", $_GET['dialog']); } if (is_array($module_dialog) and $module_dialog['class_path']) { if (file_exists($module_dialog['class_path'])) { require_once $module_dialog['class_path']; if (class_exists($module_dialog['class'])) { if (method_exists($module_dialog['class'], $module_dialog['method'])) { $sample_item = new SampleItem($_GET['parent_id']); $sample_item->set_gid($_GET['key']); $current_requirements = $sample->get_requirements(); if ($role == "add") { $module_dialog['class']::$module_dialog['method']($current_requirements[$_GET['key']]['type_id'], $current_requirements[$_GET['key']]['category_id'], "Sample", $_GET['parent_id'], $_GET['key']); } elseif ($role == "edit") { $module_dialog['class']::$module_dialog['method']($current_requirements[$_GET['key']]['fulfilled'][0]['item_id']); } } else { throw new BaseModuleDialogMethodNotFoundException(); } } else { throw new BaseModuleDialogClassNotFoundException(); } } else { throw new BaseModuleDialogFileNotFoundException(); } } else { throw new BaseModuleDialogNotFoundException(); } } else { throw new SampleSecurityAccessDeniedException(); } } else { throw new BaseModuleDialogMissingException(); } }