diff --git a/src/components/com_tjucm/administrator/assets/css/tjucm.css b/src/components/com_tjucm/administrator/assets/css/tjucm.css index 7ae82a71..c323376d 100644 --- a/src/components/com_tjucm/administrator/assets/css/tjucm.css +++ b/src/components/com_tjucm/administrator/assets/css/tjucm.css @@ -1,33 +1,3 @@ -.icon-48-types { -background-image: url(../images/l_types.png); -padding-left:60px!important; -} - -.icon-48-type { -background-image: url(../images/l_types.png); -padding-left:60px!important; -} - -.color-box-types { -float: left;width: 15px;height: 15px;margin-right: 5px;border: 1px solid rgba(0, 0, 0, .2);} - -.icon-48-items { -background-image: url(../images/l_items.png); -padding-left:60px!important; -} - -.icon-48-item { -background-image: url(../images/l_items.png); -padding-left:60px!important; -} - -.color-box-items { -float: left;width: 15px;height: 15px;margin-right: 5px;border: 1px solid rgba(0, 0, 0, .2);} - -.other-filters{ - padding: 0 14px; -} - /* CSS for frontend*/ #item-form .radio input{ margin-left:5px !important; diff --git a/src/components/com_tjucm/administrator/assets/js/tjucm_type.js b/src/components/com_tjucm/administrator/assets/js/tjucm_type.js deleted file mode 100644 index 442914a5..00000000 --- a/src/components/com_tjucm/administrator/assets/js/tjucm_type.js +++ /dev/null @@ -1,3 +0,0 @@ -js = jQuery.noConflict(); -js(document).ready(function () { -}); diff --git a/src/components/com_tjucm/administrator/classes/funlist.php b/src/components/com_tjucm/administrator/classes/funlist.php deleted file mode 100644 index 33c7ffe4..00000000 --- a/src/components/com_tjucm/administrator/classes/funlist.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved. - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - */ - -defined('_JEXEC') or die('Restricted access'); -jimport('joomla.form.form'); - -/** - * Extra function list. - * - * @package Joomla.site - * @subpackage com_tjucm - * - * @since 1.0 - */ -class TjucmFunList -{ - /** - * Function to get data - * - * @param STRING $table Name of database table - * @param STRING $selectList Selected value colume name - * @param STRING $where Query where condition - * @param STRING $returnObject Selecting data using JDatabase - link https://docs.joomla.org/Selecting_data_using_JDatabase - * @param STRING $joinType LEFT, RIGHT etc - * @param STRING $joinTable Name of database table - * - * @return true - * - * @since 1.0.0 - */ - public function getDataValues($table, $selectList = "*", $where = "", $returnObject = "", $joinType = "", $joinTable = "") - { - // Ref - link https://docs.joomla.org/Selecting_data_using_JDatabase - - $db = JFactory::getDbo(); - $query = $db->getQuery(true); - - $query->select($selectList); - $query->from($table); - - if ($joinTable) - { - $query->join($joinType, $joinTable); - } - - if ($where) - { - $query->where($where); - } - - $db->setQuery($query); - - return $db->$returnObject(); - } -} diff --git a/src/components/com_tjucm/administrator/houseKeeping/1.1.0/ucmSubformData.php b/src/components/com_tjucm/administrator/houseKeeping/1.1.0/ucmSubformData.php index dcdc6725..28a9cc9b 100644 --- a/src/components/com_tjucm/administrator/houseKeeping/1.1.0/ucmSubformData.php +++ b/src/components/com_tjucm/administrator/houseKeeping/1.1.0/ucmSubformData.php @@ -128,14 +128,11 @@ public function migrate() // Save ucmSubForm records if (!empty($ucmSubFormDataSet)) { - $itemFormModel = BaseDatabaseModel::getInstance('ItemForm', 'TjucmModel', array('ignore_request' => true)); - // Set ucm type id to check permission in Item form model save() for logged-in user $ucmTypeId = $tjUcmModelType->getTypeId($ucmSubFormClient); - $itemFormModel->setState('ucmType.id', $ucmTypeId); // Call method to save ucmsubform data into new UCM data - $subFormContentIds = $itemFormModel->saveUcmSubFormRecords($validData, $ucmSubFormDataSet); + $subFormContentIds = $this->saveUcmSubFormRecords($validData, $ucmSubFormDataSet, $ucmTypeId); // To update existing ucm subform field value from JSON to subform ucm type name if ($subFormContentIds) @@ -163,4 +160,104 @@ public function migrate() return $result; } + + /** + * Function to save ucmSubForm records + * + * @param ARRAY &$validData Parent record data + * @param ARRAY $ucmSubFormDataSet ucmSubForm records data + * @param ARRAY $ucmTypeId UCM Type Id + * + * @return ARRAY + */ + public function saveUcmSubFormRecords(&$validData, $ucmSubFormDataSet, $ucmTypeId) + { + $db = JFactory::getDbo(); + $subFormContentIds = array(); + $isNew = empty($validData['id']) ? 1 : 0; + + // Delete removed subform details + if (!$isNew) + { + $query = $db->getQuery(true); + $query->select('id'); + $query->from($db->quoteName('#__tj_ucm_data')); + $query->where($db->quoteName('parent_id') . '=' . $validData['id']); + $db->setQuery($query); + $oldSubFormContentIds = $db->loadColumn(); + } + + JLoader::import('components.com_tjfields.tables.fieldsvalue', JPATH_ADMINISTRATOR); + JLoader::import('components.com_tjfields.tables.field', JPATH_ADMINISTRATOR); + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjucm/models'); + $tjUcmModelType = JModelLegacy::getInstance('Type', 'TjucmModel'); + $itemFormModel = BaseDatabaseModel::getInstance('ItemForm', 'TjucmModel', array('ignore_request' => true)); + $itemFormModel->setState('ucmType.id', $ucmTypeId); + + if (!empty($ucmSubFormDataSet)) + { + foreach ($ucmSubFormDataSet as $client => $ucmSubFormTypeData) + { + $validData['client'] = $client; + $validData['type_id'] = $tjUcmModelType->getTypeId($client); + $clientDetail = explode('.', $client); + + // This is an extra field which is used to render the reference of the ucmsubform field on the form (used in case of edit) + $ucmSubformContentIdFieldName = $clientDetail[0] . '_' . $clientDetail[1] . '_' . 'contentid'; + $count = 0; + + foreach ($ucmSubFormTypeData as $ucmSubFormData) + { + $validData['id'] = isset($ucmSubFormData[$ucmSubformContentIdFieldName]) ? (int) $ucmSubFormData[$ucmSubformContentIdFieldName] : 0; + + // Unset extra data + $sfFieldName = $ucmSubFormData['ucmSubformFieldName']; + unset($ucmSubFormData['ucmSubformFieldName']); + $ucmSubformContentFieldElementId = 'jform[' . $sfFieldName . '][' . $sfFieldName . $count . '][' . $ucmSubformContentIdFieldName . ']'; + $count++; + + if ($insertedId = $itemFormModel->save($validData, $ucmSubFormData)) + { + $validData['id'] = $insertedId; + $subFormContentIds[] = array('elementName' => $ucmSubformContentFieldElementId, 'content_id' => $insertedId); + $ucmSubFormData[$ucmSubformContentIdFieldName] = $insertedId; + + // Get field id of contentid field + $fieldTable = JTable::getInstance('Field', 'TjfieldsTable', array('dbo', $db)); + $fieldTable->load(array('name' => $ucmSubformContentIdFieldName)); + + // Add-Update the value of content id field in the fields value table - start + $fieldsValueTable = JTable::getInstance('Fieldsvalue', 'TjfieldsTable', array('dbo', $db)); + $fieldsValueTable->load(array('field_id' => $fieldTable->id, 'content_id' => $insertedId, 'client' => $validData['client'])); + + if (empty($fieldsValueTable->id)) + { + $fieldsValueTable->field_id = $fieldTable->id; + $fieldsValueTable->value = $fieldsValueTable->content_id = $insertedId; + $fieldsValueTable->client = $validData['client']; + } + + $fieldsValueTable->user_id = JFactory::getUser()->id; + $fieldsValueTable->store(); + + // Add-Update the value of content id field in the fields value table - end + } + } + } + } + + // Delete removed ucmSubForm record from the form + if (!empty($oldSubFormContentIds)) + { + foreach ($oldSubFormContentIds as $oldSubFormContentId) + { + if (array_search($oldSubFormContentId, array_column($subFormContentIds, 'content_id')) === false) + { + $itemFormModel->delete($oldSubFormContentId); + } + } + } + + return $subFormContentIds; + } } diff --git a/src/components/com_tjucm/administrator/houseKeeping/1.2.3/updateClientName.php b/src/components/com_tjucm/administrator/houseKeeping/1.2.3/updateClientName.php new file mode 100644 index 00000000..b3c17650 --- /dev/null +++ b/src/components/com_tjucm/administrator/houseKeeping/1.2.3/updateClientName.php @@ -0,0 +1,264 @@ + + * @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'); + +use Joomla\Registry\Registry; +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Filesystem\File; + +/** + * Migration file for TJ-UCM + * + * @since 1.0 + */ +class TjHouseKeepingUpdateClientName extends TjModelHouseKeeping +{ + public $title = "Update Types Name"; + + public $description = 'Update UCM Types name and name of fields in each Type'; + + /** + * Subform migration script + * + * @return void + * + * @since 1.0 + */ + public function migrate() + { + JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjucm/tables'); + JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjfields/tables'); + JLoader::import('components.com_tjfields.helpers.tjfields', JPATH_ADMINISTRATOR); + + // TJ-Fields helper object + $tjfieldsHelper = new TjfieldsHelper; + + $result = array(); + $ucmSubFormFieldsConfig = 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(); + + $session = JFactory::getSession(); + $updatedTypes = (empty($session->get('updatedTypes'))) ? array() : $session->get('updatedTypes'); + + if (!empty($ucmTypes)) + { + foreach ($ucmTypes as $ucmType) + { + if (in_array($ucmType->id, $updatedTypes)) + { + continue; + } + + $ucmTypeTable = JTable::getInstance('Type', 'TjucmTable', array('dbo', $db)); + $ucmTypeTable->load($ucmType->id); + $updatedUniqueIdentifier = 'com_tjucm.' . preg_replace("/[^a-zA-Z0-9]/", "", str_replace('com_tjucm.', '', $ucmTypeTable->unique_identifier)); + $ucmTypeParams = new Registry($ucmType->params); + + // Variable to store the old client of the UCM Type + $oldClientName = $ucmTypeTable->unique_identifier; + $ucmTypeTable->unique_identifier = $updatedUniqueIdentifier; + + if ($ucmTypeTable->store()) + { + // Get all the field groups of the UCM Type + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->qn('#__tjfields_groups')); + $query->where($db->quoteName('client') . '=' . $db->quote($oldClientName)); + $db->setQuery($query); + $fieldGroups = $db->loadObjectlist(); + + foreach ($fieldGroups as $fieldGroup) + { + $tjfieldsGroupTable = JTable::getInstance('Group', 'TjfieldsTable', array('dbo', $db)); + $tjfieldsGroupTable->load($fieldGroup->id); + $tjfieldsGroupTable->client = $updatedUniqueIdentifier; + + // Update the client of field group in the given UCM Type + if ($tjfieldsGroupTable->store()) + { + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->qn('#__tjfields_fields')); + $query->where($db->quoteName('client') . '=' . $db->quote($oldClientName)); + $query->where($db->quoteName('group_id') . '=' . $fieldGroup->id); + $db->setQuery($query); + $fields = $db->loadObjectlist(); + + foreach ($fields as $field) + { + $tjfieldsFieldTable = JTable::getInstance('Field', 'TjfieldsTable', array('dbo', $db)); + $tjfieldsFieldTable->load($field->id); + $tjfieldsFieldTable->client = $updatedUniqueIdentifier; + + if ($tjfieldsFieldTable->type == 'cluster') + { + $tjfieldsFieldTable->name = str_replace('.', '_', $updatedUniqueIdentifier) . '_clusterclusterid'; + } + elseif ($tjfieldsFieldTable->type == 'ownership') + { + $tjfieldsFieldTable->name = str_replace('.', '_', $updatedUniqueIdentifier) . '_ownershipcreatedby'; + } + elseif ($tjfieldsFieldTable->type == 'itemcategory') + { + $tjfieldsFieldTable->name = str_replace('.', '_', $updatedUniqueIdentifier) . '_itemcategoryitemcategory'; + } + else + { + $tjfieldsFieldTable->name = str_replace('.', '_', $updatedUniqueIdentifier) . '_' . strtolower(preg_replace("/[^a-zA-Z0-9]/", "", $field->label)); + } + + $tjfieldsFieldTable->store(); + + // Check if field name is unique + $isUnique = $tjfieldsHelper->checkIfUniqueName($tjfieldsFieldTable->name); + + // If the name of the field is not unique then update the name by appending count to it + if ($isUnique > 1) + { + $count = 0; + + while ($tjfieldsHelper->checkIfUniqueName($tjfieldsFieldTable->name) > 1) + { + $count++; + $tjfieldsFieldTable->name = $tjfieldsFieldTable->name . $count; + } + + $tjfieldsFieldTable->store(); + } + } + } + } + + // Update client in ucm_data table + $query = $db->getQuery(true); + $fields = array($db->quoteName('client') . ' = ' . $db->quote($updatedUniqueIdentifier)); + $conditions = array($db->quoteName('client') . ' = ' . $db->quote($oldClientName)); + $query->update($db->quoteName('#__tj_ucm_data'))->set($fields)->where($conditions); + $db->setQuery($query); + $db->execute(); + + // Update client in fields_value table + $query = $db->getQuery(true); + $query->update($db->quoteName('#__tjfields_fields_value'))->set($fields)->where($conditions); + $db->setQuery($query); + $db->execute(); + + // Update value of ucmsubform fields in fields_value table + $query = $db->getQuery(true); + $fields = array($db->quoteName('value') . ' = ' . $db->quote($updatedUniqueIdentifier)); + $conditions = array($db->quoteName('value') . ' = ' . $db->quote($oldClientName)); + $query->update($db->quoteName('#__tjfields_fields_value'))->set($fields)->where($conditions); + $db->setQuery($query); + $db->execute(); + + $oldClientParts = explode('.', $oldClientName); + $newClientParts = explode('.', $updatedUniqueIdentifier); + $oldFileName = $oldClientParts[1] . 'form_extra.xml'; + $newFileName = $newClientParts[1] . 'form_extra.xml'; + $oldFileNameAdmin = $oldClientParts[1] . '_extra.xml'; + + // If the UCM type is of subform type then update the link in the respective field + if ($ucmTypeParams->get('is_subform')) + { + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->qn('#__tjfields_fields')); + $query->where($db->quoteName('params') . ' LIKE ' . $db->quote('%' . $oldFileName . '%')); + $db->setQuery($query); + $ucmSubFormFields = $db->loadObjectlist(); + + foreach ($ucmSubFormFields as $ucmSubFormField) + { + $tjfieldsFieldTable = JTable::getInstance('Field', 'TjfieldsTable', array('dbo', $db)); + $tjfieldsFieldTable->load($ucmSubFormField->id); + $tjfieldsFieldTable->params = str_replace($oldFileName, $newFileName, $tjfieldsFieldTable->params); + $tjfieldsFieldTable->store(); + } + } + + // If the UCM type is used as data source in related field the we need to update the UCM name in the field params + if ($ucmTypeParams->get('is_subform')) + { + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->qn('#__tjfields_fields')); + $query->where($db->quoteName('params') . ' LIKE ' . $db->quote('%' . $oldClientName . '%')); + $db->setQuery($query); + $formFields = $db->loadObjectlist(); + + foreach ($formFields as $formField) + { + $tjfieldsFieldTable = JTable::getInstance('Field', 'TjfieldsTable', array('dbo', $db)); + $tjfieldsFieldTable->load($formField->id); + $fieldParams = new Registry($tjfieldsFieldTable->params); + + if ($fieldParams->get('client') == $oldClientName) + { + $fieldParams->set('client', $updatedUniqueIdentifier); + } + + $tjfieldsFieldTable->params = json_encode($fieldParams); + $tjfieldsFieldTable->store(); + } + } + + // Delete the old XML files for the UCM type + if (File::exists(JPATH_SITE . '/components/com_tjucm/models/forms/' . $oldFileName)) + { + File::delete(JPATH_SITE . '/components/com_tjucm/models/forms/' . $oldFileName); + } + + if (File::exists(JPATH_SITE . '/' . 'administrator/components/com_tjucm/models/forms/' . $oldFileNameAdmin)) + { + File::delete(JPATH_SITE . '/' . 'administrator/components/com_tjucm/models/forms/' . $oldFileNameAdmin); + } + + // Regenerate the XML files + $tjfieldsHelper->generateXml(array('client' => $updatedUniqueIdentifier, 'client_type' => $newClientParts[1])); + } + + $updatedTypes[] = $ucmType->id; + $session->set('updatedTypes', $updatedTypes); + + $result['status'] = ''; + $result['message'] = "Migration in progress"; + + return $result; + } + } + + $session->set('updatedTypes', ''); + + $result['status'] = true; + $result['message'] = "Migration successful"; + } + catch (Exception $e) + { + $result['err_code'] = ''; + $result['status'] = false; + $result['message'] = $e->getMessage(); + } + + return $result; + } +} diff --git a/src/components/com_tjucm/administrator/models/forms/type.xml b/src/components/com_tjucm/administrator/models/forms/type.xml index 3497a681..7aca87fc 100644 --- a/src/components/com_tjucm/administrator/models/forms/type.xml +++ b/src/components/com_tjucm/administrator/models/forms/type.xml @@ -1,36 +1,18 @@ - +
- - - - - - - - - - - - - - - - - -
diff --git a/src/components/com_tjucm/administrator/models/item.php b/src/components/com_tjucm/administrator/models/item.php index 1a6bf330..0c3b54d0 100644 --- a/src/components/com_tjucm/administrator/models/item.php +++ b/src/components/com_tjucm/administrator/models/item.php @@ -55,9 +55,6 @@ class TjucmModelItem extends JModelAdmin */ public function __construct($config = array()) { - JLoader::import('components.com_tjucm.classes.funlist', JPATH_ADMINISTRATOR); - $this->common = new TjucmFunList; - parent::__construct($config); } @@ -290,7 +287,10 @@ public function save($data, $extra_jform_data = '', $post = '') $input = JFactory::getApplication()->input; $filter = JFilterInput::getInstance(); - $data['type_id'] = $this->common->getDataValues('#__tj_ucm_types', 'id AS type_id', 'unique_identifier = "' . $this->client . '"', 'loadResult'); + JLoader::import('components.com_tjucm.tables.type', JPATH_ADMINISTRATOR); + $tjUcmTypeTable = JTable::getInstance('TjucmTableType', 'JTable', array('dbo', JFactory::getDbo())); + $tjUcmTypeTable->load(array('unique_identifier' => $this->client)); + $data['type_id'] = $tjUcmTypeTable->id; if (parent::save($data)) { diff --git a/src/components/com_tjucm/administrator/models/type.php b/src/components/com_tjucm/administrator/models/type.php index 782c53a2..081e8a9d 100644 --- a/src/components/com_tjucm/administrator/models/type.php +++ b/src/components/com_tjucm/administrator/models/type.php @@ -48,9 +48,6 @@ class TjucmModelType extends JModelAdmin */ public function __construct($config = array()) { - JLoader::import('components.com_tjucm.classes.funlist', JPATH_ADMINISTRATOR); - $this->common = new TjucmFunList; - parent::__construct($config); } @@ -313,39 +310,25 @@ public function save($data) if (!empty($data['id'])) { $field_group = $this->getGroupCount($data['unique_identifier']); - - // Not able to get count using getTotal method of category model - $field_category = $this->common->getDataValues('#__categories', 'count(*)', 'extension = "' . $data['unique_identifier'] . '"', 'loadResult'); - - // $field_category = $this->getCategoryCount($data['unique_identifier']); + $field_category = $this->getCategoryCount($data['unique_identifier']); if ($field_group == 0 && $field_category == 0) { - $data['unique_identifier'] = 'com_tjucm.' . $data['alias']; + $data['unique_identifier'] = 'com_tjucm.' . preg_replace("/[^a-zA-Z0-9]/", "", $data['alias']); } } else { - $data['unique_identifier'] = 'com_tjucm.' . $data['alias']; + $data['unique_identifier'] = 'com_tjucm.' . preg_replace("/[^a-zA-Z0-9]/", "", $data['alias']); } - $params = array(); - $params['is_subform'] = $data['is_subform']; - $params['allow_draft_save'] = $data['allow_draft_save']; - $params['allow_auto_save'] = $data['allow_auto_save']; - $params['publish_items'] = $data['publish_items']; - $params['allowed_count'] = $data['allowed_count']; - $params['layout'] = $data['layout']; - $params['details_layout'] = $data['details_layout']; - $params['list_layout'] = $data['list_layout']; - // If UCM type is a subform then need to add content_id as hidden field in the form - For flat subform storage JLoader::import('components.com_tjfields.tables.field', JPATH_ADMINISTRATOR); $db = JFactory::getDbo(); $tjfieldsFieldTable = JTable::getInstance('Field', 'TjfieldsTable', array('dbo', $db)); $tjfieldsFieldTable->load(array('name' => str_replace('.', '_', $data['unique_identifier']) . '_contentid')); - if ($params['is_subform'] == 1 && empty($tjfieldsFieldTable->id)) + if ($data['params']['is_subform'] == 1 && empty($tjfieldsFieldTable->id)) { JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjfields/models'); $fieldGroup = array("name" => "hidden", "title" => "hidden", "client" => $data['unique_identifier'], "state" => 1); @@ -365,20 +348,18 @@ public function save($data) $input->post->set('client_type', ''); } - // If UCM type is a subform then it cant be saved as draft and auto save is also disabled - if ($params['is_subform'] == 1) + // Check the params 'Group' of fields & UCM type is a subform then it cant be saved as draft and auto save is also disabled + if ($data['params']['is_subform'] == 1) { - $params['allow_draft_save'] = $params['allow_auto_save'] = $params['allowed_count'] = 0; + $data['params']['allow_draft_save'] = $data['params']['allow_auto_save'] = $data['params']['allowed_count'] = 0; } // If auto save is enabled then draft save is enabled by default - if ($params['allow_auto_save'] == 1) + if ($data['params']['allow_auto_save'] == 1) { - $params['allow_draft_save'] = 1; + $data['params']['allow_draft_save'] = 1; } - $data['params'] = json_encode($params); - if (parent::save($data)) { return true; @@ -417,10 +398,10 @@ public function getGroupCount($client) public function getCategoryCount($client) { JLoader::import('components.com_categories.models.categories', JPATH_ADMINISTRATOR); - $categories_model = JModelLegacy::getInstance('Categories', 'CategoriesModel'); - $categories_model->setState('filter.extension', $client); + $categoryModel = JModelLegacy::getInstance('Categories', 'CategoriesModel', array('ignore_request' => true)); + $categoryModel->setState('filter.extension', $client); - return $categories_model->getTotal(); + return $categoryModel->getTotal(); } /** @@ -543,7 +524,7 @@ public function delete(&$pks) // Delete UCM type if (!parent::delete($pk)) - { + { return false; } } diff --git a/src/components/com_tjucm/administrator/tjucm.php b/src/components/com_tjucm/administrator/tjucm.php index 0bfd57c3..fd288f3f 100644 --- a/src/components/com_tjucm/administrator/tjucm.php +++ b/src/components/com_tjucm/administrator/tjucm.php @@ -20,15 +20,6 @@ // Include dependancies jimport('joomla.application.component.controller'); -$path = JPATH_COMPONENT_ADMINISTRATOR . '/classes/' . 'funlist.php'; - -if (!class_exists('TjucmFunList')) -{ - // Require_once $path; - JLoader::register('TjucmFunList', $path); - JLoader::load('TjucmFunList'); -} - // Load backend helper $path = JPATH_ADMINISTRATOR . '/components/com_tjucm/helpers/tjucm.php'; diff --git a/src/components/com_tjucm/administrator/views/type/tmpl/edit.php b/src/components/com_tjucm/administrator/views/type/tmpl/edit.php index 21ec84bd..c861509a 100644 --- a/src/components/com_tjucm/administrator/views/type/tmpl/edit.php +++ b/src/components/com_tjucm/administrator/views/type/tmpl/edit.php @@ -14,15 +14,8 @@ JHtml::_('behavior.formvalidation'); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); - -JHtml::script(JUri::root() . 'administrator/components/com_tjucm/assets/js/tjucm_type.js'); ?>