Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Regis Houssin 2012-03-15 16:02:43 +01:00
commit d296f17f36
10 changed files with 187 additions and 15 deletions

View File

@ -105,6 +105,7 @@ $categ = array();
$dirmod = array(); $dirmod = array();
$i = 0; // is a sequencer of modules found $i = 0; // is a sequencer of modules found
$j = 0; // j is module number. Automatically affected if module number not defined. $j = 0; // j is module number. Automatically affected if module number not defined.
$modNameLoaded=array();
foreach ($modulesdir as $dir) foreach ($modulesdir as $dir)
{ {
@ -123,10 +124,18 @@ foreach ($modulesdir as $dir)
if ($modName) if ($modName)
{ {
if (! empty($modNameLoaded[$modName]))
{
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
dol_syslog($mesg, LOG_ERR);
continue;
}
try try
{ {
$res=include_once($dir.$file); $res=include_once($dir.$file);
$objMod = new $modName($db); $objMod = new $modName($db);
$modNameLoaded[$modName]=$dir;
if ($objMod->numero > 0) if ($objMod->numero > 0)
{ {

View File

@ -27,6 +27,9 @@
* \brief File of class to manage contract numbering * \brief File of class to manage contract numbering
*/ */
/**
* Parent class for all contract numbering modules
*/
class ModelNumRefContracts class ModelNumRefContracts
{ {
var $error=''; var $error='';

View File

@ -156,7 +156,7 @@ function don_create($db, $id, $message, $modele, $outputlangs)
$dir = DOL_DOCUMENT_ROOT . "/core/modules/dons/"; $dir = DOL_DOCUMENT_ROOT . "/core/modules/dons/";
// Positionne modele sur le nom du modele <20> utiliser // Set template to use
if (! dol_strlen($modele)) if (! dol_strlen($modele))
{ {
if ($conf->global->DON_ADDON_MODEL) if ($conf->global->DON_ADDON_MODEL)

View File

@ -72,36 +72,71 @@ class ExportCsv extends ModeleExports
} }
/**
* getDriverId
*
* @return int
*/
function getDriverId() function getDriverId()
{ {
return $this->id; return $this->id;
} }
/**
* getDriverLabel
*
* @return string
*/
function getDriverLabel() function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
/**
* getDriverDesc
*
* @return string
*/
function getDriverDesc() function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
/**
* getDriverExtension
*
* @return string
*/
function getDriverExtension() function getDriverExtension()
{ {
return $this->extension; return $this->extension;
} }
/**
* getDriverVersion
*
* @return string
*/
function getDriverVersion() function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
/**
* getLabelLabel
*
* @return string
*/
function getLibLabel() function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
/**
* getLibVersion
*
* @return string
*/
function getLibVersion() function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;

View File

@ -71,36 +71,71 @@ class ExportExcel extends ModeleExports
$this->row=0; $this->row=0;
} }
/**
* getDriverId
*
* @return int
*/
function getDriverId() function getDriverId()
{ {
return $this->id; return $this->id;
} }
/**
* getDriverLabel
*
* @return string
*/
function getDriverLabel() function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
/**
* getDriverDesc
*
* @return string
*/
function getDriverDesc() function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
/**
* getDriverExtension
*
* @return string
*/
function getDriverExtension() function getDriverExtension()
{ {
return $this->extension; return $this->extension;
} }
/**
* getDriverVersion
*
* @return string
*/
function getDriverVersion() function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
/**
* getLibLabel
*
* @return string
*/
function getLibLabel() function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
/**
* getLibVersion
*
* @return string
*/
function getLibVersion() function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;

View File

@ -72,36 +72,71 @@ class ExportExcel2007 extends ExportExcel
$this->row=0; $this->row=0;
} }
/**
* getDriverLabel
*
* @return int
*/
function getDriverId() function getDriverId()
{ {
return $this->id; return $this->id;
} }
/**
* getDriverLabel
*
* @return string
*/
function getDriverLabel() function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
/**
* getDriverDesc
*
* @return string
*/
function getDriverDesc() function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
/**
* getDriverExtension
*
* @return string
*/
function getDriverExtension() function getDriverExtension()
{ {
return $this->extension; return $this->extension;
} }
/**
* getDriverVersion
*
* @return string
*/
function getDriverVersion() function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
/**
* getLibLabel
*
* @return string
*/
function getLibLabel() function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
/**
* getLibVersion
*
* @return string
*/
function getLibVersion() function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;

View File

@ -66,36 +66,71 @@ class ExportTsv extends ModeleExports
$this->version_lib=DOL_VERSION; $this->version_lib=DOL_VERSION;
} }
/**
* getDriverId
*
* @return int
*/
function getDriverId() function getDriverId()
{ {
return $this->id; return $this->id;
} }
/**
* getDriverLabel
*
* @return string
*/
function getDriverLabel() function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
/**
* getDriverDesc
*
* @return string
*/
function getDriverDesc() function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
/**
* getDriverExtension
*
* @return string
*/
function getDriverExtension() function getDriverExtension()
{ {
return $this->extension; return $this->extension;
} }
/**
* getDriverVersion
*
* @return string
*/
function getDriverVersion() function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
/**
* getLibLabel
*
* @return string
*/
function getLibLabel() function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
/**
* getLibVersion
*
* @return string
*/
function getLibVersion() function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;

View File

@ -92,7 +92,10 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
/** /**
* \brief Return picto of export driver * Return picto of export driver
*
* @param string $key Key of driver
* @return string Picto string
*/ */
function getPicto($key) function getPicto($key)
{ {
@ -100,7 +103,10 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
} }
/** /**
* \brief Renvoi libelle d'un driver export * Renvoi libelle d'un driver export
*
* @param string $key Key of driver
* @return string Label
*/ */
function getDriverLabel($key) function getDriverLabel($key)
{ {
@ -108,7 +114,10 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
} }
/** /**
* \brief Renvoi le descriptif d'un driver export * Renvoi le descriptif d'un driver export
*
* @param string $key Key of driver
* @return string Description
*/ */
function getDriverDesc($key) function getDriverDesc($key)
{ {
@ -116,7 +125,10 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
} }
/** /**
* \brief Renvoi version d'un driver export * Renvoi version d'un driver export
*
* @param string $key Key of driver
* @return string Driver version
*/ */
function getDriverVersion($key) function getDriverVersion($key)
{ {
@ -124,7 +136,10 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
} }
/** /**
* \brief Renvoi libelle de librairie externe du driver * Renvoi libelle de librairie externe du driver
*
* @param string $key Key of driver
* @return string Label of library
*/ */
function getLibLabel($key) function getLibLabel($key)
{ {
@ -132,7 +147,10 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
} }
/** /**
* \brief Renvoi version de librairie externe du driver * Renvoi version de librairie externe du driver
*
* @param string $key Key of driver
* @return string Version of library
*/ */
function getLibVersion($key) function getLibVersion($key)
{ {

View File

@ -695,11 +695,13 @@ if ($action == 'create')
$langs->load("project"); $langs->load("project");
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
/* Fix: If a project must be linked to any companies (suppliers or not), project must be not be set as limited to customer but must be not linked to any particular thirdparty
if ($societe->fournisseur==1) if ($societe->fournisseur==1)
$numprojet=select_projects(-1,$_POST["projectid"],'projectid'); $numprojet=select_projects(-1,$_POST["projectid"],'projectid');
else else
$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid'); $numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
//$numprojet=select_projects($soc->id,GETPOST('projectid','int'),'projectid'); */
$numprojet=select_projects($soc->id,GETPOST('projectid','int'),'projectid');
if ($numprojet==0) if ($numprojet==0)
{ {
print ' &nbsp; <a href="'.DOL_DOCUMENT_ROOT.'/projet/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>'; print ' &nbsp; <a href="'.DOL_DOCUMENT_ROOT.'/projet/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>';

View File

@ -272,7 +272,7 @@ ALTER TABLE llx_product_extrafields ADD COLUMN import_key varchar(14);
ALTER TABLE llx_societe_extrafields ADD COLUMN import_key varchar(14); ALTER TABLE llx_societe_extrafields ADD COLUMN import_key varchar(14);
-- Disable foreign key checks for external modules constraints -- Disable foreign key checks for external modules constraints
SET FOREIGN_KEY_CHECKS=0; --SET FOREIGN_KEY_CHECKS=0;
DROP TABLE llx_c_currencies; DROP TABLE llx_c_currencies;
create table llx_c_currencies create table llx_c_currencies
@ -425,7 +425,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XEU'
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARP', NULL, 0, 'Pesos argentins'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARP', NULL, 0, 'Pesos argentins');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MXP', NULL, 0, 'Pesos Mexicans'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MXP', NULL, 0, 'Pesos Mexicans');
SET FOREIGN_KEY_CHECKS=1; --SET FOREIGN_KEY_CHECKS=1;
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso); ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso);
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso); ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso);