//this is just to figure out what the creator entered note type ID is $noteType = new NoteType(); $resourceNote = new ResourceNote(); $resourceNote->resourceNoteID = ''; $resourceNote->updateLoginID = $loginID; $resourceNote->updateDate = date('Y-m-d'); $resourceNote->noteTypeID = $noteType->getInitialNoteTypeID(); $resourceNote->tabName = 'Product'; $resourceNote->resourceID = $resourceID; //only insert provider as note if it's been submitted if ($_POST['providerText'] && !$_POST['organizationID'] && $_POST['resourceStatus'] == 'progress') { $resourceNote->noteText = "Provider: " . $_POST['providerText'] . "\n\n" . $_POST['noteText']; } else { $resourceNote->noteText = $_POST['noteText']; } $resourceNote->save(); } //first remove the organizations if this is a saved request $resource->removeResourceOrganizations(); if ($_POST['organizationID'] && $organizationRoleID) { $resourceOrganizationLink = new ResourceOrganizationLink(); $resourceOrganizationLink->resourceID = $resourceID; $resourceOrganizationLink->organizationID = $_POST['organizationID']; $resourceOrganizationLink->organizationRoleID = $organizationRoleID; $resourceOrganizationLink->save(); } $yearArray = array(); $yearArray = explode(':::', $_POST['years']); $subStartArray = array(); $subStartArray = explode(':::', $_POST['subStarts']); $subEndArray = array();
continue; } if ($note['delimiter'] !== "") { $noteArray = array_map('trim', explode($note['delimiter'], $data[intval($note['column']) - 1])); } else { $noteArray = array(trim($data[intval($note['column']) - 1])); } foreach ($noteArray as $currentNote) { $noteObj = new ResourceNote(); $noteObj->resourceID = $resource->primaryKey; $noteObj->noteTypeID = $note['noteType']; $noteObj->updateLoginID = ''; $noteObj->updateDate = ''; $noteObj->noteText = $currentNote; $noteObj->tabName = 'Product'; $noteObj->save(); $noteInserted++; } } //Add subjects to the resource foreach ($generalDetailSubjectLinkIDArray as $generalDetailID) { $resourceSubject = new ResourceSubject(); $resourceSubject->resourceID = $resource->primaryKey; $resourceSubject->generalDetailSubjectLinkID = $generalDetailID; $resourceSubject->save(); } // Do we have to create an organization or attach the resource to an existing one? foreach ($jsonData['organization'] as $importOrganization) { if ($importOrganization['column'] === "") { continue; }