コード例 #1
0
ファイル: home.php プロジェクト: Simplon-lyon/donatello-basic
        $currentProjectId = $_SESSION['selected_project_id'];
        $currentProject = $_SESSION['selected_project'];
        //$currentProject = searchWhere( $projects, "id_project", $currentProjectId );
        // print_r( $currentProject );
    } else {
        if (count($projects) > 0) {
            // si aucun item sélectionné et qu'il existe des projets : selectionne le 1er projet
            $currentProject = $projects[0];
            $currentProjectId = $currentProject["id_project"];
            error_log("default project selection {$currentProjectId} » " . $currentProject['title']);
        }
    }
}
// chargement des catégories du projet selectionné
if (isset($currentProjectId)) {
    $projectCategories = getProjectCategories($currentProjectId);
    error_log("projectCategories " . count($projectCategories));
}
?>

<!doctype html>
<html lang="fr_FR">
<head>
    <meta charset="UTF-8">
    <title>Donatello - Home</title>
    <link rel="stylesheet" href="styles/base.css"/>
    <link rel="stylesheet" href="styles/simpllo.css"/>
    <script type="text/javascript" src="js/lib.js"></script>
</head>
<body>
コード例 #2
0
ファイル: export_odt_ajax.php プロジェクト: fg-ok/codev
            // if none defined, get all mantis statuses
            $statusNames = Constants::$statusNames;
            ksort($statusNames);
        }
    }
    $statusList[Constants::$status_new] = array('id' => Constants::$status_new, 'name' => Constants::$statusNames[Constants::$status_new], 'selected' => false);
    foreach ($statusNames as $id => $name) {
        if (Constants::$status_new != $id) {
            $statusList[] = array('id' => $id, 'name' => $name, 'selected' => false);
        }
    }
    return $statusList;
}
// ----------- MAIN ------------
if (Tools::isConnectedUser() && isset($_GET['action'])) {
    if (isset($_GET['action'])) {
        $smartyHelper = new SmartyHelper();
        if ($_GET['action'] == 'updateProject') {
            $projectid = Tools::getSecureGETIntValue('projectid');
            $categories = getProjectCategories($projectid);
            $statusList = getProjectStatusList($projectid);
            $response = array('categoryList' => $categories, 'statusList' => $statusList);
            $jsonResponse = Tools::array2json($response);
            echo "{$jsonResponse}";
        } else {
            Tools::sendNotFoundAccess();
        }
    }
} else {
    Tools::sendUnauthorizedAccess();
}