diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php index 0b7d2ffdc547506f395e4e88b49c21524cd6f6fe..bf74e1adcd15db3ad1987a0a0262fc19a8f168d4 100644 --- a/htdocs/core/modules/expedition/modules_expedition.php +++ b/htdocs/core/modules/expedition/modules_expedition.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> - * Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com> + * Copyright (C) 2011-2013 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 @@ -25,7 +25,8 @@ /** * \file htdocs/core/modules/expedition/modules_expedition.php * \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'; @@ -60,15 +61,15 @@ abstract class ModelePdfExpedition extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references d expedition + * Parent Class of numbering models of sending receipts references */ abstract class ModelNumRefExpedition { var $error=''; - /** Return if a module can be used or not + /** Return if a model can be used or not * - * @return boolean true if module can be used + * @return boolean true if model can be used */ function isEnabled() { @@ -88,7 +89,7 @@ abstract class ModelNumRefExpedition } /** - * Return numbering example + * Returns numbering example * * @return string Example */ @@ -110,7 +111,7 @@ abstract class ModelNumRefExpedition } /** - * Return next value + * Returns next value assigned * * @param Societe $objsoc Third party object * @param Object $shipment Shipment object @@ -123,7 +124,7 @@ abstract class ModelNumRefExpedition } /** - * Return numbering version module + * Returns version of the numbering model * * @return string Value */ @@ -158,7 +159,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) $srctemplatepath=''; - // Positionne le modele sur le nom du modele a utiliser + // Sets the model on the model name to use if (! dol_strlen($modele)) { if (! empty($conf->global->EXPEDITION_ADDON_PDF)) @@ -171,7 +172,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) } } - // If selected modele is a filename template (then $modele="modelname:filename") + // If selected model is a filename template (then $modele="modelname:filename") $tmp=explode(':',$modele,2); if (! empty($tmp[1])) { @@ -189,7 +190,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) { $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); if (file_exists($file)) { @@ -201,7 +202,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) if ($filefound) break; } - // Charge le modele + // Load the model if ($filefound) { require_once $file; @@ -221,14 +222,14 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) //require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; //dol_delete_preview($object); - // Appel des triggers + // Calls triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('SHIPPING_BUILDDOC',$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End calls triggers return 1; } @@ -242,8 +243,15 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) } else { - dol_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file)); - return -1; + if (! $conf->global->EXPEDITION_ADDON_PDF) + { + 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 diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index f9407ba804e2e6760d9f31e2a8675c4a2b8da627..d14d4ae5f435f35a522ef0251706273c853895f2 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -24,7 +24,7 @@ /** * \file htdocs/core/modules/supplier_order/modules_commandefournisseur.php * \ingroup commande fournisseur - * \brief File that contain parent class for supplier orders models + * \brief File that contains parent class for supplier orders models * and parent class for supplier orders numbering models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -44,13 +44,13 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator * * @param DoliDB $db Database handler * @param string $maxfilenamelength Max length of value to show - * @return array List of numbers + * @return array List of templates */ static function liste_modeles($db,$maxfilenamelength=0) { global $conf; - $type='order_supplier'; + $type='supplier_order'; $liste=array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -79,7 +79,7 @@ abstract class ModeleNumRefSuppliersOrders return true; } - /** Returns the default description of the model numbering + /** Returns default description of numbering model * * @return string Description Text */ @@ -101,7 +101,7 @@ abstract class ModeleNumRefSuppliersOrders 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 */ @@ -120,7 +120,7 @@ abstract class ModeleNumRefSuppliersOrders return $langs->trans("NotAvailable"); } - /** Returns version of the model numbering + /** Returns version of the numbering model * * @return string Value */ @@ -138,7 +138,7 @@ abstract class ModeleNumRefSuppliersOrders /** - * Create a document onto disk according to template module. + * Create a document onto disk according to template model. * * @param DoliDB $db Database handler * @param Object $object Object supplier order @@ -164,7 +164,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet $srctemplatepath=''; - // Set the model on the model name to use + // Sets the model on the model name to use if (! dol_strlen($modele)) { if (! empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) @@ -195,7 +195,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet { $file = $prefix."_".$modele.".modules.php"; - // We checked the location of the model + // We check the model location $file=dol_buildpath($reldir."core/modules/supplier_order/pdf/".$file,0); if (file_exists($file)) { @@ -229,7 +229,9 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $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 return 1;