• R/O
  • HTTP
  • SSH
  • HTTPS

e-dokyumento: Commit

e-Dokyumento is an opensource Document Management System that stores, organizes, indexes, routes, and tracks electronic documents. It automates the basic office document workflow such as receiving, filing, routing, and approving of hard-printed documents through capturing (scanning), digitizing (OCR Reading), storing, tagging, and electronically routing and approving (e-signature) of documents.


Commit MetaInfo

Revisionc7ef4e2168998bbb74b3e1bcda803be64b6a0cb5 (tree)
Zeit2020-09-01 15:40:49
AutorNelson Maligro <nelsonmaligro@gmai...>
CommiterNelson Maligro

Log Message

01 Sep 2020

Ändern Zusammenfassung

  • modified: controllers/dastransact.js (diff)
  • modified: controllers/dbhandle.js (diff)
  • modified: err.log (diff)
  • modified: public/assets/verifydoc.js (diff)
  • delete: public/drive/PDF-temp/Bibliography 14Feb2019.docx.eric.pdf
  • delete: public/drive/PDF-temp/Document Workfow and Routing.docx.pdf
  • delete: public/drive/PDF-temp/eric.pdf
  • delete: public/drive/PDF-temp/route-Bibliography 14Feb2019.docx.eric.pdf.pdf
  • delete: public/drive/PDF-temp/route-Document Workfow and Routing.docx.pdf
  • delete: public/drive/PDF-temp/route-Document Workfow and Routing.docx.pdf.pdf
  • delete: public/drive/PDF-temp/route-empty.pdf
  • delete: public/drive/PDF-temp/sam.pdf
  • delete: public/drive/PDF-temp/sam.res.pdf
  • delete: public/drive/Release/Document Workfow and Routing.docx.pdf
  • modified: views/login.ejs (diff)
  • modified: views/verifydoc.ejs (diff)

Diff

--- a/controllers/dastransact.js
+++ b/controllers/dastransact.js
@@ -60,6 +60,10 @@ module.exports = function(app, arrDB){
6060 scanCode(req, res, id);
6161 });
6262 });
63+ //post handle scanning of Document QR Code
64+ app.post('/scanqrdoc', urlencodedParser, function(req,res){
65+ scanqrdoc(req, res);
66+ });
6367 //post handle send file to user for notification
6468 app.post('/senduser', urlencodedParser, function(req,res){
6569 utilsdocms.validToken(req, res, function (decoded, id){
@@ -100,6 +104,27 @@ module.exports = function(app, arrDB){
100104 //------------------------------------------FUNCTIONS START HERE----------------------------------------------------
101105 //declare bootstap static folder here to redirect access to public drive folder when token not validated
102106 app.use(express.static('./public'));
107+
108+ //process document scan and verify QR COde
109+ function scanqrdoc(req, res){
110+ console.log('Scan Document QR Code');
111+ dbhandle.actlogFindSerial(req.body.content,(result)=>{
112+ if (result){
113+ //console.log(result[0].doc);
114+ if (result[0].doc.includes('.res.pdf')) return res.json('fail');
115+ else {
116+ dbhandle.userFind(result[0].user, function(user){
117+ let disDeyt = new Date(result[0].deyt);
118+ let newDeyt = disDeyt.getMonth() + '/' +disDeyt.getDate() + '/' + disDeyt.getFullYear() + ' ' + disDeyt.getHours() + disDeyt.getMinutes() + 'H';
119+ let docResult = {deyt:newDeyt, name:user.email, file:result[0].doc};
120+ return res.json(JSON.stringify(docResult));
121+ });
122+ }
123+ } else return res.json('fail');
124+ });
125+
126+ }
127+
103128 //process document release after signing
104129 function mergedrawdoc(req, res, id){
105130 dbhandle.userFind(id, function(user){
--- a/controllers/dbhandle.js
+++ b/controllers/dbhandle.js
@@ -187,6 +187,14 @@ exports.actlogFindAction = function (action, callback){
187187 callback(res);
188188 });
189189 };
190+//find monitoring by title
191+exports.actlogFindSerial = function (serial, callback){
192+ //find file
193+ activitylogsModel.find({serial:{'$regex':'^'+serial+'$','$options':'i'}}, function (err, res){
194+ //console.log(res);
195+ callback(res);
196+ });
197+};
190198 //edit activity logs
191199 exports.actlogSignEdit = function (Doc, newDoc){
192200 //Create records
--- a/err.log
+++ b/err.log
@@ -487,3 +487,31 @@ SyntaxError: await is only valid in async function
487487 at D:\Projects\PN DocMS\node_modules\mongoose\lib\query.js:4390:12
488488 at D:\Projects\PN DocMS\node_modules\mongoose\lib\query.js:2869:28
489489 at processTicksAndRejections (internal/process/task_queues.js:75:11)
490+Cannot read property 'includes' of undefined
491+TypeError: Cannot read property 'includes' of undefined
492+ at D:\Projects\PN DocMS\controllers\dastransact.js:114:26
493+ at D:\Projects\PN DocMS\controllers\dbhandle.js:195:5
494+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\model.js:4827:16
495+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\query.js:4390:12
496+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\helpers\query\completeMany.js:35:39
497+ at processTicksAndRejections (internal/process/task_queues.js:75:11)
498+Cannot read property 'includes' of undefined
499+TypeError: Cannot read property 'includes' of undefined
500+ at D:\Projects\PN DocMS\controllers\dastransact.js:114:26
501+ at D:\Projects\PN DocMS\controllers\dbhandle.js:195:5
502+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\model.js:4827:16
503+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\query.js:4390:12
504+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\helpers\query\completeMany.js:35:39
505+ at processTicksAndRejections (internal/process/task_queues.js:75:11)
506+Cannot set headers after they are sent to the client
507+Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
508+ at ServerResponse.setHeader (_http_outgoing.js:485:11)
509+ at ServerResponse.header (D:\Projects\PN DocMS\node_modules\express\lib\response.js:771:10)
510+ at ServerResponse.send (D:\Projects\PN DocMS\node_modules\express\lib\response.js:170:12)
511+ at ServerResponse.json (D:\Projects\PN DocMS\node_modules\express\lib\response.js:267:15)
512+ at D:\Projects\PN DocMS\controllers\dastransact.js:118:15
513+ at D:\Projects\PN DocMS\controllers\dbhandle.js:195:5
514+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\model.js:4827:16
515+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\query.js:4390:12
516+ at D:\Projects\PN DocMS\node_modules\mongoose\lib\helpers\query\completeMany.js:35:39
517+ at processTicksAndRejections (internal/process/task_queues.js:75:11)
--- a/public/assets/verifydoc.js
+++ b/public/assets/verifydoc.js
@@ -12,34 +12,24 @@ function openCam(){
1212 }
1313
1414 function submitQRPass(content){
15- alert(content);
16- /*
17- var hash = new Hashes.SHA512().b64(content); var branch= "N6"; var action= '6';
18- if ($('#disLevel').val().toUpperCase()=='DEP') {branch = "N6"; action='1';}
19- else if ($('#disLevel').val().toUpperCase()=='EAGM') {branch = "G.M."; action='1';}
20- else if ($('#disLevel').val().toUpperCase()=='DUTYADMIN') branch = "Duty Admin";
21- else branch = "Receiving";
22- var todo = {filename:$('#fileroute').val(),monitfile:$('#fileroute').val(),user:getCookie('me'),hashval:hash, action:action,remark:'', branch:branch,subject:''};
15+ var todo = {content:content};
2316 $.ajax({
2417 type: 'POST',
25- url: '/scancode',
18+ url: '/scanqrdoc',
2619 data: todo,
2720 success: function(data){
28- if (data=='successful') {
29- lastQRCode = hash;
30- $('#routeattachPage').hide();
31- var options = {
32- height: "400px",
33- };
34- PDFObject.embed('/drive/PDF-temp/route-'+$('#fileroute').val()+'.pdf', "#routeattachPage",options);
35- scanner.stop();$('#app').hide();$('#passapp').hide(); valPass = false;togglecam=false;
36- releasethisdoc();
21+ sound = document.getElementById('soundNoti'); sound.play();
22+ if (data!='fail') {
23+ let docRes = JSON.parse(data);
24+ $('#alert').html('<div class="alert alert-success" style="left:-300px;width:1120px;text-align:center;" role="alert"> Document Verified! Record Exist. <br>' +
25+ '<table cellspacing="15" cellpadding="5"><tr syle="padding:0;"><td style="border:1px solid black;">Timestamp:' + docRes.deyt + '</td><td style="border:1px solid black;">Signee:' + docRes.name + '</td><td style="border:1px solid black;">Document:' + docRes.file + '</td></tr></table></div>');
26+
3727 } else {
38- alert('QR Code or Password Fail!');$('#verPass').val('');
28+ $('#alert').html('<div class="alert alert-danger" style="width:660px;text-align:center;" role="alert"> Invalid Document! No Record Exist.</div>');
29+
3930 }
4031 }
4132 });
42- */
4333 }
4434 function closeDialog(){
4535 scanner.stop();
Binary files a/public/drive/PDF-temp/Bibliography 14Feb2019.docx.eric.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/Document Workfow and Routing.docx.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/eric.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/route-Bibliography 14Feb2019.docx.eric.pdf.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/route-Document Workfow and Routing.docx.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/route-Document Workfow and Routing.docx.pdf.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/route-empty.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/sam.pdf and /dev/null differ
Binary files a/public/drive/PDF-temp/sam.res.pdf and /dev/null differ
Binary files a/public/drive/Release/Document Workfow and Routing.docx.pdf and /dev/null differ
--- a/views/login.ejs
+++ b/views/login.ejs
@@ -1,3 +1,4 @@
1+<button style="margin-top:10px; position: absolute; right: 0;" type="button" class="btn btn-primary btn-flat " onclick="location.href='/verifydoc'">Click Here to Verify Document</button>
12 <div class="sufee-login d-flex align-content-center flex-wrap">
23 <div class="container">
34 <div class="login-content">
--- a/views/verifydoc.ejs
+++ b/views/verifydoc.ejs
@@ -1,3 +1,5 @@
1+<button style="margin-top:10px; position: absolute; right: 0;" type="button" class="btn btn-primary btn-flat " onclick="location.href='/'">Back to Login page</button>
2+
13 <div class="sufee-login d-flex align-content-center flex-wrap">
24 <div class="container">
35 <div class="login-content">
@@ -14,12 +16,14 @@
1416 </div>
1517 </div>
1618 <br>
17- <div id="alert" class="alert alert-success" style="width:660px;text-align:center;" role="alert"> Document Verified! Record Exist.
18- </div>
19-
19+ <div id="alert">
20+ <div class="alert alert-secondary" style="left:-100px;width:860px;text-align:center;" role="alert"> Scan QR Code of the Document <br> Note: This validates the existence of the document in the e-Dokyumento and not the authenticity of the signature. </div>
21+ </div>
2022 </div>
2123 </div>
2224 </div>
25+ <audio src="/images/noti.wav" type="audio/mpeg" id="soundNoti" autostart="false"></audio>
26+
2327 <script src="/vendors/jquery/dist/jquery.min.js"></script>
2428 <script type="text/javascript" src="/assets/js/adapter.min.js"></script>
2529 <script type="text/javascript" src="/assets/js/vue.min.js"></script>
Show on old repository browser