Skip to content
Snippets Groups Projects
Commit 6607f1ec authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: move to external module

parent c26e48af
No related branches found
No related tags found
No related merge requests found
......@@ -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 '<tr class="liste_titre">';
print '<td>';
print $langs->trans('AddMilestone').'</td>';
print '<td colspan="10">&nbsp;</td>';
print "</tr>\n";
// Add milestone form
print '<form action="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="propalid" value="'.$propal->id.'">';
print '<input type="hidden" name="action" value="addmilestone">';
// Label
print '<tr '.$bc[$var].'>';
print '<td colspan="5">';
print '<input size="30" type="text" id="milestone_label" name="milestone_label" value="'.(!empty($milestone_error)?$_POST["milestone_label"]:$langs->trans('Label')).'" '.addHelpMessage("milestone_label",$langs->trans('Label')).'>';
print '</td>';
print '<td align="center" valign="middle" rowspan="2" colspan="4">';
print '<input type="submit" class="button" value="'.$langs->trans('Add').'" name="addmilestone">';
print '</td>';
print '</tr>';
// Description
print '<tr '.$bc[$var].'>';
print '<td colspan="5">';
// 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 '<textarea cols="70" id="milestone_desc" name="milestone_desc" rows="'.$nbrows.'" class="flat" '.addHelpMessage("milestone_desc",$langs->trans('Description')).'>';
print (!empty($milestone_error)?$_POST["milestone_desc"]:$langs->trans('Description'));
print '</textarea>';
}
print '</td></tr>';
print '</form>';
formAddMilestone($propal);
$var=!$var;
}
......
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
*
* 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/');
}
}
?>
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
# 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
-- ============================================================================
-- Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
--
-- 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);
-- ===========================================================================
-- Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
--
-- 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;
-- ============================================================================
-- Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
--
-- 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
-- ============================================================================
-- Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
--
-- 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;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment