Пример #1
0
    }
    //end if
    // generate the graph (this dumps either the HTML OR the image contents)
    $graph->StrokeCSIM();
    // if jpgraph is not rendering the image, pull the HTML from the buffer and assign to a variable
    // for template assignment magic
    if (!$is_rendering_image) {
        $gantt_chart = ob_get_clean();
    }
    //end if
    $app->tpl->assign('gantt_chart', $gantt_chart);
    //grab the items
    //------------------------------------------------------------------
    $count = CTSDatabaseAPI::count($glpi_id);
    $app->tpl->assign('count', $count);
    $app->tpl->assign('item', ReserveDatabaseAPI::get_GLPI($glpi_id));
    $app->tpl->assign('glpi_id', $glpi_id);
    $app->tpl->display('single-gantt.tpl');
});
//end equipment/id/item
respond('/equipment/[i:id]?/item/model/[:model]/list/?/[:action]?', function ($request, $response, $app) {
    //this is where the gantt view will be
    $glpi_id = $request->glpi_id;
    $data = ReserveDatabaseAPI::search($request);
    if ($data['redirect_url']) {
        //if there was a redirect url in the data, redirect the user there
        $response->redirect($data['redirect_url']);
    }
    //otherwise assign the title and reservations
    //we only need the first two dates
    if ($request->id) {