Skip to content

Commit

Permalink
Merge Release 1.0.2 into Master (#71)
Browse files Browse the repository at this point in the history
* Bug #164674 fix: search box for cert-xxxx is showing error (#48)

* Bug #164625 fix: title is showing blank data, it should display course name (#49)

* Bug #164705 fix: click on the social media post the back button on the certificate is of no use (#52)

* Bug #164705 fix: click on the social media post :: the back button on the certificate is of no use

* Bug #164705 fix: Resolve comment

* Bug #164707 fix: user able to download others certificate as well (#53)

* Bug #164707 fix: user able to download others certificate as well

* Bug #164707 fix: Resolve comments

* Bug #164707 fix: Resolve comments

* Bug #164707 fix: Resolve comment

* Task #164910 chore: Button to copy shareble certificate link (#51)

* Task #164910 chore: Button to copy shareble certificate link

* Task #164910 chore: Button to copy shareble certificate link

* Task #164910 chore: Button to copy shareble certificate link

* Task #164910 chore: Resolve comment

* Task #164910 chore: Resolve comments

* Task #164910 chore: Resolve comments

* Task #164910 chore: Resolve comments

* Task #164910 chore: Resolve comments

* Task #163318 fix: Fixed image cut issue while image generation (#54)

* Issue #164867 style: desing changes update (#50)

Co-authored-by: “Mangesh <“[email protected]”>

* Task #163318 fix: Added fixed width height for certificate container (#58)

* Bug165031 : Backend > Attendees > Error '0 Call to a member function getDownloadUrl() on string' occurs on checkin the attendee (#62)

Co-authored-by: Snehal Patil <[email protected]>

* Task #165230 Chore: Back end>>Issued Certificate >> Search should also be done by username. (#59)

* Task #165122 Chore: Backend certificate view changes- Adding Course co… (#55)

* Task #165122 Chore: Backend certificate view changes- Adding Curse column at Issued certificate View

* Changing title of column

* Resolving conflicts

* Task #165122 Chore: Backend Issued certificate view changes- Adding attendee… (#56)

* Task #165122 Chore: Backend certificate view changes- Adding attendee name to the user column

* Changing title of column User

* Resolving phpcs issue

* Resolving conflicts

* Task #165166 Chore: Add Certificate Url column under Issued Certificate View (#57)

* Task #165166 Chore: Add Copy Url column under Issued Cetificate VIew

* Resolving conflicts

* Resolving comments

* Resolving comments

* Resolving comments

* Task #165166 Feat: Adding (#63)

* Bug165031 : Backend > Attendees > Error '0 Call to a member function … (#64)

* Bug165031 : Backend > Attendees > Error '0 Call to a member function …

* Bug165031 : Backend > Attendees > Error '0 Call to a member function …

Co-authored-by: Snehal Patil <[email protected]>

* Task #165259 Chore: Adding proper names to the client filter and column in Issue… (#66)

* Task #165259 Chore: Adding proper names to the client filter in Issued Certificate view

* Adding names to client column

* Task #165259 Chore: Renaming Unique Certificate Id column name to Certificate Id at both end (#67)

* Task #165259 Chore: Reordering columns of Issues Certificate View (#68)

* Issue #000 chore: Release version change (#70)

Co-authored-by: Tushar Shekokar <[email protected]>
Co-authored-by: Mangesh Mane <[email protected]>
Co-authored-by: “Mangesh <“[email protected]”>
Co-authored-by: snehal patil <[email protected]>
Co-authored-by: Snehal Patil <[email protected]>
Co-authored-by: divyachaudhari <[email protected]>
  • Loading branch information
7 people authored Oct 1, 2020
1 parent 10be00b commit 2aa9fe0
Show file tree
Hide file tree
Showing 16 changed files with 267 additions and 61 deletions.
2 changes: 2 additions & 0 deletions src/components/com_tjcertificate/administrator/access.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
<action name="template.edit" title="COM_TJCERTIFICATE_PERMISSION_TEMPLATE_EDIT_ALL_TITLE" description="COM_TJCERTIFICATE_PERMISSION_TEMPLATE_EDIT_ALL_DESC" />
<action name="template.edit.own" title="COM_TJCERTIFICATE_PERMISSION_TEMPLATE_EDIT_OWN_TITLE" description="COM_TJCERTIFICATE_PERMISSION_TEMPLATE_EDIT_OWN_DESC" />
<action name="certificate.download.own" title="COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_OWN" description="COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_OWN_DESC" />
<action name="certificate.download.all" title="COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_ALL" description="COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_ALL_DESC" />
</section>
</access>
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public function download()
}

$certificate = TJCERT::Certificate();

// Check user having permission to download
if (!$certificate::canDownload($uniqueCertificateId))
{
$app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'));
$app->redirect('index.php');
}

$certificateObj = $certificate::validateCertificate($uniqueCertificateId);

if (!$certificateObj->id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_COMMENT="Comment"

;Certificate - Filters
COM_TJCERTIFICATE_CERTIFICATE_FILTER_SEARCH_LABEL="Search"
COM_TJCERTIFICATE_CERTIFICATE_FILTER_SEARCH_LABEL_DESC="Search in template title. Prefix with ID:to search for a Certificate ID"
COM_TJCERTIFICATE_CERTIFICATE_FILTER_SEARCH_LABEL_DESC="Search in template title. Prefix with ID:to search for a Certificate ID. Search for User Name"
COM_TJCERTIFICATE_CERTIFICATE_FILTER_CERTIFICATE_TEMPLATE_SELECT="- Select Template -"
COM_TJCERTIFICATE_CERTIFICATE_FILTER_CERTIFICATE_TEMPLATE="Template"
COM_TJCERTIFICATE_CERTIFICATE_FILTER_DESC_CERTIFICATE_TEMPLATE="Select Template"
Expand Down Expand Up @@ -250,3 +250,21 @@ COM_TJCERTIFICATE_SOCIAL_SHARING_OPTIONS="Select social sharing options"
;Certificate Menu option
COM_TJCERTIFICATE_CERTIFICATE_TEXT_FILTER="Show Free Text Filter"
COM_TJCERTIFICATE_CERTIFICATE_TYPE_FILTER="Show Certificate Type Filter"

;Certificate PDF download permissions
COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_OWN="Download own certificate"
COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_OWN_DESC="Allow users to download own certificate"
COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_ALL="Download all certificate"
COM_TJCERTIFICATE_PERMISSION_CERTIFICATE_DOWNLOAD_ALL_DESC="Allow users to download all certificate"

;Issued Certificate View
COM_TJCERTIFICATE_CERTIFICATE_EXPIRED="Certificate expired"
COM_TJCERTIFICATE_CERTIFICATE_URL_COPY="Copy Url"
COM_TJCERTIFICATE_CERTIFICATE_URL="Certificate Url"
COM_TJCERTIFICATE_CERTIFICATE_TYPE_NAME="Title"
COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_USER_NAME="User Name"
COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_CERTIFICATE_ID="Certificate Id"
COM_TJCERTIFICATE_CERTIFICATE_FILTER_CERTIFICATE_TYPE_SELECT="- Select Type -"
COM_TJCERTIFICATE_CLIENT_COM_TJLMS_COURSE="Course"
COM_TJCERTIFICATE_CLIENT_COM_JTICKETING_EVENT="Event"
COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_TYPE="Type"
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,11 @@ public function getUrl($options, $showSearchBox = true)
{
$url = 'index.php?option=com_tjcertificate&view=certificate&certificate=' . $this->unique_certificate_id;

$url .= '&show_search=' . $showSearchBox;
// If search box is true then only show search box param in URL
if ($showSearchBox)
{
$url .= '&show_search=' . $showSearchBox;
}

if (isset($options['popup']))
{
Expand Down Expand Up @@ -751,8 +755,8 @@ public function issueCertificate($replacements, $options)
{
try
{
// Check user_id or certificate_template_id (this is needed to generate certificate body) is empty
if (empty($this->user_id) || empty($this->certificate_template_id))
// Check user_id or issued Id or certificate_template_id (this is needed to generate certificate body) is empty
if ((empty($this->user_id) && empty($this->client_issued_to)) || empty($this->certificate_template_id))
{
throw new Exception(Text::_('COM_TJCERTIFICATE_CERTIFICATE_EMPTY_DATA'));
}
Expand Down Expand Up @@ -937,4 +941,36 @@ protected function generateUniqueCertId($options)

return $certificateString;
}

/**
* This function checks the certificate download permission
*
* @param STRING $uniqueCertificateId certificate Id
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
public static function canDownload($uniqueCertificateId)
{
$user = Factory::getUser();

if ($user->authorise('certificate.download.all', 'com_tjcertificate'))
{
return true;
}

if ($user->authorise('certificate.download.own', 'com_tjcertificate'))
{
$table = TJCERT::table("certificates");
$table->load(array('unique_certificate_id' => $uniqueCertificateId));

if ($user->get('id') == $table->user_id)
{
return true;
}
}

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ protected function getListQuery()
else
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where(' (ct.title LIKE ' . $search . ' OR ci.unique_certificate_id LIKE ' . $search . ' )');
$query->where(' (ct.title LIKE ' . $search . ' OR ci.unique_certificate_id LIKE '
. $search . ' OR ci.client_issued_to_name LIKE ' . $search .
' OR users.name LIKE ' . $search . ' )');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
</field>

<field name="client"
type="sql"
query="SELECT DISTINCT (`client`) FROM `#__tj_certificate_issue` ORDER BY client ASC" key_field="client" value_field="client"
type="getclientlist"
filter="safehtml"
label="COM_TJCERTIFICATE_CERTIFICATE_FILTER_CERTIFICATE_CLIENT"
description="COM_TJCERTIFICATE_CERTIFICATE_FILTER_DESC_CERTIFICATE_CLIENT"
onchange="this.form.submit();">
<option value="">COM_TJCERTIFICATE_CERTIFICATE_FILTER_CERTIFICATE_CLIENT_SELECT</option>
</field>
addfieldpath="/components/com_tjcertificate/models/fields"
clientByUser="0"
onchange="this.form.submit();" />

<!-- <field
name="user_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,24 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;

$options = array();
$options['relative'] = true;

HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');
HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('formbehavior.chosen', 'select');
HTMLHelper::_('behavior.modal', 'a.modal');
HTMLHelper::script('com_tjcertificate/certificateImage.min.js', $options);

$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'ci.id';
$dispatcher = JDispatcher::getInstance();
PluginHelper::importPlugin('content');

if ( $saveOrder )
{
Expand Down Expand Up @@ -81,23 +89,29 @@
</th>

<th>
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_UNIQUE_ID'); ?>
</th>
<th>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_TEMPLATE', 'ci.certificate_template_id', $listDirn, $listOrder); ?>
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_CERTIFICATE_ID'); ?>
</th>
<th>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_CLIENT', 'ci.client', $listDirn, $listOrder); ?>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_USER_NAME', 'ci.user_id', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_USER', 'ci.user_id', $listDirn, $listOrder); ?>
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_TYPE_NAME'); ?>
</th>
<th>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_ISSUED_DATE', 'ci.issued_on', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_EXPIRY_DATE', 'ci.expired_on', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_TYPE', 'ci.client', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_TEMPLATE', 'ci.certificate_template_id', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_URL'); ?>
</th>
<th>
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_LIST_VIEW_COMMENT'); ?>
</th>
Expand All @@ -117,6 +131,7 @@
<?php
foreach ($this->items as $i => $item)
{
$data = $dispatcher->trigger('getCertificateClientData', array($item->client_id, $item->client));
$item->max_ordering = 0;

$canEdit = $this->canDo->get('core.edit');
Expand Down Expand Up @@ -155,9 +170,27 @@

</div>
</td>
<td><?php echo $this->escape($item->title); ?></td>
<td><?php echo $this->escape($item->client); ?></td>
<td><?php echo $this->escape($item->uname); ?></td>
<td>
<?php
$userName = '-';

if (!empty($item->client_issued_to_name))
{
$userName = $this->escape($item->client_issued_to_name);
}
elseif (!empty($item->uname))
{
$userName = $this->escape($item->uname);
}

echo $userName;
?>
</td>
<td>
<?php
echo (!empty($data[0]->title)) ? $data[0]->title : '-';
?>
</td>
<td><?php echo HTMLHelper::date($item->issued_on, Text::_('DATE_FORMAT_LC')); ?></td>
<td><?php
if (!empty($item->expired_on) && $item->expired_on != '0000-00-00 00:00:00')
Expand All @@ -168,7 +201,42 @@
{
echo '-';
}
?></td>
?>
</td>
<td>
<?php
$client = str_replace(".", "_", $item->client);
$client = strtoupper("COM_TJCERTIFICATE_CLIENT_" . $client);
echo TEXT::_($client);
?>
</td>
<td><?php echo $this->escape($item->title); ?></td>
<td>
<?php
$utcNow = Factory::getDate()->toSql();

if ($item->expired_on > $utcNow || $item->expired_on == '0000-00-00 00:00:00')
{
// Get TJcertificate url for display certificate
$urlOpts = array ('absolute' => '');
$link = TJCERT::Certificate($item->id)->getUrl($urlOpts, false);
?>
<div class="btn-group">
<a id="copyurl<?php echo $item->id;?>" data-toggle="popover"
data-placement="bottom" data-content="Copied!"
data-alt-url="<?php echo $link;?>" class="btn" type="button"
onclick="certificateImage.copyUrl('copyurl<?php echo $item->id;?>');">
<?php echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_URL_COPY');?>
</a>
</div>
<?php
}
else
{
echo Text::_('COM_TJCERTIFICATE_CERTIFICATE_EXPIRED');
}
?>
</td>
<td><?php echo $this->escape($item->comment); ?></td>
<td><?php echo (int) $item->id; ?></td>
</tr>
Expand Down
35 changes: 29 additions & 6 deletions src/components/com_tjcertificate/media/css/tjCertificate.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,20 @@
.bs-v1 {
box-shadow: 0 4px 10px 0 rgba(0,0,0,0.1);
}
.line-h-noraml{
line-height: normal;
}
.w-100{
width:100%;
}
.tj-certificate-image {
background-color: #fff;
width: 100%;
float: left;
}
.tj-certificate-image img{
width: 100%;
}
#certificateContent{
margin: 0 auto;
}
Expand All @@ -148,32 +157,47 @@
border-radius: 5px;
margin-left: 4px;
border: 1px solid #ddd;
display: inline-block;
display: inline-block !important;
}
.tjlmspin__caption_desc{
line-height: 18px;
font-size: 14px;
margin-bottom: 10px;
}
.tjlmspin__position {
.tjlmspin__position,
.eventlist__price
{
position: absolute;
top: 9px;
background: #FAF8F8;
padding: 1px 10px;
color: #333;
font-weight: 600;
}
.tjlmslist .tjlmslist__image .tjlmspin__price {
.tjlmslist .tjlmslist__image .tjlmspin__price,
.eventlist .eventlist__price
{
left: 25px;
}
.tjlmspin.mobile-view{
.tjlmspin.mobile-view,
.eventpin.mobile-view
{
width: 255px;
margin: 0 auto;
float: none;
}
.view-certificate .popover-title{
display: none;
}
.tj-certificate .thumbnail{
min-height: auto !important;
width: 100% !important;
}
.eventlist__desc{
height: 20px;
overflow: hidden;
display: inline-block;
}
@media screen and (max-width: 600px) {
.tj-certificate-share-download{
text-align: center;
Expand All @@ -183,9 +207,8 @@
.tjlmslist .thumbnail{
border:0;
}

#certificateContent{
min-height: 800px;
width: 1150px;
}
}
}
Loading

0 comments on commit 2aa9fe0

Please sign in to comment.