Rename all models
This commit is contained in:
@@ -69,7 +69,7 @@ class TaskImport extends Base
|
||||
$row = $this->prepare($row);
|
||||
|
||||
if ($this->validateCreation($row)) {
|
||||
if ($this->taskCreation->create($row) > 0) {
|
||||
if ($this->taskCreationModel->create($row) > 0) {
|
||||
$this->logger->debug('TaskImport: imported successfully line '.$line_number);
|
||||
$this->counter++;
|
||||
} else {
|
||||
@@ -100,27 +100,27 @@ class TaskImport extends Base
|
||||
$values['time_spent'] = (float) $row['time_spent'];
|
||||
|
||||
if (! empty($row['assignee'])) {
|
||||
$values['owner_id'] = $this->user->getIdByUsername($row['assignee']);
|
||||
$values['owner_id'] = $this->userModel->getIdByUsername($row['assignee']);
|
||||
}
|
||||
|
||||
if (! empty($row['creator'])) {
|
||||
$values['creator_id'] = $this->user->getIdByUsername($row['creator']);
|
||||
$values['creator_id'] = $this->userModel->getIdByUsername($row['creator']);
|
||||
}
|
||||
|
||||
if (! empty($row['color'])) {
|
||||
$values['color_id'] = $this->color->find($row['color']);
|
||||
$values['color_id'] = $this->colorModel->find($row['color']);
|
||||
}
|
||||
|
||||
if (! empty($row['column'])) {
|
||||
$values['column_id'] = $this->column->getColumnIdByTitle($this->projectId, $row['column']);
|
||||
$values['column_id'] = $this->columnModel->getColumnIdByTitle($this->projectId, $row['column']);
|
||||
}
|
||||
|
||||
if (! empty($row['category'])) {
|
||||
$values['category_id'] = $this->category->getIdByName($this->projectId, $row['category']);
|
||||
$values['category_id'] = $this->categoryModel->getIdByName($this->projectId, $row['category']);
|
||||
}
|
||||
|
||||
if (! empty($row['swimlane'])) {
|
||||
$values['swimlane_id'] = $this->swimlane->getIdByName($this->projectId, $row['swimlane']);
|
||||
$values['swimlane_id'] = $this->swimlaneModel->getIdByName($this->projectId, $row['swimlane']);
|
||||
}
|
||||
|
||||
if (! empty($row['date_due'])) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Kanboard\Import;
|
||||
|
||||
use Kanboard\Model\User;
|
||||
use Kanboard\Model\UserModel;
|
||||
use SimpleValidator\Validator;
|
||||
use SimpleValidator\Validators;
|
||||
use Kanboard\Core\Security\Role;
|
||||
@@ -56,7 +56,7 @@ class UserImport extends Base
|
||||
$row = $this->prepare($row);
|
||||
|
||||
if ($this->validateCreation($row)) {
|
||||
if ($this->user->create($row)) {
|
||||
if ($this->userModel->create($row)) {
|
||||
$this->logger->debug('UserImport: imported successfully line '.$line_number);
|
||||
$this->counter++;
|
||||
} else {
|
||||
@@ -109,7 +109,7 @@ class UserImport extends Base
|
||||
{
|
||||
$v = new Validator($values, array(
|
||||
new Validators\MaxLength('username', t('The maximum length is %d characters', 50), 50),
|
||||
new Validators\Unique('username', t('The username must be unique'), $this->db->getConnection(), User::TABLE, 'id'),
|
||||
new Validators\Unique('username', t('The username must be unique'), $this->db->getConnection(), UserModel::TABLE, 'id'),
|
||||
new Validators\MinLength('password', t('The minimum length is %d characters', 6), 6),
|
||||
new Validators\Email('email', t('Email address invalid')),
|
||||
new Validators\Integer('is_ldap_user', t('This value must be an integer')),
|
||||
|
||||
Reference in New Issue
Block a user