This commit is contained in:
Laurent Destailleur 2009-07-22 20:42:31 +00:00
parent 68fd815137
commit 41b1f422b2

View File

@ -22,119 +22,117 @@
*/ */
/** /**
\defgroup agenda Module agenda * \defgroup agenda Module agenda
\brief Module pour gerer l'agenda et actions * \brief Module pour gerer l'agenda et actions
\brief $Id$ * \brief $Id$
*/ */
/** /**
\file htdocs/includes/modules/modAgenda.class.php * \file htdocs/includes/modules/modAgenda.class.php
\ingroup agenda * \ingroup agenda
\brief Fichier de description et activation du module agenda * \brief Fichier de description et activation du module agenda
*/ */
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
/** /**
\class modAdherent * \class modAdherent
\brief Classe de description et activation du module Adherent * \brief Classe de description et activation du module Adherent
*/ */
class modAgenda extends DolibarrModules class modAgenda extends DolibarrModules
{ {
/** /**
* \brief Constructeur. Definit les noms, constantes et boites * \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'acces base * \param DB handler d'acces base
*/ */
function modAgenda($DB) function modAgenda($DB)
{ {
$this->db = $DB; $this->db = $DB;
$this->numero = 2400; $this->numero = 2400;
$this->family = "projects"; $this->family = "projects";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = eregi_replace('^mod','',get_class($this)); $this->name = eregi_replace('^mod','',get_class($this));
$this->description = "Gestion de l'agenda et des actions"; $this->description = "Gestion de l'agenda et des actions";
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0; $this->special = 0;
$this->picto='calendar'; $this->picto='calendar';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/agenda/temp"); $this->dirs = array("/agenda/temp");
// Config pages // Config pages
//------------- //-------------
$this->config_page_url = array("agenda.php"); $this->config_page_url = array("agenda.php");
// Dependancies // Dependancies
//------------- //-------------
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();
$this->langfiles = array("companies"); $this->langfiles = array("companies");
// Constantes // Constantes
//----------- //-----------
$this->const = array(); $this->const = array();
// New pages on tabs // New pages on tabs
// ----------------- // -----------------
$this->tabs = array(); $this->tabs = array();
// Boxes // Boxes
//------ //------
$this->boxes = array(); $this->boxes = array();
$this->boxes[0][1] = "box_actions.php"; $this->boxes[0][1] = "box_actions.php";
// Permissions // Permissions
//------------ //------------
$this->rights = array(); $this->rights = array();
$this->rights_class = 'agenda'; $this->rights_class = 'agenda';
$r=0; $r=0;
// $this->rights[$r][0] Id permission (unique tous modules confondus) // $this->rights[$r][0] Id permission (unique tous modules confondus)
// $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) // $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission)
// $this->rights[$r][2] Non utilise // $this->rights[$r][2] Non utilise
// $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut
// $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][4] Niveau 1 pour nommer permission dans code
// $this->rights[$r][5] Niveau 2 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code
// $r++; // $r++;
$this->rights[$r][0] = 2401; $this->rights[$r][0] = 2401;
$this->rights[$r][1] = 'Read actions/tasks linked to his account'; $this->rights[$r][1] = 'Read actions/tasks linked to his account';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'myactions'; $this->rights[$r][4] = 'myactions';
$this->rights[$r][5] = 'read'; $this->rights[$r][5] = 'read';
$r++; $r++;
$this->rights[$r][0] = 2402; $this->rights[$r][0] = 2402;
$this->rights[$r][1] = 'Create/modify/delete actions/tasks linked to his account'; $this->rights[$r][1] = 'Create/modify/delete actions/tasks linked to his account';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'myactions'; $this->rights[$r][4] = 'myactions';
$this->rights[$r][5] = 'create'; $this->rights[$r][5] = 'create';
$r++; $r++;
$this->rights[$r][0] = 2403; $this->rights[$r][0] = 2403;
$this->rights[$r][1] = 'Read actions/tasks of others'; $this->rights[$r][1] = 'Read actions/tasks of others';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'allactions'; $this->rights[$r][4] = 'allactions';
$this->rights[$r][5] = 'read'; $this->rights[$r][5] = 'read';
$r++; $r++;
$this->rights[$r][0] = 2405; $this->rights[$r][0] = 2405;
$this->rights[$r][1] = 'Create/modify/delete actions/tasks of others'; $this->rights[$r][1] = 'Create/modify/delete actions/tasks of others';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'allactions'; $this->rights[$r][4] = 'allactions';
$this->rights[$r][5] = 'create'; $this->rights[$r][5] = 'create';
$r++; $r++;
// Menus // Menus
//------ //------
$r=0; $r=0;
@ -153,44 +151,44 @@ class modAgenda extends DolibarrModules
$r++; $r++;
// Exports // Exports
//-------- //--------
$r=0; $r=0;
// $this->export_code[$r] Code unique identifiant l'export (tous modules confondus) // $this->export_code[$r] Code unique identifiant l'export (tous modules confondus)
// $this->export_label[$r] Libelle par defaut si traduction de cle "ExportXXX" non trouvee (XXX = Code) // $this->export_label[$r] Libelle par defaut si traduction de cle "ExportXXX" non trouvee (XXX = Code)
// $this->export_permission[$r] Liste des codes permissions requis pour faire l'export // $this->export_permission[$r] Liste des codes permissions requis pour faire l'export
// $this->export_fields_sql[$r] Liste des champs exportables en codif sql // $this->export_fields_sql[$r] Liste des champs exportables en codif sql
// $this->export_fields_name[$r] Liste des champs exportables en codif traduction // $this->export_fields_name[$r] Liste des champs exportables en codif traduction
// $this->export_sql[$r] Requete sql qui offre les donnees a l'export // $this->export_sql[$r] Requete sql qui offre les donnees a l'export
} }
/** /**
* \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module.
* Definit egalement les repertoires de donnees a creer pour ce module. * Definit egalement les repertoires de donnees a creer pour ce module.
* \param options Options when enabling module * \param options Options when enabling module
*/ */
function init($options='') function init($options='')
{ {
// Prevent pb of modules not correctly disabled // Prevent pb of modules not correctly disabled
//$this->remove($options); //$this->remove($options);
$sql = array(); $sql = array();
return $this->_init($sql,$options); return $this->_init($sql,$options);
} }
/** /**
* \brief Fonction appelee lors de la desactivation d'un module. * \brief Fonction appelee lors de la desactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module. * Supprime de la base les constantes, boites et permissions du module.
* \param options Options when disabling module * \param options Options when disabling module
*/ */
function remove($options='') function remove($options='')
{ {
$sql = array(); $sql = array();
return $this->_remove($sql,$options); return $this->_remove($sql,$options);
} }
} }
?> ?>