Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ CREATE TABLE IF NOT EXISTS `#__fields_groups` (
`asset_id` int(10) NOT NULL DEFAULT 0,
`extension` varchar(255) NOT NULL DEFAULT '',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`note` varchar(255) NOT NULL DEFAULT '',
`description` text NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ CREATE TABLE "#__fields_groups" (
"asset_id" bigint DEFAULT 0 NOT NULL,
"extension" varchar(255) DEFAULT '' NOT NULL,
"title" varchar(255) DEFAULT '' NOT NULL,
"alias" varchar(255) DEFAULT '' NOT NULL,
"note" varchar(255) DEFAULT '' NOT NULL,
"description" text DEFAULT '' NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
Expand Down
9 changes: 0 additions & 9 deletions administrator/components/com_fields/models/forms/group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@
required="true"
/>

<field
name="alias"
type="text"
label="JFIELD_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
hint="JFIELD_ALIAS_PLACEHOLDER"
size="45"
/>

<field
name="state"
type="list"
Expand Down
43 changes: 1 addition & 42 deletions administrator/components/com_fields/models/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,9 @@ public function save($data)
// Alter the title for save as copy
$input = JFactory::getApplication()->input;

// Save new group as unpublished
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
$origTable->load($input->getInt('id'));

if ($data['title'] == $origTable->title)
{
list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']);
$data['title'] = $title;
$data['alias'] = $alias;
}
else
{
if ($data['alias'] == $origTable->alias)
{
$data['alias'] = '';
}
}

$data['state'] = 0;
}

Expand All @@ -73,31 +57,6 @@ public function getTable($name = 'Group', $prefix = 'FieldsTable', $options = ar
return JTable::getInstance($name, $prefix, $options);
}

/**
* Method to change the title & alias.
*
* @param integer $category_id The id of the category.
* @param string $alias The alias.
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
* @since __DEPLOY_VERSION__
*/
protected function generateNewTitle($category_id, $alias, $title)
{
// Alter the title & alias
$table = $this->getTable();

while ($table->load(array('alias' => $alias)))
{
$title = StringHelper::increment($title);
$alias = StringHelper::increment($alias, 'dash');
}

return array($title, $alias);
}

/**
* Abstract method for getting the form from the model.
*
Expand Down
5 changes: 2 additions & 3 deletions administrator/components/com_fields/models/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function __construct($config = array())
'id', 'a.id',
'title', 'a.title',
'type', 'a.type',
'alias', 'a.alias',
'state', 'a.state',
'access', 'a.access',
'access_level',
Expand Down Expand Up @@ -125,7 +124,7 @@ protected function getListQuery()
$query->select(
$this->getState(
'list.select',
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.note' .
'a.id, a.title, a.checked_out, a.checked_out_time, a.note' .
', a.state, a.access, a.created, a.created_by, a.ordering, a.language'
)
);
Expand Down Expand Up @@ -195,7 +194,7 @@ protected function getListQuery()
else
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('(a.title LIKE ' . $search . ' OR a.alias LIKE ' . $search . ')');
$query->where('a.title LIKE ' . $search);
}
}

Expand Down
14 changes: 0 additions & 14 deletions administrator/components/com_fields/tables/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,6 @@ public function check()
return false;
}

$this->alias = trim($this->alias);

if (empty($this->alias))
{
$this->alias = $this->title;
}

$this->alias = JApplicationHelper::stringURLSafe($this->alias, $this->language);

if (trim(str_replace('-', '', $this->alias)) == '')
{
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}

$date = JFactory::getDate();
$user = JFactory::getUser();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<span class="small break-word">
<?php if (empty($item->note)) : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
<?php else : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?>
<?php if ($item->note) : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note)); ?>
<?php endif; ?>
</span>
</div>
Expand Down
1 change: 0 additions & 1 deletion installation/sql/mysql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ CREATE TABLE IF NOT EXISTS `#__fields_groups` (
`asset_id` int(10) NOT NULL DEFAULT 0,
`extension` varchar(255) NOT NULL DEFAULT '',
`title` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(255) NOT NULL DEFAULT '',
`note` varchar(255) NOT NULL DEFAULT '',
`description` text NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '0',
Expand Down
1 change: 0 additions & 1 deletion installation/sql/postgresql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,6 @@ CREATE TABLE "#__fields_groups" (
"asset_id" bigint DEFAULT 0 NOT NULL,
"extension" varchar(255) DEFAULT '' NOT NULL,
"title" varchar(255) DEFAULT '' NOT NULL,
"alias" varchar(255) DEFAULT '' NOT NULL,
"note" varchar(255) DEFAULT '' NOT NULL,
"description" text NOT NULL,
"state" smallint DEFAULT '0' NOT NULL,
Expand Down