Skip to content

Commit

Permalink
Merge pull request #352 from jcraitz/jcraitz-fix-workflow-start-on-ne…
Browse files Browse the repository at this point in the history
…w-resources

fixes workflow start for new resources created by ajax form or API
  • Loading branch information
veggiematts authored Jan 25, 2018
2 parents bebe54d + a805616 commit 1c1031d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions resources/ajax_processing/submitNewResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

$resource->resourceTypeID = $_POST['resourceTypeID'];
$resource->resourceFormatID = $_POST['resourceFormatID'];
$resource->acquisitionTypeID = $_POST['acquisitionTypeID'];

$resource->titleText = $_POST['titleText'];
$resource->descriptionText = $_POST['descriptionText'];
$resource->isbnOrISSN = [];
Expand Down Expand Up @@ -60,7 +58,8 @@
// Create the default order
$resourceAcquisition = new ResourceAcquisition();
$resourceAcquisition->resourceID = $resourceID;
$resourceAcquisition->subscriptionStartDate = date("Y-m-d");
$resourceAcquisition->acquisitionTypeID = $_POST['acquisitionTypeID'];
$resourceAcquisition->subscriptionStartDate = date("Y-m-d");
$resourceAcquisition->subscriptionEndDate = date("Y-m-d");
$resourceAcquisition->save();

Expand Down Expand Up @@ -149,7 +148,7 @@

//next if the resource was submitted, enter into workflow
if ($statusID == $status->getIDFromName('progress')){
$resource->enterNewWorkflow();
$resourceAcquisition->enterNewWorkflow();
}


Expand Down
2 changes: 1 addition & 1 deletion resources/api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
}


$resource->enterNewWorkflow();
$resourceAcquisition->enterNewWorkflow();


} catch (Exception $e) {
Expand Down

0 comments on commit 1c1031d

Please sign in to comment.