Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -126,7 +126,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
public static $databaseColumnMap = array(
|
||||
'author' => 'member_id',
|
||||
'container' => 'category_id',
|
||||
'date' => 'record_publish_date',
|
||||
'date' => 'record_saved',
|
||||
'is_future_entry' => 'record_future_date',
|
||||
'future_date' => 'record_publish_date',
|
||||
'num_comments' => 'record_comments',
|
||||
@@ -152,6 +152,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
'meta_data' => 'record_meta_data',
|
||||
'author_name' => 'record_author_name',
|
||||
'is_anon' => 'record_is_anon',
|
||||
'last_comment_anon' => 'record_last_comment_anon'
|
||||
);
|
||||
|
||||
|
||||
@@ -635,7 +636,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
}
|
||||
}
|
||||
|
||||
if ( $fieldsClass::fixedFieldFormShow( 'record_publish_date' ) AND ( \IPS\Member::loggedIn()->modPermission( "can_future_publish_content" ) or \IPS\Member::loggedIn()->modPermission( "can_future_publish_" . static::$title ) ) )
|
||||
if ( isset( $elements['date'] ) AND $fieldsClass::fixedFieldFormShow( 'record_publish_date' ) AND ( \IPS\Member::loggedIn()->modPermission( "can_future_publish_content" ) or \IPS\Member::loggedIn()->modPermission( "can_future_publish_" . static::$title ) ) )
|
||||
{
|
||||
$formElements['record_publish_date'] = $elements['date'];
|
||||
}
|
||||
@@ -1107,7 +1108,6 @@ class _Records extends \IPS\Content\Item implements
|
||||
/* Other data */
|
||||
if ( $isNew OR $database->_comment_bump & \IPS\cms\Databases::BUMP_ON_EDIT )
|
||||
{
|
||||
$this->record_saved = time();
|
||||
$this->record_updated = time();
|
||||
}
|
||||
|
||||
@@ -1657,7 +1657,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
*/
|
||||
public function get__publishDate()
|
||||
{
|
||||
return $this->record_publish_date ? $this->record_publish_date : $this->record_saved;
|
||||
return $this->record_publish_date ? $this->record_publish_date : $this->record_saved;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1948,6 +1948,10 @@ class _Records extends \IPS\Content\Item implements
|
||||
{
|
||||
return $this->_content;
|
||||
}
|
||||
else if( $key === 'date')
|
||||
{
|
||||
return $this->_publishDate;
|
||||
}
|
||||
|
||||
if ( isset( static::$databaseColumnMap[ $key ] ) )
|
||||
{
|
||||
@@ -2047,6 +2051,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
$this->record_last_comment = $comment->mapped('date');
|
||||
$this->record_last_comment_by = $comment->author()->member_id;
|
||||
$this->record_last_comment_name = $comment->author()->name;
|
||||
$this->record_last_comment_anon = $comment->isAnonymous();
|
||||
$this->save();
|
||||
|
||||
if ( $setCategory and $this->category_id )
|
||||
@@ -2959,8 +2964,8 @@ class _Records extends \IPS\Content\Item implements
|
||||
|
||||
if( $this->isAnonymous() )
|
||||
{
|
||||
$topic->setAnonymous( TRUE, $this->author );
|
||||
$post->setAnonymous( TRUE, $this->author );
|
||||
$topic->setAnonymous( TRUE, $this->author() );
|
||||
$post->setAnonymous( TRUE, $this->author() );
|
||||
}
|
||||
|
||||
$topic->markRead();
|
||||
@@ -4045,4 +4050,31 @@ class _Records extends \IPS\Content\Item implements
|
||||
|
||||
return $lastMod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the earliest publish date for the new content item, we can have past items for records.
|
||||
*
|
||||
* @return \IPS\DateTime|null
|
||||
*/
|
||||
protected static function getMinimumPublishDate(): ?\IPS\DateTime
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can the publish date be changed while editing the item?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public static bool $allowPublishDateWhileEditing = TRUE;
|
||||
|
||||
/**
|
||||
* Allow editing of the publish date from existing records
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function supportsPublishDate( ?\IPS\Content\Item $item ): bool
|
||||
{
|
||||
return !static::database()->forum_record AND parent::supportsPublishDate($item);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user