-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-1.2.4' into Bug#154975
- Loading branch information
Showing
26 changed files
with
535 additions
and
122 deletions.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
src/components/com_tjucm/administrator/houseKeeping/1.2.4/updateAlias.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
/** | ||
* @package TJ-UCM | ||
* @subpackage com_tjucm | ||
* | ||
* @author Techjoomla <extensions@techjoomla.com> | ||
* @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL | ||
*/ | ||
|
||
// No direct access | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
/** | ||
* Migration file for TJ-UCM | ||
* | ||
* @since 1.2.4 | ||
*/ | ||
class TjHouseKeepingUpdateAlias extends TjModelHouseKeeping | ||
{ | ||
public $title = "Update Types Alias"; | ||
|
||
public $description = 'Update UCM Types alias'; | ||
|
||
/** | ||
* Subform migration script | ||
* | ||
* @return void | ||
* | ||
* @since 1.2.4 | ||
*/ | ||
public function migrate() | ||
{ | ||
JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjucm/tables'); | ||
JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_menus/tables'); | ||
|
||
// TJ-Fields helper object | ||
$tjfieldsHelper = new TjfieldsHelper; | ||
|
||
$result = array(); | ||
|
||
try | ||
{ | ||
// Get all the UCM types | ||
$db = JFactory::getDbo(); | ||
$query = $db->getQuery(true); | ||
$query->select('*'); | ||
$query->from($db->qn('#__tj_ucm_types')); | ||
$db->setQuery($query); | ||
$ucmTypes = $db->loadObjectlist(); | ||
|
||
if (!empty($ucmTypes)) | ||
{ | ||
foreach ($ucmTypes as $ucmType) | ||
{ | ||
$ucmTypeTable = JTable::getInstance('Type', 'TjucmTable', array('dbo', $db)); | ||
|
||
// Remove white spaces in alias of UCM types | ||
$updatedAlias = JFilterOutput::stringURLSafe($ucmTypeTable->alias); | ||
$oldAlias = $ucmTypeTable->alias; | ||
$ucmTypeTable->alias = $updatedAlias; | ||
$ucmTypeTable->store(); | ||
|
||
$result['status'] = ''; | ||
$result['message'] = "Migration in progress"; | ||
} | ||
} | ||
|
||
// Get all the menus of UCM types | ||
$query->from($db->quoteName('#__menu')); | ||
$query->where( | ||
$db->quoteName(link) . "=" . $db->quote('index.php?option=com_tjucm&view=itemform') . | ||
"||" . $db->quoteName(link) . "=" . $db->quote('index.php?option=com_tjucm&view=items') | ||
); | ||
$db->setQuery($query); | ||
$menuItems = $db->loadObjectlist(); | ||
|
||
if (!empty($menuItems)) | ||
{ | ||
foreach ($menuItems as $menuItem) | ||
{ | ||
$menuItemTable = JTable::getInstance('Menu', 'MenusTable', array('dbo', $db)); | ||
$oldparams = json_decode($menuItemTable->params); | ||
|
||
// Remove white spaces in alias of menus | ||
$oldparams->ucm_type = JFilterOutput::stringURLSafe($oldparams->ucm_type); | ||
$menuItemTable->params = json_encode($oldparams); | ||
$menuItemTable->store(); | ||
$result['status'] = ''; | ||
$result['message'] = "Migration in progress"; | ||
} | ||
} | ||
|
||
$result['status'] = true; | ||
$result['message'] = "Migration successful"; | ||
} | ||
catch (Exception $e) | ||
{ | ||
$result['err_code'] = ''; | ||
$result['status'] = false; | ||
$result['message'] = $e->getMessage(); | ||
} | ||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.