Skip to content

Commit

Permalink
Fix disable admin signature for new templates.
Browse files Browse the repository at this point in the history
Fix send reviewed doc to correct category.
  • Loading branch information
sjpadgett committed Sep 29, 2018
1 parent 9a7444a commit 3003401
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion portal/lib/doc_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
$cpid = $_REQUEST['cpid'] ? $_REQUEST['cpid'] : $GLOBALS['pid'];

try {
$result = sqlQuery("SELECT id FROM categories WHERE name LIKE ?", array("Reviewed"));
$category = $result['id'] ? $result['id'] : 3;
$form_filename = convert_safe_file_dir_name($_REQUEST['docid']) . '_' . convert_safe_file_dir_name($cpid) . '.pdf';
$templatedir = $GLOBALS['OE_SITE_DIR'] . "/documents/onsite_portal_documents/patient_documents";
$templatepath = "$templatedir/$form_filename";
Expand Down Expand Up @@ -85,7 +87,7 @@
echo xla("ERROR Missing Patient ID");
exit();
}
$rc = $d->createDocument($cpid, 29, $form_filename, 'application/pdf', $data);
$rc = $d->createDocument($cpid, $category, $form_filename, 'application/pdf', $data);
ob_clean();
echo $rc;
$logit->portalLog('chart document', $cpid, ('document:'.$form_filename));
Expand Down
14 changes: 9 additions & 5 deletions portal/patient/scripts/app/onsitedocuments.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ var page = {
}
pageAudit.fetchParams.doc = page.onsiteDocument.get('id')
pageAudit.fetchOnsitePortalActivities(pageAudit.fetchParams);

if ( cuser != '-patient-') {
// disable admin signature in patient view
$('#patientSignature').prop("onclick", null);
} else {
$('#adminSignature').prop("onclick", null);
}
});
},

Expand Down Expand Up @@ -331,6 +338,7 @@ var page = {
$("#submitTemplate").hide();
$("#sendTemplate").hide();
page.onsiteDocument.set('fullDocument',templateHtml);
$('#adminSignature').prop("onclick", null);
}
}
});
Expand Down Expand Up @@ -394,16 +402,12 @@ var page = {
$('#confirmDeleteOnsiteDocumentButton').click(function (e) {
e.preventDefault();
page.deleteModel();

});
// disable admin signature in patient view
// @todo do better disable check as may want to delete in dashboard someday.
$('#adminSignature').prop("onclick", null);
} else {
// no point in initializing the click handlers if we don't show the button
$('#patientSignature').prop("onclick", null);
$('#deleteOnsiteDocumentButtonContainer').hide();
}

},

/**
Expand Down

0 comments on commit 3003401

Please sign in to comment.