diff --git a/include/note.php b/include/note.php index b88727b..92891b5 100644 --- a/include/note.php +++ b/include/note.php @@ -443,7 +443,10 @@ class Note { public function getNoteLinksFromInput($aValues) { - $oApp = new application($this->iAppId); + $iAppId = $this->iAppId; + if(!$iAppId) + $iAppId = getInput('iAppId', $aValues); + $oApp = new application($iAppId); $iCount = sizeof($oApp->getVersions()); $aLinkedVersions = html_read_input_series('iVersionId', $aValues, $iCount); $aLinks = array(); @@ -595,6 +598,20 @@ class Note { echo html_frame_end(); } + public function checkOutputEditorInput($aClean) + { + $shErrors = ''; + $iVersionId = getInput('iVersionId', $aClean); + + if($iVersionId == APPNOTE_SHOW_FOR_SPECIFIC_VERSIONS) + { + $aNoteLinks = $this->getNoteLinksFromInput($aClean); + if(!sizeof($aNoteLinks)) + $shErrors .= '
  • You need to show the note for at least one version, or choose another display mode
  • '; + } + return $shErrors; + } + /* retrieves values from $aValue that were output by outputEditor() */ /* $aValues can be $_REQUEST or any array with the values from outputEditor() */ function GetOutputEditorValues($aValues)