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
1479a40e
Commit
1479a40e
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Bad parameter position
parent
688dad64
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/comm/action/fiche.php
+45
-32
45 additions, 32 deletions
htdocs/comm/action/fiche.php
with
45 additions
and
32 deletions
htdocs/comm/action/fiche.php
+
45
−
32
View file @
1479a40e
...
...
@@ -44,16 +44,15 @@ $langs->load("orders");
$langs
->
load
(
"agenda"
);
// If socid provided by ajax company selector
if
(
!
empty
(
$_REQUE
ST
[
'socid_id'
]
))
if
(
GETPO
ST
(
'socid_id'
))
{
$_GET
[
'socid'
]
=
$_GET
[
'socid_id'
];
$_POST
[
'socid'
]
=
$_POST
[
'socid_id'
];
$_REQUEST
[
'socid'
]
=
$_REQUEST
[
'socid_id'
];
$_GET
[
'socid'
]
=
GETPOST
(
'socid_id'
);
$_POST
[
'socid'
]
=
GETPOST
(
'socid_id'
);
}
// Security check
$socid
=
isset
(
$_GET
[
'socid'
])
?
$_GET
[
'socid'
]
:
$_
POST
[
'socid'
]
;
$id
=
isset
(
$_GET
[
"id"
])
?
$_GET
[
"id"
]
:
''
;
$socid
=
GET
POST
(
'socid'
)
;
$id
=
GETPOST
(
'id'
)
;
if
(
$user
->
societe_id
)
$socid
=
$user
->
societe_id
;
// TODO: revoir les droits car pas clair
//$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id');
...
...
@@ -423,17 +422,31 @@ $htmlactions = new FormActions($db);
* Affichage fiche en mode creation
*/
if
(
$_
GET
[
"
action
"
]
==
'create'
)
if
(
GET
POST
(
'
action
'
)
==
'create'
)
{
$contact
=
new
Contact
(
$db
);
if
(
$_REQUEST
[
"contactid"
])
{
$result
=
$contact
->
fetch
(
$_REQUE
ST
[
"contactid"
]
);
$result
=
$contact
->
fetch
(
GETPO
ST
(
"contactid"
)
);
if
(
$result
<
0
)
dol_print_error
(
$db
,
$contact
->
error
);
}
print
'<form name="formaction" action="fiche.php" method="post">'
;
if
(
$conf
->
use_javascript_ajax
)
{
/*
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
jQuery("#selectsocid").change(function() {
document.formaction.action.value="create";
document.formaction.submit();
});
})';
print '</script>'."\n";
*/
}
print
'<form name="formaction" action="fiche.php" method="POST">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="add_action">'
;
if
(
!
empty
(
$_REQUEST
[
"backtopage"
]))
print
'<input type="hidden" name="backtopage" value="'
.
(
$_REQUEST
[
"backtopage"
]
!=
1
?
$_REQUEST
[
"backtopage"
]
:
$_SERVER
[
"HTTP_REFERER"
])
.
'">'
;
...
...
@@ -448,10 +461,10 @@ if ($_GET["action"] == 'create')
// Type d'action actifs
print
'<tr><td width="30%"><span class="fieldrequired">'
.
$langs
->
trans
(
"Type"
)
.
'</span></b></td><td>'
;
if
(
$_
GET
[
"actioncode"
]
)
if
(
GET
POST
(
"actioncode"
)
)
{
print
'<input type="hidden" name="actioncode" value="'
.
$_GET
[
"actioncode"
]
.
'">'
.
"
\n
"
;
$cactioncomm
->
fetch
(
$_
GET
[
"actioncode"
]
);
$cactioncomm
->
fetch
(
GET
POST
(
"actioncode"
)
);
print
$cactioncomm
->
getNomUrl
();
}
else
...
...
@@ -468,12 +481,12 @@ if ($_GET["action"] == 'create')
// Societe, contact
print
'<tr><td width="30%" nowrap="nowrap">'
.
$langs
->
trans
(
"ActionOnCompany"
)
.
'</td><td>'
;
if
(
$_REQUE
ST
[
"socid"
]
>
0
)
if
(
GETPO
ST
(
"socid"
)
>
0
)
{
$societe
=
new
Societe
(
$db
);
$societe
->
fetch
(
$_REQUE
ST
[
"socid"
]
);
$societe
->
fetch
(
GETPO
ST
(
"socid"
)
);
print
$societe
->
getNomUrl
(
1
);
print
'<input type="hidden" name="socid" value="'
.
$_REQUE
ST
[
"socid"
]
.
'">'
;
print
'<input type="hidden" name="socid" value="'
.
GETPO
ST
(
"socid"
)
.
'">'
;
}
else
{
...
...
@@ -482,10 +495,10 @@ if ($_GET["action"] == 'create')
print
'</td></tr>'
;
// If company is forced, we propose contacts (may be contact is also forced)
if
(
$_REQUE
ST
[
"socid"
]
>
0
)
if
(
GETPO
ST
(
"socid"
)
>
0
)
{
print
'<tr><td nowrap>'
.
$langs
->
trans
(
"ActionOnContact"
)
.
'</td><td>'
;
$html
->
select_contacts
(
$_REQUE
ST
[
"socid"
],
$_REQUE
ST
[
'contactid'
]
,
'contactid'
,
1
,
1
);
$html
->
select_contacts
(
GETPO
ST
(
"socid"
),
GETPO
ST
(
'contactid'
)
,
'contactid'
,
1
,
1
);
print
'</td></tr>'
;
}
...
...
@@ -496,7 +509,7 @@ if ($_GET["action"] == 'create')
$langs
->
load
(
"project"
);
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Project"
)
.
'</td><td>'
;
$numproject
=
select_projects
(
$societe
->
id
,
$_REQUE
ST
[
"projectid"
]
?
$_REQUE
ST
[
"projectid"
]
:
$projectid
,
'projectid'
);
$numproject
=
select_projects
(
$societe
->
id
,
GETPO
ST
(
"projectid"
)
?
GETPO
ST
(
"projectid"
)
:
$projectid
,
'projectid'
);
if
(
$numproject
==
0
)
{
print
' <a href="../../projet/fiche.php?socid='
.
$societe
->
id
.
'&action=create">'
.
$langs
->
trans
(
"AddProject"
)
.
'</a>'
;
...
...
@@ -511,33 +524,33 @@ if ($_GET["action"] == 'create')
// Affected by
print
'<tr><td width="30%" nowrap="nowrap">'
.
$langs
->
trans
(
"ActionAffectedTo"
)
.
'</td><td>'
;
// $html->select_users($_REQUEST["affectedto"]?$_REQUEST["affectedto"]:$actioncomm->usertodo,'affectedto',1);
$html
->
select_users
(
$_REQUE
ST
[
"affectedto"
]
?
$_REQUE
ST
[
"affectedto"
]
:
(
$actioncomm
->
usertodo
->
id
>
0
?
$actioncomm
->
usertodo
:
$user
),
'affectedto'
,
1
);
$html
->
select_users
(
GETPO
ST
(
"affectedto"
)
?
GETPO
ST
(
"affectedto"
)
:
(
$actioncomm
->
usertodo
->
id
>
0
?
$actioncomm
->
usertodo
:
$user
),
'affectedto'
,
1
);
print
'</td></tr>'
;
// Realised by
print
'<tr><td nowrap>'
.
$langs
->
trans
(
"ActionDoneBy"
)
.
'</td><td>'
;
$html
->
select_users
(
$_REQUE
ST
[
"doneby"
]
?
$_REQUE
ST
[
"doneby"
]
:
$actioncomm
->
userdone
,
'doneby'
,
1
);
$html
->
select_users
(
GETPO
ST
(
"doneby"
)
?
GETPO
ST
(
"doneby"
)
:
$actioncomm
->
userdone
,
'doneby'
,
1
);
print
'</td></tr>'
;
print
'</table>'
;
print
'<br>'
;
print
'<table class="border" width="100%">'
;
if
(
!
empty
(
$_GET
[
"datep"
]
)
&&
preg_match
(
'/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/'
,
$_
GET
[
"datep"
]
,
$reg
))
if
(
GETPOST
(
"datep"
)
&&
preg_match
(
'/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/'
,
GET
POST
(
"datep"
)
,
$reg
))
{
$actioncomm
->
datep
=
dol_mktime
(
0
,
0
,
0
,
$reg
[
2
],
$reg
[
3
],
$reg
[
1
]);
}
// Date start
print
'<tr><td width="30%" nowrap="nowrap"><span class="fieldrequired">'
.
$langs
->
trans
(
"DateActionStart"
)
.
'</span></td><td>'
;
if
(
$_REQUE
ST
[
"afaire"
]
==
1
)
$html
->
select_date
(
$actioncomm
->
datep
,
'ap'
,
1
,
1
,
0
,
"action"
,
1
,
1
);
else
if
(
$_REQUE
ST
[
"afaire"
]
==
2
)
$html
->
select_date
(
$actioncomm
->
datep
,
'ap'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
if
(
GETPO
ST
(
"afaire"
)
==
1
)
$html
->
select_date
(
$actioncomm
->
datep
,
'ap'
,
1
,
1
,
0
,
"action"
,
1
,
1
);
else
if
(
GETPO
ST
(
"afaire"
)
==
2
)
$html
->
select_date
(
$actioncomm
->
datep
,
'ap'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
else
$html
->
select_date
(
$actioncomm
->
datep
,
'ap'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
print
'</td></tr>'
;
// Date end
print
'<tr><td>'
.
$langs
->
trans
(
"DateActionEnd"
)
.
'</td><td>'
;
if
(
$_REQUE
ST
[
"afaire"
]
==
1
)
$html
->
select_date
(
$actioncomm
->
datef
,
'p2'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
else
if
(
$_REQUE
ST
[
"afaire"
]
==
2
)
$html
->
select_date
(
$actioncomm
->
datef
,
'p2'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
if
(
GETPO
ST
(
"afaire"
)
==
1
)
$html
->
select_date
(
$actioncomm
->
datef
,
'p2'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
else
if
(
GETPO
ST
(
"afaire"
)
==
2
)
$html
->
select_date
(
$actioncomm
->
datef
,
'p2'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
else
$html
->
select_date
(
$actioncomm
->
datef
,
'p2'
,
1
,
1
,
1
,
"action"
,
1
,
1
);
print
'</td></tr>'
;
...
...
@@ -545,14 +558,14 @@ if ($_GET["action"] == 'create')
print
'<tr><td width="10%">'
.
$langs
->
trans
(
"Status"
)
.
' / '
.
$langs
->
trans
(
"Percentage"
)
.
'</td>'
;
print
'<td>'
;
$percent
=
0
;
if
(
isset
(
$_
POST
[
'percentage'
]
))
if
(
GET
POST
(
'percentage'
))
{
$percent
=
$_
POST
[
'percentage'
]
;
$percent
=
GET
POST
(
'percentage'
)
;
}
else
{
if
(
$_REQUE
ST
[
"afaire"
]
==
1
)
$percent
=
0
;
if
(
$_REQUE
ST
[
"afaire"
]
==
2
)
$percent
=
100
;
if
(
GETPO
ST
(
"afaire"
)
==
1
)
$percent
=
0
;
if
(
GETPO
ST
(
"afaire"
)
==
2
)
$percent
=
100
;
}
print
$htmlactions
->
form_select_status_action
(
'formaction'
,
$percent
,
1
);
print
'</td></tr>'
;
...
...
@@ -642,19 +655,19 @@ if ($_GET["id"])
$delay_warning
=
$conf
->
global
->
MAIN_DELAY_ACTIONS_TODO
*
24
*
60
*
60
;
// Confirmation suppression action
if
(
$_
GET
[
"action"
]
==
'delete'
)
if
(
GET
POST
(
"action"
)
==
'delete'
)
{
$ret
=
$html
->
form_confirm
(
"fiche.php?id="
.
$_GET
[
"id"
],
$langs
->
trans
(
"DeleteAction"
),
$langs
->
trans
(
"ConfirmDeleteAction"
),
"confirm_delete"
,
''
,
''
,
1
);
if
(
$ret
==
'html'
)
print
'<br>'
;
}
if
(
$_REQUE
ST
[
"action"
]
==
'edit'
)
if
(
GETPO
ST
(
"action"
)
==
'edit'
)
{
// Fiche action en mode edition
print
'<form name="formaction" action="fiche.php" method="post">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="update">'
;
print
'<input type="hidden" name="id" value="'
.
$_REQUE
ST
[
"id"
]
.
'">'
;
print
'<input type="hidden" name="id" value="'
.
GETPO
ST
(
"id"
)
.
'">'
;
if
(
!
empty
(
$_REQUEST
[
"backtopage"
]))
print
'<input type="hidden" name="from" value="'
.
(
$_REQUEST
[
"from"
]
?
$_REQUEST
[
"from"
]
:
$_SERVER
[
"HTTP_REFERER"
])
.
'">'
;
print
'<table class="border" width="100%">'
;
...
...
@@ -674,7 +687,7 @@ if ($_GET["id"])
// Company
print
'<tr><td>'
.
$langs
->
trans
(
"Company"
)
.
'</td>'
;
print
'<td>'
;
print
$html
->
select_societes
(
$act
->
societe
->
id
,
'socid'
,
1
,
1
);
print
$html
->
select_societes
(
$act
->
societe
->
id
,
'socid'
,
''
,
1
,
1
);
print
'</td>'
;
// Contact
...
...
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