diff --git a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts index 261eb6e873f63dbd45ec5610dc0717e02a16f607..26f059db5b27a81fa2d22710674d2f76e56a533d 100644 --- a/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/status-administration.component.ts @@ -7,15 +7,14 @@ import { NotificationService } from '../notification.service'; import { FormControl, Validators} from '@angular/forms'; declare function $j(selector: any): any; - declare var angularGlobals: any; @Component({ templateUrl: "../../../../Views/status-administration.component.html", - // styleUrls: ['css/status-administration.component.css'], providers: [NotificationService] }) export class StatusAdministrationComponent implements OnInit { + mobileQuery: MediaQueryList; private _mobileQueryListener: () => void; coreUrl: string; @@ -41,8 +40,7 @@ export class StatusAdministrationComponent implements OnInit { getErrorMessage() { return this.statusId.hasError('required') ? this.lang.enterValue : - this.statusId.hasError('pattern') ? this.lang.patternId : - ''; + this.statusId.hasError('pattern') ? this.lang.patternId : ''; } constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient, private route: ActivatedRoute, private router: Router, private notify: NotificationService) { @@ -57,18 +55,16 @@ export class StatusAdministrationComponent implements OnInit { } ngOnInit(): void { - this.loading = true; this.coreUrl = angularGlobals.coreUrl; - - this.prepareStatus(); + this.loading = true; this.route.params.subscribe((params) => { if (typeof params['identifier'] == "undefined") { this.http.get(this.coreUrl + 'rest/administration/statuses/new') .subscribe((data) => { this.status.img_filename = "fm-letter"; - this.status.can_be_searched = true - this.status.can_be_modified = true + this.status.can_be_searched = true; + this.status.can_be_modified = true; this.statusImages = data['statusImages']; this.creationMode = true; this.loading = false; @@ -81,27 +77,9 @@ export class StatusAdministrationComponent implements OnInit { this.statusIdAvailable = true; this.loading = false; } - - this.updateBreadcrumb(angularGlobals.applicationName); }); } - prepareStatus() { - $j('#inner_content').remove(); - } - - updateBreadcrumb(applicationName: string) { - var breadCrumb = "<a href='index.php?reinit=true'>" + applicationName + "</a> > " + - "<a onclick='location.hash = \"/administration\"' style='cursor: pointer'>" + this.lang.administration + "</a> > " + - "<a onclick='location.hash = \"/administration/statuses\"' style='cursor: pointer'>" + this.lang.statuses + "</a> > "; - if (this.creationMode == true) { - breadCrumb += this.lang.statusCreation; - } else { - breadCrumb += this.lang.statusModification; - } - $j('#ariane')[0].innerHTML = breadCrumb; - } - getStatusInfos(statusIdentifier: string) { this.http.get(this.coreUrl + 'rest/statuses/' + statusIdentifier) .subscribe((data) => { @@ -146,7 +124,7 @@ export class StatusAdministrationComponent implements OnInit { submitStatus() { if (this.creationMode == true) { this.http.post(this.coreUrl + 'rest/statuses', this.status) - .subscribe((data: any) => { + .subscribe(() => { this.notify.success(this.lang.statusAdded); this.router.navigate(['administration/statuses']); }, (err) => { @@ -155,7 +133,7 @@ export class StatusAdministrationComponent implements OnInit { } else if (this.creationMode == false) { this.http.put(this.coreUrl + 'rest/statuses/' + this.statusIdentifier, this.status) - .subscribe((data: any) => { + .subscribe(() => { this.notify.success(this.lang.statusUpdated); this.router.navigate(['administration/statuses']); }, (err) => { @@ -163,5 +141,4 @@ export class StatusAdministrationComponent implements OnInit { }); } } - } diff --git a/src/app/history/controllers/BatchHistoryController.php b/src/app/history/controllers/BatchHistoryController.php index 4eea69e3a0ef0ff7f764544ab1f454a58cfa7db9..d8a385365324c56cb7c9725f2e74c969d7032eea 100644 --- a/src/app/history/controllers/BatchHistoryController.php +++ b/src/app/history/controllers/BatchHistoryController.php @@ -36,7 +36,7 @@ class BatchHistoryController return $response->withStatus(400)->withJson(['errors' => 'Bad Request']); } - $maxRequestSize = 10000; + $maxRequestSize = 50000; $batchHistories = BatchHistoryModel::get([ 'select' => ['event_date', 'module_name', 'total_processed', 'total_errors', 'info'], diff --git a/src/app/history/controllers/HistoryController.php b/src/app/history/controllers/HistoryController.php index af0bb61c7c55ab188b156460f1f278463cdfa058..ac3e21d84ae3aaa99c0c87825260a6482576a733 100644 --- a/src/app/history/controllers/HistoryController.php +++ b/src/app/history/controllers/HistoryController.php @@ -40,7 +40,7 @@ class HistoryController return $response->withStatus(400)->withJson(['errors' => 'Bad Request']); } - $maxRequestSize = 10000; + $maxRequestSize = 50000; $histories = HistoryModel::get([ 'select' => ['event_date', 'event_type', 'user_id', 'info', 'remote_ip'], diff --git a/src/app/resource/models/ResModelAbstract.php b/src/app/resource/models/ResModelAbstract.php index b3bc6abeb75dbaa9b8b632f415657718b508035d..f113baa2e0c12712fa7597bdcbbb7fdbe92e8aaf 100644 --- a/src/app/resource/models/ResModelAbstract.php +++ b/src/app/resource/models/ResModelAbstract.php @@ -215,10 +215,11 @@ class ResModelAbstract // In Progress -// public static function getProcessLimitDate(array $aArgs) +// public static function getStoreProcessLimitDate(array $aArgs) // { // ValidatorModel::notEmpty($aArgs, ['resId']); // ValidatorModel::intVal($aArgs, ['resId']); +// ValidatorModel::stringType($aArgs, ['admissionDate']); // // // @@ -262,6 +263,7 @@ class ResModelAbstract // // $document = ResModel::getById(['resId' => $aArgs['resId'], 'select' => ['creation_date', 'type_id']]); // +// $processDelay = 30; // if (!empty($document['type_id'])) { // $doctypeExt = DatabaseModel::select([ // 'select' => ['process_delay'], @@ -272,6 +274,16 @@ class ResModelAbstract // $processDelay = $doctypeExt[0]['process_delay']; // } // +// $defaultDate = $document['creation_date']; +// if (empty($document['creation_date'])) { +// $document['creation_date'] = date('c'); +// } +// +// $date = new \DateTime($document['creation_date']); +// $date->add(new \DateInterval("P{$processDelay}D")); +// +// return $date->format('Y-m-d H:i:s'); +// // // // diff --git a/src/core/controllers/StoreController.php b/src/core/controllers/StoreController.php index d174a34de0f540d21d9055f4856e4793a042def1..aaa27cd6a4419363f0ad5c4e4dde5b132bc4bb38 100644 --- a/src/core/controllers/StoreController.php +++ b/src/core/controllers/StoreController.php @@ -385,6 +385,9 @@ class StoreController if ($value['column'] == 'category_id') { $categoryId = $value['value']; } + if ($value['column'] == 'admission_date') { + $admissionDate = $value['value']; + } } if (!$processLimitDateFound) {