소스 검색

#916 Hierarchical selector: clicking on the label now has the same effect as clicking on the radio button itself. (The label is no longer an hyperlink)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3222 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 년 전
부모
커밋
380156b260
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      application/ui.extkeywidget.class.inc.php

+ 4 - 3
application/ui.extkeywidget.class.inc.php

@@ -557,6 +557,7 @@ EOF
 			$aSortedRoots = $aTree[$iRootId];
 			$aSortedRoots = $aTree[$iRootId];
 			asort($aSortedRoots);
 			asort($aSortedRoots);
 			$oP->add("<ul>\n");
 			$oP->add("<ul>\n");
+			$fUniqueId = microtime(true);
 			foreach($aSortedRoots as $id => $sName)
 			foreach($aSortedRoots as $id => $sName)
 			{
 			{
 				if ($bSelect)
 				if ($bSelect)
@@ -564,14 +565,14 @@ EOF
 					$sChecked = ($aNodes[$id]->GetKey() == $currValue) ? 'checked' : '';
 					$sChecked = ($aNodes[$id]->GetKey() == $currValue) ? 'checked' : '';
 					if ($bMultiple)
 					if ($bMultiple)
 					{
 					{
-						$sSelect = '<input type="checkbox" value="'.$aNodes[$id]->GetKey().'" name="selectObject[]" '.$sChecked.'>&nbsp;';
+						$sSelect = '<input id="input_'.$fUniqueId.'_'.$aNodes[$id]->GetKey().'" type="checkbox" value="'.$aNodes[$id]->GetKey().'" name="selectObject[]" '.$sChecked.'>&nbsp;';
 					}
 					}
 					else
 					else
 					{
 					{
-						$sSelect = '<input type="radio" value="'.$aNodes[$id]->GetKey().'" name="selectObject" '.$sChecked.'>&nbsp;';
+						$sSelect = '<input id="input_'.$fUniqueId.'_'.$aNodes[$id]->GetKey().'" type="radio" value="'.$aNodes[$id]->GetKey().'" name="selectObject" '.$sChecked.'>&nbsp;';
 					}
 					}
 				}
 				}
-				$oP->add('<li>'.$sSelect.$aNodes[$id]->GetHyperlink());
+				$oP->add('<li>'.$sSelect.'<label for="input_'.$fUniqueId.'_'.$aNodes[$id]->GetKey().'">'.$aNodes[$id]->GetName().'</label>');
 				$this->DumpNodes($oP, $id, $aTree, $aNodes, $currValue);
 				$this->DumpNodes($oP, $id, $aTree, $aNodes, $currValue);
 				$oP->add("</li>\n");
 				$oP->add("</li>\n");
 			}
 			}