Commit 7e7690aa authored by Internship UKSW 2019's avatar Internship UKSW 2019

Initial commit

parent f28b6f23
This diff is collapsed.
......@@ -763,7 +763,7 @@ class FormCreate extends Component {
Email: dataApprover[0].EMail[0]
}
let postdataDokumen = {
"doc_code": this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject,
"doc_code": this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "." + this.state.subject,
"user_id": user_id,
"doc_type": this.state.documentType,
"rev_date": this.state.effectiveDate,
......@@ -878,7 +878,7 @@ class FormCreate extends Component {
"user_role": "Creator",
"action": "Create New Document",
"trail_status": "Waiting for Approval - " + dataApprover[0].EmpFullName[0],
"doc_code": this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject
"doc_code": this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject
}
let postDataTrail = js2xmlparser.parse("_posttrailinsert", dataTrail);
let responseInsertTrail = await axios.post(process.env.REACT_APP_MAIN_APIURL + '/DocumentManagement/trailinsert', postDataTrail, { headers: { 'Content-Type': 'text/xml' } })
......@@ -888,7 +888,7 @@ class FormCreate extends Component {
"emailcc": JSON.parse(localStorage.getItem("dataLogin")).email[0],
"emailsend": dataApprover[0].EMail[0],
"message": "<p>Dengan hormat,</p> \
<p>Terdapat pengajuan dokumen dengan No." + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + JSON.parse(localStorage.getItem("dataLDAP"))["Full Name"] + ".<br /> Untuk review dan approval silahkan klik link berikut ini <a href='http://" + localStorage.getItem('host') + "' target='_blank'>Link Dokumen</a></p> \
<p>Terdapat pengajuan dokumen dengan No." + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + JSON.parse(localStorage.getItem("dataLDAP"))["Full Name"] + ".<br /> Untuk review dan approval silahkan klik link berikut ini <a href='http://" + localStorage.getItem('host') + "' target='_blank'>Link Dokumen</a></p> \
<p>Terimakasih</p> \
<p>Regards,</p> \
<p>Admin</p><br /> \
......@@ -1057,7 +1057,7 @@ class FormCreate extends Component {
<h2 className={"text-center" + (pageNumber == 1 ? " text-danger" : "")}>{this.state.subject}</h2><br />
<div className={"form-group row" + (pageNumber == 1 ? " text-danger" : "")}>
<label className="col-xl-4 col-lg-4 col-md-5 col-sm-4 control-label">Code</label>
<label className="col-xl-8 col-lg-8 col-md-7 col-sm-8">{": " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject}</label>
<label className="col-xl-8 col-lg-8 col-md-7 col-sm-8">{": " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject}</label>
</div>
<div className={"form-group row" + (pageNumber == 1 ? " text-danger" : "")}>
<label className="col-xl-4 col-lg-4 col-md-5 col-sm-4 control-label">Revision Date</label>
......@@ -1409,7 +1409,7 @@ class FormCreate extends Component {
<h1 className="text-center">{this.state.subject}</h1><br />
<div className="form-group row">
<label className="col-xl-3 col-lg-3 col-md-3 col-sm-3 control-label">Code</label>
<label className="col-xl-9 col-lg-9 col-md-9 col-sm-9 control-label">{": " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject}</label>
<label className="col-xl-9 col-lg-9 col-md-9 col-sm-9 control-label">{": " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject}</label>
</div>
<div className="form-group row">
<label className="col-xl-3 col-lg-3 col-md-3 col-sm-3 control-label">Revision Date</label>
......
......@@ -70,7 +70,8 @@ class FormPublish extends Component {
let approver = dataDocument[m].approver[0];
let documentType = dataDocument[m].doc_type[0];
let documentCode = dataDocument[m].doc_code[0] + "";
let splitDocumentCode = documentCode.split("-");
let documentCode2 = documentCode.replace("-" + dataDocument[m].subject[0], "");
let splitDocumentCode = documentCode2.split("-");
let businessUnit = splitDocumentCode[0];
let revisionCode = splitDocumentCode[2];
let responseDataRevision = await axios.get(process.env.REACT_APP_MAIN_APIURL + '/DocumentManagement/revisionkey/' + doc_id, { headers: { 'Content-Type': 'application/xml' } })
......@@ -243,11 +244,11 @@ class FormPublish extends Component {
}
//Send Email Notification After Publish
let postdataEmailAfterPublish = {
"subject": "Dokumen " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject + " Sudah Dipublish",
"subject": "Dokumen " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject + " Sudah Dipublish",
"emailcc": JSON.parse(localStorage.getItem("dataLogin")).email[0],
"emailsend": sendEmailPublish,
"message": "<p>Dengan hormat,</p> \
<p>Dokumen dengan No." + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + this.state.creator_name + " telah dipublish.<br /> Untuk melihat dokumen, silahkan klik link berikut <a href='http://" + localStorage.getItem('host') + "' target='_blank'>Link Dokumen</a></p> \
<p>Dokumen dengan No." + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + this.state.creator_name + " telah dipublish.<br /> Untuk melihat dokumen, silahkan klik link berikut <a href='http://" + localStorage.getItem('host') + "' target='_blank'>Link Dokumen</a></p> \
<p>Terimakasih</p> \
<p>Regards,</p> \
<p>Admin</p><br /> \
......@@ -269,11 +270,11 @@ class FormPublish extends Component {
}
//Send Email Notification After UnPublish
let postdataEmailAfterUnpublish = {
"subject": "Dokumen " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject + " Sudah Diunpublish",
"subject": "Dokumen " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject + " Sudah Diunpublish",
"emailcc": "",
"emailsend": sendEmailPublish,
"message": "<p>Dengan hormat,</p> \
<p>Dokumen dengan No." + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + this.state.creator_name + " telah diunpublish oleh " + JSON.parse(localStorage.getItem("dataLogin")).user_name[0] + ".</p> \
<p>Dokumen dengan No." + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + this.state.creator_name + " telah diunpublish oleh " + JSON.parse(localStorage.getItem("dataLogin")).user_name[0] + ".</p> \
<p>Terimakasih</p> \
<p>Regards,</p> \
<p>Admin</p><br /> \
......@@ -297,7 +298,7 @@ class FormPublish extends Component {
// contents: this.state.contents
}
let putdataDokumen = {
"doc_code": this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject,
"doc_code": this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject,
"user_id": this.state.user_id,
"doc_type": this.state.documentType,
"rev_date": this.state.effectiveDate,
......@@ -386,7 +387,7 @@ class FormPublish extends Component {
"user_role": "Compliance Officer",
"action": actionPublish,
"trail_status": tracking,
"doc_code": this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject,
"doc_code": this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject,
}
let postDataTrail = js2xmlparser.parse("_posttrailinsert", dataTrail);
let responseInsertTrail = await axios.post(process.env.REACT_APP_MAIN_APIURL + '/DocumentManagement/trailinsert', postDataTrail, { headers: { 'Content-Type': 'text/xml' } })
......@@ -557,7 +558,7 @@ class FormPublish extends Component {
<h1 className="text-center">{this.state.subject}</h1><br />
<div className="form-group row">
<label className="col-xl-3 col-lg-3 col-md-3 col-sm-3 control-label">Code</label>
<label className="col-xl-9 col-lg-9 col-md-9 col-sm-9 control-label">{": " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject}</label>
<label className="col-xl-9 col-lg-9 col-md-9 col-sm-9 control-label">{": " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject}</label>
</div>
<div className="form-group row">
<label className="col-xl-3 col-lg-3 col-md-3 col-sm-3 control-label">Revision Date</label>
......
......@@ -86,7 +86,8 @@ class FormRevision extends Component {
let approver = dataDocument[m].approver[0];
let documentType = dataDocument[m].doc_type[0];
let documentCode = dataDocument[m].doc_code[0] + "";
let splitDocumentCode = documentCode.split("-");
let documentCode2 = documentCode.replace("-" + dataDocument[m].subject[0], "");
let splitDocumentCode = documentCode2.split("-");
let businessUnit = splitDocumentCode[0];
let revisionCode = splitDocumentCode[2];
// Check user id creator with user id document
......@@ -623,11 +624,11 @@ class FormRevision extends Component {
}
//Send Email Notification After Reviewed
let postdataEmailAfterUnpublish = {
"subject": "Dokumen " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject + " Sudah Direview",
"subject": "Dokumen " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject + " Sudah Direview",
"emailcc": "",
"emailsend": emailComplianceOfficer,
"message": "<p>Dengan hormat,</p> \
<p>Dokumen dengan No." + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + this.state.creator_name + " telah direview dan tidak perlu direvisi.<br /> Untuk melihat dokumen, silahkan klik link berikut <a href='http://" + localStorage.getItem('host') + "' target='_blank'>Link Dokumen</a></p> \
<p>Dokumen dengan No." + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject + " yang diajukan oleh " + this.state.creator_name + " telah direview dan tidak perlu direvisi.<br /> Untuk melihat dokumen, silahkan klik link berikut <a href='http://" + localStorage.getItem('host') + "' target='_blank'>Link Dokumen</a></p> \
<p>Terimakasih</p> \
<p>Regards,</p> \
<p>Admin</p><br /> \
......@@ -1152,7 +1153,7 @@ class FormRevision extends Component {
"user_role": "Creator",
"action": "Submit Revised Document",
"trail_status": tracking,
"doc_code": this.state.businessUnit + "-" + this.state.documentType + "-" + rCode + "-" + this.state.subject
"doc_code": this.state.businessUnit + "." + this.state.documentType + "." + rCode + "-" + this.state.subject
}
let postDataTrail = js2xmlparser.parse("_posttrailinsert", dataTrail);
let responseInsertTrail = await axios.post(process.env.REACT_APP_MAIN_APIURL + '/DocumentManagement/trailinsert', postDataTrail, { headers: { 'Content-Type': 'text/xml' } })
......@@ -1171,7 +1172,7 @@ class FormRevision extends Component {
this.setState({ revisionDate: this.state.revisionDate });
}
let putdataDokumen = {
"doc_code": this.state.businessUnit + "-" + this.state.documentType + "-" + rCode + "-" + this.state.subject,
"doc_code": this.state.businessUnit + "." + this.state.documentType + "." + rCode + "-" + this.state.subject,
"user_id": this.state.user_id,
"doc_type": this.state.documentType,
"rev_date": this.state.revisionDate,
......@@ -1477,7 +1478,7 @@ class FormRevision extends Component {
<h2 className={"text-center" + (pageNumber == 1 ? " text-danger" : "")}>{this.state.subject}</h2><br />
<div className={"form-group row" + (pageNumber == 1 ? " text-danger" : "")}>
<label className="col-xl-4 col-lg-4 col-md-5 col-sm-4 control-label">Code</label>
<label className="col-xl-8 col-lg-8 col-md-7 col-sm-8">{": " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject}</label>
<label className="col-xl-8 col-lg-8 col-md-7 col-sm-8">{": " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject}</label>
</div>
<div className={"form-group row" + (pageNumber == 1 ? " text-danger" : "")}>
<label className="col-xl-4 col-lg-4 col-md-5 col-sm-4 control-label">Revision Date</label>
......@@ -1694,7 +1695,7 @@ class FormRevision extends Component {
<h1 className="text-center">{this.state.subject}</h1><br />
<div className="form-group row">
<label className="col-xl-3 col-lg-3 col-md-3 col-sm-3 control-label">Code</label>
<label className="col-xl-9 col-lg-9 col-md-9 col-sm-9 control-label">{": " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject}</label>
<label className="col-xl-9 col-lg-9 col-md-9 col-sm-9 control-label">{": " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject}</label>
</div>
<div className="form-group row">
<label className="col-xl-3 col-lg-3 col-md-3 col-sm-3 control-label">Revision Date</label>
......@@ -1867,7 +1868,7 @@ class FormRevision extends Component {
<h2 className="text-center">{this.state.subject}</h2><br />
<div className="form-group row">
<label className="col-xl-4 col-lg-4 col-md-5 col-sm-4 control-label">Code</label>
<label className="col-xl-8 col-lg-8 col-md-7 col-sm-8">{": " + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + "-" + this.state.subject}</label>
<label className="col-xl-8 col-lg-8 col-md-7 col-sm-8">{": " + this.state.businessUnit + "." + this.state.documentType + "." + this.state.revisionCode + "-" + this.state.subject}</label>
</div>
<div className="form-group row">
<label className="col-xl-4 col-lg-4 col-md-5 col-sm-4 control-label">Revision Date</label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment