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
7e380bb2
Commit
7e380bb2
authored
13 years ago
by
Juanjo Menent
Browse files
Options
Downloads
Patches
Plain Diff
Uniformize code. visual enhancement
parent
dd8f52a7
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/admin/societe.php
+21
-18
21 additions, 18 deletions
htdocs/admin/societe.php
with
21 additions
and
18 deletions
htdocs/admin/societe.php
+
21
−
18
View file @
7e380bb2
...
...
@@ -3,6 +3,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -22,7 +23,7 @@
* \file htdocs/admin/societe.php
* \ingroup company
* \brief Third party module setup page
* \version $Id: societe.php,v 1.6
2
2011/08/1
6 16:49
:2
4
simnandez Exp $
* \version $Id: societe.php,v 1.6
3
2011/08/1
7 07:50
:2
9
simnandez Exp $
*/
require
(
"../main.inc.php"
);
...
...
@@ -34,10 +35,12 @@ $langs->load("admin");
if
(
!
$user
->
admin
)
accessforbidden
();
$action
=
GETPOST
(
"action"
);
/*
* Actions
*/
if
(
$
_GET
[
"
action
"
]
==
'setcodeclient'
)
if
(
$action
==
'setcodeclient'
)
{
if
(
dolibarr_set_const
(
$db
,
"SOCIETE_CODECLIENT_ADDON"
,
$_GET
[
"value"
],
'chaine'
,
0
,
''
,
$conf
->
entity
)
>
0
)
{
...
...
@@ -50,7 +53,7 @@ if ($_GET["action"] == 'setcodeclient')
}
}
if
(
$
_GET
[
"
action
"
]
==
'setcodecompta'
)
if
(
$action
==
'setcodecompta'
)
{
if
(
dolibarr_set_const
(
$db
,
"SOCIETE_CODECOMPTA_ADDON"
,
$_GET
[
"value"
],
'chaine'
,
0
,
''
,
$conf
->
entity
)
>
0
)
{
...
...
@@ -63,7 +66,7 @@ if ($_GET["action"] == 'setcodecompta')
}
}
if
(
$
_POST
[
"
action
"
]
==
'COMPANY_USE_SEARCH_TO_SELECT'
)
if
(
$action
==
'COMPANY_USE_SEARCH_TO_SELECT'
)
{
if
(
dolibarr_set_const
(
$db
,
"COMPANY_USE_SEARCH_TO_SELECT"
,
$_POST
[
"activate_COMPANY_USE_SEARCH_TO_SELECT"
],
'chaine'
,
0
,
''
,
$conf
->
entity
))
{
...
...
@@ -77,7 +80,7 @@ if ($_POST["action"] == 'COMPANY_USE_SEARCH_TO_SELECT')
}
// define constants for models generator that need parameters
if
(
$
_POST
[
"
action
"
]
==
'setModuleOptions'
)
if
(
$action
==
'setModuleOptions'
)
{
$post_size
=
count
(
$_POST
);
for
(
$i
=
0
;
$i
<
$post_size
;
$i
++
)
...
...
@@ -92,7 +95,7 @@ if ($_POST["action"] == 'setModuleOptions')
}
// Activate a document generator module
if
(
$
_GET
[
"
action
"
]
==
'set'
)
if
(
$action
==
'set'
)
{
$type
=
'company'
;
$sql
=
"INSERT INTO "
.
MAIN_DB_PREFIX
.
"document_model (nom, type, entity, libelle, description)"
;
...
...
@@ -108,7 +111,7 @@ if ($_GET["action"] == 'set')
}
// Disable a document generator module
if
(
$
_GET
[
"
action
"
]
==
'del'
)
if
(
$action
==
'del'
)
{
$type
=
'company'
;
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"document_model"
;
...
...
@@ -121,7 +124,7 @@ if ($_GET["action"] == 'del')
}
// Define default generator
if
(
$
_GET
[
"
action
"
]
==
'setdoc'
)
if
(
$action
==
'setdoc'
)
{
$db
->
begin
();
...
...
@@ -158,7 +161,7 @@ if ($_GET["action"] == 'setdoc')
}
//Activate ProfId
if
(
$
_GET
[
"
action
"
]
==
'setprofid'
)
if
(
$action
==
'setprofid'
)
{
$idprof
=
"SOCIETE_IDPROF"
.
$_GET
[
"value"
]
.
"_UNIQUE"
;
if
(
dolibarr_set_const
(
$db
,
$idprof
,
$_GET
[
"status"
],
'chaine'
,
0
,
''
,
$conf
->
entity
)
>
0
)
...
...
@@ -179,7 +182,7 @@ if ($_GET["action"] == 'setprofid')
$form
=
new
Form
(
$db
);
$help_url
=
'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers'
;
$help_url
=
'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers
|ES:Configuración_del_módulo_terceros
'
;
llxHeader
(
''
,
$langs
->
trans
(
"CompanySetup"
),
$help_url
);
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/admin/modules.php">'
.
$langs
->
trans
(
"BackToModuleList"
)
.
'</a>'
;
...
...
@@ -236,13 +239,13 @@ if (is_resource($handle))
if
(
$conf
->
global
->
SOCIETE_CODECLIENT_ADDON
==
"
$file
"
)
{
print
"<td align=
\"
center
\"
>
\n
"
;
print
img_picto
(
$langs
->
trans
(
"Activated"
),
'on'
);
print
img_picto
(
$langs
->
trans
(
"Activated"
),
'
switch_
on'
);
print
"</td>
\n
"
;
}
else
{
print
'<td align="center"><a href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=setcodeclient&value='
.
$file
.
'">'
;
print
img_picto
(
$langs
->
trans
(
"Disabled"
),
'off'
);
print
img_picto
(
$langs
->
trans
(
"Disabled"
),
'
switch_
off'
);
print
'</a></td>'
;
}
...
...
@@ -302,13 +305,13 @@ if (is_resource($handle))
if
(
$conf
->
global
->
SOCIETE_CODECOMPTA_ADDON
==
"
$file
"
)
{
print
'<td align="center">'
;
print
img_picto
(
$langs
->
trans
(
"Activated"
),
'on'
);
print
img_picto
(
$langs
->
trans
(
"Activated"
),
'
switch_
on'
);
print
'</td>'
;
}
else
{
print
'<td align="center"><a href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=setcodecompta&value='
.
$file
.
'">'
;
print
img_picto
(
$langs
->
trans
(
"Disabled"
),
'off'
);
print
img_picto
(
$langs
->
trans
(
"Disabled"
),
'
switch_
off'
);
print
'</a></td>'
;
}
print
'<td> </td>'
;
...
...
@@ -401,7 +404,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
//{
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=del&value='
.
$name
.
'&scandir='
.
$module
->
scandir
.
'&label='
.
urlencode
(
$module
->
name
)
.
'">'
;
print
img_picto
(
$langs
->
trans
(
"Enabled"
),
'on'
);
print
img_picto
(
$langs
->
trans
(
"Enabled"
),
'
switch_
on'
);
print
'</a>'
;
//}
//else
...
...
@@ -415,13 +418,13 @@ foreach ($conf->file->dol_document_root as $dirroot)
if
(
versioncompare
(
$module
->
phpmin
,
versionphparray
())
>
0
)
{
print
"<td align=
\"
center
\"
>
\n
"
;
print
img_picto
(
dol_escape_htmltag
(
$langs
->
trans
(
"ErrorModuleRequirePHPVersion"
,
join
(
'.'
,
$module
->
phpmin
))),
'off'
);
print
img_picto
(
dol_escape_htmltag
(
$langs
->
trans
(
"ErrorModuleRequirePHPVersion"
,
join
(
'.'
,
$module
->
phpmin
))),
'
switch_
off'
);
print
"</td>"
;
}
else
{
print
"<td align=
\"
center
\"
>
\n
"
;
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=set&value='
.
$name
.
'&scandir='
.
$module
->
scandir
.
'&label='
.
urlencode
(
$module
->
name
)
.
'">'
.
img_picto
(
$langs
->
trans
(
"Disabled"
),
'off'
)
.
'</a>'
;
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=set&value='
.
$name
.
'&scandir='
.
$module
->
scandir
.
'&label='
.
urlencode
(
$module
->
name
)
.
'">'
.
img_picto
(
$langs
->
trans
(
"Disabled"
),
'
switch_
off'
)
.
'</a>'
;
print
"</td>"
;
}
}
...
...
@@ -578,5 +581,5 @@ dol_fiche_end();
$db
->
close
();
llxFooter
(
'$Date: 2011/08/1
6 16:49
:2
4
$ - $Revision: 1.6
2
$'
);
llxFooter
(
'$Date: 2011/08/1
7 07:50
:2
9
$ - $Revision: 1.6
3
$'
);
?>
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