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
482a771e
Commit
482a771e
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Some quality fixes
parent
83cf8a8e
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
+17
-20
17 additions, 20 deletions
htdocs/core/class/html.formcontract.class.php
htdocs/fichinter/fiche.php
+15
-14
15 additions, 14 deletions
htdocs/fichinter/fiche.php
with
32 additions
and
34 deletions
htdocs/core/class/html.formcontract.class.php
+
17
−
20
View file @
482a771e
...
@@ -23,9 +23,9 @@
...
@@ -23,9 +23,9 @@
*/
*/
/**
/**
* Class to manage generation of HTML components for
bank
module
* Class to manage generation of HTML components for
contract
module
*/
*/
class
Form
c
ontract
class
Form
C
ontract
{
{
var
$db
;
var
$db
;
var
$error
;
var
$error
;
...
@@ -49,9 +49,10 @@ class Formcontract
...
@@ -49,9 +49,10 @@ class Formcontract
* @param int $selected Id contract preselected
* @param int $selected Id contract preselected
* @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
* @return int Nbre of project if OK, <0 if KO
* @return int Nbre of project if OK, <0 if KO
*/
*/
function
select_contract
(
$socid
=-
1
,
$selected
=
''
,
$htmlname
=
'contrattid'
,
$maxlength
=
16
)
function
select_contract
(
$socid
=-
1
,
$selected
=
''
,
$htmlname
=
'contrattid'
,
$maxlength
=
16
,
$showempty
=
1
)
{
{
global
$db
,
$user
,
$conf
,
$langs
;
global
$db
,
$user
,
$conf
,
$langs
;
...
@@ -59,22 +60,19 @@ class Formcontract
...
@@ -59,22 +60,19 @@ class Formcontract
if
(
!
empty
(
$conf
->
global
->
PROJECT_HIDE_UNSELECTABLES
))
$hideunselectables
=
true
;
if
(
!
empty
(
$conf
->
global
->
PROJECT_HIDE_UNSELECTABLES
))
$hideunselectables
=
true
;
// Search all contacts
// Search all contacts
$sql
=
'SELECT c.rowid, c.ref,
c.note,
c.fk_soc, c.statut'
;
$sql
=
'SELECT c.rowid, c.ref, c.fk_soc, c.statut'
;
$sql
.
=
' FROM '
.
MAIN_DB_PREFIX
.
'contrat as c'
;
$sql
.
=
' FROM '
.
MAIN_DB_PREFIX
.
'contrat as c'
;
$sql
.
=
" WHERE c.entity = "
.
$conf
->
entity
;
$sql
.
=
" WHERE c.entity = "
.
$conf
->
entity
;
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
if
(
$socid
==
0
)
if
(
$socid
==
0
)
$sql
.
=
" AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"
;
$sql
.
=
" AND (c.fk_soc=0 OR c.fk_soc IS NULL)"
;
else
$sql
.
=
" AND c.fk_soc = "
.
$socid
;
else
$sql
.
=
" AND c.fk_soc="
.
$socid
;
$sql
.
=
" ORDER BY c.note ASC"
;
dol_syslog
(
"contact.lib
::select_contrat
s
sql="
.
$sql
);
dol_syslog
(
get_class
(
$this
)
.
"
::select_contra
c
t sql="
.
$sql
);
$resql
=
$db
->
query
(
$sql
);
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
if
(
$resql
)
{
{
print
'<select class="flat" name="'
.
$htmlname
.
'">'
;
print
'<select class="flat" name="'
.
$htmlname
.
'">'
;
print
'<option value="0"> </option>'
;
if
(
$showempty
)
print
'<option value="0"> </option>'
;
$num
=
$db
->
num_rows
(
$resql
);
$num
=
$db
->
num_rows
(
$resql
);
$i
=
0
;
$i
=
0
;
if
(
$num
)
if
(
$num
)
...
@@ -102,7 +100,7 @@ class Formcontract
...
@@ -102,7 +100,7 @@ class Formcontract
if
(
!
$obj
->
statut
>
0
)
if
(
!
$obj
->
statut
>
0
)
{
{
$disabled
=
1
;
$disabled
=
1
;
$labeltoshow
.
=
'
-
'
.
$langs
->
trans
(
"Draft"
);
$labeltoshow
.
=
'
(
'
.
$langs
->
trans
(
"Draft"
)
.
')'
;
}
}
if
(
$socid
>
0
&&
(
!
empty
(
$obj
->
fk_soc
)
&&
$obj
->
fk_soc
!=
$socid
))
if
(
$socid
>
0
&&
(
!
empty
(
$obj
->
fk_soc
)
&&
$obj
->
fk_soc
!=
$socid
))
{
{
...
@@ -121,7 +119,6 @@ class Formcontract
...
@@ -121,7 +119,6 @@ class Formcontract
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$resultat
.
=
'>'
.
$labeltoshow
;
$resultat
.
=
'>'
.
$labeltoshow
;
if
(
!
$disabled
)
$resultat
.
=
' - '
.
dol_trunc
(
$obj
->
title
,
$maxlength
);
$resultat
.
=
'</option>'
;
$resultat
.
=
'</option>'
;
}
}
print
$resultat
;
print
$resultat
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/fichinter/fiche.php
+
15
−
14
View file @
482a771e
...
@@ -895,8 +895,9 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->ficheint
...
@@ -895,8 +895,9 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->ficheint
$form
=
new
Form
(
$db
);
$form
=
new
Form
(
$db
);
$formfile
=
new
FormFile
(
$db
);
$formfile
=
new
FormFile
(
$db
);
$formcontract
=
new
FormContract
(
$db
);
llxHeader
();
llxHeader
(
''
,
$langs
->
trans
(
"Fichinter"
)
);
if
(
$action
==
'create'
)
if
(
$action
==
'create'
)
{
{
...
@@ -1022,12 +1023,12 @@ if ($action == 'create')
...
@@ -1022,12 +1023,12 @@ if ($action == 'create')
print
'</td></tr>'
;
print
'</td></tr>'
;
}
}
// Contrat
// Contra
c
t
if
(
$conf
->
contrat
->
enabled
)
if
(
$conf
->
contrat
->
enabled
)
{
{
$langs
->
load
(
"contrat"
);
$langs
->
load
(
"contrat"
);
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Contrat"
)
.
'</td><td>'
;
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Contra
c
t"
)
.
'</td><td>'
;
$numcontrat
=
select_contrat
s
(
$soc
->
id
,
GETPOST
(
'contratid'
,
'int'
),
'contratid'
);
$numcontrat
=
$formcontract
->
select_contra
c
t
(
$soc
->
id
,
GETPOST
(
'contratid'
,
'int'
),
'contratid'
,
0
,
1
);
if
(
$numcontrat
==
0
)
if
(
$numcontrat
==
0
)
{
{
print
' <a href="'
.
DOL_URL_ROOT
.
'/contrat/fiche.php?socid='
.
$soc
->
id
.
'&action=create">'
.
$langs
->
trans
(
"AddContract"
)
.
'</a>'
;
print
' <a href="'
.
DOL_URL_ROOT
.
'/contrat/fiche.php?socid='
.
$soc
->
id
.
'&action=create">'
.
$langs
->
trans
(
"AddContract"
)
.
'</a>'
;
...
@@ -1243,7 +1244,7 @@ else if ($id > 0 || ! empty($ref))
...
@@ -1243,7 +1244,7 @@ else if ($id > 0 || ! empty($ref))
if
(
$action
!=
'contrat'
)
if
(
$action
!=
'contrat'
)
{
{
print
'<td align="right"><a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=contrat&id='
.
$object
->
id
.
'">'
;
print
'<td align="right"><a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=contrat&id='
.
$object
->
id
.
'">'
;
print
img_edit
(
$langs
->
trans
(
'SetContrat'
),
1
);
print
img_edit
(
$langs
->
trans
(
'SetContra
c
t'
),
1
);
print
'</a></td>'
;
print
'</a></td>'
;
}
}
print
'</tr></table>'
;
print
'</tr></table>'
;
...
...
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