Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
00efdbef
Commit
00efdbef
authored
Jan 30, 2025
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7591 : calendar bugs
parent
e65cfd55
Pipeline
#4104
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
common.js
outils/static/js/common.js
+17
-8
No files found.
outils/static/js/common.js
View file @
00efdbef
...
...
@@ -267,19 +267,19 @@ function draw_shift_templates(params) {
if
(
type
==
2
)
{
//Shift templates are gathered (places and weeks)
//a profile is defined (useful for assigning it a color)
profile
=
'more_than_50pc'
;
/*
profile = 'more_than_50pc';
if (e.data.reserved / e.data.max <= .25) {
profile = 'less_than_25pc';
} else if (e.data.reserved / e.data.max <= .5) {
profile = 'less_than_50pc';
}
}
*/
//Compile data for each box, including profil
if
(
typeof
boxes
[
e
.
data
.
day
+
'_'
+
e
.
data
.
begin
]
==
"undefined"
)
{
boxes
[
e
.
data
.
day
+
'_'
+
e
.
data
.
begin
]
=
{
'reserved'
:
e
.
data
.
reserved
,
'max'
:
e
.
data
.
max
,
'profil'
:
profile
};
boxes
[
e
.
data
.
day
+
'_'
+
e
.
data
.
begin
]
=
{
'reserved'
:
e
.
data
.
reserved
,
'max'
:
e
.
data
.
max
};
}
else
{
boxes
[
e
.
data
.
day
+
'_'
+
e
.
data
.
begin
][
'reserved'
]
+=
e
.
data
.
reserved
;
boxes
[
e
.
data
.
day
+
'_'
+
e
.
data
.
begin
][
'max'
]
+=
e
.
data
.
max
;
var
existing_profil
=
boxes
[
e
.
data
.
day
+
'_'
+
e
.
data
.
begin
][
'profil'
];
/*
var existing_profil = boxes[e.data.day+'_'+e.data.begin]['profil'];
if (existing_profil == 'more_than_50pc' && profile != 'more_than_50pc') {
boxes[e.data.day+'_'+e.data.begin]['profil'] = profile;
...
...
@@ -287,6 +287,7 @@ function draw_shift_templates(params) {
if (existing_profil == 'less_than_50pc' && profile == 'less_than_25pc') {
boxes[e.data.day+'_'+e.data.begin]['profil'] = profile;
}
*/
}
}
}
...
...
@@ -311,10 +312,16 @@ function draw_shift_templates(params) {
if
(
target
.
length
>
0
)
{
max
+=
boxes
[
k
].
max
;
dispo
+=
(
boxes
[
k
].
max
-
boxes
[
k
].
reserved
);
let
profile
=
'more_than_50pc'
;
if
(
boxes
[
k
].
reserved
/
boxes
[
k
].
max
<=
.
25
)
{
profile
=
'less_than_25pc'
;
}
else
if
(
boxes
[
k
].
reserved
/
boxes
[
k
].
max
<=
.
5
)
{
profile
=
'less_than_50pc'
;
}
var
box
=
$
(
'<div/>'
).
attr
(
'data-type'
,
'compact'
);
box
.
addClass
(
'shift'
);
box
.
addClass
(
'b_'
+
boxes
[
k
].
profil
);
box
.
addClass
(
'b_'
+
profile
);
if
(
boxes
[
k
].
max
<=
boxes
[
k
].
reserved
)
{
box
.
addClass
(
'full'
);
}
...
...
@@ -396,13 +403,15 @@ function retrieve_and_draw_shift_tempates(params) {
function
filter_weeks
(
params
)
{
var
clicked
=
$
(
this
);
if
(
typeof
params
.
triggered_by
!==
"undefined"
)
{
clicked
=
$
(
params
.
triggered_by
.
target
);
}
var
week_types
=
$
(
'#week_types'
);
var
parent_div
=
clicked
.
closest
(
'div'
);
var
w1
=
week_types
.
find
(
'#dw1'
);
var
w2
=
week_types
.
find
(
'#dw2'
);
var
w3
=
week_types
.
find
(
'#dw3'
);
var
w4
=
week_types
.
find
(
'#dw4'
);
if
(
parent_div
.
hasClass
(
'oddeven_selector'
))
{
// Paires ou impaires has been clicked
if
(
clicked
.
is
(
':checked'
))
{
...
...
@@ -462,6 +471,6 @@ function shift_loc_selection() {
st_loc_buttons
.
click
(
shift_loc_selection
);
week_types
.
find
(
'input'
).
change
(()
=>
{
filter_weeks
({
shift_listener
:
true
});
week_types
.
find
(
'input'
).
change
((
elt
)
=>
{
filter_weeks
({
shift_listener
:
true
,
triggered_by
:
elt
});
});
Write
Preview
Markdown
is supported
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