Skip to content

Commit

Permalink
Merge pull request #64 in PLUG/backend_swagimportexport from bugfix/P…
Browse files Browse the repository at this point in the history
…T-2267-Skip-line-function-for-errors to master

* commit '2292a2ce318c225d4a1fa78c145751d8f0d0b6c3':
  PT-2267 Added snippet success status to logger
  PT-2267 Added snippet success status to logger
  • Loading branch information
dnoegel committed Jan 12, 2015
2 parents 32d3b04 + 2292a2c commit e4436d3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
10 changes: 8 additions & 2 deletions Components/SwagImportExport/Utils/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Shopware\Components\SwagImportExport\DataWorkflow;
use Shopware\Components\SwagImportExport\StatusLogger;
use Shopware\Components\SwagImportExport\Utils\SnippetsHelper;

class CommandHelper
{
Expand Down Expand Up @@ -193,8 +194,10 @@ public function exportAction()
$post = $dataWorkflow->export($postData, $this->filePath);

$message = $post['position'] . ' ' . $profile->getType() . ' exported successfully';
$status = SnippetsHelper::getNamespace()
->get('controller/log_status_success', 'No errors');

$logger->write($message, 'false');
$logger->write($message, $status);

$logData = array(
date("Y-m-d H:i:s"),
Expand Down Expand Up @@ -342,7 +345,10 @@ public function importAction()
&& $logger->getMessage() === null) {

$message = $post['position'] . ' ' . $post['adapter'] . ' imported successfully';
$logger->write($message, 'false');
$status = SnippetsHelper::getNamespace()
->get('controller/log_status_success', 'No errors');

$logger->write($message, $status);

$logData = array(
date("Y-m-d H:i:s"),
Expand Down
10 changes: 8 additions & 2 deletions Controllers/Backend/SwagImportExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Shopware\Components\SwagImportExport\Utils\TreeHelper;
use Shopware\Components\SwagImportExport\Utils\DataHelper;
use Shopware\Components\SwagImportExport\StatusLogger;
use Shopware\Components\SwagImportExport\Utils\SnippetsHelper;

/**
* Shopware ImportExport Plugin
Expand Down Expand Up @@ -652,8 +653,10 @@ public function exportAction()
$post = $dataWorkflow->export($postData);

$message = $post['position'] . ' ' . $profile->getType() . ' exported successfully';
$status = SnippetsHelper::getNamespace()
->get('controller/log_status_success', 'No errors');

$logger->write($message, 'false');
$logger->write($message, $status);

$logData = array(
date("Y-m-d H:i:s"),
Expand Down Expand Up @@ -826,7 +829,10 @@ public function importAction()

if ($logger->getMessage() === null) {
$message = $post['position'] . ' ' . $post['adapter'] . ' imported successfully';
$logger->write($message, 'false');
$status = SnippetsHelper::getNamespace()
->get('controller/log_status_success', 'No errors');

$logger->write($message, $status);

$logData = array(
date("Y-m-d H:i:s"),
Expand Down
2 changes: 2 additions & 0 deletions Snippets/backend/swag_importexport/main.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ adapters/orders/status_not_found = "Status %s was not found for order %s"
adapters/orders/detail_status_not_found = "Detail status with id %s was not found"
adapters/translations/no_ids = "Can not read translations without ids."
adapters/translations/no_column_names = "Can not read translations without column names."
controller/log_status_success = "No errors"

[de_DE : default]
adapters/ordernumber_required = "Bestellnummer erforderlich."
Expand Down Expand Up @@ -134,3 +135,4 @@ adapters/orders/status_not_found = "Status %s was not found for order %s."
adapters/orders/detail_status_not_found = "Positionsstatus mit ID %s nicht gefunden"
adapters/translations/no_ids = "Kann Übersetzungen ohne IDs nicht lesen."
adapters/translations/no_column_names = "Kann Übersetzungen ohne Spaltennamen nicht lesen."
controller/log_status_success = "Keine Fehler"

0 comments on commit e4436d3

Please sign in to comment.