mirror of
https://github.com/Karaka-Management/oms-ProjectManagement.git
synced 2026-01-11 07:38:40 +00:00
fix bugs
This commit is contained in:
parent
392adbfbe9
commit
730d30aacc
|
|
@ -5,7 +5,7 @@
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "ProjectManagement",
|
"name": "ProjectManagement",
|
||||||
"uri": "{/base}/projectmanagement/list?{?}",
|
"uri": "{/base}/projectmanagement/list",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 60,
|
"order": 60,
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"uri": "{/base}/projectmanagement/list?{?}",
|
"uri": "{/base}/projectmanagement/list",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Create",
|
"name": "Create",
|
||||||
"uri": "{/base}/projectmanagement/create?{?}",
|
"uri": "{/base}/projectmanagement/create",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 5,
|
"order": 5,
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,13 @@
|
||||||
"null": false,
|
"null": false,
|
||||||
"foreignTable": "account",
|
"foreignTable": "account",
|
||||||
"foreignKey": "account_id"
|
"foreignKey": "account_id"
|
||||||
|
},
|
||||||
|
"projectmanagement_project_unit": {
|
||||||
|
"name": "projectmanagement_project_unit",
|
||||||
|
"type": "INT",
|
||||||
|
"null": false,
|
||||||
|
"foreignTable": "unit",
|
||||||
|
"foreignKey": "unit_id"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -84,21 +84,20 @@ final class ApiController extends Controller
|
||||||
$project->progress = $request->getDataInt('progress') ?? 0;
|
$project->progress = $request->getDataInt('progress') ?? 0;
|
||||||
$project->budgetCosts->value = $request->getDataInt('budgetcosts') ?? 0;
|
$project->budgetCosts->value = $request->getDataInt('budgetcosts') ?? 0;
|
||||||
$project->actualCosts->value = $request->getDataInt('actualcosts') ?? 0;
|
$project->actualCosts->value = $request->getDataInt('actualcosts') ?? 0;
|
||||||
|
$project->unit = $request->getDataInt('unit') ?? $this->app->unitId;
|
||||||
|
|
||||||
// @todo implement unit
|
// @todo implement media path based on id
|
||||||
//$project->unit = $this->app->unitId;
|
if (!empty($request->files)) {
|
||||||
|
|
||||||
if (!empty($uploadedFiles = $request->files)) {
|
|
||||||
$uploaded = $this->app->moduleManager->get('Media', 'Api')->uploadFiles(
|
$uploaded = $this->app->moduleManager->get('Media', 'Api')->uploadFiles(
|
||||||
[],
|
names: [],
|
||||||
[],
|
fileNames: [],
|
||||||
$uploadedFiles,
|
files: $request->files,
|
||||||
$request->header->account,
|
account: $request->header->account,
|
||||||
__DIR__ . '/../../../Modules/Media/Files/Modules/ProjectManagement',
|
basePath: __DIR__ . '/../../../Modules/Media/Files/Modules/ProjectManagement',
|
||||||
'/Modules/ProjectManagement',
|
virtualPath: '/Modules/ProjectManagement',
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($uploaded as $media) {
|
foreach ($uploaded->sources as $media) {
|
||||||
$project->files[] = $media;
|
$project->files[] = $media;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,9 @@ class Project
|
||||||
* @var Task[]
|
* @var Task[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public $tasks = [];
|
public array $tasks = [];
|
||||||
|
|
||||||
|
public int $unit = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ final class ProjectMapper extends DataMapperFactory
|
||||||
'projectmanagement_project_progress_type' => ['name' => 'projectmanagement_project_progress_type', 'type' => 'int', 'internal' => 'progressType'],
|
'projectmanagement_project_progress_type' => ['name' => 'projectmanagement_project_progress_type', 'type' => 'int', 'internal' => 'progressType'],
|
||||||
'projectmanagement_project_created_by' => ['name' => 'projectmanagement_project_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
'projectmanagement_project_created_by' => ['name' => 'projectmanagement_project_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
||||||
'projectmanagement_project_created_at' => ['name' => 'projectmanagement_project_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
'projectmanagement_project_created_at' => ['name' => 'projectmanagement_project_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||||
|
'projectmanagement_project_unit' => ['name' => 'projectmanagement_project_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
||||||
use Modules\ProjectManagement\Models\NullProject;
|
use Modules\ProjectManagement\Models\NullProject;
|
||||||
use Modules\ProjectManagement\Models\ProgressType;
|
use Modules\ProjectManagement\Models\ProgressType;
|
||||||
|
|
||||||
/** \Modules\ProjectManagement\Models\Project $project */
|
/** @var \Modules\ProjectManagement\Models\Project $project */
|
||||||
$project = $this->data['project'] ?? new NullProject();
|
$project = $this->data['project'] ?? new NullProject();
|
||||||
|
|
||||||
$isNew = $project->id === 0;
|
$isNew = $project->id === 0;
|
||||||
|
|
@ -72,7 +72,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" id="iProgress" name="progress" value="<?= $project->progress; ?>"<?= $project->progressType !== ProgressType::MANUAL ? ' disabled' : ''; ?>>
|
<input type="number" id="iProgress" name="progress" step="1" min="0" max="100" value="<?= $project->progress; ?>"<?= $project->progressType !== ProgressType::MANUAL ? ' disabled' : ''; ?>>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -81,14 +81,14 @@ echo $this->data['nav']->render(); ?>
|
||||||
<div>
|
<div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iBudget"><?= $this->getHtml('Budget'); ?></label><td>
|
<label for="iBudget"><?= $this->getHtml('Budget'); ?></label><td>
|
||||||
<input type="text" id="iBudget" name="budget">
|
<input type="number" step="any" id="iBudget" name="budget">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iActual"><?= $this->getHtml('Actual'); ?></label>
|
<label for="iActual"><?= $this->getHtml('Actual'); ?></label>
|
||||||
<input type="text" id="iActual" name="actual">
|
<input type="number" step="any" id="iActual" name="actual">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -116,7 +116,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<?php if (!$isNew) : ?>
|
<?php if (!$isNew) : ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
<?= $this->getData('calendar')->render($project->getCalendar()); ?>
|
<?= $this->getData('calendar')->render($project->calendar); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user