diff --git a/portal/lib/doc_lib.php b/portal/lib/doc_lib.php index baffe0c26fe..4b5eb21e422 100644 --- a/portal/lib/doc_lib.php +++ b/portal/lib/doc_lib.php @@ -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"; @@ -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)); diff --git a/portal/patient/scripts/app/onsitedocuments.js b/portal/patient/scripts/app/onsitedocuments.js index a12ec4af90f..10093dc95a4 100644 --- a/portal/patient/scripts/app/onsitedocuments.js +++ b/portal/patient/scripts/app/onsitedocuments.js @@ -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); + } }); }, @@ -331,6 +338,7 @@ var page = { $("#submitTemplate").hide(); $("#sendTemplate").hide(); page.onsiteDocument.set('fullDocument',templateHtml); + $('#adminSignature').prop("onclick", null); } } }); @@ -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(); } + }, /**