2012-08-24 5 views
0

설문 조사에서 첫 페이지로 트리 로그인 페이지가 있습니다. 문제는 사용자가 노드를 선택하지 않고 다음 버튼을 클릭하면 동일한 페이지로 리디렉션된다는 것입니다. 문제는 그가 어떤 오류 메시지도받지 않는다는 것입니다.트리 로그인 페이지에 오류 메시지를 표시하지 않습니다.

나는 오류 메시지 이

(PS 표시() 함수를 확인)

나를 어디 수정이 작업을 수행하는 아래 코드로 봐주세요 '그룹을 선택하세요'를 얻기 위해 사용자가 원하는 나는 잘못 가고있다

<?php 
/** 
* File: TreeLoginWidget.php 
* 
* 
* Purpose: display tree page. 
* 
* Dependents: none 
* 
* Dependencies: SurveyItem 
* 
* Classes: 
* 1. PinWidget 
* 
* Interface/public functions: 
* 
* Notes: ??? 
* 
* Todo: none 
* 
**/ 

class DisplayTreeLoginWidget extends DisplayItem 
{ 

    function DisplayTreeLoginWidget(& $sourceObj) 
    { 
     // debug 
     if($pDebugTraceFlag == _ID_FLAG_ON) GDebugTraceFunc(__CLASS__." :: ".__FUNCTION__); 
     $this->node = 0; 
     $surveywidget = getDataFromSession("surveywidget"); 
     DisplayItem::DisplayItem(); 
     $_SESSION["profile"]["rootNode"]=0; 
     if($_GET["nodeId"]) { 
      setDataToSession("postVar",""); 
     } 
     $this->sourceObj =& $sourceObj; 
    } 

    /** 
    * Purpose: display pin page label text 
    * 
    * Input Params: none 
    * 
    * Output Params: none 
    * 
    * Return Value: none 
    * 
    * Notes: 
    */ 

    function display() 
    { 
     global $skin_path,$skin,$path; 
     setDataToSession("skipPage", 0); 
     setDataToSession('HideSave&Resume',0); 
     $currentPageNumber = currentPageNumber(); 
     if($currentPageNumber!=1) { 
      setDataToSession('HideSave&Resume',1); 
     } 

     echo "<script type=\"text/javascript\" src=\"".$path."../lib/java/commonFuncs.js\"></script>"; 

     // include the header 
     include_once ("../lib/include/path.inc.php"); 
     include_once ("../lib/include/jshelper.php"); 
     include_once("display/tree.inc.php"); 
     include_once("display/commonTreeLayout.php"); 
     include_once ("../lib/include/commonTreeCode.php"); 

     setUpTreeAppProperty(); 
     $postVar = getDataFromSession("postVar"); 

     if(is_array($postVar)) { 
      $_POST = $postVar; 
     } 

     if($this->sourceObj->displayType == "expanded") { 
      $postVar["Expand_All"] = "Expand All"; 
      $this->sourceObj->displayType = ""; 
     } 
     if($this->sourceObj->levelShowing != "") { 
      setDataToSession("levelShowing",$this->sourceObj->levelShowing); 
     } 

     setUpElist($postVar, $_GET); 
     $verifiedStartingNode = getTreeStartingNode(); 

     /** $matchedIdArr contains matched nodeIds or empty if no matches found/no search performed */ 
     $matchedIdArr = doSearch($verifiedStartingNode, $postVar); 
     $eList = getEList(); 

     $Tree = new TreeWithRadioButton($this->sourceObj); 

     $Tree->reSetupElist(); 

     $startingNode = &$Tree->nodesArr[$verifiedStartingNode]; 
     echo "<div class=\"body2 IE6trans\">"; 

     displaySearchTable(); 

     if(!$postVar["searchSubmit"]) { 
      $matchedIdArr = array(getDataFromSession("data,node_id")); 
     } 

     displayTree('Search Organization Structure', '', '', $startingNode, $eList, $matchedIdArr, $maxDepth, get_path_prefix(),$this->sourceObj->_errorMsg,$this->sourceObj->_prompt); 

     echo "<script type=\"text/javascript\">"; 
     echo "$(document).ready(function() { $('input[name=\"wildText\"]').keyup(function(event){ if(event.keyCode == 13){ $('input[name=\"searchSubmit\"]').click(); } }); });"; 
     echo "</script>"; 

     echo "</div>"; 
    } 

    /** 
    * Purpose: storing error message to _errorMsg 
    * 
    * Input Params: none 
    * 
    * Output Params: none 
    * 
    * Return Value: Boolean - true or false 
    * 
    * Notes: 
    */ 

    function validate() 
    { 
     // debug 
     if($pDebugTraceFlag == _ID_FLAG_ON) GDebugTraceFunc(__CLASS__." :: ".__FUNCTION__);  
     $surveywidget = getDataFromSession('surveywidget'); 
     $this->getPostData(); 
     $this->sourceObj->_errorMsg = ""; 
     $lastVisitedWidgetOid_Tree = getDataFromSession("lastVisitedWidgetOid_Tree");  
     setDataToSession("lastVisitedWidgetOid" , $lastVisitedWidgetOid_Tree); 

     setLoginUserLanguage($this->node); 

     $operations = ((strcmp($this->operation,getText2($surveywidget->saveResumeButtonText)) == 0)|| 
            (strcmp($this->operation,getText2($surveywidget->backButtonText)) == 0)|| 
            (strcmp($this->operation,getText2($surveywidget->nextButtonText)) == 0)); 

     if(($operations) && ($this->node != "")) { 
      setDataToSession("data,node_id",$this->node); 

      // used to track the node id assigned to this pin when more than one login is used 
      setDataToSession("tree_login,node_id",$this->node); 
      setDataToSession("tree_login_before_saveresume,node_id",$this->node); 


      //Custom - 
      $oids = getListOfOidAndNodes(Array($this->node)); 
      $_SESSION["conditionNodeList"] = $oids; 
      //End Custom 

      if(!getDataFromSession('multiLoginIndex')) { 
       $multiLoginIndex = 1; 
      } else { 
       $multiLoginIndex = getDataFromSession('multiLoginIndex'); 
      } 
      $multiLoginIndex++; 
      setDataToSession("multiLoginIndex",$multiLoginIndex); 

      $this->sourceObj->_errorMsg = ""; 
     } else if(($operations) && ($this->node == "")){ 
      $this->sourceObj->_errorMsg = "Please select a group"; 
      return false; 
     } else { 
      return false; 
     } 

     if($this->node == "") { 
      $this->node = 0; 
     } 
     // user click save&resume before visiting login page, we are redirecting to login page, That time user enter invalid node_id we are mainting save&resume flag to 1 for displaying submitbutton(it act like as save&resume) 
     if(getDataFromSession('save&resumeflag') == 1) { 
      setDataToSession('save&resumeloginpage',1); 
     } 

     return true; 
    } 

    /** 
    * Purpose: get post data 
    * 
    * Input Params: none 
    * 
    * Output Params: none 
    * 
    * Return Value: none 
    * 
    * Notes: 
    */ 

    function getPostData() 
    { 
     // debug 
     if($pDebugTraceFlag == _ID_FLAG_ON) GDebugTraceFunc(__CLASS__." :: ".__FUNCTION__); 
     $postVar["exactText"] = (empty($_REQUEST["exactText"])==1) ?""  :stripslashes($_REQUEST["exactText"]); 
     $postVar["wildText"] =  (empty($_REQUEST["wildText"])==1)  ?""  :stripslashes($_REQUEST["wildText"]); 
     $postVar["searchSubmit"] = (empty($_REQUEST["searchSubmit"])==1) ?""  :$_REQUEST["searchSubmit"]; 
     $postVar["Collapse_All"] = (empty($_REQUEST["Collapse_All"])==1) ?""  :$_REQUEST["Collapse_All"]; 
     $postVar["idText"] =  (empty($_REQUEST["idText"])==1)  ?""  :$_REQUEST["idText"]; 
     $postVar["node"] =   (empty($_REQUEST["node"])==1)   ?""  :$_REQUEST["node"]; 
     $this->node =    ($_REQUEST["node"] == "")    ?""  :$_REQUEST["node"]; 
     $this->operation =   (empty($_REQUEST["Operation"])==1) ?""  :$_REQUEST["Operation"]; 

     if($postVar["Collapse_All"]) { 
      $postVar["wildText"] = ""; 
     } 

     setDataToSession('postVar',$postVar); 
     setDataToSession('Operation',$this->operation); 
     setDataToSession('node',$this->node); 
    } 

} 
?> 

답변

0

코드가 길어서 읽지 않았다.

그러나 일반적인 방법은 url 매개 변수를 전달하는 것입니다. 매개 변수가 존재하면 메시지로 출력하십시오.

+0

Display()에서 바보 같은 실수를하고 있습니다. 불행히도 어디 있는지 모릅니다. – Justin

+0

@Justin 죄송합니다. 사용하는 수업에 대해 아무것도 모릅니다. – Ariel

관련 문제