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
6afa1cb2
Commit
6afa1cb2
authored
12 years ago
by
Philippe Grand
Browse files
Options
Downloads
Patches
Plain Diff
normalize
parent
ca96bd64
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/modules/expedition/modules_expedition.php
+24
-16
24 additions, 16 deletions
htdocs/core/modules/expedition/modules_expedition.php
htdocs/core/modules/supplier_order/modules_commandefournisseur.php
+12
-10
12 additions, 10 deletions
...re/modules/supplier_order/modules_commandefournisseur.php
with
36 additions
and
26 deletions
htdocs/core/modules/expedition/modules_expedition.php
+
24
−
16
View file @
6afa1cb2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 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
...
@@ -25,7 +25,8 @@
...
@@ -25,7 +25,8 @@
/**
/**
* \file htdocs/core/modules/expedition/modules_expedition.php
* \file htdocs/core/modules/expedition/modules_expedition.php
* \ingroup expedition
* \ingroup expedition
* \brief File of class to manage expedition numbering
* \brief File that contains parent class for sending receipts models
* and parent class for sending receipts numbering models
*/
*/
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/commondocgenerator.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/commondocgenerator.class.php'
;
...
@@ -60,15 +61,15 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
...
@@ -60,15 +61,15 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
/**
/**
*
Classe mere des
model
e
s
de numerotation des references d expedition
*
Parent Class of numbering
models
of sending receipts references
*/
*/
abstract
class
ModelNumRefExpedition
abstract
class
ModelNumRefExpedition
{
{
var
$error
=
''
;
var
$error
=
''
;
/** Return if a mod
ul
e can be used or not
/** Return if a mode
l
can be used or not
*
*
* @return boolean true if mod
ul
e can be used
* @return boolean true if mode
l
can be used
*/
*/
function
isEnabled
()
function
isEnabled
()
{
{
...
@@ -88,7 +89,7 @@ abstract class ModelNumRefExpedition
...
@@ -88,7 +89,7 @@ abstract class ModelNumRefExpedition
}
}
/**
/**
* Return numbering example
* Return
s
numbering example
*
*
* @return string Example
* @return string Example
*/
*/
...
@@ -110,7 +111,7 @@ abstract class ModelNumRefExpedition
...
@@ -110,7 +111,7 @@ abstract class ModelNumRefExpedition
}
}
/**
/**
* Return next value
* Return
s
next value
assigned
*
*
* @param Societe $objsoc Third party object
* @param Societe $objsoc Third party object
* @param Object $shipment Shipment object
* @param Object $shipment Shipment object
...
@@ -123,7 +124,7 @@ abstract class ModelNumRefExpedition
...
@@ -123,7 +124,7 @@ abstract class ModelNumRefExpedition
}
}
/**
/**
* Return
numbering version module
* Return
s version of the numbering model
*
*
* @return string Value
* @return string Value
*/
*/
...
@@ -158,7 +159,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
...
@@ -158,7 +159,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
$srctemplatepath
=
''
;
$srctemplatepath
=
''
;
//
Positionne le modele sur le nom du modele a utili
se
r
//
Sets the model on the model name to u
se
if
(
!
dol_strlen
(
$modele
))
if
(
!
dol_strlen
(
$modele
))
{
{
if
(
!
empty
(
$conf
->
global
->
EXPEDITION_ADDON_PDF
))
if
(
!
empty
(
$conf
->
global
->
EXPEDITION_ADDON_PDF
))
...
@@ -171,7 +172,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
...
@@ -171,7 +172,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
}
}
}
}
// If selected model
e
is a filename template (then $modele="modelname:filename")
// If selected model is a filename template (then $modele="modelname:filename")
$tmp
=
explode
(
':'
,
$modele
,
2
);
$tmp
=
explode
(
':'
,
$modele
,
2
);
if
(
!
empty
(
$tmp
[
1
]))
if
(
!
empty
(
$tmp
[
1
]))
{
{
...
@@ -189,7 +190,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
...
@@ -189,7 +190,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
{
{
$file
=
$prefix
.
"_expedition_"
.
$modele
.
".modules.php"
;
$file
=
$prefix
.
"_expedition_"
.
$modele
.
".modules.php"
;
//
On verifie l'emplacement du modele
//
We check the model location
$file
=
dol_buildpath
(
$reldir
.
"core/modules/expedition/doc/"
.
$file
,
0
);
$file
=
dol_buildpath
(
$reldir
.
"core/modules/expedition/doc/"
.
$file
,
0
);
if
(
file_exists
(
$file
))
if
(
file_exists
(
$file
))
{
{
...
@@ -201,7 +202,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
...
@@ -201,7 +202,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
if
(
$filefound
)
break
;
if
(
$filefound
)
break
;
}
}
//
Charge l
e model
e
//
Load th
e model
if
(
$filefound
)
if
(
$filefound
)
{
{
require_once
$file
;
require_once
$file
;
...
@@ -221,14 +222,14 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
...
@@ -221,14 +222,14 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
//require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
//require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
//dol_delete_preview($object);
//dol_delete_preview($object);
//
Appel de
s triggers
//
Call
s triggers
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/interfaces.class.php'
;
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/interfaces.class.php'
;
$interface
=
new
Interfaces
(
$db
);
$interface
=
new
Interfaces
(
$db
);
$result
=
$interface
->
run_triggers
(
'SHIPPING_BUILDDOC'
,
$object
,
$user
,
$langs
,
$conf
);
$result
=
$interface
->
run_triggers
(
'SHIPPING_BUILDDOC'
,
$object
,
$user
,
$langs
,
$conf
);
if
(
$result
<
0
)
{
if
(
$result
<
0
)
{
$error
++
;
$this
->
errors
=
$interface
->
errors
;
$error
++
;
$this
->
errors
=
$interface
->
errors
;
}
}
//
Fin appel
triggers
//
End calls
triggers
return
1
;
return
1
;
}
}
...
@@ -242,8 +243,15 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
...
@@ -242,8 +243,15 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
}
}
else
else
{
{
dol_print_error
(
''
,
$langs
->
trans
(
"Error"
)
.
" "
.
$langs
->
trans
(
"ErrorFileDoesNotExists"
,
$file
));
if
(
!
$conf
->
global
->
EXPEDITION_ADDON_PDF
)
return
-
1
;
{
print
$langs
->
trans
(
"Error"
)
.
" "
.
$langs
->
trans
(
"Error_EXPEDITION_ADDON_PDF_NotDefined"
);
}
else
{
print
$langs
->
trans
(
"Error"
)
.
" "
.
$langs
->
trans
(
"ErrorFileDoesNotExists"
,
$file
);
}
return
0
;
}
}
}
}
?>
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
htdocs/core/modules/supplier_order/modules_commandefournisseur.php
+
12
−
10
View file @
6afa1cb2
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
/**
/**
* \file htdocs/core/modules/supplier_order/modules_commandefournisseur.php
* \file htdocs/core/modules/supplier_order/modules_commandefournisseur.php
* \ingroup commande fournisseur
* \ingroup commande fournisseur
* \brief File that contain parent class for supplier orders models
* \brief File that contain
s
parent class for supplier orders models
* and parent class for supplier orders numbering models
* and parent class for supplier orders numbering models
*/
*/
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/commondocgenerator.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/commondocgenerator.class.php'
;
...
@@ -44,13 +44,13 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
...
@@ -44,13 +44,13 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
*
*
* @param DoliDB $db Database handler
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @param string $maxfilenamelength Max length of value to show
* @return array List of
number
s
* @return array List of
template
s
*/
*/
static
function
liste_modeles
(
$db
,
$maxfilenamelength
=
0
)
static
function
liste_modeles
(
$db
,
$maxfilenamelength
=
0
)
{
{
global
$conf
;
global
$conf
;
$type
=
'
order_
supplier'
;
$type
=
'suppli
er_ord
er'
;
$liste
=
array
();
$liste
=
array
();
include_once
DOL_DOCUMENT_ROOT
.
'/core/lib/functions2.lib.php'
;
include_once
DOL_DOCUMENT_ROOT
.
'/core/lib/functions2.lib.php'
;
...
@@ -79,7 +79,7 @@ abstract class ModeleNumRefSuppliersOrders
...
@@ -79,7 +79,7 @@ abstract class ModeleNumRefSuppliersOrders
return
true
;
return
true
;
}
}
/** Returns
the
default description of
the model
numbering
/** Returns default description of numbering
model
*
*
* @return string Description Text
* @return string Description Text
*/
*/
...
@@ -101,7 +101,7 @@ abstract class ModeleNumRefSuppliersOrders
...
@@ -101,7 +101,7 @@ abstract class ModeleNumRefSuppliersOrders
return
$langs
->
trans
(
"NoExample"
);
return
$langs
->
trans
(
"NoExample"
);
}
}
/** Tests if
the
numbers
already in force in the database do not cause conflicts that would prevent this
numbering
.
/** Tests if
existing
numbers
make problems with
numbering
*
*
* @return boolean false if conflict, true if ok
* @return boolean false if conflict, true if ok
*/
*/
...
@@ -120,7 +120,7 @@ abstract class ModeleNumRefSuppliersOrders
...
@@ -120,7 +120,7 @@ abstract class ModeleNumRefSuppliersOrders
return
$langs
->
trans
(
"NotAvailable"
);
return
$langs
->
trans
(
"NotAvailable"
);
}
}
/** Returns version of the
model
numbering
/** Returns version of the numbering
model
*
*
* @return string Value
* @return string Value
*/
*/
...
@@ -138,7 +138,7 @@ abstract class ModeleNumRefSuppliersOrders
...
@@ -138,7 +138,7 @@ abstract class ModeleNumRefSuppliersOrders
/**
/**
* Create a document onto disk according to template mod
ul
e.
* Create a document onto disk according to template mode
l
.
*
*
* @param DoliDB $db Database handler
* @param DoliDB $db Database handler
* @param Object $object Object supplier order
* @param Object $object Object supplier order
...
@@ -164,7 +164,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet
...
@@ -164,7 +164,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet
$srctemplatepath
=
''
;
$srctemplatepath
=
''
;
// Set the model on the model name to use
// Set
s
the model on the model name to use
if
(
!
dol_strlen
(
$modele
))
if
(
!
dol_strlen
(
$modele
))
{
{
if
(
!
empty
(
$conf
->
global
->
COMMANDE_SUPPLIER_ADDON_PDF
))
if
(
!
empty
(
$conf
->
global
->
COMMANDE_SUPPLIER_ADDON_PDF
))
...
@@ -195,7 +195,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet
...
@@ -195,7 +195,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet
{
{
$file
=
$prefix
.
"_"
.
$modele
.
".modules.php"
;
$file
=
$prefix
.
"_"
.
$modele
.
".modules.php"
;
// We check
ed
the location
of the model
// We check the
model
location
$file
=
dol_buildpath
(
$reldir
.
"core/modules/supplier_order/pdf/"
.
$file
,
0
);
$file
=
dol_buildpath
(
$reldir
.
"core/modules/supplier_order/pdf/"
.
$file
,
0
);
if
(
file_exists
(
$file
))
if
(
file_exists
(
$file
))
{
{
...
@@ -229,7 +229,9 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet
...
@@ -229,7 +229,9 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/interfaces.class.php'
;
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/interfaces.class.php'
;
$interface
=
new
Interfaces
(
$db
);
$interface
=
new
Interfaces
(
$db
);
$result
=
$interface
->
run_triggers
(
'ORDER_SUPPLIER_BUILDDOC'
,
$object
,
$user
,
$langs
,
$conf
);
$result
=
$interface
->
run_triggers
(
'ORDER_SUPPLIER_BUILDDOC'
,
$object
,
$user
,
$langs
,
$conf
);
if
(
$result
<
0
)
{
$error
++
;
$this
->
errors
=
$interface
->
errors
;
}
if
(
$result
<
0
)
{
$error
++
;
$this
->
errors
=
$interface
->
errors
;
}
// End calls triggers
// End calls triggers
return
1
;
return
1
;
...
...
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