Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCourrier
Commits
bad8c515
Commit
bad8c515
authored
Sep 14, 2021
by
Guillaume Heurtier
Browse files
FEAT #17268 TIME 1:30 make doctype not mandatory
parent
4b45446c
Changes
7
Hide whitespace changes
Inline
Side-by-side
sql/structure.sql
View file @
bad8c515
...
...
@@ -1142,12 +1142,12 @@ SELECT r.res_id,
r
.
custom_fields
,
en
.
entity_label
,
en
.
entity_type
AS
entitytype
FROM
doctypes
d
,
doctypes_first_level
dfl
,
doctypes_second_level
dsl
,
res_letterbox
r
LEFT
JOIN
entities
en
ON
r
.
destination
::
text
=
en
.
entity_id
::
text
WHERE
r
.
type_id
=
d
.
type_id
AND
d
.
doctypes_first_level_id
=
dfl
.
doctypes_first_level_id
AND
d
.
doctypes_second_level_id
=
dsl
.
doctypes_second_level_id
;
FROM
res_letterbox
r
LEFT
JOIN
doctypes
d
ON
r
.
type_id
=
d
.
type_id
LEFT
JOIN
doctypes_first_level
dfl
ON
d
.
doctypes_first_level_id
=
dfl
.
doctypes_first_level_id
LEFT
JOIN
doctypes_second_level
dsl
ON
d
.
doctypes_second_level_id
=
dsl
.
doctypes_second_level_id
LEFT
JOIN
entities
en
ON
r
.
destination
::
TEXT
=
en
.
entity_id
::
TEXT
;
CREATE
FUNCTION
order_alphanum
(
text
)
RETURNS
text
AS
$$
SELECT
regexp_replace
(
regexp_replace
(
regexp_replace
(
regexp_replace
(
$
1
,
...
...
src/app/action/controllers/AcknowledgementReceiptTrait.php
View file @
bad8c515
...
...
@@ -69,7 +69,10 @@ trait AcknowledgementReceiptTrait
}
}
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$resource
[
'type_id'
],
'select'
=>
[
'process_mode'
]]);
$doctype
[
'process_mode'
]
=
''
;
if
(
!
empty
(
$resource
[
'type_id'
]))
{
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$resource
[
'type_id'
],
'select'
=>
[
'process_mode'
]]);
}
if
(
$doctype
[
'process_mode'
]
==
'SVA'
)
{
$templateAttachmentType
=
'sva'
;
...
...
src/app/action/controllers/PreProcessActionController.php
View file @
bad8c515
...
...
@@ -255,7 +255,10 @@ class PreProcessActionController
continue
;
}
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$resource
[
'type_id'
],
'select'
=>
[
'process_mode'
]]);
$doctype
[
'process_mode'
]
=
''
;
if
(
!
empty
(
$resource
[
'type_id'
]))
{
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$resource
[
'type_id'
],
'select'
=>
[
'process_mode'
]]);
}
if
(
empty
(
$resource
[
'destination'
])
&&
$currentMode
==
'auto'
)
{
$noSendAR
[
'number'
]
+=
1
;
...
...
src/app/external/alfresco/controllers/AlfrescoController.php
View file @
bad8c515
...
...
@@ -692,8 +692,10 @@ class AlfrescoController
if
(
$alfrescoParameter
==
'alfrescoLogin'
)
{
$properties
[
$key
]
=
$entityInformations
[
'alfresco'
][
'login'
];
}
elseif
(
$alfrescoParameter
==
'doctypeLabel'
)
{
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'description'
],
'id'
=>
$document
[
'type_id'
]]);
$properties
[
$key
]
=
$doctype
[
'description'
];
if
(
!
empty
(
$document
[
'type_id'
]))
{
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'description'
],
'id'
=>
$document
[
'type_id'
]]);
}
$properties
[
$key
]
=
$doctype
[
'description'
]
??
''
;
}
elseif
(
$alfrescoParameter
==
'priorityLabel'
)
{
if
(
!
empty
(
$document
[
'priority'
]))
{
$priority
=
PriorityModel
::
getById
([
'select'
=>
[
'label'
],
'id'
=>
$document
[
'priority'
]]);
...
...
@@ -735,9 +737,11 @@ class AlfrescoController
}
$properties
[
$key
]
=
$contactToDisplay
[
'contact'
][
'address'
]
??
''
;
}
elseif
(
$alfrescoParameter
==
'doctypeSecondLevelLabel'
)
{
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'doctypes_second_level_id'
],
'id'
=>
$document
[
'type_id'
]]);
$doctypeSecondLevel
=
SecondLevelModel
::
getById
([
'id'
=>
$doctype
[
'doctypes_second_level_id'
],
'select'
=>
[
'doctypes_second_level_label'
]]);
$properties
[
$key
]
=
$doctypeSecondLevel
[
'doctypes_second_level_label'
];
if
(
!
empty
(
$document
[
'type_id'
]))
{
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'doctypes_second_level_id'
],
'id'
=>
$document
[
'type_id'
]]);
$doctypeSecondLevel
=
SecondLevelModel
::
getById
([
'id'
=>
$doctype
[
'doctypes_second_level_id'
],
'select'
=>
[
'doctypes_second_level_label'
]]);
}
$properties
[
$key
]
=
$doctypeSecondLevel
[
'doctypes_second_level_label'
]
??
''
;
}
elseif
(
strpos
(
$alfrescoParameter
,
'customField_'
)
!==
false
)
{
$customId
=
explode
(
'_'
,
$alfrescoParameter
)[
1
];
$customValue
=
json_decode
(
$document
[
'custom_fields'
],
true
);
...
...
src/app/external/messageExchange/controllers/SendMessageExchangeController.php
View file @
bad8c515
...
...
@@ -152,7 +152,9 @@ class SendMessageExchangeController
}
$AllInfoMainMail
=
ResModel
::
getById
([
'select'
=>
[
'*'
],
'resId'
=>
$args
[
'resId'
]]);
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'description'
],
'id'
=>
$AllInfoMainMail
[
'type_id'
]]);
if
(
!
empty
(
$AllInfoMainMail
[
'type_id'
]))
{
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'description'
],
'id'
=>
$AllInfoMainMail
[
'type_id'
]]);
}
$tmpMainExchangeDoc
=
explode
(
"__"
,
$body
[
'mainExchangeDoc'
]);
$MainExchangeDoc
=
[
'tablename'
=>
$tmpMainExchangeDoc
[
0
],
'res_id'
=>
$tmpMainExchangeDoc
[
1
]];
...
...
@@ -161,7 +163,7 @@ class SendMessageExchangeController
if
(
!
empty
(
$body
[
'joinFile'
])
||
$MainExchangeDoc
[
'tablename'
]
==
'res_letterbox'
)
{
$AllInfoMainMail
[
'Title'
]
=
$AllInfoMainMail
[
'subject'
];
$AllInfoMainMail
[
'OriginatingAgencyArchiveUnitIdentifier'
]
=
$AllInfoMainMail
[
'alt_identifier'
];
$AllInfoMainMail
[
'DocumentType'
]
=
$doctype
[
'description'
];
$AllInfoMainMail
[
'DocumentType'
]
=
$doctype
[
'description'
]
??
null
;
$AllInfoMainMail
[
'tablenameExchangeMessage'
]
=
'res_letterbox'
;
$fileInfo
=
[
$AllInfoMainMail
];
}
...
...
src/app/resource/controllers/FolderPrintController.php
View file @
bad8c515
...
...
@@ -906,8 +906,10 @@ class FolderPrintController
'resId'
=>
$resId
]);
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'description'
],
'id'
=>
$resource
[
'type_id'
]]);
$resource
[
'type_label'
]
=
$doctype
[
'description'
];
if
(
!
empty
(
$resource
[
'type_id'
]))
{
$doctype
=
DoctypeModel
::
getById
([
'select'
=>
[
'description'
],
'id'
=>
$resource
[
'type_id'
]]);
}
$resource
[
'type_label'
]
=
$doctype
[
'description'
]
??
''
;
$data
=
SummarySheetController
::
prepareData
([
'units'
=>
$units
,
'resourcesIds'
=>
[
$resId
]]);
...
...
src/app/resource/controllers/ResourceControlController.php
View file @
bad8c515
...
...
@@ -45,17 +45,19 @@ class ResourceControlController
if
(
empty
(
$body
))
{
return
[
'errors'
=>
'Body is not set or empty'
];
}
elseif
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$body
[
'doctype'
]))
{
return
[
'errors'
=>
'Body doctype is
empty or
not an integer'
];
}
elseif
(
!
empty
(
$body
[
'doctype'
])
&&
!
Validator
::
intVal
()
->
validate
(
$body
[
'doctype'
]))
{
return
[
'errors'
=>
'Body doctype is not an integer'
];
}
elseif
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$body
[
'modelId'
]))
{
return
[
'errors'
=>
'Body modelId is empty or not an integer'
];
}
elseif
(
$isWebServiceUser
&&
!
Validator
::
stringType
()
->
notEmpty
()
->
validate
(
$body
[
'status'
]))
{
return
[
'errors'
=>
'Body status is empty or not a string'
];
}
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$body
[
'doctype'
],
'select'
=>
[
1
]]);
if
(
empty
(
$doctype
))
{
return
[
'errors'
=>
'Body doctype does not exist'
];
if
(
!
empty
(
$body
[
'doctype'
]))
{
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$body
[
'doctype'
],
'select'
=>
[
1
]]);
if
(
empty
(
$doctype
))
{
return
[
'errors'
=>
'Body doctype does not exist'
];
}
}
$indexingModel
=
IndexingModelModel
::
getById
([
'id'
=>
$body
[
'modelId'
],
'select'
=>
[
'master'
,
'enabled'
]]);
...
...
@@ -167,12 +169,14 @@ class ResourceControlController
}
}
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$body
[
'doctype'
]))
{
return
[
'errors'
=>
'Body doctype is empty or not an integer'
];
}
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$body
[
'doctype'
],
'select'
=>
[
1
]]);
if
(
empty
(
$doctype
))
{
return
[
'errors'
=>
'Body doctype does not exist'
];
if
(
!
empty
(
$body
[
'doctype'
]))
{
if
(
!
Validator
::
intVal
()
->
validate
(
$body
[
'doctype'
]))
{
return
[
'errors'
=>
'Body doctype is not an integer'
];
}
$doctype
=
DoctypeModel
::
getById
([
'id'
=>
$body
[
'doctype'
],
'select'
=>
[
1
]]);
if
(
empty
(
$doctype
))
{
return
[
'errors'
=>
'Body doctype does not exist'
];
}
}
$control
=
ResourceControlController
::
controlAdjacentData
([
'body'
=>
$body
,
'isWebServiceUser'
=>
false
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment