Skip to content

Commit

Permalink
Merge pull request #332 from ChavanAnkitaMahesh/Bug130261
Browse files Browse the repository at this point in the history
Bug 333 fix : Live > Applicant account > application form > work experience > delete a section :: Needs confirmation message before deleting.
  • Loading branch information
ankush-maherwal authored Jan 13, 2020
2 parents 768464e + ceb309e commit 02ac499
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
12 changes: 12 additions & 0 deletions src/components/com_tjucm/media/js/ui/item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* confirmation message before item deletion */
jQuery(window).ready(function () {
jQuery('.delete-button').click(deleteItem);
});

function deleteItem()
{
if (!confirm(Joomla.JText._('COM_TJUCM_DELETE_MESSAGE')))
{
return false;
}
}
1 change: 1 addition & 0 deletions src/components/com_tjucm/media/js/ui/item.min.js

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

5 changes: 5 additions & 0 deletions src/components/com_tjucm/site/includes/tjucm.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ public static function init($location = 'site')
HTMLHelper::StyleSheet('media/com_tjucm/css/tjucm.css', $options);
}

if ($view == 'item')
{
HTMLHelper::script('media/com_tjucm/js/ui/item.js');
}

$loaded[$location] = true;
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/components/com_tjucm/site/views/item/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?php
/**
* @package TJ-UCM
*
* @author TechJoomla <[email protected]>
* @package TJ-UCM
* @author TechJoomla <[email protected]>
* @copyright Copyright (c) 2009-2019 TechJoomla. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

// No direct access
defined('_JEXEC') or die;

/*To load language constant of js file*/
JText::script('COM_TJUCM_DELETE_MESSAGE');

$user = JFactory::getUser();

if ($this->form_extra)
Expand Down Expand Up @@ -59,7 +61,7 @@
{
$redirectURL = JRoute::_('index.php?option=com_tjucm&task=itemform.remove&id=' . $this->item->id . '&client=' . $this->client . "&" . JSession::getFormToken() . '=1', false);
?>
<a class="btn btn-default" href="<?php echo $redirectURL; ?>"><?php echo JText::_("COM_TJUCM_DELETE_ITEM"); ?></a>
<a class="btn btn-default delete-button" href="<?php echo $redirectURL; ?>"><?php echo JText::_("COM_TJUCM_DELETE_ITEM"); ?></a>
<?php
}
?>
Expand Down
10 changes: 5 additions & 5 deletions src/components/com_tjucm/site/views/itemform/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@
</div>
<?php
if ($this->form_extra)
{
if($this->id!='0')
{
if ($this->id != '0')
{
?>
<div class="page-header">
<h1 class="page-title">
<?php echo JText::_("COM_TJUCM_EDIT_FORM") .": ". strtoupper($this->title); ?>
<?php echo JText::_("COM_TJUCM_EDIT_FORM") . ": " . strtoupper($this->title); ?>
<h1>
</div><?php
</div><?php
}
else
{
Expand All @@ -133,7 +133,7 @@
<h1 class="page-title">
<?php echo strtoupper($this->title); ?>
<h1>
</div><?php
</div><?php
}?>
<div class="form-horizontal">
<?php
Expand Down

0 comments on commit 02ac499

Please sign in to comment.