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
c190d4dd
Commit
c190d4dd
authored
13 years ago
by
Philippe Grand
Browse files
Options
Downloads
Patches
Plain Diff
fix : shipping specimen is displayed, and shipping modele can be used from custom place
parent
04f2b04d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/admin/expedition.php
+9
-17
9 additions, 17 deletions
htdocs/admin/expedition.php
htdocs/core/modules/expedition/modules_expedition.php
+28
-28
28 additions, 28 deletions
htdocs/core/modules/expedition/modules_expedition.php
with
37 additions
and
45 deletions
htdocs/admin/expedition.php
+
9
−
17
View file @
c190d4dd
...
...
@@ -118,11 +118,11 @@ if ($action == 'specimen')
$dirmodels
=
array_merge
(
array
(
'/'
),(
array
)
$conf
->
modules_parts
[
'models'
]);
foreach
(
$dirmodels
as
$reldir
)
{
$file
=
dol_buildpath
(
$reldir
.
"core/modules/expedition/doc/pdf_"
.
$modele
.
".modules.php"
,
0
);
$file
=
dol_buildpath
(
$reldir
.
"core/modules/expedition/doc/pdf_
expedition_
"
.
$modele
.
".modules.php"
,
0
);
if
(
file_exists
(
$file
))
{
$filefound
=
1
;
$classname
=
"pdf_"
.
$modele
;
$classname
=
"pdf_
expedition_
"
.
$modele
;
break
;
}
}
...
...
@@ -339,10 +339,9 @@ foreach ($dirmodels as $reldir)
while
((
$file
=
readdir
(
$handle
))
!==
false
)
{
if
(
preg_match
(
'/^(mod_.*)\.php$/i'
,
$file
,
$reg
)
)
if
(
substr
(
$file
,
0
,
15
)
==
'mod_expedition_'
&&
substr
(
$file
,
dol_strlen
(
$file
)
-
3
,
3
)
==
'php'
)
{
$file
=
$reg
[
1
];
$classname
=
substr
(
$file
,
4
);
$file
=
substr
(
$file
,
0
,
dol_strlen
(
$file
)
-
4
);
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/modules/expedition/"
.
$file
.
".php"
);
...
...
@@ -477,7 +476,7 @@ foreach ($dirmodels as $reldir)
$classname
=
substr
(
$file
,
0
,
dol_strlen
(
$file
)
-
12
);
$var
=!
$var
;
print
"
<tr
$bc[$var]
><td>
"
;
print
'
<tr
'
.
$bc
[
$var
]
.
'
><td>
'
;
print
$name
;
print
"</td><td>
\n
"
;
require_once
(
$dir
.
$file
);
...
...
@@ -490,16 +489,9 @@ foreach ($dirmodels as $reldir)
if
(
in_array
(
$name
,
$def
))
{
print
"<td align=
\"
center
\"
>
\n
"
;
//if ($conf->global->EXPEDITION_ADDON_PDF != $name)
//{
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?action=del&value='
.
$name
.
'">'
;
print
img_picto
(
$langs
->
trans
(
"Activated"
),
'switch_on'
);
print
'</a>'
;
//}
//else
//{
// print img_picto($langs->trans("Activated"),'switch_on');
//}
print
"</td>"
;
}
else
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/modules/expedition/modules_expedition.php
+
28
−
28
View file @
c190d4dd
...
...
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011
Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011
-2012
Philippe Grand <philippe.grand@atoo-net.com>
*
* 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
...
...
@@ -156,13 +156,8 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
$langs
->
load
(
"sendings"
);
// Increase limit for PDF build
$err
=
error_reporting
();
error_reporting
(
0
);
@
set_time_limit
(
120
);
error_reporting
(
$err
);
$error
=
0
;
$dir
=
"/core/modules/expedition/"
;
$srctemplatepath
=
''
;
// Positionne le modele sur le nom du modele a utiliser
...
...
@@ -186,15 +181,18 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
$srctemplatepath
=
$tmp
[
1
];
}
// Search template file
// Search template file
s
$file
=
''
;
$classname
=
''
;
$filefound
=
0
;
$dirmodels
=
array
(
'/'
);
if
(
is_array
(
$conf
->
modules_parts
[
'models'
]))
$dirmodels
=
array_merge
(
$dirmodels
,
$conf
->
modules_parts
[
'models'
]);
foreach
(
$dirmodels
as
$reldir
)
{
foreach
(
array
(
'doc'
,
'pdf'
)
as
$prefix
)
{
$file
=
$prefix
.
"_expedition_"
.
$modele
.
".modules.php"
;
// On verifie l'emplacement du modele
$file
=
dol_buildpath
(
$dir
.
'doc/'
.
$file
);
$file
=
dol_buildpath
(
$reldir
.
"core/modules/expedition/doc/"
.
$file
,
0
);
if
(
file_exists
(
$file
))
{
$filefound
=
1
;
...
...
@@ -202,6 +200,8 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
break
;
}
}
if
(
$filefound
)
break
;
}
// Charge le modele
if
(
$filefound
)
...
...
@@ -215,7 +215,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charset_output
=
$outputlangs
->
charset_output
;
if
(
$obj
->
write_file
(
$object
,
$outputlangs
)
>
0
)
if
(
$obj
->
write_file
(
$object
,
$outputlangs
,
$srctemplatepath
)
>
0
)
{
$outputlangs
->
charset_output
=
$sav_charset_output
;
...
...
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