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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
525b2cf2
Commit
525b2cf2
authored
Jul 2, 2016
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Edition of contract on intervention failed
parent
7d9671f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/class/html.formcontract.class.php
+29
-1
29 additions, 1 deletion
htdocs/core/class/html.formcontract.class.php
htdocs/fichinter/card.php
+3
-11
3 additions, 11 deletions
htdocs/fichinter/card.php
with
32 additions
and
12 deletions
htdocs/core/class/html.formcontract.class.php
+
29
−
1
View file @
525b2cf2
...
@@ -50,7 +50,7 @@ class FormContract
...
@@ -50,7 +50,7 @@ class FormContract
* @param string $htmlname Nom de la zone html
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $maxlength Maximum length of label
* @param int $showempty Show empty line
* @param int $showempty Show empty line
* @return int Nbr
e
of project if OK, <0 if KO
* @return int Nbr of project if OK, <0 if KO
*/
*/
function
select_contract
(
$socid
=-
1
,
$selected
=
''
,
$htmlname
=
'contrattid'
,
$maxlength
=
16
,
$showempty
=
1
)
function
select_contract
(
$socid
=-
1
,
$selected
=
''
,
$htmlname
=
'contrattid'
,
$maxlength
=
16
,
$showempty
=
1
)
{
{
...
@@ -137,4 +137,32 @@ class FormContract
...
@@ -137,4 +137,32 @@ class FormContract
return
-
1
;
return
-
1
;
}
}
}
}
/**
* Show a form to select a contract
*
* @param int $page Page
* @param int $socid Id third party (-1=all, 0=only contracts not linked to a third party, id=contracts not linked or linked to third party id)
* @param int $selected Id contract preselected
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $showempty Show empty line
* @return int Nbr of project if OK, <0 if KO
*/
function
formSelectContract
(
$page
,
$socid
=-
1
,
$selected
=
''
,
$htmlname
=
'contrattid'
,
$maxlength
=
16
,
$showempty
=
1
)
{
global
$langs
;
print
"
\n
"
;
print
'<form method="post" action="'
.
$page
.
'">'
;
print
'<input type="hidden" name="action" value="setcontract">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<table class="nobordernopadding" cellpadding="0" cellspacing="0">'
;
print
'<tr><td>'
;
$this
->
select_contract
(
$socid
,
$selected
,
$htmlname
,
$maxlength
,
$showempty
);
print
'</td>'
;
print
'<td align="left"><input type="submit" class="button" value="'
.
$langs
->
trans
(
"Modify"
)
.
'"></td>'
;
print
'</tr></table></form>'
;
}
}
}
This diff is collapsed.
Click to expand it.
htdocs/fichinter/card.php
+
3
−
11
View file @
525b2cf2
...
@@ -477,7 +477,7 @@ if (empty($reshook))
...
@@ -477,7 +477,7 @@ if (empty($reshook))
}
}
// Set into a contract
// Set into a contract
else
if
(
$action
==
'setcontrat'
&&
$user
->
rights
->
contrat
->
creer
)
else
if
(
$action
==
'setcontra
c
t'
&&
$user
->
rights
->
contrat
->
creer
)
{
{
$result
=
$object
->
set_contrat
(
$user
,
GETPOST
(
'contratid'
,
'int'
));
$result
=
$object
->
set_contrat
(
$user
,
GETPOST
(
'contratid'
,
'int'
));
if
(
$result
<
0
)
dol_print_error
(
$db
,
$object
->
error
);
if
(
$result
<
0
)
dol_print_error
(
$db
,
$object
->
error
);
...
@@ -1251,15 +1251,8 @@ else if ($id > 0 || ! empty($ref))
...
@@ -1251,15 +1251,8 @@ else if ($id > 0 || ! empty($ref))
print
'</td><td colspan="3">'
;
print
'</td><td colspan="3">'
;
if
(
$action
==
'contrat'
)
if
(
$action
==
'contrat'
)
{
{
print
'<table class="nobordernopadding" cellpadding="0" cellspacing="0">'
;
$formcontract
=
new
Formcontract
(
$db
);
print
'<tr><td>'
;
$formcontract
->
formSelectContract
(
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$object
->
id
,
$object
->
socid
,
$object
->
fk_contrat
,
'contratid'
,
0
,
1
);
$htmlcontract
=
new
Formcontract
(
$db
);
//print "$socid,$selected,$htmlname";
$htmlcontract
->
select_contract
(
$object
->
socid
,
$object
->
fk_contrat
,
'contratid'
);
print
'</td>'
;
print
'<td align="left"><input type="submit" class="button" value="'
.
$langs
->
trans
(
"Modify"
)
.
'"></td>'
;
print
'</tr></table>'
;
}
}
else
else
{
{
...
@@ -1649,7 +1642,6 @@ else if ($id > 0 || ! empty($ref))
...
@@ -1649,7 +1642,6 @@ else if ($id > 0 || ! empty($ref))
}
}
print
'</div>'
;
print
'</div>'
;
print
'<br>'
;
if
(
$action
!=
'presend'
)
if
(
$action
!=
'presend'
)
{
{
...
...
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