"", "result" => "", "table" => "", "header" => "", "footer" => "", ); //---------------------------- // request parameter //---------------------------- $qProjectID = isset($_SESSION["project_id"]) ? $_SESSION["project_id"] : REQ_NON; $qLimit = isset($_REQUEST["q_limit"]) ? $_REQUEST["q_limit"] : REQ_NON; $qOffset = isset($_REQUEST["q_offset"]) ? $_REQUEST["q_offset"] : REQ_NON; //---------------------------- // judge post //---------------------------- //---------------------------- // set types //---------------------------- Util::setType($qProjectID, "int"); Util::setType($qLimit, "int"); Util::setType($qOffset, "int"); //---------------------------- // Auth-Before validate //---------------------------- if ( $result === RES_OK ){ if ( ! Validate::isNumeric($qProjectID) ){ $result = RES_NG; $gResult->push("{$WORD($wk, 1)}"); } } //---------------------------- // Auth //---------------------------- if ( $result === RES_OK ){ $auth = Auth::instance("document"); if( ! $auth->readList($qProjectID) ){ $result = RES_NG; $gResult->push("{$WORD($wk, 2)}"); } } //---------------------------- // Auth-After validate //---------------------------- if ( $result === RES_OK ){ if ( ! Validate::isNumeric($qLimit) ){ $qLimit = HTML_LIMIT; } if ( ! Validate::isNumeric($qOffset) ){ $qOffset = HTML_OFFSET; } } //---------------------------- // function //---------------------------- //---------------------------- // process //---------------------------- if ( $result === RES_OK ){ $objDAODocument = DAO::instance("document"); $objViewDocument = View::instance("document"); // 文書一覧取得 -------------------- if ( $result === RES_OK ){ $objDAODocument->setAuth($auth); $resDAODocument = $objDAODocument->get(NULL, array_keys(DAO::T_DOCUMENT_STATE_VALID_TABLE()), NULL, $qProjectID, NULL, $qLimit, $qOffset); $result = $resDAODocument["result"]; if ( $result === RES_NG ){ $gResult->push("{$WORD($wk, 3)}"); } else { $arrHtml["table"] = $objViewDocument->table($resDAODocument["data"]); if ( $result === RES_OK ){ $arrHtml["header"] = Printer::paginationTableHeader(TRUE, ".", $_REQUEST, $resDAODocument["count"], $qLimit, $qOffset, 10); $arrHtml["footer"] = Printer::paginationTableFooter(TRUE, ".", $_REQUEST, $resDAODocument["count"], $qLimit, $qOffset, 10); } else { $gResult->push("{$WORD($wk, 4)}"); } } } } //---------------------------- // menu //---------------------------- { // menu ---------------------------------------------------------------- if ( $result !== RES_NG ){ $arrMenu = array(); //----- $arrMenu[0] = $objViewDocument->tab(View_document::TAB_LIST, $auth, $qProjectID); $arrMenu[1] = $objViewDocument->tab(View_document::TAB_NEW, $auth, $qProjectID); if ( $result === RES_OK ){ $arrMenu[2] = $objViewDocument->tab(View_document::TAB_DIFF, $auth, $qProjectID); } $arrMenu[3] = $objViewDocument->tab(View_document::TAB_SEARCH, $auth, $qProjectID); $arrMenu[4] = $objViewDocument->tab(View_document::TAB_DOWNLOAD_ALL, $auth, $qProjectID); //----- $arrHtml["menu"] = Printer::menuTab($arrMenu, 0); } // title --------------------------------------------------------------- $title = "{$WORD($wk, 5)}"; // form ---------------------------------------------------------------- if ( $result === RES_NG ){ // アクション(OK) $arrHtml["footer"] = Printer::link("OK", "btn btn-default", NULL, NULL, "/content/project/"); } // result -------------------------------------------------------------- $arrHtml["result"] = $gResult->string(TRUE, $result); } ?>