add WYSIWYG special character tasks

This commit is contained in:
Daniel Seifert 2021-07-28 17:39:15 +02:00
bovenliggende 3dedd7dee8
commit 194a7da474
Getekend door: DanielS
GPG sleutel-ID: 8A7C4C6ED1915C6F
5 gewijzigde bestanden met toevoegingen van 172 en 24 verwijderingen

Bestand weergeven

@ -0,0 +1,62 @@
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
namespace D3\DataWizardTasks\Application\Model\Actions;
use D3\DataWizard\Application\Model\ActionBase;
use OxidEsales\Eshop\Application\Model\Content;
use OxidEsales\Eshop\Core\Registry;
class FixWysiwygSpecialChars extends ActionBase
{
/**
* @return string
*/
public function getTitle() : string
{
return Registry::getLang()->translateString('D3_DATAWIZARDTASKS_ACTIONS_FIXWYSIWYGSPECIALCHARS');
}
/**
* @return array
*/
public function getQuery() : array
{
$content = oxNew(Content::class);
$contentTableName = $content->getCoreTableName();
$currentLanguage = $content->getLanguage();
$updateFields = [];
$whereFields = [];
foreach (array_keys(Registry::getLang()->getAllShopLanguageIds()) as $langId) {
$content->setLanguage($langId);
$fieldName = $content->getUpdateSqlFieldName('oxcontent');
$updateFields[] = 'oc.'.$fieldName.' = REPLACE(oc.'.$fieldName.', :searchSpecialChars, :replaceSpecialChars)';
$whereFields[] = $content->getUpdateSqlFieldName('oxcontent').' LIKE :whereSpecialChars';
}
$content->setLanguage($currentLanguage);
return [
"UPDATE
".$contentTableName." oc
SET
".implode(', ', $updateFields)."
WHERE ".implode(' OR ', $whereFields),
[
'searchSpecialChars' => '-&gt;',
'replaceSpecialChars' => '->',
'whereSpecialChars' => '%-&gt;%'
]
];
}
}

Bestand weergeven

@ -0,0 +1,70 @@
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
namespace D3\DataWizardTasks\Application\Model\Exports;
use D3\DataWizard\Application\Model\ExportBase;
use OxidEsales\Eshop\Application\Model\Content;
use OxidEsales\Eshop\Core\Registry;
class DestroyedWysiwygSpecialChars extends ExportBase
{
/**
* @return string
*/
public function getTitle() : string
{
return Registry::getLang()->translateString('D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS');
}
public function getDescription() : string
{
return Registry::getLang()->translateString('D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_DESC');
}
/**
* @return array
*/
public function getQuery() : array
{
$content = oxNew(Content::class);
$contentTableName = $content->getCoreTableName();
$titleTitle = Registry::getLang()->translateString('D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_TITLE');
$loadIdTitle = Registry::getLang()->translateString('D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_LOADID');
$currentLanguage = $content->getLanguage();
$whereFields = [];
foreach (array_keys(Registry::getLang()->getAllShopLanguageIds()) as $langId) {
$content->setLanguage($langId);
$whereFields[] = $content->getUpdateSqlFieldName('oxcontent').' LIKE :specialChars';
}
$content->setLanguage($currentLanguage);
return [
"SELECT
oc.OXID,
oc.OXSHOPID,
oc.OXLOADID as :loadId,
oc.OXTITLE as :titleTitle
FROM ".$contentTableName." oc
WHERE ".implode(' OR ', $whereFields)."
GROUP BY oc.oxloadid",
[
'specialChars' => '%-&gt;%',
'loadId' => $loadIdTitle,
'titleTitle' => $titleTitle
]
];
}
}

Bestand weergeven

@ -20,19 +20,25 @@ $sLangName = "Deutsch";
$aLang = array(
//Navigation
'charset' => 'UTF-8',
'charset' => 'UTF-8',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikeln',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TREE' => 'Baum',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TITLE' => 'Titel',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_COUNT' => 'Anzahl',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikeln',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TREE' => 'Baum',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TITLE' => 'Titel',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_COUNT' => 'Anzahl',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES' => 'Bestellungskennzahlen nach Monat',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_STARTDATE'=> 'Startdatum (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_ENDDATE' => 'Enddatum (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_ORDERSPERMONTH' => 'Bestellungen pro Monat',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_BASKETSIZE' => 'Warenkorbhöhe',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_MONTH' => 'Monat',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS' => 'Texte mit zerstörten Sonderzeichen',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_DESC' => 'passiert tlw. beim Speichern im WYSIWYG-Editor und führt zu Shop-Fehlern',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_LOADID'=> 'Lade-ID',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_TITLE' => 'Titel',
'D3_DATAWIZARDTASKS_ACTIONS_FIXARTEXTENDSITEMS' => 'fehlende oxartextends-Einträge nachtragen',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES' => 'Bestellungskennzahlen nach Monat',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_STARTDATE' => 'Startdatum (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_ENDDATE' => 'Enddatum (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_ORDERSPERMONTH' => 'Bestellungen pro Monat',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_BASKETSIZE' => 'Warenkorbhöhe',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_MONTH' => 'Monat',
'D3_DATAWIZARDTASKS_ACTIONS_FIXARTEXTENDSITEMS' => 'fehlende oxartextends-Einträge nachtragen',
'D3_DATAWIZARDTASKS_ACTIONS_FIXWYSIWYGSPECIALCHARS' => 'Texte mit zerstörten Sonderzeichen korrigieren',
);

Bestand weergeven

@ -20,19 +20,25 @@ $sLangName = "English";
$aLang = array(
//Navigation
'charset' => 'UTF-8',
'charset' => 'UTF-8',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES' => 'deactivated categories, with active articles',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TREE' => 'tree',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TITLE' => 'title',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_COUNT' => 'count',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES' => 'deactivated categories, with active articles',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TREE' => 'tree',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_TITLE' => 'title',
'D3_DATAWIZARDTASKS_EXPORTS_INACTIVECATEGORIES_COUNT' => 'count',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES' => 'Order key figures by month',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_STARTDATE'=> 'start date (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_ENDDATE' => 'end date (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_ORDERSPERMONTH' => 'orders per month',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_BASKETSIZE' => 'shopping cart value',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_MONTH' => 'month',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS' => 'texts with destroyed special characters',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_DESC' => 'sometimes happens when saving in the WYSIWYG editor and leads to shop errors.',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_LOADID'=> 'load ID',
'D3_DATAWIZARDTASKS_EXPORTS_DESTROYEDWYSIWYGSPECIALCHARS_TITLE' => 'title',
'D3_DATAWIZARDTASKS_ACTIONS_FIXARTEXTENDSITEMS' => 'add missing oxartextends entries',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES' => 'Order key figures by month',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_STARTDATE' => 'start date (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_ENDDATE' => 'end date (optional)',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_ORDERSPERMONTH' => 'orders per month',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_BASKETSIZE' => 'shopping cart value',
'D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_MONTH' => 'month',
'D3_DATAWIZARDTASKS_ACTIONS_FIXARTEXTENDSITEMS' => 'add missing oxartextends entries',
'D3_DATAWIZARDTASKS_ACTIONS_FIXWYSIWYGSPECIALCHARS' => 'fix texts with destroyed special characters',
);

Bestand weergeven

@ -15,6 +15,8 @@ namespace D3\DataWizardTasks\Modules\DataWizard\Application\Model;
use D3\DataWizard\Application\Model\Configuration as ConfigurationParent;
use D3\DataWizardTasks\Application\Model\Actions\FixArtextendsItems;
use D3\DataWizardTasks\Application\Model\Actions\FixWysiwygSpecialChars;
use D3\DataWizardTasks\Application\Model\Exports\DestroyedWysiwygSpecialChars;
use D3\DataWizardTasks\Application\Model\Exports\InactiveCategories;
use D3\DataWizardTasks\Application\Model\Exports\KeyFigures;
@ -25,8 +27,10 @@ class Configuration extends Configuration_parent
parent::configure();
$this->registerAction( ConfigurationParent::GROUP_ARTICLES, oxNew( FixArtextendsItems::class));
$this->registerAction( ConfigurationParent::GROUP_CMS, oxNew( FixWysiwygSpecialChars::class));
$this->registerExport( ConfigurationParent::GROUP_CATEGORY, oxNew( InactiveCategories::class));
$this->registerExport( ConfigurationParent::GROUP_SHOP, oxNew( KeyFigures::class));
$this->registerExport( ConfigurationParent::GROUP_CMS, oxNew( DestroyedWysiwygSpecialChars::class));
}
}