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
85f0d6c3
Commit
85f0d6c3
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Edition of event
parent
bb852592
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/comm/action/card.php
+49
-48
49 additions, 48 deletions
htdocs/comm/action/card.php
htdocs/comm/action/class/actioncomm.class.php
+10
-7
10 additions, 7 deletions
htdocs/comm/action/class/actioncomm.class.php
with
59 additions
and
55 deletions
htdocs/comm/action/card.php
+
49
−
48
View file @
85f0d6c3
...
...
@@ -170,7 +170,7 @@ if ($action == 'add')
}
// Initialisation objet cactioncomm
if
(
!
GETPOST
(
'actioncode'
)
>
0
)
if
(
!
GETPOST
(
'actioncode'
)
>
0
)
// actioncode is id
{
$error
++
;
$donotclearsession
=
1
;
$action
=
'create'
;
...
...
@@ -178,12 +178,12 @@ if ($action == 'add')
}
else
{
$
result
=
$cactioncomm
->
fetch
(
GETPOST
(
'actioncode'
)
)
;
$
object
->
type_code
=
GETPOST
(
'actioncode'
);
}
if
(
!
$error
)
{
// Initialisation objet actioncomm
$object
->
type_id
=
$cactioncomm
->
id
;
$object
->
type_code
=
$cactioncomm
->
code
;
$object
->
priority
=
GETPOST
(
"priority"
)
?
GETPOST
(
"priority"
)
:
0
;
$object
->
fulldayevent
=
(
!
empty
(
$fulldayevent
)
?
1
:
0
);
$object
->
location
=
GETPOST
(
"location"
);
...
...
@@ -232,8 +232,9 @@ if ($action == 'add')
$i
++
;
}
}
if
(
!
empty
(
$conf
->
global
->
AGENDA_ENABLE_DONEBY
))
if
(
!
$error
&&
!
empty
(
$conf
->
global
->
AGENDA_ENABLE_DONEBY
))
{
$userdone
=
new
User
(
$db
);
if
(
$_POST
[
"doneby"
]
>
0
)
...
...
@@ -250,10 +251,10 @@ if ($action == 'add')
if
(
GETPOST
(
'socid'
,
'int'
)
>
0
)
{
$
societe
=
new
Societe
(
$db
);
$
societe
->
fetch
(
GETPOST
(
'socid'
,
'int'
)
);
$object
->
societe
=
$societe
;
// deprecated
$object
->
thirdparty
=
$societe
;
$
object
->
socid
=
GETPOST
(
'socid'
,
'int'
);
$
object
->
fetch_thirdparty
(
);
$object
->
societe
=
$object
->
thirdparty
;
// For backward compatibility
}
// Special for module webcal and phenix
...
...
@@ -607,6 +608,7 @@ if ($action == 'create')
print
'<input type="hidden" name="action" value="add">'
;
print
'<input type="hidden" name="donotclearsession" value="1">'
;
if
(
$backtopage
)
print
'<input type="hidden" name="backtopage" value="'
.
(
$backtopage
!=
'1'
?
$backtopage
:
$_SERVER
[
"HTTP_REFERER"
])
.
'">'
;
if
(
empty
(
$conf
->
global
->
AGENDA_USE_EVENT_TYPE
))
print
'<input type="hidden" name="actioncode" value="'
.
dol_getIdFromCode
(
$db
,
'AC_OTH'
,
'c_actioncomm'
)
.
'">'
;
if
(
GETPOST
(
"actioncode"
)
==
'AC_RDV'
)
print_fiche_titre
(
$langs
->
trans
(
"AddActionRendezVous"
));
else
print_fiche_titre
(
$langs
->
trans
(
"AddAnAction"
));
...
...
@@ -620,7 +622,6 @@ if ($action == 'create')
$formactions
->
select_type_actions
(
GETPOST
(
"actioncode"
)
?
GETPOST
(
"actioncode"
)
:
$object
->
type_code
,
"actioncode"
,
"systemauto"
);
print
'</td></tr>'
;
}
else
print
'<input type="hidden" name="actioncode" value="AC_OTH">'
;
// Title
print
'<tr><td'
.
(
empty
(
$conf
->
global
->
AGENDA_USE_EVENT_TYPE
)
?
' class="fieldrequired"'
:
''
)
.
'>'
.
$langs
->
trans
(
"Title"
)
.
'</td><td><input type="text" id="label" name="label" size="60" value="'
.
GETPOST
(
'label'
)
.
'"></td></tr>'
;
...
...
@@ -864,6 +865,7 @@ if ($id > 0)
print
'<input type="hidden" name="id" value="'
.
$id
.
'">'
;
print
'<input type="hidden" name="ref_ext" value="'
.
$object
->
ref_ext
.
'">'
;
if
(
$backtopage
)
print
'<input type="hidden" name="backtopage" value="'
.
(
$backtopage
!=
'1'
?
$backtopage
:
$_SERVER
[
"HTTP_REFERER"
])
.
'">'
;
if
(
empty
(
$conf
->
global
->
AGENDA_USE_EVENT_TYPE
))
print
'<input type="hidden" name="actioncode" value="'
.
$object
->
type_code
.
'">'
;
dol_fiche_head
(
$head
,
'card'
,
$langs
->
trans
(
"Action"
),
0
,
'action'
);
...
...
@@ -879,7 +881,6 @@ if ($id > 0)
$formactions
->
select_type_actions
(
GETPOST
(
"actioncode"
)
?
GETPOST
(
"actioncode"
)
:
$object
->
type_code
,
"actioncode"
,
"systemauto"
);
print
'</td></tr>'
;
}
else
print
'<input type="hidden" name="actioncode" value="'
.
$object
->
type_code
.
'">'
;
// Title
print
'<tr><td'
.
(
empty
(
$conf
->
global
->
AGENDA_USE_EVENT_TYPE
)
?
' class="fieldrequired"'
:
''
)
.
'>'
.
$langs
->
trans
(
"Title"
)
.
'</td><td colspan="3"><input type="text" name="label" size="50" value="'
.
$object
->
label
.
'"></td></tr>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/comm/action/class/actioncomm.class.php
+
10
−
7
View file @
85f0d6c3
...
...
@@ -108,7 +108,8 @@ class ActionComm extends CommonObject
}
/**
* Add an action/event into database
* Add an action/event into database.
* $this->type_id OR $this->type_code must be set.
*
* @param User $user Object user making action
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
...
...
@@ -144,20 +145,22 @@ class ActionComm extends CommonObject
$userownerid
=
isset
(
$this
->
usertodo
->
id
)
?
$this
->
usertodo
->
id
:
$this
->
userownerid
;
// For backward compatibility
$userdoneid
=
isset
(
$this
->
userdone
->
id
)
?
$this
->
userdone
->
id
:
$this
->
userdoneid
;
// For backward compatibility
if
(
!
$this
->
type_id
&&
$this
->
type_code
)
if
(
!
$this
->
type_id
||
!
$this
->
type_code
)
{
$key
=
empty
(
$this
->
type_id
)
?
$this
->
type_code
:
$this
->
type_id
;
// Get id from code
$cactioncomm
=
new
CActionComm
(
$this
->
db
);
$result
=
$cactioncomm
->
fetch
(
$
this
->
type_code
);
$result
=
$cactioncomm
->
fetch
(
$
key
);
if
(
$result
>
0
)
{
$this
->
type_id
=
$cactioncomm
->
id
;
$this
->
code
=
$cactioncomm
->
code
;
$this
->
type_
code
=
$cactioncomm
->
code
;
}
else
if
(
$result
==
0
)
{
$this
->
error
=
'Failed to get record with code '
.
$this
->
type_code
.
' from dictionary "type of events"'
;
$this
->
error
=
'Failed to get record with
id '
.
$this
->
type_id
.
'
code '
.
$this
->
type_code
.
' from dictionary "type of events"'
;
return
-
1
;
}
else
...
...
@@ -201,7 +204,7 @@ class ActionComm extends CommonObject
$sql
.
=
(
strval
(
$this
->
datef
)
!=
''
?
"'"
.
$this
->
db
->
idate
(
$this
->
datef
)
.
"'"
:
"null"
)
.
","
;
$sql
.
=
(
isset
(
$this
->
durationp
)
&&
$this
->
durationp
>=
0
&&
$this
->
durationp
!=
''
?
"'"
.
$this
->
durationp
.
"'"
:
"null"
)
.
","
;
// deprecated
$sql
.
=
(
isset
(
$this
->
type_id
)
?
$this
->
type_id
:
"null"
)
.
","
;
$sql
.
=
(
isset
(
$this
->
code
)
?
" '"
.
$this
->
code
.
"'"
:
"null"
)
.
","
;
$sql
.
=
(
isset
(
$this
->
type_
code
)
?
" '"
.
$this
->
type_
code
.
"'"
:
"null"
)
.
","
;
$sql
.
=
(
isset
(
$this
->
socid
)
&&
$this
->
socid
>
0
?
" '"
.
$this
->
socid
.
"'"
:
"null"
)
.
","
;
$sql
.
=
(
isset
(
$this
->
fk_project
)
&&
$this
->
fk_project
>
0
?
" '"
.
$this
->
fk_project
.
"'"
:
"null"
)
.
","
;
$sql
.
=
" '"
.
$this
->
db
->
escape
(
$this
->
note
)
.
"',"
;
...
...
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