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
2dadffa9
Commit
2dadffa9
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Uniformize code
parent
d7d353ae
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/societe/class/societe.class.php
+37
-26
37 additions, 26 deletions
htdocs/societe/class/societe.class.php
with
37 additions
and
26 deletions
htdocs/societe/class/societe.class.php
+
37
−
26
View file @
2dadffa9
...
...
@@ -238,7 +238,7 @@ class Societe extends CommonObject
dol_syslog
(
"Societe::Create success id="
.
$this
->
id
);
$this
->
db
->
commit
();
return
0
;
return
$this
->
id
;
}
else
{
...
...
@@ -550,26 +550,6 @@ class Societe extends CommonObject
if
(
empty
(
$socid
)
&&
empty
(
$ref
))
return
-
1
;
// Init data for telephonie module
if
(
$conf
->
telephonie
->
enabled
&&
$user
&&
$user
->
id
)
{
/* Lecture des permissions */
$sql
=
"SELECT p.pread, p.pwrite, p.pperms"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"societe_perms as p"
;
$sql
.
=
" WHERE p.fk_user = '"
.
$user
->
id
.
"'"
;
$sql
.
=
" AND p.fk_soc = '"
.
$socid
.
"';"
;
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
{
if
(
$row
=
$this
->
db
->
fetch_row
(
$resql
))
{
$this
->
perm_read
=
$row
[
0
];
$this
->
perm_write
=
$row
[
1
];
$this
->
perm_perms
=
$row
[
2
];
}
}
}
$sql
=
'SELECT s.rowid, s.nom, s.entity, s.address, s.datec as dc, s.prefix_comm'
;
$sql
.
=
', s.price_level'
;
$sql
.
=
', s.tms as date_update'
;
...
...
@@ -785,8 +765,8 @@ class Societe extends CommonObject
}
/**
*
\brief Suppression d'une societe de la base avec se
s depend
a
nces (contacts, rib...)
*
\
param id id
de la societe a supprimer
*
Delete a third party from database and all it
s depend
e
nc
i
es (contacts, rib...)
*
@
param id id
of third party to delete
*/
function
delete
(
$id
)
{
...
...
@@ -921,7 +901,7 @@ class Societe extends CommonObject
dol_delete_dir_recursive
(
$docdir
);
}
return
0
;
return
1
;
}
else
{
...
...
@@ -1244,8 +1224,11 @@ class Societe extends CommonObject
if
(
!
$this
->
db
->
query
(
$sql
)
)
{
dol_print_error
(
$this
->
db
);
return
-
1
;
}
return
1
;
}
return
-
1
;
}
/**
...
...
@@ -1861,8 +1844,8 @@ class Societe extends CommonObject
}
/**
*
\brief
Charge les informations d'ordre info dans l'objet societe
*
\
param id id de la societe a charger
* Charge les informations d'ordre info dans l'objet societe
*
@
param id id de la societe a charger
*/
function
info
(
$id
)
{
...
...
@@ -2144,6 +2127,34 @@ class Societe extends CommonObject
}
}
/**
* Initialise an example of company with random values
* Used to build previews or test instances
*/
function
initAsSpecimen
()
{
global
$user
,
$langs
,
$conf
,
$mysoc
;
// Initialize parameters
$this
->
id
=
0
;
$this
->
nom
=
'SPECIMEN'
;
$this
->
specimen
=
1
;
$this
->
cp
=
'99999'
;
$this
->
ville
=
'MyTown'
;
$this
->
pays_id
=
1
;
$this
->
pays_code
=
'FR'
;
$this
->
siren
=
'123456789'
;
$this
->
siret
=
'ABCDE'
;
$this
->
capital
=
10000
;
$this
->
client
=
1
;
$this
->
prospect
=
1
;
$this
->
fournisseur
=
1
;
$this
->
note_public
=
'This is a comment (public)'
;
$this
->
note
=
'This is a comment (private)'
;
}
}
?>
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