diff --git a/symphony/src/Proethos2/CoreBundle/Controller/ProtocolController.php b/symphony/src/Proethos2/CoreBundle/Controller/ProtocolController.php index c7877b5..3c947fb 100644 --- a/symphony/src/Proethos2/CoreBundle/Controller/ProtocolController.php +++ b/symphony/src/Proethos2/CoreBundle/Controller/ProtocolController.php @@ -1038,7 +1038,7 @@ public function initCommitteeReviewAction($protocol_id) } // if form was to remove a member - if ( isset($post_data['reject-review']) and "yes" == $post_data['reject-review'] ) { + if ( isset($post_data['protocol-review-invitation']) and !empty($post_data['protocol-review-invitation']) ) { if ( "committee" == $post_data['member-type'] ) { $protocol_revision_repository = $protocol_committee_revision_repository; } else { @@ -1047,15 +1047,28 @@ public function initCommitteeReviewAction($protocol_id) $revision = $protocol_revision_repository->findOneBy(array('member' => $user, "protocol" => $protocol)); if($revision) { - $revision->setRejected(true); - $revision->setRejectReason($post_data['reject-reason']); - if ( 'E' == $post_data['reject-reason'] and $post_data['other-reject-reason'] ) { - $revision->setOtherRejectReason($post_data['other-reject-reason']); + if ( 'yes' == $post_data['protocol-review-invitation'] ) { + $revision->setAccepted(true); + $em->persist($revision); + $em->flush(); + + $session->getFlashBag()->add('success', $translator->trans("Review has been accepted with success!")); } - $em->persist($revision); - $em->flush(); - $session->getFlashBag()->add('success', $translator->trans("Review has been rejected with success!")); + if ( 'no' == $post_data['protocol-review-invitation'] ) { + $revision->setRejected(true); + $revision->setRejectReason($post_data['reject-reason']); + + if ( 'E' == $post_data['reject-reason'] and $post_data['other-reject-reason'] ) { + $revision->setOtherRejectReason($post_data['other-reject-reason']); + } + + $em->persist($revision); + $em->flush(); + + $session->getFlashBag()->add('success', $translator->trans("Review has been rejected with success!")); + } + return $this->redirectToRoute('crud_committee_protocol_list', array('protocol_id' => $protocol->getId()), 301); } diff --git a/symphony/src/Proethos2/CoreBundle/Resources/public/css/style.css b/symphony/src/Proethos2/CoreBundle/Resources/public/css/style.css index ccb73d4..334ac97 100644 --- a/symphony/src/Proethos2/CoreBundle/Resources/public/css/style.css +++ b/symphony/src/Proethos2/CoreBundle/Resources/public/css/style.css @@ -341,6 +341,7 @@ div.reject-report { margin-left: 23px; } +div.select-reject-reason, div.other-reject-reason { display: none; } @@ -353,6 +354,14 @@ span.reject-label { margin-top: 16px; } +.protocol-review-invitation-radio { + text-align: center; +} + +.protocol-review-invitation-radio .radio label { + padding: 0; +} + /* DIV.multiple SELECT, INPUT[type="number"] { width: 160px; diff --git a/symphony/src/Proethos2/CoreBundle/Resources/views/CRUD/listCommitteeProtocol.html.twig b/symphony/src/Proethos2/CoreBundle/Resources/views/CRUD/listCommitteeProtocol.html.twig index c4dbd16..fd94775 100644 --- a/symphony/src/Proethos2/CoreBundle/Resources/views/CRUD/listCommitteeProtocol.html.twig +++ b/symphony/src/Proethos2/CoreBundle/Resources/views/CRUD/listCommitteeProtocol.html.twig @@ -111,14 +111,20 @@ {% if 'administrator' in app.user.getRolesSlug %}{% endif %} {% if protocol.status in ["E","H"] and app.user in protocol.committeeRevisionUsers %} {% if app.user not in protocol.committeeRejectedRevisions %} - - {% if app.user not in protocol.committeeFinalRevisions %}{% endif %} + {% if app.user in protocol.committeeAcceptedRevisions or app.user in protocol.committeeFinalRevisions %} + + {% else %} + + {% endif %} {% endif %} {% endif %} {% if protocol.status in ["E","H"] and app.user in protocol.adhocRevisionUsers %} {% if app.user not in protocol.adhocRejectedRevisions %} - - {% if app.user not in protocol.adhocFinalRevisions %}{% endif %} + {% if app.user in protocol.adhocAcceptedRevisions or app.user in protocol.adhocFinalRevisions %} + + {% else %} + + {% endif %} {% endif %} {% endif %} @@ -249,27 +255,35 @@ - +