Skip to content
Snippets Groups Projects
Commit 0b2f5753 authored by uhensler's avatar uhensler
Browse files

OO-3981: Add location variable to PDF certificates

parent 82689150
No related branches found
No related tags found
No related merge requests found
...@@ -181,6 +181,8 @@ public class CertificatePDFFormWorker { ...@@ -181,6 +181,8 @@ public class CertificatePDFFormWorker {
fillField("expenditureOfWorks", expenditureOfWorks, acroForm); fillField("expenditureOfWorks", expenditureOfWorks, acroForm);
String mainLanguage = entry.getMainLanguage(); String mainLanguage = entry.getMainLanguage();
fillField("mainLanguage", mainLanguage, acroForm); fillField("mainLanguage", mainLanguage, acroForm);
String location = entry.getLocation();
fillField("location", location, acroForm);
if (entry.getLifecycle() != null) { if (entry.getLifecycle() != null) {
Formatter format = Formatter.getInstance(locale); Formatter format = Formatter.getInstance(locale);
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
package org.olat.course.certificate.manager; package org.olat.course.certificate.manager;
import java.io.File; import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.Reader; import java.io.Reader;
import java.io.Writer; import java.io.Writer;
import java.io.FileOutputStream;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.Date; import java.util.Date;
...@@ -192,6 +192,8 @@ public class CertificatePdfServiceWorker { ...@@ -192,6 +192,8 @@ public class CertificatePdfServiceWorker {
context.put("expenditureOfWorks", expenditureOfWorks); context.put("expenditureOfWorks", expenditureOfWorks);
String mainLanguage = entry.getMainLanguage(); String mainLanguage = entry.getMainLanguage();
context.put("mainLanguage", mainLanguage); context.put("mainLanguage", mainLanguage);
String location = entry.getLocation();
context.put("location", location);
if (entry.getLifecycle() != null) { if (entry.getLifecycle() != null) {
Formatter format = Formatter.getInstance(locale); Formatter format = Formatter.getInstance(locale);
......
...@@ -98,7 +98,7 @@ public class CertificatePhantomWorker { ...@@ -98,7 +98,7 @@ public class CertificatePhantomWorker {
File templateFile = certificatesManager.getTemplateFile(template); File templateFile = certificatesManager.getTemplateFile(template);
File htmlCertificateFile = copyAndEnrichTemplate(templateFile); File htmlCertificateFile = copyAndEnrichTemplate(templateFile);
List<String> cmds = new ArrayList<String>(); List<String> cmds = new ArrayList<>();
cmds.add("phantomjs"); cmds.add("phantomjs");
cmds.add(certificatesManager.getRasterizePath().toFile().getAbsolutePath()); cmds.add(certificatesManager.getRasterizePath().toFile().getAbsolutePath());
cmds.add(htmlCertificateFile.getAbsolutePath()); cmds.add(htmlCertificateFile.getAbsolutePath());
...@@ -205,6 +205,8 @@ public class CertificatePhantomWorker { ...@@ -205,6 +205,8 @@ public class CertificatePhantomWorker {
context.put("expenditureOfWorks", expenditureOfWorks); context.put("expenditureOfWorks", expenditureOfWorks);
String mainLanguage = entry.getMainLanguage(); String mainLanguage = entry.getMainLanguage();
context.put("mainLanguage", mainLanguage); context.put("mainLanguage", mainLanguage);
String location = entry.getLocation();
context.put("location", location);
if (entry.getLifecycle() != null) { if (entry.getLifecycle() != null) {
Formatter format = Formatter.getInstance(locale); Formatter format = Formatter.getInstance(locale);
...@@ -271,7 +273,7 @@ public class CertificatePhantomWorker { ...@@ -271,7 +273,7 @@ public class CertificatePhantomWorker {
} }
public static boolean checkPhantomJSAvailabilty() { public static boolean checkPhantomJSAvailabilty() {
List<String> cmds = new ArrayList<String>(); List<String> cmds = new ArrayList<>();
cmds.add("phantomjs"); cmds.add("phantomjs");
cmds.add("--help"); cmds.add("--help");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment