diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 94747d8316e..20f99d495ec 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -37,6 +37,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
+if ($conf->milestone->enabled) require_once(DOL_DOCUMENT_ROOT.'/milestone/lib/milestone.lib.php');
$langs->load('companies');
$langs->load('propal');
@@ -1714,53 +1715,7 @@ if ($id > 0 || ! empty($ref))
if ($conf->milestone->enabled)
{
- $langs->load('@milestone');
-
- print '
';
- print '| ';
- print $langs->trans('AddMilestone').' | ';
- print ' | ';
- print "
\n";
-
- // Add milestone form
- print '';
+ formAddMilestone($propal);
$var=!$var;
}
diff --git a/htdocs/includes/modules/modMilestone.class.php b/htdocs/includes/modules/modMilestone.class.php
deleted file mode 100644
index 86056c70e08..00000000000
--- a/htdocs/includes/modules/modMilestone.class.php
+++ /dev/null
@@ -1,145 +0,0 @@
-
- *
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/**
- * \defgroup milestone Milestone module
- * \brief Module to manage milestones
- * \version $Id$
- */
-
-/**
- * \file htdocs/includes/modules/modMilestone.class.php
- * \ingroup milestone
- * \brief Fichier de description et activation du module Milestone
- */
-include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
-
-
-/**
- * \class modMilestone
- * \brief Classe de description et activation du module Milestone
- */
-class modMilestone extends DolibarrModules
-{
- /**
- * \brief Constructeur. definit les noms, constantes et boites
- * \param DB handler d'acces base
- */
- function modMilestone ($DB)
- {
- $this->db = $DB;
- $this->numero = 1790;
-
- $this->family = "technic";
- // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
- $this->name = preg_replace('/^mod/i','',get_class($this));
- $this->description = "Gestion des jalons (projets, contrats, propales, ...)";
-
- // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = 'development';
-
- $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 2;
- $this->picto = 'milestone@milestone';
-
- // Data directories to create when module is enabled
- $this->dirs = array();
-
- // Dependencies
- $this->depends = array();
-
- // Config pages
- $this->config_page_url = array();
- $this->langfiles = array("@milestone");
-
- // Constantes
- $this->const = array();
-
- // Boxes
- $this->boxes = array();
-
- // Permissions
- $this->rights = array();
- $this->rights_class = 'milestone';
-
- $r=0;
-
- $this->rights[$r][0] = 1791; // id de la permission
- $this->rights[$r][1] = 'Lire les jalons'; // libelle de la permission
- $this->rights[$r][2] = 'r'; // type de la permission (deprecated)
- $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
- $this->rights[$r][4] = 'lire';
- $r++;
-
- $this->rights[$r][0] = 1792; // id de la permission
- $this->rights[$r][1] = 'Creer/modifier les jalons'; // libelle de la permission
- $this->rights[$r][2] = 'w'; // type de la permission (deprecated)
- $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
- $this->rights[$r][4] = 'creer';
- $r++;
-
- $this->rights[$r][0] = 1793; // id de la permission
- $this->rights[$r][1] = 'Supprimer les jalons'; // libelle de la permission
- $this->rights[$r][2] = 'd'; // type de la permission (deprecated)
- $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
- $this->rights[$r][4] = 'supprimer';
- $r++;
-
- }
-
-
- /**
- * \brief Function called when module is enabled.
- * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
- * It also creates data directories.
- * \return int 1 if OK, 0 if KO
- */
- function init()
- {
- $sql = array();
-
- $result=$this->load_tables();
-
- return $this->_init($sql);
- }
-
- /**
- * \brief Function called when module is disabled.
- * Remove from database constants, boxes and permissions from Dolibarr database.
- * Data directories are not deleted.
- * \return int 1 if OK, 0 if KO
- */
- function remove()
- {
- $sql = array();
-
- return $this->_remove($sql);
- }
-
- /**
- * \brief Create tables and keys required by module
- * This function is called by this->init.
- * \return int <=0 if KO, >0 if OK
- */
- function load_tables()
- {
- return $this->_load_tables('/milestone/sql/');
- }
-
-}
-?>
diff --git a/htdocs/milestone/img/object_milestone.png b/htdocs/milestone/img/object_milestone.png
deleted file mode 100644
index b3a1c8bcb00..00000000000
Binary files a/htdocs/milestone/img/object_milestone.png and /dev/null differ
diff --git a/htdocs/milestone/langs/fr_FR/milestone.lang b/htdocs/milestone/langs/fr_FR/milestone.lang
deleted file mode 100644
index 4d9215be304..00000000000
--- a/htdocs/milestone/langs/fr_FR/milestone.lang
+++ /dev/null
@@ -1,9 +0,0 @@
-# Dolibarr language file - fr_FR - milestone
-CHARSET=UTF-8
-
-Module1790Name= Jalons
-Module1790Desc= Gestion des jalons (projets, contrats, propales, ...)
-
-Milestone=Jalon
-Milestones=Jalons
-NewMilestone=Nouveau jalon
diff --git a/htdocs/milestone/sql/llx_milestone.key.sql b/htdocs/milestone/sql/llx_milestone.key.sql
deleted file mode 100644
index e7cfe547263..00000000000
--- a/htdocs/milestone/sql/llx_milestone.key.sql
+++ /dev/null
@@ -1,25 +0,0 @@
--- ============================================================================
--- Copyright (C) 2010 Regis Houssin
---
--- 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
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
---
--- $Id$
---
--- ============================================================================
-
-
-ALTER TABLE llx_milestone ADD INDEX idx_milestone_fk_user_creat (fk_user_creat);
-
-ALTER TABLE llx_milestone ADD CONSTRAINT fk_milestone_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
diff --git a/htdocs/milestone/sql/llx_milestone.sql b/htdocs/milestone/sql/llx_milestone.sql
deleted file mode 100644
index 0cfa8506f72..00000000000
--- a/htdocs/milestone/sql/llx_milestone.sql
+++ /dev/null
@@ -1,35 +0,0 @@
--- ===========================================================================
--- Copyright (C) 2010 Regis Houssin
---
--- 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
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
---
--- $Id$
--- ===========================================================================
-
-create table llx_milestone
-(
- rowid integer AUTO_INCREMENT PRIMARY KEY,
- fk_element integer NOT NULL,
- elementtype varchar(16) NOT NULL,
- label varchar(255) NOT NULL,
- description text,
- datec datetime, -- date creation
- tms timestamp, -- date creation/modification
- dateo datetime, -- date start milestone
- datee datetime, -- date end milestone
- priority integer DEFAULT 0, -- priority
- fk_user_creat integer, -- user who created the milestone
- rang integer DEFAULT 0
-)type=innodb;
diff --git a/htdocs/milestone/sql/llx_milestonedet.key.sql b/htdocs/milestone/sql/llx_milestonedet.key.sql
deleted file mode 100644
index 62801f4c075..00000000000
--- a/htdocs/milestone/sql/llx_milestonedet.key.sql
+++ /dev/null
@@ -1,29 +0,0 @@
--- ============================================================================
--- Copyright (C) 2010 Regis Houssin
---
--- 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
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
---
--- $Id$
--- ============================================================================
-
-
-ALTER TABLE llx_milestonedet ADD UNIQUE INDEX idx_milestonedet_idx1 (fk_milestone, fk_element_line);
-
-ALTER TABLE llx_milestonedet ADD INDEX idx_milestonedet_fk_milestone (fk_milestone);
-
-ALTER TABLE llx_milestonedet ADD CONSTRAINT fk_milestonedet_fk_milestone FOREIGN KEY (fk_milestone) REFERENCES llx_milestone(rowid);
-
--- Pas de contrainte sur fk_element_line car pointe sur differentes tables
-
\ No newline at end of file
diff --git a/htdocs/milestone/sql/llx_milestonedet.sql b/htdocs/milestone/sql/llx_milestonedet.sql
deleted file mode 100644
index ad72c118120..00000000000
--- a/htdocs/milestone/sql/llx_milestonedet.sql
+++ /dev/null
@@ -1,27 +0,0 @@
--- ============================================================================
--- Copyright (C) 2010 Regis Houssin
---
--- 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
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
---
--- $Id$
--- ============================================================================
-
-create table llx_milestonedet
-(
- rowid integer AUTO_INCREMENT PRIMARY KEY,
- fk_milestone integer NOT NULL,
- fk_element_line integer NOT NULL
-) type=innodb;
-