mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Include warning for #722
This commit is contained in:
@@ -43,4 +43,11 @@ interface ConfigurationInterface
|
||||
*/
|
||||
public function storeConfiguration(array $data): bool;
|
||||
|
||||
/**
|
||||
* Return possible warning to user.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWarningMessage(): string;
|
||||
|
||||
}
|
||||
|
@@ -135,4 +135,14 @@ class Initial implements ConfigurationInterface
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return possible warning to user.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWarningMessage(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@@ -268,4 +268,14 @@ class Map implements ConfigurationInterface
|
||||
|
||||
return $column;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return possible warning to user.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWarningMessage(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@@ -29,6 +29,9 @@ class Roles implements ConfigurationInterface
|
||||
/** @var ImportJob */
|
||||
private $job;
|
||||
|
||||
/** @var string */
|
||||
private $warning = '';
|
||||
|
||||
/**
|
||||
* Get the data necessary to show the configuration screen.
|
||||
*
|
||||
@@ -68,6 +71,16 @@ class Roles implements ConfigurationInterface
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return possible warning to user.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWarningMessage(): string
|
||||
{
|
||||
return $this->warning;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
@@ -246,6 +259,10 @@ class Roles implements ConfigurationInterface
|
||||
$config['column-roles-complete'] = true;
|
||||
$this->job->configuration = $config;
|
||||
$this->job->save();
|
||||
$this->warning = '';
|
||||
}
|
||||
if ($assigned === 0 || !$hasAmount) {
|
||||
$this->warning = trans('csv.roles_warning');
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user