"", "result" => "", "form" => "", "table" => "", ); //---------------------------- // request parameter //---------------------------- $qProjectID = isset($_SESSION["project_id"]) ? $_SESSION["project_id"] : REQ_NON; $qArrDocID = isset($_REQUEST["q_doc_id"]) ? $_REQUEST["q_doc_id"] : REQ_NON; //---------------------------- // judge post //---------------------------- $isPost = ($qArrDocID !== REQ_NON); //---------------------------- // set types //---------------------------- Util::setType($qProjectID, "int"); Util::setType($qArrDocID, "int"); //---------------------------- // Auth-Before validate //---------------------------- if ( $result === RES_OK ){ if ( ! Validate::isNumeric($qProjectID) ){ $result = RES_NG; $gResult->push("{$WORD($wk, 1)}"); } if ( ! Validate::isArray($qArrDocID) ){ $result = RES_NG; $gResult->push("{$WORD($wk, 2)}"); } } //---------------------------- // Auth //---------------------------- if ( $result === RES_OK ){ $auth = Auth::instance("document"); if( ! $auth->processDiff($qProjectID) ){ $result = RES_NG; $gResult->push("{$WORD($wk, 3)}"); } } //---------------------------- // Auth-After validate //---------------------------- if ( $result === RES_OK ){ } //---------------------------- // function //---------------------------- //---------------------------- // process //---------------------------- if ( $result === RES_OK ){ $objDAODocument = DAO::instance("document"); $objViewDocument = View::instance("document"); // 文書比較 -------------------- if ( $result === RES_OK ){ $objDAODocument->setAuth($auth); $resDAODocument = $objDAODocument->get($qArrDocID, array_keys(DAO::T_DOCUMENT_STATE_VALID_TABLE()), NULL, $qProjectID); $result = $resDAODocument["result"]; if ( $result === RES_OK ){ $arrHtml["form"] = $objViewDocument->diff($resDAODocument["data"]); } else if ( $result === RES_NO_DATA ){ $gResult->push("{$WORD($wk, 4)}"); } else { $gResult->push("{$WORD($wk, 5)}"); } } } //---------------------------- // 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); $arrMenu[2] = $objViewDocument->tab(View_document::TAB_DIFF, $auth, $qProjectID); $arrMenu[3] = $objViewDocument->tab(View_document::TAB_DIFF_SELECT, $auth, $qProjectID); //----- $arrHtml["menu"] = Printer::menuTab($arrMenu, 2); } // title --------------------------------------------------------------- $title = "{$WORD($wk, 6)}"; // form ---------------------------------------------------------------- if ( $result === RES_NG ) { // アクション(OK) $arrHtml["form"] = Printer::link("OK", "btn btn-default", NULL, NULL, "/content/project/"); } // result -------------------------------------------------------------- $arrHtml["result"] = $gResult->string(TRUE, $result); } ?>