mirror of
https://github.com/Karaka-Management/oms-ProjectManagement.git
synced 2026-01-10 15:18:40 +00:00
fix bugs
This commit is contained in:
parent
392adbfbe9
commit
730d30aacc
|
|
@ -5,7 +5,7 @@
|
|||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "ProjectManagement",
|
||||
"uri": "{/base}/projectmanagement/list?{?}",
|
||||
"uri": "{/base}/projectmanagement/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 60,
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "{/base}/projectmanagement/list?{?}",
|
||||
"uri": "{/base}/projectmanagement/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "{/base}/projectmanagement/create?{?}",
|
||||
"uri": "{/base}/projectmanagement/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
|
|||
|
|
@ -87,6 +87,13 @@
|
|||
"null": false,
|
||||
"foreignTable": "account",
|
||||
"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->budgetCosts->value = $request->getDataInt('budgetcosts') ?? 0;
|
||||
$project->actualCosts->value = $request->getDataInt('actualcosts') ?? 0;
|
||||
$project->unit = $request->getDataInt('unit') ?? $this->app->unitId;
|
||||
|
||||
// @todo implement unit
|
||||
//$project->unit = $this->app->unitId;
|
||||
|
||||
if (!empty($uploadedFiles = $request->files)) {
|
||||
// @todo implement media path based on id
|
||||
if (!empty($request->files)) {
|
||||
$uploaded = $this->app->moduleManager->get('Media', 'Api')->uploadFiles(
|
||||
[],
|
||||
[],
|
||||
$uploadedFiles,
|
||||
$request->header->account,
|
||||
__DIR__ . '/../../../Modules/Media/Files/Modules/ProjectManagement',
|
||||
'/Modules/ProjectManagement',
|
||||
names: [],
|
||||
fileNames: [],
|
||||
files: $request->files,
|
||||
account: $request->header->account,
|
||||
basePath: __DIR__ . '/../../../Modules/Media/Files/Modules/ProjectManagement',
|
||||
virtualPath: '/Modules/ProjectManagement',
|
||||
);
|
||||
|
||||
foreach ($uploaded as $media) {
|
||||
foreach ($uploaded->sources as $media) {
|
||||
$project->files[] = $media;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,9 @@ class Project
|
|||
* @var Task[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $tasks = [];
|
||||
public array $tasks = [];
|
||||
|
||||
public int $unit = 0;
|
||||
|
||||
/**
|
||||
* 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_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_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\ProgressType;
|
||||
|
||||
/** \Modules\ProjectManagement\Models\Project $project */
|
||||
/** @var \Modules\ProjectManagement\Models\Project $project */
|
||||
$project = $this->data['project'] ?? new NullProject();
|
||||
|
||||
$isNew = $project->id === 0;
|
||||
|
|
@ -72,7 +72,7 @@ echo $this->data['nav']->render(); ?>
|
|||
</select>
|
||||
</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>
|
||||
|
|
@ -81,14 +81,14 @@ echo $this->data['nav']->render(); ?>
|
|||
<div>
|
||||
<div class="form-group">
|
||||
<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 class="form-group">
|
||||
<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>
|
||||
|
|
@ -116,7 +116,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<?php if (!$isNew) : ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<?= $this->getData('calendar')->render($project->getCalendar()); ?>
|
||||
<?= $this->getData('calendar')->render($project->calendar); ?>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user