Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libriciel
web-DPO
Commits
ed02b7f9
Commit
ed02b7f9
authored
May 06, 2020
by
Théo GUILLON
Browse files
Correction : scroll
Modification : valeur des champs afficher pour la soustraitance
parent
272bc7d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/View/Elements/Fiches/tabs/coresponsable.ctp
View file @
ed02b7f9
<?php
echo
$this
->
Html
->
script
([
'smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min'
,
'smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js'
]);
echo
$this
->
Html
->
css
(
'/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min'
);
?>
<!-- Onglet Co-responsable -->
<div
id=
"ongletComplementaireCoresponsable"
class=
"tab-pane"
>
<br>
...
...
app/View/Elements/Fiches/tabs/soustraitance.ctp
View file @
ed02b7f9
...
...
@@ -122,6 +122,14 @@ if (isset($this->validationErrors['WebdpoSoustraitance']) ) {
$
(
eventSelect
).
on
(
"
select2:select
"
,
function
(
e
)
{
let
idSelect
=
e
.
params
.
data
.
id
;
createCardSoustraitant
(
templateFieldsSoustraitance
,
infoSoustraitances
,
idSelect
);
$
(
'
.calendar
'
).
datetimepicker
({
viewMode
:
'
year
'
,
startView
:
'
decade
'
,
format
:
'
dd/mm/yyyy
'
,
minView
:
2
,
language
:
'
fr
'
});
});
$
(
eventSelect
).
on
(
"
select2:unselect
"
,
function
(
e
)
{
...
...
@@ -133,6 +141,15 @@ if (isset($this->validationErrors['WebdpoSoustraitance']) ) {
$
(
'
input[type="hidden"][name="data[Soustraitance][currentSoustraitance][
'
+
id
+
'
][soustraitant_id]"]
'
).
remove
();
$
(
'
input[type="hidden"][name="data[Soustraitance][currentSoustraitance][
'
+
id
+
'
][soustraitance_id]"]
'
).
remove
();
});
$
(
'
.calendar
'
).
datetimepicker
({
viewMode
:
'
year
'
,
startView
:
'
decade
'
,
format
:
'
dd/mm/yyyy
'
,
minView
:
2
,
language
:
'
fr
'
});
});
function
createCardSoustraitant
(
templateFieldsSoustraitance
,
infoSoustraitances
,
idSelect
,
soustraitancefieldsRequestData
=
null
)
{
...
...
@@ -208,15 +225,30 @@ if (isset($this->validationErrors['WebdpoSoustraitance']) ) {
// On attribut la valeur au champ si il y en a une.
if
(
soustraitancefieldsRequestData
!==
null
)
{
$
.
each
(
soustraitancefieldsRequestData
[
idSelect
],
function
(
key
,
val
)
{
let
fieldId
=
'
#st_
'
+
idSelect
+
'
_
'
+
key
;
if
(
jQuery
.
isArray
(
val
))
{
let
ifMultiSelect
=
$
(
fieldId
+
'
[name="data[WebdpoSoustraitance][
'
+
idSelect
+
'
][
'
+
key
+
'
][]"]
'
);
$
.
each
(
val
,
function
(
k
,
v
)
{
$
(
'
#
'
+
key
+
v
).
attr
(
"
checked
"
,
"
checked
"
);
if
(
ifMultiSelect
.
length
)
{
$
(
fieldId
+
'
option[value="
'
+
v
+
'
"]
'
).
prop
(
"
selected
"
,
true
);
}
else
{
$
(
'
#
'
+
key
+
v
).
prop
(
"
checked
"
,
true
);
}
});
}
else
{
$
(
'
#st_
'
+
idSelect
+
'
_
'
+
key
).
val
(
val
);
let
ifRadio
=
$
(
'
input[type="radio"][name="data[WebdpoSoustraitance][
'
+
idSelect
+
'
][
'
+
key
+
'
]"][value="
'
+
val
+
'
"]
'
);
if
(
ifRadio
.
length
)
{
$
(
ifRadio
).
prop
(
"
checked
"
,
true
);
}
else
{
$
(
fieldId
).
val
(
val
);
}
}
});
}
}
</script>
\ No newline at end of file
app/View/Fiches/add.ctp
View file @
ed02b7f9
<?php
echo
$this
->
Html
->
script
(
'jquery-mask-plugin/dist/jquery.mask.min.js'
);
debug
(
$this
->
request
->
data
);
echo
$this
->
Html
->
script
([
'smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min'
,
'smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js'
,
'jquery-mask-plugin/dist/jquery.mask.min.js'
]);
echo
$this
->
Html
->
css
(
'/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min'
);
if
(
isset
(
$this
->
validationErrors
[
'WebdpoFiche'
])
&&
!
empty
(
$this
->
validationErrors
[
'WebdpoFiche'
])
||
isset
(
$this
->
validationErrors
[
'WebdpoCoresponsable'
])
&&
!
empty
(
$this
->
validationErrors
[
'WebdpoCoresponsable'
])
||
...
...
app/webroot/js/scroll.js
View file @
ed02b7f9
...
...
@@ -6,12 +6,14 @@ $(document).ready(function () {
forScrollWidth
=
$
(
forScroll
).
width
(),
navbarHeight
=
$
(
'
div.navbar-fixed-top
'
).
height
();
$
(
forScroll
).
removeClass
(
'
fixed
'
);
$
(
forScroll
).
css
(
'
width
'
,
''
);
if
(
forScroll
.
length
)
{
$
(
forScroll
).
removeClass
(
'
fixed
'
);
$
(
forScroll
).
css
(
'
width
'
,
''
);
if
(
currentScroll
>=
(
$
(
forScroll
).
offset
().
top
-
navbarHeight
))
{
$
(
forScroll
).
addClass
(
'
fixed
'
);
$
(
forScroll
).
width
(
forScrollWidth
);
if
(
currentScroll
>=
(
$
(
forScroll
).
offset
().
top
-
navbarHeight
))
{
$
(
forScroll
).
addClass
(
'
fixed
'
);
$
(
forScroll
).
width
(
forScrollWidth
);
}
}
}
...
...
@@ -20,8 +22,10 @@ $(document).ready(function () {
$
(
'
a[data-toggle="tab"]
'
).
on
(
'
shown.bs.tab
'
,
function
(
e
){
let
forScroll
=
$
(
'
.tab-pane.active .forScroll
'
);
$
(
forScroll
).
removeClass
(
'
fixed
'
);
$
(
forScroll
).
css
(
'
width
'
,
''
);
if
(
forScroll
.
length
)
{
$
(
forScroll
).
removeClass
(
'
fixed
'
);
$
(
forScroll
).
css
(
'
width
'
,
''
);
}
});
});
\ No newline at end of file
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