Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
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
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
280ee38b
Commit
280ee38b
authored
18 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
On peut modifier date planif et real d'une action
parent
525a93b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/actioncomm.class.php
+7
-6
7 additions, 6 deletions
htdocs/actioncomm.class.php
htdocs/comm/action/fiche.php
+70
-24
70 additions, 24 deletions
htdocs/comm/action/fiche.php
htdocs/lib/functions.inc.php
+15
-15
15 additions, 15 deletions
htdocs/lib/functions.inc.php
with
92 additions
and
45 deletions
htdocs/actioncomm.class.php
+
7
−
6
View file @
280ee38b
...
...
@@ -145,13 +145,13 @@ class ActionComm
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
$this
->
id
=
$id
;
$this
->
type_id
=
$type_id
;
$this
->
type_id
=
$
obj
->
type_id
;
$this
->
type_code
=
$obj
->
code
;
$transcode
=
$langs
->
trans
(
"Action"
.
$obj
->
code
);
$type_libelle
=
(
$transcode
!=
"Action"
.
$obj
->
code
?
$transcode
:
$obj
->
libelle
);
$this
->
type
=
$type_libelle
;
$this
->
label
=
$obj
->
label
;
$this
->
date
=
$obj
->
datea
;
$this
->
date
=
$obj
->
datea
;
$this
->
datep
=
$obj
->
datep
;
$this
->
datec
=
$obj
->
datec
;
$this
->
datem
=
$obj
->
datem
;
...
...
@@ -216,10 +216,11 @@ class ActionComm
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"actioncomm "
;
$sql
.
=
" SET percent='"
.
$this
->
percent
.
"'"
;
if
(
$this
->
label
)
$sql
.
=
", label = '"
.
addslashes
(
$this
->
label
)
.
"'"
;
if
(
$this
->
percent
==
100
)
$sql
.
=
", datea = now()"
;
if
(
$this
->
note
)
$sql
.
=
", note = '"
.
addslashes
(
$this
->
note
)
.
"'"
;
if
(
$this
->
contact
->
id
)
$sql
.
=
", fk_contact ="
.
$this
->
contact
->
id
;
if
(
$this
->
label
)
$sql
.
=
", label = '"
.
addslashes
(
$this
->
label
)
.
"'"
;
$sql
.
=
", datep = "
.
(
$this
->
date_p
?
"'"
.
$this
->
db
->
idate
(
$this
->
date_p
)
.
"'"
:
'null'
);
$sql
.
=
", datea = "
.
(
$this
->
date_a
?
"'"
.
$this
->
db
->
idate
(
$this
->
date_a
)
.
"'"
:
'null'
);
if
(
$this
->
note
)
$sql
.
=
", note = '"
.
addslashes
(
$this
->
note
)
.
"'"
;
if
(
$this
->
contact
->
id
)
$sql
.
=
", fk_contact ="
.
$this
->
contact
->
id
;
$sql
.
=
" WHERE id="
.
$this
->
id
;
if
(
$this
->
db
->
query
(
$sql
))
...
...
This diff is collapsed.
Click to expand it.
htdocs/comm/action/fiche.php
+
70
−
24
View file @
280ee38b
...
...
@@ -93,25 +93,34 @@ if ($_POST["action"] == 'add_action')
}
}
}
$actioncomm
->
percent
=
isset
(
$_POST
[
"percentage"
])
?
$_POST
[
"percentage"
]
:
0
;
if
(
$actioncomm
->
percent
<
100
)
{
$actioncomm
->
date_p
=
@
mktime
(
$_POST
[
"heurephour"
],
$actioncomm
->
date_p
=
@
mktime
(
$_POST
[
"heurephour"
],
$_POST
[
"heurepmin"
],
0
,
$_POST
[
"apmonth"
],
$_POST
[
"apday"
],
$_POST
[
"apyear"
]);
}
if
(
$actioncomm
->
percent
==
100
)
{
$actioncomm
->
date_a
=
@
mktime
(
$_POST
[
"heuredhour"
],
$actioncomm
->
date_a
=
@
mktime
(
$_POST
[
"heuredhour"
],
$_POST
[
"heuredmin"
],
0
,
$_POST
[
"admonth"
],
$_POST
[
"adday"
],
$_POST
[
"adyear"
]);
}
if
(
$actioncomm
->
type_id
==
5
)
{
// RDV
if
(
$actioncomm
->
date_a
)
{
$actioncomm
->
percent
=
100
;
}
else
{
$actioncomm
->
percent
=
0
;
}
}
else
{
$actioncomm
->
percent
=
isset
(
$_POST
[
"percentage"
])
?
$_POST
[
"percentage"
]
:
0
;
}
$actioncomm
->
duree
=
((
$_POST
[
"dureehour"
]
*
60
)
+
$_POST
[
"dureemin"
])
*
60
;
$actioncomm
->
user
=
$user
;
$actioncomm
->
note
=
trim
(
$_POST
[
"note"
]);
...
...
@@ -136,13 +145,13 @@ if ($_POST["action"] == 'add_action')
// Si erreur
$db
->
rollback
();
$_GET
[
"id"
]
=
$idaction
;
$error
=
$actioncomm
->
error
;
$error
=
'<div class="error">'
.
$actioncomm
->
error
.
'</div>'
;
}
}
else
{
$db
->
rollback
();
$error
=
$actioncomm
->
error
;
$error
=
'<div class="error">'
.
$actioncomm
->
error
.
'</div>'
;
}
}
else
...
...
@@ -176,15 +185,39 @@ if ($_POST["action"] == 'update')
{
$action
=
new
Actioncomm
(
$db
);
$action
->
fetch
(
$_POST
[
"id"
]);
$action
->
date_p
=
@
mktime
(
$_POST
[
"heurephour"
],
$_POST
[
"heurepmin"
],
0
,
$_POST
[
"apmonth"
],
$_POST
[
"apday"
],
$_POST
[
"apyear"
]);
$action
->
date_a
=
@
mktime
(
$_POST
[
"heuredhour"
],
$_POST
[
"heuredmin"
],
0
,
$_POST
[
"admonth"
],
$_POST
[
"adday"
],
$_POST
[
"adyear"
]);
$action
->
label
=
$_POST
[
"label"
];
$action
->
percent
=
$_POST
[
"percent"
];
$action
->
contact
->
id
=
$_POST
[
"contactid"
];
$action
->
note
=
$_POST
[
"note"
];
$action
->
update
();
if
(
$action
->
type_code
==
'AC_RDV'
&&
$action
->
percent
==
100
&&
!
$action
->
date_a
)
{
$action
->
date_a
=
$action
->
date_p
;
}
$result
=
$action
->
update
();
}
Header
(
"Location: "
.
$_POST
[
"from"
]);
exit
;
if
(
$result
<
0
)
{
$mesg
=
'<div class="error">'
.
$action
->
error
.
'</div>'
;
$_GET
[
"id"
]
=
$_POST
[
"id"
];
}
else
{
Header
(
"Location: "
.
$_POST
[
"from"
]);
exit
;
}
}
...
...
@@ -265,7 +298,7 @@ if ($_GET["action"] == 'create')
print
'</td></tr>'
;
// Date planification
print
'<tr><td>'
.
$langs
->
trans
(
"DatePlanned"
)
.
'</td><td>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Date
Action
Planned"
)
.
'</td><td>'
;
if
(
$_GET
[
"afaire"
]
==
1
||
$_GET
[
"afaire"
]
==
2
)
{
$html
->
select_date
(
-
1
,
'ap'
,
''
,
''
,
''
,
"action"
);
...
...
@@ -281,7 +314,7 @@ if ($_GET["action"] == 'create')
print
'</td></tr>'
;
// Date done
print
'<tr><td>'
.
$langs
->
trans
(
"DateDone"
)
.
'</td><td>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Date
Action
Done"
)
.
'</td><td>'
;
if
(
$_GET
[
"afaire"
]
==
1
||
$_GET
[
"afaire"
]
==
2
)
{
$html
->
select_date
(
-
1
,
'ad'
,
''
,
''
,
''
,
"action"
);
...
...
@@ -428,7 +461,7 @@ if ($_GET["action"] == 'create')
}
// Date planification
print
'<tr><td>'
.
$langs
->
trans
(
"DatePlanned"
)
.
'</td><td>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Date
Action
Planned"
)
.
'</td><td>'
;
if
(
$_GET
[
"afaire"
]
==
1
||
$_GET
[
"afaire"
]
==
2
)
{
$html
->
select_date
(
-
1
,
'ap'
,
''
,
''
,
''
,
"action"
);
...
...
@@ -444,7 +477,7 @@ if ($_GET["action"] == 'create')
print
'</td></tr>'
;
// Date done
print
'<tr><td>'
.
$langs
->
trans
(
"DateDone"
)
.
'</td><td>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Date
Action
Done"
)
.
'</td><td>'
;
if
(
$_GET
[
"afaire"
]
==
1
||
$_GET
[
"afaire"
]
==
2
)
{
$html
->
select_date
(
-
1
,
'ad'
,
''
,
''
,
''
,
"action"
);
...
...
@@ -495,6 +528,10 @@ if ($_GET["id"])
{
print
'<div class="error">'
.
$error
.
'</div><br>'
;
}
if
(
$mesg
)
{
print
$mesg
.
'<br>'
;
}
$act
=
new
ActionComm
(
$db
);
$act
->
fetch
(
$_GET
[
"id"
]);
...
...
@@ -560,13 +597,22 @@ if ($_GET["id"])
print
$langs
->
trans
(
"FeatureNotYetSupported"
);
print
'</td></tr>'
;
// Date debut
print
'<tr><td>'
.
$langs
->
trans
(
"DateActionPlanned"
)
.
'</td><td colspan="3">'
.
dolibarr_print_date
(
$act
->
datep
,
'%d %B %Y %H:%M'
)
.
'</td></tr>'
;
// Date fin real
print
'<tr><td>'
.
$langs
->
trans
(
"DateActionDone"
)
.
'</td><td colspan="3">'
.
dolibarr_print_date
(
$act
->
date
,
'%d %B %Y %H:%M'
)
.
'</td></tr>'
;
// Date planification
print
'<tr><td>'
.
$langs
->
trans
(
"DateActionPlanned"
)
.
'</td><td colspan="3">'
;
$html
->
select_date
((
$act
->
datep
?
$act
->
datep
:-
1
),
'ap'
,
''
,
''
,
''
,
"action"
);
print
' '
;
print_heure_select
(
"heurep"
,
8
,
20
);
print
'</td></tr>'
;
// Etat
// Date done
print
'<tr><td>'
.
$langs
->
trans
(
"DateActionDone"
)
.
'</td><td colspan="3">'
;
$html
->
select_date
((
$act
->
date
?
$act
->
date
:-
1
),
'ad'
,
''
,
''
,
''
,
"action"
);
print
' '
;
print_heure_select
(
"heured"
,
8
,
20
);
print
'</td></tr>'
;
// Etat
print
'<tr><td nowrap>'
.
$langs
->
trans
(
"Status"
)
.
' / '
.
$langs
->
trans
(
"Percentage"
)
.
'</td><td colspan="3"><input name="percent" value="'
.
$act
->
percent
.
'" size="4">%</td></tr>'
;
// Objet lié
...
...
This diff is collapsed.
Click to expand it.
htdocs/lib/functions.inc.php
+
15
−
15
View file @
280ee38b
...
...
@@ -1714,22 +1714,22 @@ function print_heure_select($prefix,$begin=1,$end=23)
\param prefix prefix
*/
function
print_duree_select
(
$prefix
)
{
print
'<select name="'
.
$prefix
.
'hour">'
;
print
"<option value=
\"
0
\"
>0</option>"
;
print
"<option value=
\"
1
\"
selected=
\"
true
\"
>1</option>"
;
{
print
'<select
class="flat"
name="'
.
$prefix
.
'hour">'
;
print
"<option value=
\"
0
\"
>0</option>"
;
print
"<option value=
\"
1
\"
selected=
\"
true
\"
>1</option>"
;
for
(
$hour
=
2
;
$hour
<
13
;
$hour
++
)
{
print
"<option value=
\"
$hour
\"
>
$hour
</option>"
;
}
print
"</select> H "
;
print
'<select name="'
.
$prefix
.
'min">'
;
for
(
$min
=
0
;
$min
<
55
;
$min
=
$min
+
5
)
{
print
"<option value=
\"
$min
\"
>
$min
</option>"
;
}
print
"</select>
\n
"
;
for
(
$hour
=
2
;
$hour
<
13
;
$hour
++
)
{
print
"<option value=
\"
$hour
\"
>
$hour
</option>"
;
}
print
"</select> H "
;
print
'<select
class="flat"
name="'
.
$prefix
.
'min">'
;
for
(
$min
=
0
;
$min
<
55
;
$min
=
$min
+
5
)
{
print
"<option value=
\"
$min
\"
>
$min
</option>"
;
}
print
"</select>
\n
"
;
}
...
...
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