8000 [Improvement] Only show area EditableDialogBox dialog when it actually has items to edit by rberneder · Pull Request #11070 · pimcore/pimcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 diff-file-filter>

[Improvement] Only show area EditableDialogBox dialog when it actually has items to edit #11070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
49debf3
[improvement] only show area EditableDialogBox when it actually has i…
rberneder Dec 21, 2021
9a978cd
[improvement] only show area EditableDialogBox when it actually has i…
rberneder Dec 21, 2021
ac0f8e3
[Docs] Remove query cache point as it was removed in MySQL8
dvesh3 Dec 14, 2021
70e8fb8
Don't return Document from runtime cache when `$force` parameter is t…
jdreesen Dec 14, 2021
48affbe
fix: add UTF-8 support to Input regex validation
r-vanstraaten Dec 15, 2021
20e5581
Support link generator for mockup objects (#10938)
ctippler Dec 17, 2021
3903318
Remove Document from runtime path cache after it was deleted (#11016)
jdreesen Dec 17, 2021
515acd2
Apply php-cs-fixer changes
dvesh3 Dec 17, 2021
9aed6ae
Fix has children detection
mhgtlc Dec 15, 2021
2887bc0
[Image Thumbnails] Fix system image thumbnails generation when no thu…
rquarta-extera Dec 17, 2021
dc11cf6
fix: add UTF-8 support to javascript regex validation
r-vanstraaten Dec 17, 2021
2fbc1a6
Add missing type check to the Document path cache
jdreesen Dec 17, 2021
aa476a7
Fix class field rename error
dturopoli Dec 17, 2021
cc10958
[Classification Store] Properly escape values on grids & titles
dvesh3 Dec 20, 2021
8d9ddc0
Do not initialize db schema in constructor. (#10943)
andreas-gruenwald Dec 21, 2021
36b3342
Pricing Rules - Saving pricing rule with date range condition leads t…
mcop1 Dec 21, 2021
8de885c
[DataObjects] PCX update consider empty tables (#11061)
jremmurd Dec 21, 2021
7eddbb9
Apply php-cs-fixer changes
dvesh3 Dec 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ protected function getTreeNodeConfig($element)
],
];

$hasChildren = (bool)$asset->getChildAmount($this->getAdminUser());
$hasChildren = $asset->getDao()->hasChildren($this->getAdminUser());

// set type specific settings
if ($asset instanceof Asset\Folder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1476,19 +1476,19 @@ public function storetreeAction(Request $request)
foreach ($list as $item) {
$resultItem = [
'id' => $item->getId(),
'text' => $item->getName(),
'text' => htmlspecialchars($item->getName(), ENT_QUOTES),
'expandable' => false,
'leaf' => true,
'expanded' => true,
'description' => $item->getDescription(),
'description' => htmlspecialchars($item->getDescription(), ENT_QUOTES),
'iconCls' => 'pimcore_icon_classificationstore',
];

$resultItem['qtitle'] = 'ID: ' . $item->getId();

if ($item->getDescription()) {
}
$resultItem['qtip'] = $item->getDescription() ? $item->getDescription() : ' ';
$resultItem['qtip'] = $item->getDescription() ? htmlspecialchars($item->getDescription(), ENT_QUOTES) : ' ';
$result[] = $resultItem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ protected function getTreeNodeConfig($element): array
$allowedTypes[] = DataObject::OBJECT_TYPE_VARIANT;
}

$hasChildren = (bool)$child->getChildAmount($allowedTypes, $this->getAdminUser());
$hasChildren = $child->getDao()->hasChildren($allowedTypes, null, $this->getAdminUser());

$tmpObject['allowDrop'] = false;
$tmpObject['leaf'] = !$hasChildren;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getTreeNodeConfig($element)
],
];

$hasChildren = (bool)$childDocument->getChildAmount(Admin::getCurrentUser());
$hasChildren = $childDocument->getDao()->hasChildren(null, Admin::getCurrentUser());

// add icon
9E12 $tmpDocument['expandable'] = $hasChildren;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ pimcore.helpers.grid.buildDefaultPagingToolbar = function (store, options) {
};

pimcore.helpers.grid.getTranslationColumnRenderer = function (value, metaData, record, rowIndex, colIndex, store) {
return t(value);
return Ext.util.Format.htmlEncode(t(value));
};
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pimcore.object.classes.data.input = Class.create(pimcore.object.classes.data.dat
var testString = testStringEl.getValue();

try {
var regexp = new RegExp(regex);
var regexp = new RegExp F438 (regex, 'u');
if (regexp.test(testString)) {
testStringEl.addCls("class-editor-validation-success");
testStringEl.removeCls("class-editor-validation-error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({
});

gridColumns.push({text: t("group_id"), flex: 60, sortable: true, dataIndex: 'groupId', filter: 'string'});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'groupName', filter: 'string'});
gridColumns.push({text: t("description"), flex: 200, sortable: true, dataIndex: 'groupDescription', filter: 'string'});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'groupName', filter: 'string',
renderer: Ext.util.Format.htmlEncode});
gridColumns.push({text: t("description"), flex: 200, sortable: true, dataIndex: 'groupDescription', filter: 'string',
renderer: Ext.util.Format.htmlEncode});

gridColumns.push({text: t('sorter'), width: 150, sortable: true, dataIndex: 'sorter',
tooltip: t("classificationstore_tooltip_sorter"),
Expand Down Expand Up @@ -264,8 +266,10 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({

//gridColumns.push({text: t("store"), flex: 60, sortable: true, dataIndex: 'storeId', filter: 'string'});
gridColumns.push({text: "ID", flex: 60, sortable: true, dataIndex: 'id', filter: 'string'});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'name', editor: new Ext.form.TextField({}), filter: 'string'});
gridColumns.push({text: t("description"), flex: 300, sortable: true, dataIndex: 'description', editor: new Ext.form.TextField({}), filter: 'string'});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'name', editor: new Ext.form.TextField({}), filter: 'string',
renderer: Ext.util.Format.htmlEncode});
gridColumns.push({text: t("description"), flex: 300, sortable: true, dataIndex: 'description', editor: new Ext.form.TextField({}), filter: 'string',
renderer: Ext.util.Format.htmlEncode});

var dateRenderer = function(d) {
if (d !== undefined) {
Expand Down Expand Up @@ -359,7 +363,7 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({
if (selected.length > 0) {
var record = selected[0];
var collectionId = record.data.id;
var collectionName = record.data.name;
var collectionName = Ext.util.Format.htmlEncode(record.data.name);

this.collectionId = collectionId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ pimcore.object.classificationstore.groupsPanel = Class.create({


gridColumns.push({text: t("key_id"), flex: 60, sortable: true, dataIndex: 'keyId', filter: 'string'});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'keyName', filter: 'string'});
gridColumns.push({text: t("description"), flex: 200, sortable: true, dataIndex: 'keyDescription', filter: 'string'});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'keyName', filter: 'string',
renderer: Ext.util.Format.htmlEncode});
gridColumns.push({text: t("description"), flex: 200, sortable: true, dataIndex: 'keyDescription', filter: 'string',
renderer: Ext.util.Format.htmlEncode});

gridColumns.push(mandatoryCheck);
gridColumns.push({text: t('sorter'), width: 150, sortable: true, dataIndex: 'sorter',
Expand Down Expand Up @@ -269,8 +271,10 @@ pimcore.object.classificationstore.groupsPanel = Class.create({
//gridColumns.push({text: t("store"), width: 60, sortable: true, dataIndex: 'storeId', filter: 'string'});
gridColumns.push({text: "ID", width: 60, sortable: true, dataIndex: 'id', filter: 'string'});
gridColumns.push({text: t("parent_id"), width: 160, sortable: true, dataIndex: 'parentId', hidden: true, editor: new Ext.form.TextField({})});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'name', editor: new Ext.form.TextField({}), filter: 'string'});
gridColumns.push({text: t("description"), flex: 300, sortable: true, dataIndex: 'description', editor: new Ext.form.TextField({}), filter: 'string'});
gridColumns.push({text: t("name"), flex: 200, sortable: true, dataIndex: 'name', editor: new Ext.form.TextField({}), filter: 'string',
renderer: Ext.util.Format.htmlEncode});
gridColumns.push({text: t("description"), flex: 300, sortable: true, dataIndex: 'description', editor: new Ext.form.TextField({}), filter: 'string',
renderer: Ext.util.Format.htmlEncode});

var dateRenderer = function(d) {
if (d !== undefined) {
Expand Down Expand Up @@ -365,7 +369,7 @@ pimcore.object.classificationstore.groupsPanel = Class.create({
if (selected.length > 0) {
var record = selected[0];
var groupId = record.data.id;
var groupName = record.data.name;
var groupName = Ext.util.Format.htmlEncode(record.data.name);

this.groupId = groupId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ pimcore.object.classificationstore.propertiespanel = Class.create({
sortable: true,
dataIndex: 'name',
filter: 'string',
editor: new Ext.form.TextField({})
editor: new Ext.form.TextField({}),
renderer: Ext.util.Format.htmlEncode
}

);

gridColumns.push({text: t("title"), width: 200, sortable: false, dataIndex: 'title',editor: new Ext.form.TextField({}), filter: 'string'});
gridColumns.push({text: t("description"), width: 300, sortable: true, dataIndex: 'description',editor: new Ext.form.TextField({}), filter: 'string'});
gridColumns.push({text: t("title"), width: 200, sortable: false, dataIndex: 'title',editor: new Ext.form.TextField({}), filter: 'string',
renderer: Ext.util.Format.htmlEncode});
gridColumns.push({text: t("description"), width: 300, sortable: true, dataIndex: 'description',editor: new Ext.form.TextField({}), filter: 'string',
renderer: Ext.util.Format.htmlEncode});
gridColumns.push({text: t("definition"), width: 300, sortable: true, hidden: true, dataIndex: 'definition',editor: new Ext.form.TextField({})});
gridColumns.push({text: t("type"), width: 150, sortable: true, dataIndex: 'type', filter: 'string',
editor: new Ext.form.ComboBox({
Expand Down Expand Up @@ -285,7 +288,7 @@ pimcore.object.classificationstore.propertiespanel = Class.create({
var definition = data.data.definition;
if (definition) {
definition = Ext.util.JSON.decode(definition);
definition.name = data.data.name;
definition.name = Ext.util.Format.htmlEncode(data.data.name);
} else {
definition = {
name: data.data.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ pimcore.object.classificationstore.storeTree = Class.create({
"click": function() {
var data = {
id: record.data.id,
name: record.data.text,
description: record.data.description
name: Ext.util.Format.htmlDecode(record.data.text),
description: Ext.util.Format.htmlDecode(record.data.description)
}
var panel = new pimcore.object.classificationstore.storeConfiguration(data, this.applyConfig.bind(this));
panel.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pimcore.object.tags.input = Class.create(pimcore.object.tags.abstract, {
}

if(this.fieldConfig["regex"]) {
input.regex = new RegExp(this.fieldConfig.regex);
input.regex = new RegExp(this.fieldConfig.regex, 'u');
}

this.component = new Ext.form.TextField(input);
Expand Down
19 changes: 7 additions & 12 deletions bundles/CoreBundle/Command/ThumbnailsImageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ protected function fetchItems(InputInterface $input): array
$list->setCondition(implode(' AND ', $conditions));

$assetIdsList = $list->loadIdList();
$thumbnailList = new Asset\Image\Thumbnail\Config\Listing();
$thumbnailList = [];
$thumbnailList[] = Asset\Image\Thumbnail\Config::getPreviewConfig();
if (!$input->getOption('system')) {
$thumbnailList = new Asset\Image\Thumbnail\Config\Listing();
$thumbnailList = $thumbnailList->getThumbnails();
}

$allowedThumbs = [];
if ($input->getOption('thumbnails')) {
Expand All @@ -132,7 +137,7 @@ protected function fetchItems(InputInterface $input): array

$items = [];
foreach ($assetIdsList as $assetId) {
foreach ($thumbnailList->getThumbnails() as $thumbnailConfig) {
foreach ($thumbnailList as $thumbnailConfig) {
$thumbName = $thumbnailConfig->getName();
if (empty($allowedThumbs) || in_array($thumbName, $allowedThumbs)) {
$items[] = $assetId . '~~~' . $thumbName;
Expand Down Expand Up @@ -221,16 +226,6 @@ private function fetchThumbnailConfigs(InputInterface $input, string $thumbnailC
$thumbnailsToGenerate[] = $avifConfig;
}
}

if ($input->getOption('system')) {
if (!$input->getOption('thumbnails')) {
$thumbnailsToGenerate = [];
}

$thumbnailsToGenerate[] = Asset\Image\Thumbnail\Config::getPreviewConfig();
} elseif (!$input->getOption('thumbnails')) {
$thumbnailsToGenerate[] = Asset\Image\Thumbnail\Config::getPreviewConfig();
}
}

return $thumbnailsToGenerate;
Expand Down
19 changes: 18 additions & 1 deletion bundles/EcommerceFrameworkBundle/Model/DefaultMockup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
namespace Pimcore\Bundle\EcommerceFrameworkBundle\Model;

use Pimcore\Logger;
use Pimcore\Model\DataObject;

class DefaultMockup implements ProductInterface
class DefaultMockup implements ProductInterface, LinkGeneratorAwareInterface
{
/** @var int */
protected $id;
Expand All @@ -28,6 +29,13 @@ class DefaultMockup implements ProductInterface
/** @var array */
protected $relations;

/**
* contains link generators by class type (just for caching)
*
* @var array
*/
protected static array $linkGenerators = [];

public function __construct($id, $params, $relations)
{
$this->id = $id;
Expand All @@ -41,6 +49,15 @@ public function __construct($id, $params, $relations)
}
}

public function getLinkGenerator(): ?DataObject\ClassDefinition\LinkGeneratorInterface
{
if ($classId = $this->params['o_classId'] ?? null) {
return static::$linkGenerators[$classId] ??= DataObject\ClassDefinition::getById($classId)->getLinkGenerator();
}

return null;
}

/**
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\EcommerceFrameworkBundle\Model;

use Pimcore\Model\DataObject;

/**
* Interface LinkGeneratorAwareInterface
*/
interface LinkGeneratorAwareInterface
{
/**
* @return DataObject\ClassDefinition\LinkGeneratorInterface|null
*/
public function getLinkGenerator(): ?DataObject\ClassDefinition\LinkGeneratorInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\Condition;

use DateTimeZone;
use Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\ConditionInterface;
use Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\EnvironmentInterface;

Expand Down Expand Up @@ -91,8 +92,8 @@ public function toJSON()
{
return json_encode([
'type' => 'DateRange',
'starting' => $this->getStarting()->getTimestamp(),
'ending' => $this->getEnding()->getTimestamp(),
'starting' => $this->getStarting()->format('d.m.Y'),
'ending' => $this->getEnding()->format('d.m.Y'),
]);
}

Expand All @@ -105,10 +106,10 @@ public function fromJSON($string)
{
$json = json_decode($string);

$starting = \DateTime::createFromFormat('Y-m-d\TH:i:s', $json->starting);
$starting = \DateTime::createFromFormat('d.m.Y', $json->starting, new DateTimeZone('UTC'));
$starting->setTime(0, 0, 0);

$ending = \DateTime::createFromFormat('Y-m-d\TH:i:s', $json->ending);
$ending = \DateTime::createFromFormat('d.m.Y', $json->ending, new DateTimeZone('UTC'));
$ending->setTime(23, 59, 59);

$this->setStarting($starting);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ pimcore.bundle.EcommerceFramework.pricing.config.item = Class.create({
{
condition[ item.name ] = item.getForm().getFieldValues();
}
else if(item.xtype === 'datefield')
{
condition[ item.name ] = item.getSubmitValue();
}
else
{
condition[ item.getName() ] = item.getValue();
Expand Down
Loading
0