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
5fc78270
Commit
5fc78270
authored
13 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
parents
2f1b2f7b
a3a3db58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/contact/class/contact.class.php
+7
-7
7 additions, 7 deletions
htdocs/contact/class/contact.class.php
test/phpunit/ContactTest.php
+3
-3
3 additions, 3 deletions
test/phpunit/ContactTest.php
with
10 additions
and
10 deletions
htdocs/contact/class/contact.class.php
+
7
−
7
View file @
5fc78270
...
...
@@ -229,7 +229,7 @@ class Contact extends CommonObject
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"socpeople SET "
;
if
(
$this
->
socid
>
0
)
$sql
.
=
" fk_soc='"
.
$this
->
db
->
escape
(
$this
->
socid
)
.
"',"
;
if
(
$this
->
socid
==
-
1
)
$sql
.
=
" fk_soc=null,"
;
else
if
(
$this
->
socid
==
-
1
)
$sql
.
=
" fk_soc=null,"
;
$sql
.
=
" civilite='"
.
$this
->
db
->
escape
(
$this
->
civilite_id
)
.
"'"
;
$sql
.
=
", name='"
.
$this
->
db
->
escape
(
$this
->
lastname
)
.
"'"
;
$sql
.
=
", firstname='"
.
$this
->
db
->
escape
(
$this
->
firstname
)
.
"'"
;
...
...
@@ -415,13 +415,13 @@ class Contact extends CommonObject
//check existing
$sql_check
=
"SELECT * FROM "
.
MAIN_DB_PREFIX
.
"user_alert WHERE type=1 AND fk_contact="
.
$id
.
" AND fk_user="
.
$user
->
id
;
$result_check
=
$this
->
db
->
query
(
$sql_check
);
if
(
!
$result_check
or
(
$this
->
db
->
num_rows
(
$result_check
)
<
1
))
if
(
!
$result_check
||
(
$this
->
db
->
num_rows
(
$result_check
)
<
1
))
{
//insert
$sql
=
"INSERT
into
"
.
MAIN_DB_PREFIX
.
"user_alert(type,fk_contact,fk_user) "
;
$sql
.
=
"
values
(1,"
.
$id
.
","
.
$user
->
id
.
")"
;
$sql
=
"INSERT
INTO
"
.
MAIN_DB_PREFIX
.
"user_alert(type,fk_contact,fk_user) "
;
$sql
.
=
"
VALUES
(1,"
.
$id
.
","
.
$user
->
id
.
")"
;
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
if
(
!
$result
)
{
$error
++
;
$this
->
error
=
$this
->
db
->
lasterror
();
...
...
@@ -434,8 +434,8 @@ class Contact extends CommonObject
}
else
{
$sql
=
"DELETE
from
"
.
MAIN_DB_PREFIX
.
"user_alert "
;
$sql
.
=
"
where
type=1 AND fk_contact="
.
$id
.
" AND fk_user="
.
$user
->
id
;
$sql
=
"DELETE
FROM
"
.
MAIN_DB_PREFIX
.
"user_alert "
;
$sql
.
=
"
WHERE
type=1 AND fk_contact="
.
$id
.
" AND fk_user="
.
$user
->
id
;
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
$result
)
{
...
...
This diff is collapsed.
Click to expand it.
test/phpunit/ContactTest.php
+
3
−
3
View file @
5fc78270
...
...
@@ -179,10 +179,10 @@ class ContactTest extends PHPUnit_Framework_TestCase
$localobject
->
default_lang
=
'es_ES'
;
$result
=
$localobject
->
update
(
$localobject
->
id
,
$user
);
print
__METHOD__
.
" id="
.
$localobject
->
id
.
" result="
.
$result
.
"
\n
"
;
$this
->
assertLessThan
(
$result
,
0
);
$this
->
assertLessThan
(
$result
,
0
,
'Contact::update error'
);
$result
=
$localobject
->
update_note
(
$localobject
->
note
);
print
__METHOD__
.
" id="
.
$localobject
->
id
.
" result="
.
$result
.
"
\n
"
;
$this
->
assertLessThan
(
$result
,
0
);
$this
->
assertLessThan
(
$result
,
0
,
'Contact::update_note error'
);
//$result=$localobject->update_note_public($localobject->note_public);
//print __METHOD__." id=".$localobject->id." result=".$result."\n";
//$this->assertLessThan($result, 0);
...
...
@@ -190,7 +190,7 @@ class ContactTest extends PHPUnit_Framework_TestCase
$newobject
=
new
Contact
(
$this
->
savdb
);
$result
=
$newobject
->
fetch
(
$localobject
->
id
);
print
__METHOD__
.
" id="
.
$localobject
->
id
.
" result="
.
$result
.
"
\n
"
;
$this
->
assertLessThan
(
$result
,
0
);
$this
->
assertLessThan
(
$result
,
0
,
'Contact::fetch error'
);
$this
->
assertEquals
(
$localobject
->
note
,
$newobject
->
note
);
//$this->assertEquals($localobject->note_public, $newobject->note_public);
...
...
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