mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-12-25 01:45:59 +00:00
Real null values for checked_out
This commit is contained in:
parent
520a1ec6a1
commit
b42034431f
@ -118,7 +118,7 @@ class Com_WeblinksInstallerScript
|
||||
$category->version = 1;
|
||||
$category->hits = 0;
|
||||
$category->modified_user_id = 0;
|
||||
$category->checked_out = 0;
|
||||
$category->checked_out = null;
|
||||
|
||||
// Set the location in the tree
|
||||
$category->setLocation(1, 'last-child');
|
||||
|
@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS `#__weblinks` (
|
||||
`description` text NOT NULL,
|
||||
`hits` int NOT NULL DEFAULT 0,
|
||||
`state` tinyint NOT NULL DEFAULT 0,
|
||||
`checked_out` int NOT NULL DEFAULT 0,
|
||||
`checked_out` int unsigned,
|
||||
`checked_out_time` datetime,
|
||||
`ordering` int NOT NULL DEFAULT 0,
|
||||
`access` int NOT NULL DEFAULT 1,
|
||||
|
@ -17,7 +17,7 @@ CREATE TABLE "#__weblinks" (
|
||||
"description" text NOT NULL,
|
||||
"hits" bigint DEFAULT 0 NOT NULL,
|
||||
"state" smallint DEFAULT 0 NOT NULL,
|
||||
"checked_out" bigint DEFAULT 0 NOT NULL,
|
||||
"checked_out" integer,
|
||||
"checked_out_time" timestamp without time zone,
|
||||
"ordering" bigint DEFAULT 0 NOT NULL,
|
||||
"access" bigint DEFAULT 1 NOT NULL,
|
||||
|
@ -5,12 +5,16 @@ ALTER TABLE `#__weblinks` MODIFY `publish_up` datetime NULL DEFAULT NULL;
|
||||
ALTER TABLE `#__weblinks` MODIFY `publish_down` datetime NULL DEFAULT NULL;
|
||||
ALTER TABLE `#__weblinks` MODIFY `checked_out_time` datetime NULL DEFAULT NULL;
|
||||
|
||||
ALTER TABLE `#__weblinks` MODIFY `checked_out` int unsigned;
|
||||
|
||||
UPDATE `#__weblinks` SET `modified` = `created` WHERE `modified` = '0000-00-00 00:00:00';
|
||||
|
||||
UPDATE `#__weblinks` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00';
|
||||
UPDATE `#__weblinks` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00';
|
||||
UPDATE `#__weblinks` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00';
|
||||
|
||||
UPDATE `#__weblinks` SET `checked_out` = null WHERE `checked_out` = 0;
|
||||
|
||||
UPDATE `#__categories` SET `modified_time` = `created_time` WHERE `modified_time` = '0000-00-00 00:00:00' AND `extension` = 'com_weblinks';
|
||||
|
||||
UPDATE `#__categories` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00' AND `extension` = 'com_weblinks';
|
||||
|
@ -11,12 +11,17 @@ ALTER TABLE "#__weblinks" ALTER COLUMN "publish_down" DROP DEFAULT;
|
||||
ALTER TABLE "#__weblinks" ALTER COLUMN "checked_out_time" DROP NOT NULL;
|
||||
ALTER TABLE "#__weblinks" ALTER COLUMN "checked_out_time" DROP DEFAULT;
|
||||
|
||||
ALTER TABLE "#__weblinks" ALTER COLUMN "checked_out" DROP DEFAULT;
|
||||
ALTER TABLE "#__weblinks" ALTER COLUMN "checked_out" DROP NOT NULL;
|
||||
|
||||
UPDATE "#__weblinks" SET "modified" = "created" WHERE "modified" = '1970-01-01 00:00:00';
|
||||
|
||||
UPDATE "#__weblinks" SET "publish_up" = NULL WHERE "publish_up" = '1970-01-01 00:00:00';
|
||||
UPDATE "#__weblinks" SET "publish_down" = NULL WHERE "publish_down" = '1970-01-01 00:00:00';
|
||||
UPDATE "#__weblinks" SET "checked_out_time" = NULL WHERE "checked_out_time" = '1970-01-01 00:00:00';
|
||||
|
||||
UPDATE "#__weblinks" SET "checked_out" = null WHERE "checked_out" = 0;
|
||||
|
||||
UPDATE "#__categories" SET "modified_time" = "created_time" WHERE "modified_time" = '1970-01-01 00:00:00' AND "extension" = 'com_weblinks';
|
||||
|
||||
UPDATE "#__categories" SET "checked_out_time" = NULL WHERE "checked_out_time" = '1970-01-01 00:00:00' AND "extension" = 'com_weblinks';
|
||||
|
@ -100,7 +100,7 @@ class HtmlView extends BaseHtmlView
|
||||
|
||||
$user = $app->getIdentity();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$checkedOut = $this->item->checked_out && $this->item->checked_out !== $user->get('id');
|
||||
|
||||
// Since we don't track these assets at the item level, use the category id.
|
||||
$canDo = ContentHelper::getActions('com_weblinks', 'category', $this->item->catid);
|
||||
|
@ -95,7 +95,7 @@ if ($saveOrder && !empty($this->items))
|
||||
<?php $item->cat_link = Route::_('index.php?option=com_categories&extension=com_weblinks&task=edit&type=other&cid[]=' . $item->catid); ?>
|
||||
<?php $canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $item->catid); ?>
|
||||
<?php $canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $item->catid); ?>
|
||||
<?php $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0; ?>
|
||||
<?php $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || !$item->checked_out; ?>
|
||||
<?php $canEditOwn = $user->authorise('core.edit.own', 'com_weblinks.category.' . $item->catid) && $item->created_by == $user->id; ?>
|
||||
<?php $canChange = $user->authorise('core.edit.state', 'com_weblinks.category.' . $item->catid) && $canCheckin; ?>
|
||||
<tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->catid; ?>">
|
||||
|
Loading…
Reference in New Issue
Block a user