Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(invitation): change QR image size to avoid auto resizing
Browse files Browse the repository at this point in the history
Signed-off-by: Domingo Oropeza <doropeza@teclib.com>
  • Loading branch information
DIOHz0r authored and btry committed Oct 30, 2018
1 parent ca7fe28 commit 40e6032
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 8 additions & 4 deletions inc/invitation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ public function prepareInputForAdd($input) {
return false;
}

// does the user have a default email?
if (!$user->getDefaultEmail()) {
Session::addMessageAfterRedirect(__("Email address is invalid", 'flyvemdm'),
false, INFO, true);
return false;
}

// The user already exists, add him in the entity
$profile_User = new Profile_User();
$entities = $profile_User->getEntitiesForProfileByUser($userId, $guestProfileId);
Expand Down Expand Up @@ -298,7 +305,7 @@ protected function createQRCodeDocument() {

// Generate a QRCode
$barcodeobj = new TCPDF2DBarcode($encodedRequest, 'QRCODE,L');
$qrCode = $barcodeobj->getBarcodePngData(7, 7, [0, 0, 0]);
$qrCode = $barcodeobj->getBarcodePngData(8, 8, [0, 0, 0]);

// Add border to the QR
// TCPDF forgets the quiet zone
Expand Down Expand Up @@ -474,11 +481,8 @@ public function showForm($ID, array $options = []) {

$fields = $this->fields;
$fields['user'] = User::dropdown([
'name' => 'users_id',
'value' => $this->fields['users_id'],
'entity' => $this->fields['entities_id'],
'right' => 'all',
'rand' => mt_rand(),
'display' => false,
]);
$data = [
Expand Down
9 changes: 3 additions & 6 deletions install/install.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,14 @@ public function createNotificationTargetInvitation() {
]);

// Add default translation
if (!isset($data['content_html'])) {
$contentHtml = self::convertTextToHtml($data['content_text']);
} else {
$contentHtml = self::convertTextToHtml($data['content_html']);
}
$contentHtml = !isset($data['content_html']) ? $data['content_text'] : $data['content_html'];
$translation->add([
'notificationtemplates_id' => $templateId,
'language' => '',
'subject' => addcslashes($data['subject'], "'\""),
'content_text' => addcslashes($data['content_text'], "'\""),
'content_html' => addcslashes(htmlentities($contentHtml, ENT_NOQUOTES | ENT_HTML401), "'\""),
'content_html' => addcslashes(htmlentities(self::convertTextToHtml($contentHtml),
ENT_NOQUOTES | ENT_HTML401), "'\""),
]);

// Create the notification
Expand Down

0 comments on commit 40e6032

Please sign in to comment.