Index: core/admin_templates/groups/groups_edit_users.tpl
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/admin_templates/groups/groups_edit_users.tpl (revision 15974)
+++ core/admin_templates/groups/groups_edit_users.tpl (revision )
@@ -86,7 +86,7 @@
-
+
\ No newline at end of file
Index: core/units/user_groups/user_groups_eh.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/units/user_groups/user_groups_eh.php (revision 15971)
+++ core/units/user_groups/user_groups_eh.php (revision )
@@ -43,8 +43,12 @@
$new_groups = array_diff($new_groups, $old_groups);
if ($new_groups) {
+ $new_id = (int)$this->Conn->GetOne('SELECT MIN(Id) FROM ' . $table_name .' WHERE Id < 0' );
+
foreach ($new_groups as $new_group) {
+ $new_id--;
$fields_hash = Array (
+ 'Id' => $new_id,
'GroupId' => $new_group,
'PortalUserId' => $user_id,
);
@@ -73,8 +77,12 @@
$new_users = array_diff($new_users, $old_users);
if ($new_users) {
+ $new_id = (int)$this->Conn->GetOne('SELECT MIN(Id) FROM ' . $table_name .' WHERE Id < 0' );
+
foreach ($new_users as $new_user) {
+ $new_id--;
$fields_hash = Array (
+ 'Id' => $new_id,
'GroupId' => $group_id,
'PortalUserId' => $new_user,
);
\ No newline at end of file
Index: core/units/category_items/category_items_config.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/units/category_items/category_items_config.php (revision 15971)
+++ core/units/category_items/category_items_config.php (revision )
@@ -16,7 +16,7 @@
$config = Array (
'Prefix' => 'ci',
- 'ItemClass' => Array ('class' => 'CategoryItems_DBItem', 'file' => 'category_items_dbitem.php', 'build_event' => 'OnItemBuild'),
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'CategoryItemsEventHander', 'file' => 'category_items_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'CategoryItemsTagProcessor', 'file' => 'category_items_tag_processor.php', 'build_event' => 'OnBuild'),
@@ -29,7 +29,7 @@
4 => 'event',
),
- 'IDField' => 'CategoryId', // in this case idfield doesn't exit in destination table
+ 'IDField' => 'Id',
'StatusField' => Array ('PrimaryCat'), // field, that is affected by Approve/Decline events
'TableName' => TABLE_PREFIX.'CategoryItems',
@@ -41,7 +41,6 @@
'CalculatedFields' => Array (
'' => Array (
- 'DummyId' => 'IF(ISNULL(c.CategoryId),0,c.CategoryId)',
'CategoryStatus'=> 'c.Status',
)
),
@@ -58,7 +57,7 @@
),
'Fields' => Array (
- 'DummyId' => Array (),
+ 'Id' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'CategoryId' => Array ('type' => 'int', 'not_null'=>1,'default'=>0),
'ItemResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'PrimaryCat' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
@@ -68,7 +67,6 @@
'VirtualFields' => Array (
'CategoryName' => Array ('type' => 'string', 'default' => ''),
- 'DummyId' => Array ('type' => 'int', 'default' => 0),
'CategoryStatus' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'default' => 1),
),
\ No newline at end of file
Index: core/install/upgrades.sql
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/install/upgrades.sql (revision 15971)
+++ core/install/upgrades.sql (revision )
@@ -2989,3 +2989,8 @@
l<%PRIMARY_LANGUAGE%>_PlainTextBody = REPLACE(l<%PRIMARY_LANGUAGE%>_PlainTextBody, '', ''),
l<%PRIMARY_LANGUAGE%>_HtmlBody = REPLACE(l<%PRIMARY_LANGUAGE%>_HtmlBody, '', '')
WHERE TemplateName IN ('USER.SUBSCRIBE', 'USER.UNSUBSCRIBE');
+
+ALTER TABLE CategoryItems ADD Id int(11) NOT NULL auto_increment FIRST, ADD PRIMARY KEY (Id);
+ALTER TABLE UserGroupRelations DROP PRIMARY KEY;
+ALTER TABLE UserGroupRelations ADD Id int(11) NOT NULL auto_increment FIRST, ADD PRIMARY KEY (Id), ADD UNIQUE KEY UserGroup (PortalUserId, GroupId);
+ALTER TABLE SpamControl ADD Id int(11) NOT NULL auto_increment FIRST, ADD PRIMARY KEY (Id);
Index: core/units/user_groups/user_groups_config.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/units/user_groups/user_groups_config.php (revision 15971)
+++ core/units/user_groups/user_groups_config.php (revision )
@@ -22,8 +22,6 @@
'ForeignKey' => 'GroupId',
'ParentTableKey' => 'GroupId',
- 'IDField' => 'PortalUserId',
-
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'UserGroups g ON %1$s.GroupId = g.GroupId
@@ -45,7 +43,7 @@
'GroupUsers' => Array (
'Icons' => Array ('default' => 'icon16_item.png'),
'Fields' => Array (
- 'PortalUserId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Id' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'UserName' => Array ('title' => 'la_col_UserFirstLastName', 'width' => 200, ),
'UserLogin' => Array ('title' => 'column:la_fld_Username', 'width' => 100, ),
'PrimaryGroup' => Array ( 'title' => 'la_col_PrimaryGroup', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
@@ -62,7 +60,7 @@
),
),
- 'ItemClass' => Array ('class' => 'UserGroups_DBItem', 'file' => 'user_groups_dbitem.php', 'build_event' => 'OnItemBuild'),
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'UserGroupsEventHandler', 'file' => 'user_groups_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
@@ -76,7 +74,7 @@
4 => 'event',
),
- 'IDField' => 'GroupId',
+ 'IDField' => 'Id',
'TitleField' => 'GroupName',
'TableName' => TABLE_PREFIX.'UserGroupRelations',
@@ -100,6 +98,7 @@
),
'Fields' => Array (
+ 'Id' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'PortalUserId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'GroupId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'MembershipExpires' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
@@ -124,7 +123,7 @@
1 => 'icon16_primary.png'
),
'Fields' => Array (
- 'GroupId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Id' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'GroupName' => Array ('width' => 100, ),
'GroupDescription' => Array ('title' => 'column:la_fld_Description', 'width' => 150, ),
'PrimaryGroup' => Array ( 'title' => 'la_col_PrimaryGroup', 'filter_block' => 'grid_options_filter', 'width' => 150, ),
\ No newline at end of file
Index: core/units/category_items/category_items_dbitem.php
===================================================================
--- core/units/category_items/category_items_dbitem.php (revision 15971)
+++ core/units/category_items/category_items_dbitem.php (revision 15971)
@@ -1,47 +0,0 @@
-getLinkedInfo();
-
- return '(CategoryId=' . $this->GetID() . ' AND ' . $table_info['ForeignKey'] . '=' . $table_info['ParentId'] . ')';
- }
-
- /**
- * Generate and set new temporary id
- *
- * @return void
- * @access public
- */
- public function setTempID()
- {
- // don't set temp id for this item
- }
-}
\ No newline at end of file
Index: core/kernel/db/cat_dbitem.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/kernel/db/cat_dbitem.php (revision 15971)
+++ core/kernel/db/cat_dbitem.php (revision )
@@ -409,7 +409,7 @@
$this->Conn->Query($sql);
}
else {
- $fields_hash = Array(
+ $fields_hash = Array (
'CategoryId' => $category_id,
'ItemResourceId' => $this->GetField('ResourceId'),
'PrimaryCat' => $is_primary ? 1 : 0,
@@ -417,6 +417,11 @@
'Filename' => $this->useFilenames ? (string)$this->GetDBField('Filename') : '', // because some prefixes does not use filenames,
);
+ if ( $this->Application->IsTempTable($table) ) {
+ $new_id = (int)$this->Conn->GetOne('SELECT MIN(Id) FROM ' . $table .' WHERE Id < 0' );
+ $fields_hash['Id'] = $new_id - 1;
+ }
+
$this->Conn->doInsert($fields_hash, $table);
}
\ No newline at end of file
Index: core/admin_templates/users/users_edit_groups.tpl
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/admin_templates/users/users_edit_groups.tpl (revision 15974)
+++ core/admin_templates/users/users_edit_groups.tpl (revision )
@@ -94,7 +94,7 @@
-
+
\ No newline at end of file
Index: core/units/user_groups/user_groups_dbitem.php
===================================================================
--- core/units/user_groups/user_groups_dbitem.php (revision 15971)
+++ core/units/user_groups/user_groups_dbitem.php (revision 15971)
@@ -1,42 +0,0 @@
-getLinkedInfo($this->Special, true);
-
- if ( $table_info ) {
- // we have parent info, then use it
- $keys_hash = Array ($this->IDField => $this->GetID(), $table_info['ForeignKey'] => $table_info['ParentId']);
- }
-
- return parent::GetKeyClause($method, $keys_hash);
- }
-}
\ No newline at end of file