note: When showing for specific versions, make sure at least one version is selected

This commit is contained in:
Alexander Nicolaysen Sørnes
2009-08-08 04:13:20 +02:00
parent f459f341b4
commit c7bdd32b9f

View File

@@ -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 .= '<li>You need to show the note for at least one version, or choose another display mode</li>';
}
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)