...
 
Commits (4)
......@@ -51,6 +51,10 @@ class LanguagePacks extends AbstractInteractableModule {
private notifications: Array<any> = [];
private static pluralize(count: number, word: string = 'pack', suffix: string = 's', additionalCount: number = 0): string {
return count !== 1 && additionalCount !== 1 ? word + suffix : word;
}
public initialize(currentModal: JQuery): void {
this.currentModal = currentModal;
......@@ -217,7 +221,11 @@ class LanguagePacks extends AbstractInteractableModule {
'aria-valuemax': 100,
'style': 'width: 0;',
}).append(
$('<span>', {'class': 'text-nowrap'}).text('0 of ' + this.packsUpdateDetails.toHandle + ' language packs updated'),
$(
'<span>',
{'class': 'text-nowrap'}).text('0 of ' + this.packsUpdateDetails.toHandle + ' language ' +
LanguagePacks.pluralize(this.packsUpdateDetails.toHandle) + ' updated'
),
),
));
$contentContainer.empty();
......@@ -275,9 +283,9 @@ class LanguagePacks extends AbstractInteractableModule {
const message = InfoBox.render(
Severity.ok,
'Language packs updated',
this.packsUpdateDetails.new + ' new language packs downloaded, ' +
this.packsUpdateDetails.updated + ' language packs updated, ' +
this.packsUpdateDetails.failed + ' language packs not available',
this.packsUpdateDetails.new + ' new language ' + LanguagePacks.pluralize(this.packsUpdateDetails.new) + ' downloaded, ' +
this.packsUpdateDetails.updated + ' language ' + LanguagePacks.pluralize(this.packsUpdateDetails.updated) + ' updated, ' +
this.packsUpdateDetails.failed + ' language ' + LanguagePacks.pluralize(this.packsUpdateDetails.failed) + ' not available',
);
this.addNotification(message);
if (updateIsoTimes === true) {
......@@ -315,7 +323,10 @@ class LanguagePacks extends AbstractInteractableModule {
.css('width', percent + '%')
.attr('aria-valuenow', percent)
.find('span')
.text(this.packsUpdateDetails.handled + ' of ' + this.packsUpdateDetails.toHandle + ' language packs updated');
.text(
this.packsUpdateDetails.handled + ' of ' + this.packsUpdateDetails.toHandle + ' language ' +
LanguagePacks.pluralize(this.packsUpdateDetails.handled, 'pack', 's', this.packsUpdateDetails.toHandle) + ' updated'
);
}
}
......
......@@ -237,7 +237,7 @@ define(['jquery',
// The incoming value consists of the table name, an underscore and the uid
// or just the uid
// For a single selection field we need only the uid, so we extract it
var pattern = /_(\\d+)$/
var pattern = /_(\d+)$/
, result = value.toString().match(pattern);
if (result != null) {
......
......@@ -22,6 +22,7 @@ use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Schema\Parser\AST\CreateColumnDefinitionItem;
use TYPO3\CMS\Core\Database\Schema\Parser\AST\CreateForeignKeyDefinitionItem;
......@@ -301,57 +302,57 @@ class TableBuilder
case DataType\TinyIntDataType::class:
// TINYINT is MySQL specific and mapped to a standard SMALLINT
case DataType\SmallIntDataType::class:
$doctrineType = Type::SMALLINT;
$doctrineType = Types::SMALLINT;
break;
case DataType\MediumIntDataType::class:
// MEDIUMINT is MySQL specific and mapped to a standard INT
case DataType\IntegerDataType::class:
$doctrineType = Type::INTEGER;
$doctrineType = Types::INTEGER;
break;
case DataType\BigIntDataType::class:
$doctrineType = Type::BIGINT;
$doctrineType = Types::BIGINT;
break;
case DataType\BinaryDataType::class:
case DataType\VarBinaryDataType::class:
// CHAR/VARCHAR is determined by "fixed" column property
$doctrineType = Type::BINARY;
$doctrineType = Types::BINARY;
break;
case DataType\TinyBlobDataType::class:
case DataType\MediumBlobDataType::class:
case DataType\BlobDataType::class:
case DataType\LongBlobDataType::class:
// Actual field type is determined by field length
$doctrineType = Type::BLOB;
$doctrineType = Types::BLOB;
break;
case DataType\DateDataType::class:
$doctrineType = Type::DATE;
$doctrineType = Types::DATE_MUTABLE;
break;
case DataType\TimestampDataType::class:
case DataType\DateTimeDataType::class:
// TIMESTAMP or DATETIME are determined by "version" column property
$doctrineType = Type::DATETIME;
$doctrineType = Types::DATETIME_MUTABLE;
break;
case DataType\NumericDataType::class:
case DataType\DecimalDataType::class:
$doctrineType = Type::DECIMAL;
$doctrineType = Types::DECIMAL;
break;
case DataType\RealDataType::class:
case DataType\FloatDataType::class:
case DataType\DoubleDataType::class:
$doctrineType = Type::FLOAT;
$doctrineType = Types::FLOAT;
break;
case DataType\TimeDataType::class:
$doctrineType = Type::TIME;
$doctrineType = Types::TIME_MUTABLE;
break;
case DataType\TinyTextDataType::class:
case DataType\MediumTextDataType::class:
case DataType\TextDataType::class:
case DataType\LongTextDataType::class:
$doctrineType = Type::TEXT;
$doctrineType = Types::TEXT;
break;
case DataType\CharDataType::class:
case DataType\VarCharDataType::class:
$doctrineType = Type::STRING;
$doctrineType = Types::STRING;
break;
case DataType\EnumDataType::class:
$doctrineType = EnumType::TYPE;
......@@ -361,7 +362,7 @@ class TableBuilder
break;
case DataType\JsonDataType::class:
// JSON is not supported in Doctrine 2.5, mapping to the more generic TEXT type
$doctrineType = SetType::TEXT;
$doctrineType = Types::TEXT;
break;
case DataType\YearDataType::class:
// The YEAR data type is MySQL specific and offers little to no benefit.
......@@ -370,7 +371,7 @@ class TableBuilder
// application and for all other accounts it's an integer with a valid
// range of 1901 to 2155.
// Using a SMALLINT covers the value range and ensures database compatibility.
$doctrineType = SetType::SMALLINT;
$doctrineType = Types::SMALLINT;
break;
default:
throw new \RuntimeException(
......
......@@ -14,7 +14,7 @@ namespace TYPO3\CMS\Lowlevel\Integrity;
* The TYPO3 project - inspiring people to share!
*/
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
......@@ -451,7 +451,7 @@ class DatabaseIntegrityCheck
$fieldType = $column->getType()->getName();
if (in_array(
$fieldType,
[Type::BIGINT, Type::INTEGER, Type::SMALLINT, Type::DECIMAL, Type::FLOAT],
[Types::BIGINT, Types::INTEGER, Types::SMALLINT, Types::DECIMAL, Types::FLOAT],
true
)) {
$whereClause[] = $queryBuilder->expr()->andX(
......@@ -461,7 +461,7 @@ class DatabaseIntegrityCheck
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
)
);
} elseif (in_array($fieldType, [Type::STRING, Type::TEXT], true)) {
} elseif (in_array($fieldType, [Types::STRING, Types::TEXT], true)) {
$whereClause[] = $queryBuilder->expr()->andX(
$queryBuilder->expr()->isNotNull($fieldName),
$queryBuilder->expr()->neq(
......@@ -469,7 +469,7 @@ class DatabaseIntegrityCheck
$queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
)
);
} elseif ($fieldType === Type::BLOB) {
} elseif ($fieldType === Types::BLOB) {
$whereClause[] = $queryBuilder->expr()->andX(
$queryBuilder->expr()->isNotNull($fieldName),
$queryBuilder->expr()
......
......@@ -4586,11 +4586,6 @@ instead.]]></description>
<property name="JSwindow.newWindow" type="boolean">
<description><![CDATA[Each picture will open in a new window!]]></description>
<default><![CDATA[
]]></default>
</property>
<property name="alternativeTempPath" type="string">
<description><![CDATA[Enter an alternative path to use for temp images.]]></description>
<default><![CDATA[
]]></default>
</property>
<property name="bodyTag" type="string">
......@@ -4672,11 +4667,6 @@ If you add "m" to either the width or height, the image will be held in proporti
</property>
</type>
<type id="imgResource">
<property name="alternativeTempPath" type="string">
<description><![CDATA[Enter an alternative path to use for temp images.]]></description>
<default><![CDATA[
]]></default>
</property>
<property name="ext" type="stdWrap">
<description><![CDATA[
]]></description>
......
......@@ -70,7 +70,6 @@
'allWrap': kw('allWrap'),
'alt_print': A,
'alternativeSortingField': kw('alternativeSortingField'),
'alternativeTempPath': kw('alternativeTempPath'),
'altIcons': kw('altIcons'),
'altImgResource': kw('altImgResource'),
'altLabels': kw('altLabels'),
......