mirror of
https://github.com/Karaka-Management/oms-ContractManagement.git
synced 2026-01-24 07:38:40 +00:00
add/change docs
This commit is contained in:
parent
eb184b72de
commit
bdee6f52d3
|
|
@ -108,7 +108,7 @@ final class ApiController extends Controller
|
|||
$contract->description = (string) ($request->getData('description') ?? '');
|
||||
$contract->type = new NullContractType((int) ($request->getData('type') ?? 0));
|
||||
$contract->start = new \DateTime($request->getData('start') ?? 'now');
|
||||
$contract->account = new NullAccount((int) $request->getData('account'));
|
||||
$contract->account = new NullAccount((int) ($request->getData('account') ?? 0));
|
||||
|
||||
if (!empty($request->getData('end'))) {
|
||||
$contract->end = new \DateTime($request->getData('end'));
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ use phpOMS\Message\RequestAbstract;
|
|||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Views\View;
|
||||
use Modules\ContractManagement\Models\ContractMapper;
|
||||
use Modules\ContractManagement\Models\ContractType;
|
||||
use Modules\ContractManagement\Models\ContractTypeL11n;
|
||||
|
||||
/**
|
||||
* Backend controller for the contracts module.
|
||||
|
|
@ -57,17 +59,17 @@ final class BackendController extends Controller
|
|||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('contracts',
|
||||
ContractMapper::with('language', $response->getLanguage())
|
||||
ContractMapper::with('language', $response->getLanguage(), [ContractTypeL11n::class])
|
||||
::getBeforePivot((int) ($request->getData('id') ?? 0), null, 25)
|
||||
);
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->setData('contracts',
|
||||
ContractMapper::with('language', $response->getLanguage())
|
||||
ContractMapper::with('language', $response->getLanguage(), [ContractTypeL11n::class])
|
||||
::getAfterPivot((int) ($request->getData('id') ?? 0), null, 25)
|
||||
);
|
||||
} else {
|
||||
$view->setData('contracts',
|
||||
ContractMapper::with('language', $response->getLanguage())
|
||||
ContractMapper::with('language', $response->getLanguage(), [ContractTypeL11n::class])
|
||||
::getAfterPivot(0, null, 25)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ declare(strict_types=1);
|
|||
namespace Modules\ContractManagement\Models;
|
||||
|
||||
use Modules\Media\Models\Media;
|
||||
use Modules\Media\Models\NullMedia;
|
||||
use Modules\Admin\Models\Account;
|
||||
use Modules\Admin\Models\NullAccount;
|
||||
use phpOMS\Localization\Money;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\ContractManagement\Models;
|
||||
|
||||
use Modules\Editor\Models\EditorDocMapper;
|
||||
use Modules\Media\Models\MediaMapper;
|
||||
use Modules\Admin\Models\AccountMapper;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
|
|
@ -39,7 +38,7 @@ final class ContractMapper extends DataMapperAbstract
|
|||
'contractmgmt_contract_id' => ['name' => 'contractmgmt_contract_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'contractmgmt_contract_title' => ['name' => 'contractmgmt_contract_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
|
||||
'contractmgmt_contract_description' => ['name' => 'contractmgmt_contract_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'contractmgmt_contract_accouunt' => ['name' => 'contractmgmt_contract_accouunt', 'type' => 'int', 'internal' => 'accouunt'],
|
||||
'contractmgmt_contract_account' => ['name' => 'contractmgmt_contract_account', 'type' => 'int', 'internal' => 'account'],
|
||||
'contractmgmt_contract_costs' => ['name' => 'contractmgmt_contract_costs', 'type' => 'Serializable', 'internal' => 'costs'],
|
||||
'contractmgmt_contract_duration' => ['name' => 'contractmgmt_contract_duration', 'type' => 'int', 'internal' => 'duration'],
|
||||
'contractmgmt_contract_warning' => ['name' => 'contractmgmt_contract_warning', 'type' => 'int', 'internal' => 'warning'],
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
?>
|
||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->title); ?></a>
|
||||
<td class="content" data-label="<?= $this->getHtml('Account'); ?>"><a href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $value->account->getId()); ?>"><?= $this->printHtml($value->account->name1); ?> <?= $this->printHtml($value->account->name2); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Account'); ?>"><a class="content" href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $value->account->getId()); ?>"><?= $this->printHtml($value->account->name1); ?> <?= $this->printHtml($value->account->name2); ?></a>
|
||||
<td data-label="<?= $this->getHtml('End'); ?>"><a href="<?= $url; ?>"><span class="tag <?= $type; ?>"><?= $value->end !== null ? $value->end->format('Y-m-d') : ''; ?></span></a>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user