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
4c9cc63f
Commit
4c9cc63f
authored
Apr 5, 2012
by
Regis Houssin
Browse files
Options
Downloads
Plain Diff
Merge pull request #152 from grandoc/develop
Prepair to display within a custom place
parents
f874d68e
df132198
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/admin/project.php
+29
-71
29 additions, 71 deletions
htdocs/admin/project.php
with
29 additions
and
71 deletions
htdocs/admin/project.php
+
29
−
71
View file @
4c9cc63f
...
@@ -30,14 +30,17 @@ require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
...
@@ -30,14 +30,17 @@ require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
require_once
(
DOL_DOCUMENT_ROOT
.
'/projet/class/task.class.php'
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/projet/class/task.class.php'
);
$langs
->
load
(
"admin"
);
$langs
->
load
(
"admin"
);
$langs
->
load
(
"errors"
);
$langs
->
load
(
"other"
);
$langs
->
load
(
"other"
);
$langs
->
load
(
"projects"
);
$langs
->
load
(
"projects"
);
if
(
!
$user
->
admin
)
if
(
!
$user
->
admin
)
accessforbidden
();
accessforbidden
();
$value
=
GETPOST
(
'value'
,
'alpha'
);
$value
=
GETPOST
(
'value'
,
'alpha'
);
$action
=
GETPOST
(
'action'
,
'alpha'
);
$action
=
GETPOST
(
'action'
,
'alpha'
);
$label
=
GETPOST
(
'label'
,
'alpha'
);
$scandir
=
GETPOST
(
'scandir'
,
'alpha'
);
$type
=
'project'
;
/*
/*
...
@@ -84,7 +87,6 @@ if ($action == 'specimen')
...
@@ -84,7 +87,6 @@ if ($action == 'specimen')
}
}
}
}
if
(
$filefound
)
if
(
$filefound
)
{
{
require_once
(
$file
);
require_once
(
$file
);
...
@@ -111,26 +113,13 @@ if ($action == 'specimen')
...
@@ -111,26 +113,13 @@ if ($action == 'specimen')
if
(
$action
==
'set'
)
if
(
$action
==
'set'
)
{
{
$label
=
GETPOST
(
'label'
,
'alpha'
);
$ret
=
addDocumentModel
(
$value
,
$type
,
$label
,
$scandir
);
$scandir
=
GETPOST
(
'scandir'
,
'alpha'
);
$type
=
'project'
;
$sql
=
"INSERT INTO "
.
MAIN_DB_PREFIX
.
"document_model (nom, type, entity, libelle, description)"
;
$sql
.
=
" VALUES ('"
.
$db
->
escape
(
$value
)
.
"','"
.
$type
.
"',"
.
$conf
->
entity
.
", "
;
$sql
.
=
(
$label
?
"'"
.
$db
->
escape
(
$label
)
.
"'"
:
'null'
)
.
", "
;
$sql
.
=
(
!
empty
(
$scandir
)
?
"'"
.
$db
->
escape
(
$scandir
)
.
"'"
:
"null"
);
$sql
.
=
")"
;
$resql
=
$db
->
query
(
$sql
);
}
}
if
(
$action
==
'del'
)
if
(
$action
==
'del'
)
{
{
$type
=
'project'
;
$ret
=
delDocumentModel
(
$value
,
$type
);
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"document_model"
;
if
(
$ret
>
0
)
$sql
.
=
" WHERE nom = '"
.
$db
->
escape
(
$value
)
.
"'"
;
$sql
.
=
" AND type = '"
.
$type
.
"'"
;
$sql
.
=
" AND entity = "
.
$conf
->
entity
;
if
(
$db
->
query
(
$sql
))
{
{
if
(
$conf
->
global
->
PROJECT_ADDON_PDF
==
"
$value
"
)
dolibarr_del_const
(
$db
,
'PROJECT_ADDON_PDF'
,
$conf
->
entity
);
if
(
$conf
->
global
->
PROJECT_ADDON_PDF
==
"
$value
"
)
dolibarr_del_const
(
$db
,
'PROJECT_ADDON_PDF'
,
$conf
->
entity
);
}
}
...
@@ -138,37 +127,18 @@ if ($action == 'del')
...
@@ -138,37 +127,18 @@ if ($action == 'del')
if
(
$action
==
'setdoc'
)
if
(
$action
==
'setdoc'
)
{
{
$label
=
GETPOST
(
'label'
,
'alpha'
);
$scandir
=
GETPOST
(
'scandir'
,
'alpha'
);
$db
->
begin
();
if
(
dolibarr_set_const
(
$db
,
"PROJECT_ADDON_PDF"
,
$value
,
'chaine'
,
0
,
''
,
$conf
->
entity
))
if
(
dolibarr_set_const
(
$db
,
"PROJECT_ADDON_PDF"
,
$value
,
'chaine'
,
0
,
''
,
$conf
->
entity
))
{
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf
->
global
->
PROJECT_ADDON_PDF
=
$value
;
$conf
->
global
->
PROJECT_ADDON_PDF
=
$value
;
}
}
// On active le modele
// On active le modele
$type
=
'project'
;
$ret
=
delDocumentModel
(
$value
,
$type
);
$sql_del
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"document_model"
;
if
(
$ret
>
0
)
$sql_del
.
=
" WHERE nom = '"
.
$db
->
escape
(
$value
)
.
"'"
;
$sql_del
.
=
" AND type = '"
.
$type
.
"'"
;
$sql_del
.
=
" AND entity = "
.
$conf
->
entity
;
$result1
=
$db
->
query
(
$sql_del
);
$sql
=
"INSERT INTO "
.
MAIN_DB_PREFIX
.
"document_model (nom, type, entity, libelle, description)"
;
$sql
.
=
" VALUES ('"
.
$db
->
escape
(
$value
)
.
"', '"
.
$type
.
"', "
.
$conf
->
entity
.
", "
;
$sql
.
=
(
$label
?
"'"
.
$db
->
escape
(
$label
)
.
"'"
:
'null'
)
.
", "
;
$sql
.
=
(
!
empty
(
$scandir
)
?
"'"
.
$db
->
escape
(
$scandir
)
.
"'"
:
"null"
);
$sql
.
=
")"
;
$result2
=
$db
->
query
(
$sql
);
if
(
$result1
&&
$result2
)
{
$db
->
commit
();
}
else
{
{
$
db
->
rollback
(
);
$
ret
=
addDocumentModel
(
$value
,
$type
,
$label
,
$scandir
);
}
}
}
}
...
@@ -177,7 +147,7 @@ if ($action == 'setmod')
...
@@ -177,7 +147,7 @@ if ($action == 'setmod')
// TODO Verifier si module numerotation choisi peut etre active
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
// par appel methode canBeActivated
dolibarr_set_const
(
$db
,
"PROJECT_ADDON"
,
GETPOST
(
'value'
,
'alpha'
)
,
'chaine'
,
0
,
''
,
$conf
->
entity
);
dolibarr_set_const
(
$db
,
"PROJECT_ADDON"
,
$value
,
'chaine'
,
0
,
''
,
$conf
->
entity
);
}
}
/*
/*
...
@@ -186,10 +156,10 @@ if ($action == 'setmod')
...
@@ -186,10 +156,10 @@ if ($action == 'setmod')
$dirmodels
=
array_merge
(
array
(
'/'
),(
array
)
$conf
->
modules_parts
[
'models'
]);
$dirmodels
=
array_merge
(
array
(
'/'
),(
array
)
$conf
->
modules_parts
[
'models'
]);
$form
=
new
Form
(
$db
);
llxHeader
();
llxHeader
();
$form
=
new
Form
(
$db
);
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/admin/modules.php">'
.
$langs
->
trans
(
"BackToModuleList"
)
.
'</a>'
;
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/admin/modules.php">'
.
$langs
->
trans
(
"BackToModuleList"
)
.
'</a>'
;
print_fiche_titre
(
$langs
->
trans
(
"ProjectsSetup"
),
$linkback
,
'setup'
);
print_fiche_titre
(
$langs
->
trans
(
"ProjectsSetup"
),
$linkback
,
'setup'
);
...
@@ -197,9 +167,6 @@ print "<br>";
...
@@ -197,9 +167,6 @@ print "<br>";
// Project numbering module
// Project numbering module
$dir
=
DOL_DOCUMENT_ROOT
.
"/core/modules/project/"
;
print_titre
(
$langs
->
trans
(
"ProjectsNumberingModules"
));
print_titre
(
$langs
->
trans
(
"ProjectsNumberingModules"
));
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
...
@@ -235,12 +202,12 @@ foreach ($dirmodels as $reldir)
...
@@ -235,12 +202,12 @@ foreach ($dirmodels as $reldir)
$module
=
new
$file
;
$module
=
new
$file
;
if
(
$module
->
isEnabled
())
{
// Show modules according to features level
// Show modules according to features level
if
(
$module
->
version
==
'development'
&&
$conf
->
global
->
MAIN_FEATURES_LEVEL
<
2
)
continue
;
if
(
$module
->
version
==
'development'
&&
$conf
->
global
->
MAIN_FEATURES_LEVEL
<
2
)
continue
;
if
(
$module
->
version
==
'experimental'
&&
$conf
->
global
->
MAIN_FEATURES_LEVEL
<
1
)
continue
;
if
(
$module
->
version
==
'experimental'
&&
$conf
->
global
->
MAIN_FEATURES_LEVEL
<
1
)
continue
;
if
(
$module
->
isEnabled
())
{
$var
=!
$var
;
$var
=!
$var
;
print
'<tr '
.
$bc
[
$var
]
.
'><td>'
.
$module
->
nom
.
"</td><td>
\n
"
;
print
'<tr '
.
$bc
[
$var
]
.
'><td>'
.
$module
->
nom
.
"</td><td>
\n
"
;
print
$module
->
info
();
print
$module
->
info
();
...
@@ -255,13 +222,13 @@ foreach ($dirmodels as $reldir)
...
@@ -255,13 +222,13 @@ foreach ($dirmodels as $reldir)
print
'</td>'
.
"
\n
"
;
print
'</td>'
.
"
\n
"
;
print
'<td align="center">'
;
print
'<td align="center">'
;
if
(
$conf
->
global
->
PROJECT_ADDON
==
"
$file
"
)
if
(
$conf
->
global
->
PROJECT_ADDON
==
$classname
)
{
{
print
img_picto
(
$langs
->
trans
(
"Activated"
),
'switch_on'
);
print
img_picto
(
$langs
->
trans
(
"Activated"
),
'switch_on'
);
}
}
else
else
{
{
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=setmod&value='
.
$
fil
e
.
'" alt="'
.
$langs
->
trans
(
"Default"
)
.
'">'
.
img_picto
(
$langs
->
trans
(
"Disabled"
),
'switch_off'
)
.
'</a>'
;
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=setmod&value='
.
$
classnam
e
.
'" alt="'
.
$langs
->
trans
(
"Default"
)
.
'">'
.
img_picto
(
$langs
->
trans
(
"Disabled"
),
'switch_off'
)
.
'</a>'
;
}
}
print
'</td>'
;
print
'</td>'
;
...
@@ -305,8 +272,6 @@ print '</table><br>';
...
@@ -305,8 +272,6 @@ print '</table><br>';
* Modeles documents for projects
* Modeles documents for projects
*/
*/
//$dir = DOL_DOCUMENT_ROOT.'/core/modules/project/pdf/';
print_titre
(
$langs
->
trans
(
"ProjectsModelModule"
));
print_titre
(
$langs
->
trans
(
"ProjectsModelModule"
));
// Defini tableau def de modele
// Defini tableau def de modele
...
@@ -375,16 +340,9 @@ foreach ($dirmodels as $reldir)
...
@@ -375,16 +340,9 @@ foreach ($dirmodels as $reldir)
if
(
in_array
(
$name
,
$def
))
if
(
in_array
(
$name
,
$def
))
{
{
print
"<td align=
\"
center
\"
>
\n
"
;
print
"<td align=
\"
center
\"
>
\n
"
;
//if ($conf->global->PROJECT_ADDON_PDF != "$name")
//{
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=del&value='
.
$name
.
'&scandir='
.
$module
->
scandir
.
'&label='
.
urlencode
(
$module
->
name
)
.
'">'
;
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=del&value='
.
$name
.
'&scandir='
.
$module
->
scandir
.
'&label='
.
urlencode
(
$module
->
name
)
.
'">'
;
print
img_picto
(
$langs
->
trans
(
"Enabled"
),
'switch_on'
);
print
img_picto
(
$langs
->
trans
(
"Enabled"
),
'switch_on'
);
print
'</a>'
;
print
'</a>'
;
//}
//else
//{
// print img_picto($langs->trans("Enabled"),'on');
//}
print
"</td>"
;
print
"</td>"
;
}
}
else
else
...
...
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