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
c5d5d6a8
Commit
c5d5d6a8
authored
11 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
A better fix to have default statut to enabled when created an address.
parent
d15aeb26
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/contact/class/contact.class.php
+7
-8
7 additions, 8 deletions
htdocs/contact/class/contact.class.php
with
7 additions
and
8 deletions
htdocs/contact/class/contact.class.php
+
7
−
8
View file @
c5d5d6a8
...
...
@@ -67,7 +67,7 @@ class Contact extends CommonObject
var
$code
;
var
$email
;
var
$skype
;
var
$skype
;
var
$jabberid
;
var
$phone_pro
;
var
$phone_perso
;
...
...
@@ -103,6 +103,7 @@ class Contact extends CommonObject
function
__construct
(
$db
)
{
$this
->
db
=
$db
;
$this
->
statut
=
1
;
// By default, status is enabled
}
/**
...
...
@@ -125,9 +126,9 @@ class Contact extends CommonObject
$this
->
firstname
=
trim
(
$this
->
firstname
);
if
(
!
empty
(
$conf
->
global
->
MAIN_FIRST_TO_UPPER
))
$this
->
lastname
=
ucwords
(
$this
->
lastname
);
if
(
!
empty
(
$conf
->
global
->
MAIN_FIRST_TO_UPPER
))
$this
->
firstname
=
ucwords
(
$this
->
firstname
);
if
(
!
$this
->
socid
)
$this
->
socid
=
0
;
if
(
!
$this
->
priv
)
$this
->
priv
=
0
;
if
(
empty
(
$this
->
statut
))
$this
->
statut
=
1
;
//
Defult status to Actif
if
(
empty
(
$this
->
socid
)
)
$this
->
socid
=
0
;
if
(
empty
(
$this
->
priv
)
)
$this
->
priv
=
0
;
if
(
empty
(
$this
->
statut
))
$this
->
statut
=
0
;
//
This is to convert '' into '0' to avoid bad sql request
$sql
=
"INSERT INTO "
.
MAIN_DB_PREFIX
.
"socpeople ("
;
$sql
.
=
" datec"
;
...
...
@@ -237,7 +238,7 @@ class Contact extends CommonObject
$this
->
phone_perso
=
trim
(
$this
->
phone_perso
);
$this
->
phone_mobile
=
trim
(
$this
->
phone_mobile
);
$this
->
jabberid
=
trim
(
$this
->
jabberid
);
$this
->
skype
=
trim
(
$this
->
skype
);
$this
->
skype
=
trim
(
$this
->
skype
);
$this
->
fax
=
trim
(
$this
->
fax
);
$this
->
zip
=
(
empty
(
$this
->
zip
)
?
''
:
$this
->
zip
);
$this
->
town
=
(
empty
(
$this
->
town
)
?
''
:
$this
->
town
);
...
...
@@ -261,7 +262,7 @@ class Contact extends CommonObject
$sql
.
=
", poste='"
.
$this
->
db
->
escape
(
$this
->
poste
)
.
"'"
;
$sql
.
=
", fax='"
.
$this
->
db
->
escape
(
$this
->
fax
)
.
"'"
;
$sql
.
=
", email='"
.
$this
->
db
->
escape
(
$this
->
email
)
.
"'"
;
$sql
.
=
", skype='"
.
$this
->
db
->
escape
(
$this
->
skype
)
.
"'"
;
$sql
.
=
", skype='"
.
$this
->
db
->
escape
(
$this
->
skype
)
.
"'"
;
$sql
.
=
", note_private = "
.
(
isset
(
$this
->
note_private
)
?
"'"
.
$this
->
db
->
escape
(
$this
->
note_private
)
.
"'"
:
"null"
);
$sql
.
=
", note_public = "
.
(
isset
(
$this
->
note_public
)
?
"'"
.
$this
->
db
->
escape
(
$this
->
note_public
)
.
"'"
:
"null"
);
$sql
.
=
", phone = "
.
(
isset
(
$this
->
phone_pro
)
?
"'"
.
$this
->
db
->
escape
(
$this
->
phone_pro
)
.
"'"
:
"null"
);
...
...
@@ -1100,7 +1101,5 @@ class Contact extends CommonObject
}
}
}
?>
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