From 6607f1ece42a3d1ce0d8a92662b5628f8497c6e4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 28 Jun 2010 13:31:49 +0000 Subject: [PATCH] Fix: move to external module --- htdocs/comm/propal.php | 49 +----- .../includes/modules/modMilestone.class.php | 145 ------------------ htdocs/milestone/img/object_milestone.png | Bin 602 -> 0 bytes htdocs/milestone/langs/fr_FR/milestone.lang | 9 -- htdocs/milestone/sql/llx_milestone.key.sql | 25 --- htdocs/milestone/sql/llx_milestone.sql | 35 ----- htdocs/milestone/sql/llx_milestonedet.key.sql | 29 ---- htdocs/milestone/sql/llx_milestonedet.sql | 27 ---- 8 files changed, 2 insertions(+), 317 deletions(-) delete mode 100644 htdocs/includes/modules/modMilestone.class.php delete mode 100644 htdocs/milestone/img/object_milestone.png delete mode 100644 htdocs/milestone/langs/fr_FR/milestone.lang delete mode 100644 htdocs/milestone/sql/llx_milestone.key.sql delete mode 100644 htdocs/milestone/sql/llx_milestone.sql delete mode 100644 htdocs/milestone/sql/llx_milestonedet.key.sql delete mode 100644 htdocs/milestone/sql/llx_milestonedet.sql 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 '
'; - print ''; - print ''; - print ''; - - // Label - print ''; - print ''; - print 'trans('Label')).'" '.addHelpMessage("milestone_label",$langs->trans('Label')).'>'; - print ''; - - print ''; - print ''; - print ''; - - print ''; - - // Description - print ''; - print ''; - - // Editor wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('milestone_desc',(!empty($milestone_error)?$_POST["milestone_desc"]:''),100,'dolibarr_details'); - $doleditor->Create(); - } - else - { - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - print ''; - } - print ''; - 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 b3a1c8bcb0045d3009279b01b5e34ec051eca62e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 602 zcmV-g0;TB;QQM`m?c zf)ZB2gP^wWpym?rrU*jDi-@3@U4j8K3vseD>7H(@ zDw9PmD7w4)z500F&SWxyjah3!Ykk=m^FT^@1zlqJBc31O-D@F)C0w`L1quJ!O~-Lw zCP@N85CHB0Ndu+Spe)N*nDiE6N&*VH{L7!jaSTxuf$O@*aVqTl{tc}73^{xM6VD-d zuhnXC%T3!R=hTAnz zBS_&~v})3zNl4mp#hG{)9u@n=nYZUd=lWf!!w5kNK?sCRd-$tx3@coG60s(_R_-j4 zgKM+phfDFp7f^I|!QbsbEE7zPB-sLu*_Ff1&U?s o-$2T%3s;e}LiNli;`|X{0Puo7Y^0f+4FCWD07*qoM6N<$f{Wf3h5!Hn 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; -