Skip to content

Commit

Permalink
Add public comment field
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Richter committed Oct 14, 2024
1 parent 4374029 commit aefd46b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
28 changes: 28 additions & 0 deletions Classes/Domain/Model/PublishedItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ class PublishedItem extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected $comment = '';

/**
* publicComment
*
* @var string
*/
protected $publicComment = '';

/**
* publisher
*
Expand Down Expand Up @@ -1009,6 +1016,16 @@ protected static function getSubitemPlateId(PublishedSubitem $subitem): string
return $subitem->getPlateId();
}

/**
* Returns the public comment
*
* @return string $publicComment
*/
public function getComment(): string
{
return $this->publicComment;
}

/**
* Returns the comment
*
Expand All @@ -1019,6 +1036,17 @@ public function getComment(): string
return $this->comment;
}

/**
* Sets the public comment
*
* @param string $publicComment
* @return void
*/
public function setComment(string $publicComment): void
{
$this->publicComment = $publicComment;
}

/**
* Sets the comment
*
Expand Down
16 changes: 13 additions & 3 deletions Configuration/TCA/tx_mpdbcore_domain_model_publisheditem.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'title,type,instrumentation,responsible_person,language,id,comment',
'searchFields' => 'title,type,instrumentation,responsible_person,language,id,comment,public_comment',
'iconfile' => 'EXT:mpdb_core/Resources/Public/Icons/tx_mpdbcore_domain_model_publishermakroitem.gif'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, type, instrumentation, data_acquisition_certain, related_persons_known, work_examined, data_set_manually_checked, contained_works_identified, responsible_person, date_of_publishing, final, language, id, comment, contained_works, editors, instruments, genre, first_composer, published_subitems, publisher',
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, type, instrumentation, data_acquisition_certain, related_persons_known, work_examined, data_set_manually_checked, contained_works_identified, responsible_person, date_of_publishing, final, language, id, comment, public_comment, contained_works, editors, instruments, genre, first_composer, published_subitems, publisher',
],
'types' => [
'1' => ['showitem' => 'title, type, instrumentation, data_acquisition_certain, related_persons_known, work_examined, data_set_manually_checked, contained_works_identified, responsible_person, date_of_publishing, final, language, id, comment, contained_works, editors, instruments, genre, first_composer, published_subitems, publisher, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, sys_language_uid, l10n_parent, l10n_diffsource, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, hidden, starttime, endtime'],
'1' => ['showitem' => 'title, type, instrumentation, data_acquisition_certain, related_persons_known, work_examined, data_set_manually_checked, contained_works_identified, responsible_person, date_of_publishing, final, language, id, comment, public_comment, contained_works, editors, instruments, genre, first_composer, published_subitems, publisher, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, sys_language_uid, l10n_parent, l10n_diffsource, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, hidden, starttime, endtime'],
],
'columns' => [
'sys_language_uid' => [
Expand Down Expand Up @@ -284,6 +284,16 @@
'eval' => 'trim'
]
],
'public_comment' => [
'exclude' => true,
'label' => 'LLL:EXT:mpdb_core/Resources/Private/Language/locallang_db.xlf:tx_mpdbcore_domain_model_publisheditem.public_comment',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim'
]
],
'contained_works' => [
'exclude' => true,
'label' => 'enthaltene Werke',
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<trans-unit id="tx_mpdbcore_domain_model_publisheditem.comment" resname="tx_mpdbcore_domain_model_publisheditem.comment" approved="yes">
<source>comment</source>
</trans-unit>
<trans-unit id="tx_mpdbcore_domain_model_publisheditem.public_comment" resname="tx_mpdbcore_domain_model_publisheditem.public_comment" approved="yes">
<source>public comment</source>
</trans-unit>
<trans-unit id="tx_mpdbcore_domain_model_publisheditem.contained_works" resname="tx_mpdbcore_domain_model_publisheditem.contained_works" approved="yes">
<source>contained works</source>
</trans-unit>
Expand Down
3 changes: 2 additions & 1 deletion ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CREATE TABLE tx_mpdbcore_domain_model_publishedsubitem (
db_identifier int(11) DEFAULT '0' NOT NULL,
contained_works int(11) unsigned DEFAULT '0' NOT NULL,
publisher_actions int(11) unsigned DEFAULT '0' NOT NULL,
mvdb_id varchar(255) DEFAULT '' NOT NULL
mvdb_id varchar(255) DEFAULT '' NOT NULL

);

Expand All @@ -51,6 +51,7 @@ CREATE TABLE tx_mpdbcore_domain_model_publisheditem (
mvdb_id varchar(255) DEFAULT '' NOT NULL,
plate_ids varchar(255) DEFAULT '' NOT NULL,
comment text,
public_comment text,
contained_works int(11) unsigned DEFAULT '0' NOT NULL,
editors int(11) unsigned DEFAULT '0' NOT NULL,
instruments int(11) unsigned DEFAULT '0' NOT NULL,
Expand Down

0 comments on commit aefd46b

Please sign in to comment.