function define_workspace($workflow_id)
{
    global $user;
    if ($workflow_id == "0" || empty($workflow_id)) {
        return drupal_access_denied();
    }
    if (Workflow_Users::doesWorkflowHaveUserName($workflow_id, $user->name) && Workflow_Permission::doesWorkflowHavePermission($workflow_id, "canAnalyzeSpecimen")) {
        $apiary_session_base = $user->name . '_' . $workflow_id . '_';
        if (empty($_SESSION['apiary_session_id'])) {
            $_SESSION['apiary_session_id'] = $apiary_session_base . date("Ymdhis");
        }
        echo get_workspace_mark_up($workflow_id);
    } else {
        echo "It seems you do not have permission to access this workflow. Please contact administrator for further instructions.";
    }
}
function get_images_list($specimen_pid, $nothing, $workflow_id)
{
    global $user;
    if (Workflow_Users::doesWorkflowHaveUserName($workflow_id, $user->name) && Workflow_Permission::doesWorkflowHavePermission($workflow_id, "canAnalyzeSpecimen")) {
        $image_pids = AP_Specimen::getImageListForSpecimen($specimen_pid);
        echo json_encode($image_pids);
    }
}
Beispiel #3
0
 static function doesWorkflowHavePermission($workflow_id, $permission_name)
 {
     module_load_include('php', 'apiary_project', 'workflow/include/class.Workflow_Permission');
     return Workflow_Permission::doesWorkflowHavePermission($workflow_id, $permission_name);
 }
function template($param1, $param2, $workflow_id)
{
    global $user;
    $returnjs = "";
    if (Workflow_Users::doesWorkflowHaveUserName($workflow_id, $user->name) && Workflow_Permission::doesWorkflowHavePermission($workflow_id, "canTranscribe")) {
    } else {
        $returnjs .= "jQuery.jGrowl('Sorry! You do not have permission for this operation');";
    }
    echo $returnjs;
}
function parse_tab_nav($roi_pid, $size, $parse_level = null)
{
    $parse_tab_nav = '';
    $current_parse_level = '0';
    $msg = '';
    $returnJSON = "";
    $workflow_id = getWorkflowIdFromSessionId($_SESSION['apiary_session_id']);
    if ($roi_pid == 1) {
        $parse_tab_nav = get_empty_parse_tab_nav();
    } else {
        $parse_levels = Workflow_Permission::getParseLevelList($workflow_id);
        if (sizeOf($parse_levels) > 0) {
            if ($parse_level == null || $parse_level == '0' || $parse_level == '') {
                $parse_level = (string) $parse_levels[0];
            }
            if (array_search($parse_level, $parse_levels) > -1) {
                $current_parse_level = $parse_level;
                $parse_tab_nav_array = get_parse_tab_nav($roi_pid, $size, $workflow_id, $parse_levels, $parse_level);
                foreach ($parse_tab_nav_array as $thing => $value) {
                    $returnJSON[$thing] = $value;
                }
            } else {
                $msg = 'This workflow does not have permission to parse at the level requested: ' . $parse_level . '.';
            }
        } else {
            $msg = 'This workflow does not have permission to parse at any level.';
        }
    }
    $returnJSON['current_parse_level'] = $current_parse_level;
    $returnJSON['msg'] = $msg;
    echo json_encode($returnJSON);
}