Verified Commit 52450b28 authored by Damien's avatar Damien

FIX #12070 TIME 4:00 Improve controls when creating resource

parent 40b42d34
......@@ -181,9 +181,6 @@ CREATE TABLE indexing_models_fields
)
WITH (OIDS=FALSE);
ALTER TABLE res_letterbox DROP COLUMN IF EXISTS model_id;
ALTER TABLE res_letterbox ADD COLUMN model_id INTEGER;
/* TAGS */
DO $$ BEGIN
......@@ -220,9 +217,6 @@ DO $$ BEGIN
END IF;
END$$;
/* LIST INSTANCE */
ALTER TABLE listinstance DROP COLUMN IF EXISTS added_by_entity;
ALTER TABLE listinstance_history_details DROP COLUMN IF EXISTS added_by_entity;
/* NOTES */
DO $$ BEGIN
......@@ -239,6 +233,8 @@ END$$;
/* RES_LETTERBOX */
ALTER TABLE res_letterbox DROP COLUMN IF EXISTS model_id;
ALTER TABLE res_letterbox ADD COLUMN model_id INTEGER;
DO $$ BEGIN
IF (SELECT count(column_name) from information_schema.columns where table_name = 'res_letterbox' and column_name = 'typist' and data_type != 'integer') THEN
ALTER TABLE res_letterbox ADD COLUMN typist_tmp integer;
......@@ -253,7 +249,7 @@ END$$;
/* MLB COLL EXT */
DO $$ BEGIN
IF (SELECT count(attname) FROM pg_attribute WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'mlb_coll_ext') AND attname = 'category_id') THEN
IF (SELECT count(attname) FROM pg_attribute WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'res_letterbox') AND attname = 'category_id') = 0 THEN
ALTER TABLE res_letterbox ADD COLUMN category_id character varying(32);
UPDATE res_letterbox SET category_id = mlb_coll_ext.category_id FROM mlb_coll_ext WHERE res_letterbox.res_id = mlb_coll_ext.res_id;
UPDATE res_letterbox set category_id = 'incoming' WHERE category_id IS NULL;
......@@ -364,6 +360,7 @@ DELETE FROM usergroups_services WHERE service_id = 'edit_recipient_outside_proce
DELETE FROM usergroups_services WHERE service_id = 'update_list_diff_in_details';
DELETE FROM usergroups_services WHERE service_id = 'edit_recipient_in_process';
/* REFACTORING MODIFICATION */
ALTER TABLE notif_email_stack ALTER COLUMN attachments TYPE text;
ALTER TABLE tags ALTER COLUMN label TYPE character varying(128);
......@@ -423,6 +420,12 @@ ALTER TABLE res_letterbox DROP COLUMN IF EXISTS offset_doc;
ALTER TABLE res_letterbox DROP COLUMN IF EXISTS is_multi_docservers;
ALTER TABLE res_letterbox DROP COLUMN IF EXISTS tablename;
ALTER TABLE res_letterbox DROP COLUMN IF EXISTS validation_date;
ALTER TABLE listinstance DROP COLUMN IF EXISTS added_by_entity;
ALTER TABLE listinstance DROP COLUMN IF EXISTS coll_id;
ALTER TABLE listinstance DROP COLUMN IF EXISTS listinstance_type;
ALTER TABLE listinstance DROP COLUMN IF EXISTS visible;
ALTER TABLE listinstance_history_details DROP COLUMN IF EXISTS added_by_entity;
/* RE CREATE VIEWS */
......
......@@ -341,7 +341,6 @@ abstract class avis_controler_Abstract
$stepDetails['listinstance_id'] = $res->listinstance_id;
$stepDetails['coll_id'] = $res->coll_id;
$stepDetails['res_id'] = $res->res_id;
$stepDetails['listinstance_type'] = $res->listinstance_type;
$stepDetails['sequence'] = $res->sequence;
$stepDetails['item_id'] = $res->item_id;
$stepDetails['item_type'] = $res->item_type;
......
......@@ -489,10 +489,10 @@ abstract class diffusion_list_Abstract extends functions
if ($processDate != '') {
$stmt = $db->query(
'insert into '.ENT_LISTINSTANCE
.' (coll_id, res_id, listinstance_type, sequence, item_id, item_type, item_mode, added_by_user, visible, viewed, difflist_type, process_comment, process_date, signatory, requested_signature) '
.' (coll_id, res_id, sequence, item_id, item_type, item_mode, added_by_user, visible, viewed, difflist_type, process_comment, process_date, signatory, requested_signature) '
.'values ('
.'?, ?, '
."'DOC', ?, "
."?, "
.'?, '
."'user_id' , "
.'?, '
......
......@@ -413,7 +413,6 @@ abstract class visa_Abstract extends Database
$stepDetails['listinstance_id'] = $res->listinstance_id;
$stepDetails['coll_id'] = $res->coll_id;
$stepDetails['res_id'] = $res->res_id;
$stepDetails['listinstance_type'] = $res->listinstance_type;
$stepDetails['sequence'] = $res->sequence;
$stepDetails['item_id'] = $res->item_id;
$stepDetails['item_type'] = $res->item_type;
......
......@@ -426,15 +426,12 @@ CREATE SEQUENCE listinstance_id_seq
CREATE TABLE listinstance
(
listinstance_id BIGINT NOT NULL DEFAULT nextval('listinstance_id_seq'::regclass),
coll_id character varying(50) NOT NULL,
res_id bigint NOT NULL,
listinstance_type character varying(50) DEFAULT 'DOC'::character varying,
"sequence" bigint NOT NULL,
item_id character varying(128) NOT NULL,
item_type character varying(255) NOT NULL,
item_mode character varying(50) NOT NULL,
added_by_user character varying(128) NOT NULL,
visible character varying(1) NOT NULL DEFAULT 'Y'::bpchar,
viewed bigint,
difflist_type character varying(50),
process_date timestamp without time zone,
......
......@@ -336,10 +336,14 @@ abstract class BasketModelAbstract
$user = UserModel::getById(['id' => $aArgs['userId'], 'select' => ['user_id']]);
$count = ResModel::getOnView([
'select' => ['COUNT(1)'],
'where' => [PreparedClauseController::getPreparedClause(['login' => $user['user_id'], 'clause' => $aArgs['clause']])]
]);
try {
$count = ResModel::getOnView([
'select' => ['COUNT(1)'],
'where' => [PreparedClauseController::getPreparedClause(['login' => $user['user_id'], 'clause' => $aArgs['clause']])]
]);
} catch (\Exception $e) {
return 0;
}
if (empty($count[0]['count'])) {
return 0;
......
......@@ -31,13 +31,11 @@ class ListInstanceHistoryDetailModel
'listinstance_history_id' => $args['listinstance_history_id'],
'coll_id' => 'letterbox_coll',
'res_id' => $args['res_id'],
'listinstance_type' => 'DOC',
'sequence' => $args['sequence'],
'item_id' => $args['item_id'],
'item_type' => $args['item_type'],
'item_mode' => $args['item_mode'],
'added_by_user' => $args['added_by_user'],
'visible' => 'Y',
'viewed' => 0,
'difflist_type' => $args['difflist_type'],
'process_date' => $args['process_date'],
......
......@@ -67,15 +67,12 @@ abstract class ListInstanceModelAbstract
DatabaseModel::insert([
'table' => 'listinstance',
'columnsValues' => [
'coll_id' => 'letterbox_coll',
'res_id' => $args['res_id'],
'listinstance_type' => 'DOC',
'sequence' => $args['sequence'],
'item_id' => $args['item_id'],
'item_type' => $args['item_type'],
'item_mode' => $args['item_mode'],
'added_by_user' => $args['added_by_user'],
'visible' => 'Y',
'viewed' => $args['viewed'],
'difflist_type' => $args['difflist_type'],
'process_date' => $args['process_date'],
......
......@@ -56,7 +56,7 @@ export class CustomFieldsAdministrationComponent implements OnInit {
label: this.lang.checkboxInput,
type: 'checkbox'
}
]
];
customFields: any[] = [];
customFieldsClone: any[] = [];
......@@ -204,4 +204,4 @@ export class CustomFieldsAdministrationComponent implements OnInit {
return false;
}
}
}
\ No newline at end of file
}
......@@ -44,7 +44,7 @@
<br />{{modService.name}}</button>
</div>
<div class="col-md-6 adminArea_3" *ngIf="classementServices">
<div class="adminArea-label">{{lang.classement}}</div>
<div class="adminArea-label">{{lang.classifying}}</div>
<button class="col-md-4 col-xs-6 adminArea-button"
mat-button color="primary" matTooltip="{{modService.comment}}" *ngFor="let modService of classementServices"
(click)="goToSpecifiedAdministration(modService)">
......@@ -69,4 +69,4 @@
[mode]="appService.getViewMode() ? 'over' : 'side'" class="panel-right" style="overflow-x:hidden;" [ngStyle]="{'width': appService.getViewMode() ? '80%' : '30%'}"
autoFocus="false">
</mat-sidenav>
</mat-sidenav-container>
\ No newline at end of file
</mat-sidenav-container>
......@@ -32,7 +32,7 @@ export class IndexingFormComponent implements OnInit {
@ViewChild('appDiffusionsList', { static: false }) appDiffusionsList: DiffusionsListComponent;
fieldCategories: any[] = ['mail', 'contact', 'process', 'classement'];
fieldCategories: any[] = ['mail', 'contact', 'process', 'classifying'];
indexingModelsCore: any[] = [
{
......@@ -127,14 +127,14 @@ export class IndexingFormComponent implements OnInit {
values: []
},
{
identifier: 'folder',
label: this.lang.folder,
identifier: 'folders',
label: this.lang.folders,
type: 'autocomplete',
default_value: '',
values: ['/rest/autocomplete/folders', '/rest/folders']
},
{
identifier: 'docDate',
identifier: 'documentDate',
label: this.lang.docDate,
unit: 'mail',
type: 'date',
......
......@@ -159,7 +159,7 @@ export const LANG_EN = {
"chronoNumber" : "Chrono number",
"chronoNumberShort" : "Chrono Num",
"city" : "City",
"classement" : "RANKING",
"classifying" : "Classifying",
"clause" : "Clause",
"clickOn" : "Click on",
"close" : "Close",
......
......@@ -167,7 +167,7 @@ export const LANG_FR = {
"chronoNumber" : "Numéro chrono",
"chronoNumberShort" : "N° Chrono",
"city" : "Ville",
"classement" : "CLASSEMENT",
"classifying" : "CLASSEMENT",
"clause" : "Clause",
"clauseGroup" : "Périmètre documentaire",
"clickOn" : "Cliquez sur",
......
......@@ -160,7 +160,7 @@ export const LANG_NL = {
"chronoNumber" : "Chrononummer",
"chronoNumberShort" : "Chrono Num", //_TO_TRANSLATE
"city" : "Gemeente",
"classement" : "STANDEN",
"classifying" : "STANDEN",
"clause" : "Clausule",
"clauseGroup" : "Documentaire perimeter",
"clickOn" : "Klik op",
......
......@@ -558,8 +558,7 @@ class DoctypeControllerTest extends TestCase
'format' => 'txt',
'type_id' => $doctypeId,
'category_id' => 'incoming',
'subject' => 'subject value test U',
'typist' => 'LLane'
'subject' => 'subject value test U'
];
$fullRequest = \httpRequestCustom::addContentInBody($aArgs, $request);
......
......@@ -58,7 +58,7 @@ class ResControllerTest extends TestCase
$this->assertSame(102, $res['type_id']);
$this->assertSame('txt', $res['format']);
$this->assertSame('NEW', $res['status']);
$this->assertSame('LLane', $res['typist']);
$this->assertSame(19, $res['typist']);
$this->assertSame(null, $res['destination']);
$GLOBALS['userId'] = 'superadmin';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment