File tree 1 file changed +5
-5
lines changed
src/protected/application/lib/modules/Diligence/Controllers
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ public function POST_save(): void
34
34
35
35
$ app = App::i ();
36
36
$ registration = $ app ->repo ('Registration ' )->find ($ this ->data ['registration ' ]);
37
-
37
+ // Consulta se tem diligencia
38
38
$ isDiligence = $ app ->repo ('Diligence\Entities\Diligence ' )->findOneBy (['registration ' => $ this ->data ['registration ' ]]);
39
-
40
- if (is_null ($ isDiligence ) || $ isDiligence ->open_agent_id == $ app ->user ->profile_id ){
39
+ // Se não tiver diligencia ou se quem abriu a diligencia é a mesma pessoa logada poderá alterar o registro
40
+ if (is_null ($ isDiligence ) || $ isDiligence ->openAgent -> id == $ app ->user ->profile -> id ){
41
41
if (($ this ->data ['idDiligence ' ] ?: 0 ) == 0 && (is_null ($ registration ->opportunity ->use_multiple_diligence ) || $ registration ->opportunity ->use_multiple_diligence === 'Não ' )) {
42
42
$ diligences = $ app ->repo (EntityDiligence::class)->findBy ([
43
43
'registration ' => $ registration ,
@@ -73,9 +73,9 @@ public function GET_getcontent(): void
73
73
{
74
74
$ app = App::i ();
75
75
76
- //ID é o número da inscrição
76
+ // ID é o número da inscrição
77
77
if (isset ($ this ->data ['id ' ])) {
78
- //Repositorio da Diligencia
78
+ // Repositorio da Diligencia
79
79
$ diligences = $ app ->repo ('Diligence\Entities\Diligence ' )
80
80
->findBy (
81
81
['registration ' => $ this ->data ['id ' ]],
You can’t perform that action at this time.
0 commit comments