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
aeb3573d
Commit
aeb3573d
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #763 from grandoc/develop
display enhancement and standardize
parents
5b6a12d0
45d9d525
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
htdocs/admin/compta.php
+17
-3
17 additions, 3 deletions
htdocs/admin/compta.php
htdocs/admin/contract.php
+17
-1
17 additions, 1 deletion
htdocs/admin/contract.php
htdocs/admin/dons.php
+37
-53
37 additions, 53 deletions
htdocs/admin/dons.php
htdocs/admin/project.php
+26
-12
26 additions, 12 deletions
htdocs/admin/project.php
with
97 additions
and
69 deletions
htdocs/admin/compta.php
+
17
−
3
View file @
aeb3573d
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
...
@@ -35,6 +36,10 @@ accessforbidden();
...
@@ -35,6 +36,10 @@ accessforbidden();
$action
=
GETPOST
(
'action'
,
'alpha'
);
$action
=
GETPOST
(
'action'
,
'alpha'
);
/*
* Actions
*/
$compta_mode
=
defined
(
'COMPTA_MODE'
)
?
COMPTA_MODE
:
'RECETTES-DEPENSES'
;
$compta_mode
=
defined
(
'COMPTA_MODE'
)
?
COMPTA_MODE
:
'RECETTES-DEPENSES'
;
if
(
$action
==
'setcomptamode'
)
if
(
$action
==
'setcomptamode'
)
...
@@ -87,7 +92,7 @@ if ($action == 'update' || $action == 'add')
...
@@ -87,7 +92,7 @@ if ($action == 'update' || $action == 'add')
}*/
}*/
/*
/*
*
Affichage page
*
View
*/
*/
llxHeader
();
llxHeader
();
...
@@ -97,9 +102,18 @@ $form=new Form($db);
...
@@ -97,9 +102,18 @@ $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
(
'ComptaSetup'
),
$linkback
,
'setup'
);
print_fiche_titre
(
$langs
->
trans
(
'ComptaSetup'
),
$linkback
,
'setup'
);
print
'<br>'
;
print
'<br>'
;
$h
=
0
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/compta.php"
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Compta"
);
$head
[
$h
][
2
]
=
'Compta'
;
$hselected
=
$h
;
$h
++
;
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"ModuleSetup"
));
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
// Cas du parametre COMPTA_MODE
// Cas du parametre COMPTA_MODE
...
...
This diff is collapsed.
Click to expand it.
htdocs/admin/contract.php
+
17
−
1
View file @
aeb3573d
<?php
<?php
/* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
...
@@ -27,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
...
@@ -27,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$langs
->
load
(
"admin"
);
$langs
->
load
(
"admin"
);
$langs
->
load
(
"errors"
);
$langs
->
load
(
"errors"
);
$langs
->
load
(
"contracts"
);
if
(
!
$user
->
admin
)
accessforbidden
();
if
(
!
$user
->
admin
)
accessforbidden
();
...
@@ -88,6 +90,20 @@ print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup');
...
@@ -88,6 +90,20 @@ print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup');
print
"<br>"
;
print
"<br>"
;
$h
=
0
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/contract.php"
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Contracts"
);
$head
[
$h
][
2
]
=
'Contract'
;
$hselected
=
$h
;
$h
++
;
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"ModuleSetup"
));
/*
* Contracts Numbering model
*/
print_titre
(
$langs
->
trans
(
"ContractsNumberingModules"
));
print_titre
(
$langs
->
trans
(
"ContractsNumberingModules"
));
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
...
@@ -129,7 +145,7 @@ if (is_resource($handle))
...
@@ -129,7 +145,7 @@ if (is_resource($handle))
print
$module
->
info
();
print
$module
->
info
();
print
'</td>'
;
print
'</td>'
;
// Show example of numbering mod
ul
e
// Show example of numbering mode
l
print
'<td nowrap="nowrap">'
;
print
'<td nowrap="nowrap">'
;
$tmp
=
$module
->
getExample
();
$tmp
=
$module
->
getExample
();
if
(
preg_match
(
'/^Error/'
,
$tmp
))
{
$langs
->
load
(
"errors"
);
print
'<div class="error">'
.
$langs
->
trans
(
$tmp
)
.
'</div>'
;
}
if
(
preg_match
(
'/^Error/'
,
$tmp
))
{
$langs
->
load
(
"errors"
);
print
'<div class="error">'
.
$langs
->
trans
(
$tmp
)
.
'</div>'
;
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/admin/dons.php
+
37
−
53
View file @
aeb3573d
<?php
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
...
@@ -47,7 +48,7 @@ if ($action == 'specimen')
...
@@ -47,7 +48,7 @@ if ($action == 'specimen')
$don
=
new
Don
(
$db
);
$don
=
new
Don
(
$db
);
$don
->
initAsSpecimen
();
$don
->
initAsSpecimen
();
//
Charge le mode
le
//
Search template fi
le
s
$dir
=
DOL_DOCUMENT_ROOT
.
"/core/modules/dons/"
;
$dir
=
DOL_DOCUMENT_ROOT
.
"/core/modules/dons/"
;
$file
=
$modele
.
".modules.php"
;
$file
=
$modele
.
".modules.php"
;
if
(
file_exists
(
$dir
.
$file
))
if
(
file_exists
(
$dir
.
$file
))
...
@@ -75,66 +76,38 @@ if ($action == 'specimen')
...
@@ -75,66 +76,38 @@ if ($action == 'specimen')
}
}
}
}
if
(
$action
==
'setdoc'
)
// Set default model
else
if
(
$action
==
'setdoc'
)
{
{
$value
=
GETPOST
(
'value'
,
'alpha'
);
if
(
dolibarr_set_const
(
$db
,
"COMMANDE_ADDON_PDF"
,
$value
,
'chaine'
,
0
,
''
,
$conf
->
entity
))
$label
=
GETPOST
(
'label'
,
'alpha'
);
$scandir
=
GETPOST
(
'scandir'
,
'alpha'
);
$db
->
begin
();
if
(
dolibarr_set_const
(
$db
,
"DON_ADDON_MODEL"
,
$value
,
'chaine'
,
0
,
''
,
$conf
->
entity
))
{
{
$conf
->
global
->
DON_ADDON_MODEL
=
$value
;
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf
->
global
->
COMMANDE_ADDON_PDF
=
$value
;
}
}
// On active le modele
// On active le modele
$type
=
'donation'
;
$ret
=
delDocumentModel
(
$value
,
$type
);
$sql_del
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"document_model"
;
if
(
$ret
>
0
)
$sql_del
.
=
" WHERE nom = '"
.
$db
->
escape
(
$value
)
.
"' AND type = '"
.
$type
.
"'"
;
$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
);
}
}
}
}
if
(
$action
==
'set'
)
// Activate a model
else
if
(
$action
==
'set'
)
{
{
$value
=
GETPOST
(
'value'
,
'alpha'
);
$ret
=
addDocumentModel
(
$value
,
$type
,
$label
,
$scandir
);
$label
=
GETPOST
(
'label'
,
'alpha'
);
$scandir
=
GETPOST
(
'scandir'
,
'alpha'
);
$type
=
'donation'
;
$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'
)
else
if
(
$action
==
'del'
)
{
{
$value
=
GETPOST
(
'value'
,
'alpha'
);
$ret
=
delDocumentModel
(
$value
,
$type
);
if
(
$ret
>
0
)
$type
=
'donation'
;
{
$sql
=
"DELETE FROM "
.
MAIN_DB_PREFIX
.
"document_model"
;
if
(
$conf
->
global
->
COMMANDE_ADDON_PDF
==
"
$value
"
)
dolibarr_del_const
(
$db
,
'COMMANDE_ADDON_PDF'
,
$conf
->
entity
);
$sql
.
=
" WHERE nom = '"
.
$value
.
"' AND type = '"
.
$type
.
"'"
;
}
$resql
=
$db
->
query
(
$sql
);
}
}
/*
/*
* View
* View
...
@@ -147,6 +120,17 @@ llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration');
...
@@ -147,6 +120,17 @@ llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration');
$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
(
"DonationsSetup"
),
$linkback
,
'setup'
);
print_fiche_titre
(
$langs
->
trans
(
"DonationsSetup"
),
$linkback
,
'setup'
);
print
'<br>'
;
$h
=
0
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/dons.php"
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Donations"
);
$head
[
$h
][
2
]
=
'Donation'
;
$hselected
=
$h
;
$h
++
;
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"ModuleSetup"
));
// Document templates
// Document templates
...
...
This diff is collapsed.
Click to expand it.
htdocs/admin/project.php
+
26
−
12
View file @
aeb3573d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-201
2
Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011-201
3
Philippe Grand <philippe.grand@atoo-net.com>
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
...
@@ -66,7 +66,7 @@ if ($action == 'updateMask')
...
@@ -66,7 +66,7 @@ if ($action == 'updateMask')
}
}
}
}
if
(
$action
==
'specimen'
)
else
if
(
$action
==
'specimen'
)
{
{
$modele
=
GETPOST
(
'module'
,
'alpha'
);
$modele
=
GETPOST
(
'module'
,
'alpha'
);
...
@@ -111,12 +111,13 @@ if ($action == 'specimen')
...
@@ -111,12 +111,13 @@ if ($action == 'specimen')
}
}
}
}
if
(
$action
==
'set'
)
// Activate a model
else
if
(
$action
==
'set'
)
{
{
$ret
=
addDocumentModel
(
$value
,
$type
,
$label
,
$scandir
);
$ret
=
addDocumentModel
(
$value
,
$type
,
$label
,
$scandir
);
}
}
if
(
$action
==
'del'
)
else
if
(
$action
==
'del'
)
{
{
$ret
=
delDocumentModel
(
$value
,
$type
);
$ret
=
delDocumentModel
(
$value
,
$type
);
if
(
$ret
>
0
)
if
(
$ret
>
0
)
...
@@ -125,7 +126,8 @@ if ($action == 'del')
...
@@ -125,7 +126,8 @@ if ($action == 'del')
}
}
}
}
if
(
$action
==
'setdoc'
)
// Set default model
else
if
(
$action
==
'setdoc'
)
{
{
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
))
{
{
...
@@ -142,7 +144,7 @@ if ($action == 'setdoc')
...
@@ -142,7 +144,7 @@ if ($action == 'setdoc')
}
}
}
}
if
(
$action
==
'setmod'
)
else
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
...
@@ -156,7 +158,7 @@ if ($action == 'setmod')
...
@@ -156,7 +158,7 @@ if ($action == 'setmod')
$dirmodels
=
array_merge
(
array
(
'/'
),(
array
)
$conf
->
modules_parts
[
'models'
]);
$dirmodels
=
array_merge
(
array
(
'/'
),(
array
)
$conf
->
modules_parts
[
'models'
]);
llxHeader
();
llxHeader
(
""
,
$langs
->
trans
(
"ProjectsSetup"
)
);
$form
=
new
Form
(
$db
);
$form
=
new
Form
(
$db
);
...
@@ -165,8 +167,20 @@ print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup');
...
@@ -165,8 +167,20 @@ print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup');
print
"<br>"
;
print
"<br>"
;
$h
=
0
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/project.php"
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Projects"
);
$head
[
$h
][
2
]
=
'Project'
;
$hselected
=
$h
;
$h
++
;
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"ModuleSetup"
));
/*
* Projects Numbering model
*/
// Project numbering module
print_titre
(
$langs
->
trans
(
"ProjectsNumberingModules"
));
print_titre
(
$langs
->
trans
(
"ProjectsNumberingModules"
));
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
...
@@ -198,7 +212,7 @@ foreach ($dirmodels as $reldir)
...
@@ -198,7 +212,7 @@ foreach ($dirmodels as $reldir)
$file
=
$reg
[
1
];
$file
=
$reg
[
1
];
$classname
=
substr
(
$file
,
4
);
$classname
=
substr
(
$file
,
4
);
require_once
DOL_DOCUMENT_ROOT
.
"/core/modules/project/"
.
$file
.
'.php'
;
require_once
$dir
.
$file
.
'.php'
;
$module
=
new
$file
;
$module
=
new
$file
;
...
@@ -213,7 +227,7 @@ foreach ($dirmodels as $reldir)
...
@@ -213,7 +227,7 @@ foreach ($dirmodels as $reldir)
print
$module
->
info
();
print
$module
->
info
();
print
'</td>'
;
print
'</td>'
;
// Show example of numbering mod
ul
e
// Show example of numbering mode
l
print
'<td nowrap="nowrap">'
;
print
'<td nowrap="nowrap">'
;
$tmp
=
$module
->
getExample
();
$tmp
=
$module
->
getExample
();
if
(
preg_match
(
'/^Error/'
,
$tmp
))
print
'<div class="error">'
.
$langs
->
trans
(
$tmp
)
.
'</div>'
;
if
(
preg_match
(
'/^Error/'
,
$tmp
))
print
'<div class="error">'
.
$langs
->
trans
(
$tmp
)
.
'</div>'
;
...
@@ -269,7 +283,7 @@ print '</table><br>';
...
@@ -269,7 +283,7 @@ print '</table><br>';
/*
/*
*
Modeles documents for project
s
*
Document templates generator
s
*/
*/
print_titre
(
$langs
->
trans
(
"ProjectsModelModule"
));
print_titre
(
$langs
->
trans
(
"ProjectsModelModule"
));
...
@@ -352,7 +366,7 @@ foreach ($dirmodels as $reldir)
...
@@ -352,7 +366,7 @@ foreach ($dirmodels as $reldir)
print
"</td>"
;
print
"</td>"
;
}
}
// Defaut
// Defau
l
t
print
"<td align=
\"
center
\"
>"
;
print
"<td align=
\"
center
\"
>"
;
if
(
$conf
->
global
->
PROJECT_ADDON_PDF
==
"
$name
"
)
if
(
$conf
->
global
->
PROJECT_ADDON_PDF
==
"
$name
"
)
{
{
...
...
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