Skip to content

Commit

Permalink
Merge Release 1.0.1 into Master (#47)
Browse files Browse the repository at this point in the history
* Task #163911: Added cols client issued to and client issued to name (#28)

* Bug #162401 Fix: Warning on com_tjcertificate edit template view (#18)

* Task #163911: Added cols client issued to and client issued to name

* Task #163911: Added cols client issued to and client issued to name

* Task #163911: Added cols client issued to and client issued to name

Co-authored-by: MeghaBiranje <[email protected]>

* Task #163318 fix: Show image for the first time also to make it responsive (#43)

* Task #163318 chore: Added height width in media query (#42)

* Task #163314 chore: Add social sharing config and buttons

* Task #163314 chore: Resolve comments

* Task #163314 chore: Resolve comments

* Task #163317 chore: Make Certificate Available in image Format

* Task #163314 chore: Resolve comments

* Task #164387 chore:Certificate list view changes

* Task #163318 chore: Certificate page detail view

* Task #164387 chore: Resolve comments

* Task #164387 chore: Resolve comments

* Task #163318 chore: Certificate page detail view

* Task #163318 chore: Certificate page detail view

* Task #164387 chore:Certificate list view changes

* Task #163318 chore: Resolve comments

* Task #164387 chore: Resolve comments

* Task #164387 chore: Resolve comments

* Task #163318 chore: Resolve comments

* Task #163318 chore: Update code

* Task #163318 chore: Update code

* Task #163318 chore: Update code changes for Certificateshare feature

* Task #163318 chore: Update code changes for Certificateshare feature

* Task #163318 chore: Update code changes for Certificateshare feature

* Task #163318 chore: Update code changes for Certificateshare feature

* Task #163318 chore: Update code changes for Certificateshare feature

* Task #163318 chore: Update code changes for Certificateshare feature

* Task #163318 chore: Update code changes for Certificate detail page

* Task #163318 chore: Update code changes for Certificate detail page

* Task #163318 chore: Update code changes for Certificate detail page

* Task #163318 chore: Add back button on detail view

* Task #163318 chore: Update code changes for Certificate Detail View

* Task #163318 chore: Update download image link

* Task #163318 chore: Resolve conflicts

* Task #163318 chore: Update code for download link

* Task #163318 chore: Added height widthin media query

* Task #163318 fix: Design issue and conditional code move (#44)

* Task #163318 fix: Show image for the first time also to make it responsive

* Task #163318 fix: Design issue and conditional code move

* Task #163318 chore: Update code for Share functionality on plugin disabled (#45)

* Task #163318 chore: Update code for Share functionality on plugin disabled

* Task #163318 chore: Update code for Share functionality on plugin disabled

* Task #163318 chore: Update download button URL (#46)

Co-authored-by: punambaravkar <[email protected]>
Co-authored-by: MeghaBiranje <[email protected]>
Co-authored-by: Tushar Shekokar <[email protected]>
  • Loading branch information
4 people authored Sep 10, 2020
1 parent 2737130 commit 4cf1f22
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class TjCertificateCertificate extends CMSObject

private $client_id = 0;

private $client_issued_to = 0;

private $client_issued_to_name = "";

private $user_id = 0;

public $state = 1;
Expand Down Expand Up @@ -148,6 +152,58 @@ public function getClientId()
return $this->client_id;
}

/**
* Set client issued to
*
* @param integer $value Value to set client issued to.
*
* @return void.
*
* @since __DEPLOY_VERSION__
*/
public function setClientIssuedTo($value = 0)
{
$this->client_issued_to = $value;
}

/**
* Get client issued to
*
* @return string Client issued to.
*
* @since __DEPLOY_VERSION__
*/
public function getClientIssuedTo()
{
return $this->client_issued_to;
}

/**
* Set client issued to name
*
* @param string $value Value to set client issued to name.
*
* @return void.
*
* @since __DEPLOY_VERSION__
*/
public function setClientIssuedToName($value = "")
{
$this->client_issued_to_name = $value;
}

/**
* Get client issued to name
*
* @return string Client issued to name.
*
* @since __DEPLOY_VERSION__
*/
public function getClientIssuedToName()
{
return $this->client_issued_to_name;
}

/**
* Set User Id
*
Expand Down Expand Up @@ -432,21 +488,28 @@ public function bind(&$array)
/**
* Method to get issued certificate list
*
* @param string $client Client e.g. com_tjlms.course
* @param string $client Client e.g. com_tjlms.course
*
* @param integer $clientId Specific client id
* @param integer $clientId Specific client id
*
* @param integer $userId User Id
* @param integer $userId User Id
*
* @param boolean $expired Get expired certificates
* @param boolean $expired Get expired certificates
*
* @param boolean $clientIssuedTo Client issued to
*
* @return boolean|array Issued certificate array
*
* @since 1.0
*/
public static function getIssued($client, $clientId, $userId, $expired = false)
public static function getIssued($client, $clientId, $userId = 0, $expired = false, $clientIssuedTo = 0)
{
if (empty($client) || empty($clientId) || empty($userId))
if (empty($client) || empty($clientId))
{
return false;
}

if (empty($userId) && empty($clientIssuedTo))
{
return false;
}
Expand All @@ -455,7 +518,16 @@ public static function getIssued($client, $clientId, $userId, $expired = false)

$model->setState('filter.client', $client);
$model->setState('filter.client_id', $clientId);
$model->setState('filter.user_id', $userId);

if (!empty($userId))
{
$model->setState('filter.user_id', $userId);
}

if ($clientIssuedTo)
{
$model->setState('filter.client_issued_to', $clientIssuedTo);
}

if ($expired)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ protected function getListQuery()
$query->where($db->quoteName('ci.user_id') . ' = ' . (int) $userId);
}

// Filter by client issued to
$clientIssuedTo = $this->getState('filter.client_issued_to');

if (!empty($clientIssuedTo))
{
$query->where($db->quoteName('ci.client_issued_to') . ' = ' . (int) $clientIssuedTo);
}

// Filter by search in title.
$search = $this->getState('filter.search');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ CREATE TABLE IF NOT EXISTS `#__tj_certificate_issue` (
`generated_body` text NOT NULL,
`client` varchar(100) NOT NULL,
`client_id` int(11) NOT NULL,
`client_issued_to` int(11) NOT NULL,
`client_issued_to_name` varchar(400) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` int(11) NOT NULL,
`comment` text NULL,
`state` tinyint(3) NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE `#__tj_certificate_issue` ADD `client_issued_to` int(11) NOT NULL AFTER `user_id`;
ALTER TABLE `#__tj_certificate_issue` ADD `client_issued_to_name` varchar(400) COLLATE 'utf8mb4_unicode_ci' NOT NULL AFTER `client_issued_to`;
10 changes: 6 additions & 4 deletions src/components/com_tjcertificate/media/css/tjCertificate.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@
float: left;
}
#certificateContent{
/*
min-height: 800px;
width: 1150px;
*/
margin: 0 auto;
}
.tj-certificate-content{
Expand All @@ -152,6 +148,7 @@
border-radius: 5px;
margin-left: 4px;
border: 1px solid #ddd;
display: inline-block;
}
.tjlmspin__caption_desc{
line-height: 18px;
Expand Down Expand Up @@ -186,4 +183,9 @@
.tjlmslist .thumbnail{
border:0;
}

#certificateContent{
min-height: 800px;
width: 1150px;
}
}
14 changes: 10 additions & 4 deletions src/components/com_tjcertificate/media/js/certificateImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,23 @@ var certificateImage = {
},
success: function(data) {
result = data;
Joomla.loadingLayer('hide');

var certificateId = jQuery("#certificateId").val();
var imagePath = certRootUrl + 'media/com_tjcertificate/certificates/';
var img = document.createElement('img');
jQuery('#certificateContent').hide();
img.src = imagePath + certificateId + ".png";
jQuery("#previewImage").append(img);
setTimeout(function(){
Joomla.loadingLayer('hide'); },
1000);
}
});

return result;
},

generateImage: function(element) {
var certificateId = jQuery("#certificateId").val();
var imagePath = certRootUrl + 'media/com_tjcertificate/certificates/';
jQuery('#certificateContent').width(element.offsetWidth).height(element.offsetHeight);
Joomla.loadingLayer('show');

Expand All @@ -56,7 +63,6 @@ var certificateImage = {
scrollY: -window.scrollY,
allowTaint: true
}).then(function(canvas) {
jQuery("#downloadImage").attr("href", canvas.toDataURL('image/png'));
certificateImage.enableDownloadShareBtns();
certificateImage.uploadImage(canvas.toDataURL('image/png'));
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

$options['relative'] = true;
HTMLHelper::_('jquery.framework');
HTMLHelper::_('behavior.framework');
HTMLHelper::StyleSheet('media/com_tjcertificate/vendors/font-awesome-4.1.0/css/font-awesome.min.css');
HTMLHelper::StyleSheet('media/com_tjcertificate/css/tjCertificate.css');
HTMLHelper::StyleSheet('media/com_tjlms/vendors/artificiers/artficier.css');
Expand Down Expand Up @@ -60,7 +61,8 @@
// For facebook and linkedin
$config = Factory::getConfig();
$siteName = $config->get('sitename');
$document->addCustomTag('<meta property="og:title" content="' . $this->escape($this->item->title) . '" />');
$ogTitle = $this->item->title ? $this->escape($this->item->title) : $this->escape($siteName) . ' ' .Text::_('COM_TJCERTIFICATE_CERTIFICATE_DETAIL_VIEW_HEAD');
$document->addCustomTag('<meta property="og:title" content="' . $ogTitle . '" />');
$document->addCustomTag('<meta property="og:image" content="' . $this->imagePath . '" />');
$document->addCustomTag('<meta property="og:description" content="' . $this->escape($description) . '" />');
$document->addCustomTag('<meta property="og:site_name" content="' . $this->escape($siteName) . '" />');
Expand Down Expand Up @@ -97,7 +99,7 @@
}
?>
</div>
<div class="col-xs-12 col-md-4">
<div class="col-xs-12 col-md-4 mb-25">
<?php
if ($this->certificate->getUserId() == Factory::getUser()->id)
{
Expand All @@ -108,21 +110,19 @@
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_DOWNLOAD');?>
</a>
<div id="download-popover-content" class="hide">
<a class="d-block mb-15" id="downloadImage" href="<?php echo $imageUrl;?>" download ><i class="fa fa-download mr-5" aria-hidden="true"></i>
<a class="d-block mb-15" id="downloadImage" href="<?php echo $this->imagePath;?>" download ><i class="fa fa-download mr-5" aria-hidden="true"></i>
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_DOWNLOAD_AS_IMAGE'); ?>
</a>
<?php
if ($this->certificate->getDownloadUrl())
{
?>

<a class="d-block mb-15" href="<?php echo $this->certificate->getDownloadUrl();?>">
<i class="fa fa-file-pdf-o mr-5" aria-hidden="true"></i>
<?php
echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_DOWNLOAD_PDF');
?>
</a>

<a class="d-block mb-15" href="<?php echo $this->certificate->getDownloadUrl();?>">
<i class="fa fa-file-pdf-o mr-5" aria-hidden="true"></i>
<?php
echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_DOWNLOAD_PDF');
?>
</a>
<?php
}
?>
Expand All @@ -138,18 +138,17 @@
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_DOWNLOAD_SHARE');?>
</a>

<?php
} ?>
<div id="sharing-popover-content" class="hide">
<div class="tj-certificate-sharing">
<?php
if (isset($this->item))
{
echo $this->loadTemplate('social_sharing');
}
echo $this->loadTemplate('social_sharing');
?>
</div>
</div>

<?php
}
?>
</div>
</div>
<?php
Expand Down
2 changes: 1 addition & 1 deletion src/components/com_tjcertificate/tjcertificate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://techjoomla.com</authorUrl>
<description />
<version>1.0.0</version>
<version>1.0.1</version>
<install>
<!-- Runs on install -->
<sql>
Expand Down

0 comments on commit 4cf1f22

Please sign in to comment.