$license->statusDate = date('Y-m-d H:i:s'); $response = _("Document Added Successfully."); } $license->shortName = $_POST['shortName']; $license->description = $_POST['description']; $license->typeID = $_POST['documentTypeID']; $license->statusDate = date('Y-m-d H:i:s'); $license->statusLoginID = $user->primaryKey; //this method will save to either organization or provider depending on the settings //also, if this organization or provider doesn't exist it will create a new org/provider $license->setOrganization($_POST['organizationID'], $_POST['organizationName']); //this is the html that will be displayed in the form after submitting. //this is the only form in which this is done. try { $license->save(); $license->setConsortiums($_POST['consortiumID']); if (isset($_POST['licenseID']) && $_POST['licenseID'] != '') { $licenseID = $_POST['licenseID']; } else { // I am adding a new license so go ahead and create the document $licenseID = $license->primaryKey; // Save the document $document = new Document(); $document->documentID = ''; $document->effectiveDate = date('Y-m-d H:i:s'); if (isset($_POST['revisionDate']) && $_POST['revisionDate'] != '') { $document->revisionDate = date("Y-m-d", strtotime($_POST['revisionDate'])); } $document->shortName = $_POST['shortName']; $document->documentTypeID = $_POST['documentTypeID']; $document->parentDocumentID = $_POST['parentDocumentID'];