echo "<select name='docTypeID' id='docTypeID'>"; $displayArray = array(); $display = array(); $documentType = new DocumentType(); $displayArray = $documentType->allAsArray(); foreach ($displayArray as $display) { if ($_POST['shortName'] == $display['shortName']) { echo "<option value='" . $display['documentTypeID'] . "' selected>" . $display['shortName'] . "</option>"; } else { echo "<option value='" . $display['documentTypeID'] . "'>" . $display['shortName'] . "</option>"; } } echo "</select>"; break; case 'addNoteType': $noteType = new DocumentNoteType(); if (isset($_REQUEST['shortName']) && $_REQUEST['shortName'] != '') { $noteType->documentNoteTypeID = ''; $noteType->shortName = $_REQUEST['shortName']; try { $noteType->save(); } catch (Exception $e) { echo $e->getMessage(); } } /* <select name="note[documentNoteTypeID]" id="noteDocumentNoteTypeID"> <option value="1">Test Type 1</option> <option value="2">Test Type 2</option> <option value="3">Test Type 3</option> <option value="4">Test Type 4</option> </select> */ echo ' <select id="noteDocumentNoteTypeID" name="note[documentNoteTypeID]">';
</div> <?php break; //form to add/edit notes //form to add/edit notes case 'getNoteForm': //note ID sent in for updates if (isset($_GET['documentNoteID'])) { $documentNoteID = $_GET['documentNoteID']; } else { $documentNoteID = ''; } $note = new DocumentNote(new NamedArguments(array('primaryKey' => $documentNoteID))); $documentNoteType = new DocumentNoteType(new NamedArguments(array('primaryKeyName' => 'documentNoteTypeID'))); $license = new License(new NamedArguments(array('primaryKey' => $_GET['licenseID']))); $documents = $license->getAllDocumentNamesAsIndexedArray(); ?> <div id='div_noteForm'> <form id='noteForm'> <input type='hidden' id='documentNoteID' name='documentNoteID' value='<?php echo $documentNoteID; ?> '> <input type='hidden' id='licenseID' name='licenseID' value='<?php echo $_GET['licenseID']; ?> '> <table class="thickboxTable" style="width:300px;"> <tr>
if ($user->canEdit()) { echo "<br /><br /><a href='ajax_forms.php?action=getSFXForm&licenseID=" . $licenseID . "&height=178&width=260&modal=true' class='thickbox' id='addSFXResource'>" . _("add new terms tool resource link") . "</a>"; } break; case 'getAllNotes': $licenseID = $_GET['licenseID']; $license = new License(new NamedArguments(array('primaryKey' => $licenseID))); $notes = $license->getNotes(); ?> <h4>Notes</h4> <?php if ($user->canEdit()) { echo "<a href='ajax_forms.php?action=getNoteForm&licenseID=" . $licenseID . "&height=380&width=305&modal=true' class='thickbox' id='note'>" . _("add new note") . "</a><br /><br />"; } if (is_array($notes) && count($notes) > 0) { $documentNoteTypes = new DocumentNoteType(new NamedArguments(array('primaryKeyName' => 'documentNoteTypeID'))); $notetypes = $documentNoteTypes->allAsIndexedArray(); $documents = $license->getAllDocumentNamesAsIndexedArray(); ?> <table class='verticalFormTable'> <tr> <th style='width:80px;'><?php echo _("Date"); ?> </th> <th style='width:540px;'><?php echo _("Note"); ?> </th> <th style='width:540px;'><?php echo _("Document");