Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
31b0d6e8
Commit
31b0d6e8
authored
4 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FIX #10240 TIME 0:25 fix set sign and date block prepos
parent
4ab49dd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/frontend/app/document/document.component.ts
+1
-4
1 addition, 4 deletions
src/frontend/app/document/document.component.ts
src/frontend/app/signatures/signatures.component.ts
+23
-37
23 additions, 37 deletions
src/frontend/app/signatures/signatures.component.ts
with
24 additions
and
41 deletions
src/frontend/app/document/document.component.ts
+
1
−
4
View file @
31b0d6e8
...
@@ -251,7 +251,6 @@ export class DocumentComponent implements OnInit {
...
@@ -251,7 +251,6 @@ export class DocumentComponent implements OnInit {
cssClass
:
'
my-custom-class
'
,
cssClass
:
'
my-custom-class
'
,
componentProps
:
{
componentProps
:
{
currentWorflow
:
this
.
mainDocument
.
workflow
.
filter
((
line
:
{
current
:
boolean
;
})
=>
line
.
current
===
true
)[
0
],
currentWorflow
:
this
.
mainDocument
.
workflow
.
filter
((
line
:
{
current
:
boolean
;
})
=>
line
.
current
===
true
)[
0
],
posCurrentUser
:
this
.
mainDocument
.
workflow
.
indexOf
(
this
.
mainDocument
.
workflow
.
filter
((
item
:
{
current
:
boolean
;
})
=>
item
.
current
===
true
)[
0
])
}
}
});
});
await
modal
.
present
();
await
modal
.
present
();
...
@@ -376,9 +375,7 @@ export class DocumentComponent implements OnInit {
...
@@ -376,9 +375,7 @@ export class DocumentComponent implements OnInit {
this
.
signaturesService
.
signaturesListSubstituted
=
[];
this
.
signaturesService
.
signaturesListSubstituted
=
[];
}
}
if
(
realUserWorkflow
[
0
].
datePositions
.
length
>
0
&&
this
.
functionsService
.
empty
(
this
.
signaturesService
.
datesContent
))
{
if
(
realUserWorkflow
[
0
].
datePositions
.
length
>
0
&&
this
.
functionsService
.
empty
(
this
.
signaturesService
.
datesContent
))
{
const
currentUser
=
this
.
mainDocument
.
workflow
.
indexOf
(
realUserWorkflow
[
0
]);
realUserWorkflow
[
0
].
datePositions
.
forEach
((
date
:
any
)
=>
{
const
datePosUser
=
realUserWorkflow
[
0
].
datePositions
.
filter
((
item
:
any
)
=>
item
.
sequence
===
currentUser
);
datePosUser
.
forEach
((
date
:
any
)
=>
{
if
(
!
this
.
signaturesService
.
datesContent
[
date
.
page
])
{
if
(
!
this
.
signaturesService
.
datesContent
[
date
.
page
])
{
this
.
signaturesService
.
datesContent
[
date
.
page
]
=
[];
this
.
signaturesService
.
datesContent
[
date
.
page
]
=
[];
}
}
...
...
This diff is collapsed.
Click to expand it.
src/frontend/app/signatures/signatures.component.ts
+
23
−
37
View file @
31b0d6e8
...
@@ -19,7 +19,6 @@ import { SignaturePadPageComponent } from '../pad/pad.component';
...
@@ -19,7 +19,6 @@ import { SignaturePadPageComponent } from '../pad/pad.component';
export
class
SignaturesComponent
implements
OnInit
{
export
class
SignaturesComponent
implements
OnInit
{
@
Input
()
currentWorflow
:
any
;
@
Input
()
currentWorflow
:
any
;
@
Input
()
posCurrentUser
:
number
;
loading
:
boolean
=
true
;
loading
:
boolean
=
true
;
scrolling
:
boolean
=
false
;
scrolling
:
boolean
=
false
;
...
@@ -109,35 +108,32 @@ export class SignaturesComponent implements OnInit {
...
@@ -109,35 +108,32 @@ export class SignaturesComponent implements OnInit {
}
}
}
}
mustPrePosSignature
(
signPosCurrentPage
:
any
,
signPosOtherPage
:
any
)
{
return
!
(
!
this
.
signPosMode
||
(
signPosCurrentPage
.
length
===
0
&&
signPosOtherPage
.
length
===
0
));
}
selectSignature
(
signature
:
any
)
{
selectSignature
(
signature
:
any
)
{
const
percentWidth
=
25
;
const
percentWidth
=
25
;
signature
.
width
=
percentWidth
;
signature
.
width
=
percentWidth
;
const
signPosCurrentPage
=
this
.
currentWorflow
.
signaturePositions
.
filter
((
item
:
any
)
=>
item
.
page
===
this
.
signaturesService
.
currentPage
);
const
signPosCurrentPage
=
this
.
currentWorflow
.
signaturePositions
.
filter
((
item
:
any
)
=>
item
.
page
===
this
.
signaturesService
.
currentPage
);
const
signPosOtherPage
=
this
.
currentWorflow
.
signaturePositions
.
filter
((
item
:
any
)
=>
item
.
page
!==
this
.
signaturesService
.
currentPage
);
const
signPosOtherPage
=
this
.
currentWorflow
.
signaturePositions
.
filter
((
item
:
any
)
=>
item
.
page
!==
this
.
signaturesService
.
currentPage
);
if
(
!
this
.
signPosMode
||
(
signPosCurrentPage
.
length
===
0
&&
signPosOtherPage
.
length
===
0
))
{
if
(
!
this
.
mustPrePosSignature
(
signPosCurrentPage
,
signPosOtherPage
))
{
signature
.
positionX
=
60
;
signature
.
positionX
=
60
;
signature
.
positionY
=
80
;
signature
.
positionY
=
80
;
this
.
storeSignature
(
signature
,
this
.
signaturesService
.
currentPage
);
this
.
storeSignature
(
signature
,
this
.
signaturesService
.
currentPage
);
this
.
notificationService
.
success
(
'
lang.signatureInDocAdded
'
);
this
.
notificationService
.
success
(
'
lang.signatureInDocAdded
'
);
this
.
modalController
.
dismiss
(
'
success
'
);
this
.
modalController
.
dismiss
(
'
success
'
);
}
else
{
}
else
{
l
et
sign
aturePos
=
this
.
currentWorflow
.
signaturePositions
.
filter
((
item
:
any
)
=>
item
.
sequence
===
this
.
posCurrentUser
);
// s
et sign
block in current page
if
(
signPosCurrentPage
.
length
>
0
&&
signPosOtherPage
.
length
===
0
)
{
if
(
signPosCurrentPage
.
length
>
0
)
{
signature
.
positionX
=
signPosCurrentPage
[
0
].
positionX
;
signature
.
positionX
=
signPosCurrentPage
[
0
].
positionX
;
signature
.
positionY
=
signPosCurrentPage
[
0
].
positionY
;
signature
.
positionY
=
signPosCurrentPage
[
0
].
positionY
;
this
.
storeSignature
(
signature
,
this
.
signaturesService
.
currentPage
);
this
.
storeSignature
(
signature
,
this
.
signaturesService
.
currentPage
);
}
else
if
(
signPosCurrentPage
.
length
>
0
&&
signPosOtherPage
.
length
>
0
)
{
}
signature
.
positionX
=
signaturePos
[
0
].
positionX
;
signature
.
positionY
=
signaturePos
[
0
].
positionY
;
// set sign block in other page
this
.
storeSignature
(
signature
,
signaturePos
[
0
].
page
);
if
(
signPosOtherPage
.
length
>
0
)
{
}
if
(
signaturePos
.
length
>
0
)
{
signaturePos
.
forEach
((
element
:
{
positionX
:
any
;
positionY
:
any
;
page
:
number
;
})
=>
{
signature
.
positionX
=
element
.
positionX
;
signature
.
positionY
=
element
.
positionY
;
this
.
storeSignature
(
signature
,
element
.
page
);
});
}
else
{
signPosOtherPage
.
forEach
((
element
:
{
positionX
:
any
;
positionY
:
any
;
page
:
number
;
})
=>
{
signPosOtherPage
.
forEach
((
element
:
{
positionX
:
any
;
positionY
:
any
;
page
:
number
;
})
=>
{
signature
.
positionX
=
element
.
positionX
;
signature
.
positionX
=
element
.
positionX
;
signature
.
positionY
=
element
.
positionY
;
signature
.
positionY
=
element
.
positionY
;
...
@@ -147,25 +143,15 @@ export class SignaturesComponent implements OnInit {
...
@@ -147,25 +143,15 @@ export class SignaturesComponent implements OnInit {
if
(
this
.
currentWorflow
.
signaturePositions
.
length
===
1
)
{
if
(
this
.
currentWorflow
.
signaturePositions
.
length
===
1
)
{
this
.
notificationService
.
success
(
'
lang.signatureInDocAddedAlt
'
);
this
.
notificationService
.
success
(
'
lang.signatureInDocAddedAlt
'
);
}
else
{
}
else
{
if
(
signaturePos
.
length
>
0
)
{
this
.
translate
.
get
(
'
lang.signaturesInDocAdded
'
,
{
0
:
this
.
currentWorflow
.
signaturePositions
.
map
((
item
:
any
)
=>
item
.
page
)
}).
subscribe
((
res
:
string
)
=>
{
this
.
translate
.
get
(
'
lang.signaturesInDocAdded
'
,
{
0
:
signaturePos
.
map
((
item
:
any
)
=>
item
.
page
)
}).
subscribe
((
res
:
string
)
=>
{
this
.
notificationService
.
success
(
res
);
this
.
notificationService
.
success
(
res
);
});
});
}
else
{
this
.
translate
.
get
(
'
lang.signaturesInDocAdded
'
,
{
0
:
this
.
currentWorflow
.
signaturePositions
.
map
((
item
:
any
)
=>
item
.
page
)
}).
subscribe
((
res
:
string
)
=>
{
this
.
notificationService
.
success
(
res
);
});
}
}
}
if
(
signPosCurrentPage
.
length
===
0
&&
signPosOtherPage
.
length
>
0
)
{
// if no sign in current page but have sign in other page
if
(
signaturePos
.
length
>
0
)
{
if
(
signPosCurrentPage
.
length
===
0
&&
signPosOtherPage
.
length
>
0
)
{
this
.
modalController
.
dismiss
({
redirectPage
:
signaturePos
[
0
].
page
});
// go to first page with signature block
}
else
{
this
.
modalController
.
dismiss
({
redirectPage
:
signPosOtherPage
[
0
].
page
});
this
.
modalController
.
dismiss
({
redirectPage
:
this
.
currentWorflow
.
signaturePositions
[
0
].
page
});
}
else
{
}
}
else
if
(
signPosCurrentPage
.
length
>
0
&&
signPosOtherPage
.
length
>
0
)
{
this
.
modalController
.
dismiss
({
redirectPage
:
signaturePos
[
0
].
page
});
}
else
{
this
.
modalController
.
dismiss
(
'
success
'
);
this
.
modalController
.
dismiss
(
'
success
'
);
}
}
}
}
...
@@ -184,7 +170,7 @@ export class SignaturesComponent implements OnInit {
...
@@ -184,7 +170,7 @@ export class SignaturesComponent implements OnInit {
font
:
'
Arial
'
,
font
:
'
Arial
'
,
size
:
15
,
size
:
15
,
color
:
'
#666
'
,
color
:
'
#666
'
,
format
:
'
d MMMM y
'
format
:
'
d MMMM y
'
};
};
dateBlock
.
positionX
=
60
;
dateBlock
.
positionX
=
60
;
...
@@ -202,7 +188,7 @@ export class SignaturesComponent implements OnInit {
...
@@ -202,7 +188,7 @@ export class SignaturesComponent implements OnInit {
font
:
'
Arial
'
,
font
:
'
Arial
'
,
size
:
15
,
size
:
15
,
color
:
'
#666
'
,
color
:
'
#666
'
,
format
:
'
d MMMM y
'
format
:
'
d MMMM y
'
};
};
this
.
storeDate
(
dateBlock
,
this
.
signaturesService
.
currentPage
);
this
.
storeDate
(
dateBlock
,
this
.
signaturesService
.
currentPage
);
}
}
...
@@ -215,7 +201,7 @@ export class SignaturesComponent implements OnInit {
...
@@ -215,7 +201,7 @@ export class SignaturesComponent implements OnInit {
font
:
'
Arial
'
,
font
:
'
Arial
'
,
size
:
15
,
size
:
15
,
color
:
'
#666
'
,
color
:
'
#666
'
,
format
:
'
d MMMM y
'
format
:
'
d MMMM y
'
};
};
this
.
storeDate
(
dateBlock
,
position
.
page
);
this
.
storeDate
(
dateBlock
,
position
.
page
);
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment