/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modClickToDial($db) { parent::__construct($db); $this->numero = 58; $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 du Click To Dial"; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 1; $this->picto = 'phoning'; // Data directories to create when module is enabled $this->dirs = array(); // Dependencies $this->depends = array(); $this->requiredby = array(); // Config pages $this->config_page_url = array("clicktodial.php"); // Constants $this->const = array(); // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'clicktodial'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modFckeditor($db) { parent::__construct($db); $this->numero = 2000; $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 = "Editeur WYSIWYG"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 2; // Name of png file (without png) used for this module. // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. $this->picto = 'list'; // Data directories to create when module is enabled $this->dirs = array("/fckeditor/temp", "/fckeditor/image"); // Config pages $this->config_page_url = array("fckeditor.php"); // Dependances $this->depends = array(); $this->requiredby = array(); // Constantes $this->const = array(); $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "Activation fckeditor sur notes autres"); $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "Activation fckeditor sur notes produits"); $this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "Activation fckeditor sur emailing"); // Boites $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'fckeditor'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modNotification($db) { parent::__construct($db); $this->numero = 600; $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 notifications (par mail) sur evenement Dolibarr"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 1; $this->picto = 'email'; // Data directories to create when module is enabled. $this->dirs = array(); // Dependances $this->depends = array(); $this->requiredby = array(); $this->langfiles = array("mails"); // Config pages $this->config_page_url = array("notification.php"); // Constantes $this->const = array(); // Boites $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'notification'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modMailmanSpip($db) { parent::__construct($db); $this->numero = 105; $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 = "Mailman or Spip interface for member module"; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 1; $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array(); // Dependencies $this->depends = array('modAdherent'); $this->requiredby = array(); // Config pages $this->config_page_url = array('mailman.php@adherents'); // Constants $this->const = array(); $this->const[1] = array("ADHERENT_MAILMAN_UNSUB_URL", "chaine", "http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%", "Url de désinscription aux listes mailman"); $this->const[2] = array("ADHERENT_MAILMAN_URL", "chaine", "http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%", "Url pour les inscriptions mailman"); $this->const[3] = array("ADHERENT_MAILMAN_LISTS", "chaine", "", "Mailing-list to subscribe new members to"); // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'clicktodial'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modSyslog($db) { parent::__construct($db); $this->numero = 42; // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "base"; // 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)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Activate debug logs (syslog)"; // Can be enabled / disabled only in the main company $this->core_enabled = 1; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'speedealing'; // 'experimental' or 'dolibarr' or version // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 2; // Name of image file used for this module. $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array(); // Config pages $this->config_page_url = array("syslog.php"); // Dependances $this->depends = array(); $this->requiredby = array(); // Constantes $this->const = array(); // Boites $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'syslog'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modExternalRss($db) { global $conf; parent::__construct($db); $this->numero = 320; $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 = "Ajout de files d'informations RSS dans les ecrans Dolibarr"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 1; $this->picto = 'rss'; // Data directories to create when module is enabled $this->dirs = array("/externalrss/temp"); // Config pages $this->config_page_url = array("external_rss.php"); // Dependances $this->depends = array(); $this->requiredby = array(); $this->phpmin = array(4, 2, 0); $this->phpmax = array(); // Constantes $this->const = array(); // Boxes $this->boxes = array(); // Les boites sont ajoutees lors de la configuration des flux // Permissions $this->rights = array(); $this->rights_class = 'externalrss'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modComptabilite($db) { global $conf; parent::__construct($db); $this->numero = 10; $this->family = "financial"; // 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 sommaire de comptabilite"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->picto = ''; // Config pages $this->config_page_url = array("compta.php"); // Dependances $this->depends = array("modFacture", "modBanque"); $this->requiredby = array(); $this->conflictwith = array("modAccounting"); $this->langfiles = array("compta"); // Constantes $this->const = array(); // Data directories to create when module is enabled $this->dirs = array("/comptabilite/temp", "/comptabilite/rapport", "/comptabilite/export", "/comptabilite/bordereau"); // Boites $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'compta'; $r = 0; $r++; $this->rights[$r][0] = 95; $this->rights[$r][1] = 'Lire CA, bilans, resultats'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'resultat'; $this->rights[$r][5] = 'lire'; $r++; $this->rights[$r][0] = 96; $this->rights[$r][1] = 'Parametrer la ventilation'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'ventilation'; $this->rights[$r][5] = 'parametrer'; $r++; $this->rights[$r][0] = 97; $this->rights[$r][1] = 'Lire les ventilations de factures'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'ventilation'; $this->rights[$r][5] = 'lire'; $r++; $this->rights[$r][0] = 98; $this->rights[$r][1] = 'Ventiler les lignes de factures'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'ventilation'; $this->rights[$r][5] = 'creer'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modLdap($db) { parent::__construct($db); $this->numero = 200; $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 = "Synchronisation Ldap"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 1; // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png' $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array("/ldap/temp"); // Config pages $this->config_page_url = array("ldap.php"); // Dependancies $this->depends = array(); $this->requiredby = array(); // Constants $this->const = array(0 => array('LDAP_SERVER_TYPE', 'chaine', 'openldap', '', 0), 1 => array('LDAP_SERVER_PROTOCOLVERSION', 'chaine', '3', '', 0), 2 => array('LDAP_SERVER_HOST', 'chaine', 'localhost', '', 0), 3 => array('LDAP_USER_DN', 'chaine', 'ou=users,dc=my-domain,dc=com', '', 0), 4 => array('LDAP_GROUP_DN', 'chaine', 'ou=groups,dc=my-domain,dc=com', '', 0), 5 => array('LDAP_FILTER_CONNECTION', 'chaine', '&(objectClass=user)(objectCategory=person)', '', 0), 6 => array('LDAP_FIELD_LOGIN', 'chaine', 'uid', '', 0), 7 => array('LDAP_FIELD_FULLNAME', 'chaine', 'cn', '', 0), 8 => array('LDAP_FIELD_NAME', 'chaine', 'sn', '', 0), 9 => array('LDAP_FIELD_FIRSTNAME', 'chaine', 'givenname', '', 0), 10 => array('LDAP_FIELD_MAIL', 'chaine', 'mail', '', 0), 11 => array('LDAP_FIELD_PHONE', 'chaine', 'telephonenumber', '', 0), 12 => array('LDAP_FIELD_FAX', 'chaine', 'facsimiletelephonenumber', '', 0), 13 => array('LDAP_FIELD_MOBILE', 'chaine', 'mobile', '', 0)); // Boites $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'ldap'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modBarcode($db) { parent::__construct($db); $this->numero = 55; $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 codes barres"; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 2; $this->picto = 'barcode'; // Data directories to create when module is enabled $this->dirs = array("/barcode/temp"); // Dependances $this->depends = array(); // May be used for product or service or third party module $this->requiredby = array(); // Config pages $this->config_page_url = array("barcode.php"); // Constants // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); $this->const = array(); // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'barcode'; $this->rights[1][0] = 300; // id de la permission $this->rights[1][1] = 'Lire les codes barres'; // libelle de la permission $this->rights[1][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[1][3] = 1; // La permission est-elle une permission par defaut $this->rights[1][4] = 'lire'; $this->rights[2][0] = 301; // id de la permission $this->rights[2][1] = 'Creer/modifier les codes barres'; // libelle de la permission $this->rights[2][2] = 'w'; // type de la permission (deprecie a ce jour) $this->rights[2][3] = 0; // La permission est-elle une permission par defaut $this->rights[2][4] = 'creer'; $this->rights[4][0] = 302; // id de la permission $this->rights[4][1] = 'Supprimer les codes barres'; // libelle de la permission $this->rights[4][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[4][3] = 0; // La permission est-elle une permission par defaut $this->rights[4][4] = 'supprimer'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modExternalSite($db) { parent::__construct($db); // Id for module (must be unique). // Use here a free id. $this->numero = 100; // Family can be 'crm','financial','hr','projects','product','technic','other' // It is used to sort modules in module setup page $this->family = "other"; // 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)); // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value) $this->description = "Include any external web site into Dolibarr menus and view it into a Dolibarr frame."; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (XXX is id value) $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=other) $this->special = 1; // Name of png file (without png) used for this module $this->picto = 'bookmark'; // Call to inside lang's file $this->langfiles = array("@externalsite"); // Data directories to create when module is enabled $this->dirs = array(); // Config pages. Put here list of php page names stored in admmin directory used to setup module $this->config_page_url = array("externalsite.php@externalsite"); // Dependencies $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled // Constants $this->const = array(); // List of parameters // Boxes $this->boxes = array(); // List of boxes $r = 0; // Add here list of php file(s) stored in core/boxes that contains class to show a box. // Example: //$this->boxes[$r][1] = "myboxa.php"; //$r++; //$this->boxes[$r][1] = "myboxb.php"; //$r++; // Permissions $this->rights_class = 'externalsite'; // Permission key $this->rights = array(); // Permission array used by this module // Menus //------ $r = 0; $this->menu[$r] = array('fk_menu' => 0, 'type' => 'top', 'titre' => 'ExternalSites', 'mainmenu' => 'externalsite', 'url' => '/externalsite/frames.php', 'langs' => 'other', 'position' => 100, 'perms' => '', 'enabled' => '$conf->externalsite->enabled', 'target' => '', 'user' => 0); $r++; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modDon($db) { parent::__construct($db); $this->numero = 700; $this->family = "financial"; // 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 dons"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; // Name of png file (without png) used for this module. // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. $this->picto = 'bill'; // Data directories to create when module is enabled $this->dirs = array("/dons/temp"); // Dependancies $this->depends = array(); $this->requiredby = array(); // Config pages $this->config_page_url = array("dons.php"); // Constants $this->const = array(); $r = 0; $this->const[$r][0] = "DON_ADDON_MODEL"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "html_cerfafr"; $this->const[$r][3] = 'Nom du gestionnaire de generation de recu de dons'; $this->const[$r][4] = 0; $r++; // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'don'; $this->rights[1][0] = 701; $this->rights[1][1] = 'Lire les dons'; $this->rights[1][2] = 'r'; $this->rights[1][3] = 1; $this->rights[1][4] = 'lire'; $this->rights[2][0] = 702; $this->rights[2][1] = 'Creer/modifier les dons'; $this->rights[2][2] = 'w'; $this->rights[2][3] = 0; $this->rights[2][4] = 'creer'; $this->rights[3][0] = 703; $this->rights[3][1] = 'Supprimer les dons'; $this->rights[3][2] = 'd'; $this->rights[3][3] = 0; $this->rights[3][4] = 'supprimer'; }
/** * \brief Constructeur. Definit les noms, constantes et boites * \param DB Database handler */ function modMap($DB) { parent::__construct($DB); $this->numero = 450; $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 = "Carthographie"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->picto = 'globe'; $this->moddir = "map"; //directory for module in htdocs : test index.php presence // Data directories to create when module is enabled $this->dirs = array(); // Config pages //------------- $this->config_page_url = array("map.php@map"); // Dependances //------------ $this->depends = array(); $this->requiredby = array(); $this->langfiles = array("map@map", "companies"); // Constantes //----------- $this->const = array(); $this->const[0] = array("MAP_SYSTEM", "texte", "openlayers"); // Boites //------- $this->boxes = array(); // Menu //------------ // None // Permissions //------------ $this->rights = array(); $this->rights_class = 'map'; $r = 0; // $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][2] Non utilise // $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][5] Niveau 2 pour nommer permission dans code $this->rights[$r][0] = 451; $this->rights[$r][1] = 'See map'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'read'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modLabel($db) { parent::__construct($db); $this->numero = 60; $this->family = "other"; // 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 etiquettes"; $this->version = 'development'; // 'development' or 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 2; $this->picto = 'label'; // Data directories to create when module is enabled $this->dirs = array("/label/temp"); // Dependancies $this->depends = array(); $this->requiredby = array(); // Config pages $this->config_page_url = array("label.php"); // Constants $this->const = array(); // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'label'; $this->rights[1][0] = 601; // id de la permission $this->rights[1][1] = 'Lire les etiquettes'; // libelle de la permission $this->rights[1][3] = 1; // La permission est-elle une permission par defaut $this->rights[1][4] = 'lire'; $this->rights[2][0] = 602; // id de la permission $this->rights[2][1] = 'Creer/modifier les etiquettes'; // libelle de la permission $this->rights[2][3] = 0; // La permission est-elle une permission par defaut $this->rights[2][4] = 'creer'; $this->rights[4][0] = 609; // id de la permission $this->rights[4][1] = 'Supprimer les etiquettes'; // libelle de la permission $this->rights[4][3] = 0; // La permission est-elle une permission par defaut $this->rights[4][4] = 'supprimer'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modExport($db) { parent::__construct($db); $this->numero = 240; $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 = "Outils d'exports de donnees Dolibarr (via un assistant)"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array("/export/temp"); // Config pages $this->config_page_url = array(); // Dependances $this->depends = array(); $this->requiredby = array(); $this->phpmin = array(4, 2, 0); $this->phpmax = array(); // Constantes $this->const = array(); // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'export'; $r = 0; $r++; $this->rights[$r][0] = 1201; $this->rights[$r][1] = 'Lire les exports'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 1202; $this->rights[$r][1] = 'Creer/modifier un export'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'creer'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modDocument($db) { parent::__construct($db); $this->numero = 51; $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 = "Generation de courriers/publipostages papiers"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'development'; $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->picto = 'email'; // Data directories to create when module is enabled $this->dirs = array("/document/temp"); // Config pages //$this->config_page_url = array("document.php"); // Dependencies $this->depends = array(); $this->requiredby = array(); $this->conflictwith = array(); $this->langfiles = array("orders", "bills", "companies"); // Constantes $this->const = array(); // Boites $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'document'; $r = 0; $this->rights[$r][0] = 511; $this->rights[$r][1] = 'Lire les documents'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 512; $this->rights[$r][1] = 'Supprimer les documents clients'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'supprimer'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modGeoIPMaxmind($db) { parent::__construct($db); $this->numero = 2900; // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $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)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "GeoIP Maxmind conversions capabilities"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // 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); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 1; // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png' $this->picto = 'globe'; // Data directories to create when module is enabled $this->dirs = array("/geoipmaxmind"); // Config pages $this->config_page_url = array("geoipmaxmind.php"); // D�pendances $this->depends = array(); $this->requiredby = array(); $this->phpmin = array(4, 2, 0); $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; // Constantes $this->const = array(); // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'geoipmaxmind'; $r = 0; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modImport($db) { parent::__construct($db); $this->numero = 250; $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 = "Outils d'imports de donnees Dolibarr (via un assistant)"; // Possible values for version are: 'experimental' or 'dolibarr' or version $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array("/import/temp"); // Config pages $this->config_page_url = array(); // D�pendances $this->depends = array(); $this->requiredby = array(); $this->phpmin = array(4, 3, 0); // Need auto_detect_line_endings php option to solve MAC pbs. $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; // Constantes $this->const = array(); // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'import'; $r = 0; $r++; $this->rights[$r][0] = 1251; $this->rights[$r][1] = 'Run mass imports of external data (data load)'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'run'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modWebServices($db) { parent::__construct($db); $this->numero = 2600; $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 = "Enable the Dolibarr web services server"; $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) $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 1; // Name of image file used for this module. $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array(); // Config pages //------------- $this->config_page_url = array("webservices.php@webservices"); // Dependancies //------------- $this->depends = array(); $this->requiredby = array(); $this->langfiles = array("other"); // Constantes //----------- $this->const = array(); // New pages on tabs // ----------------- $this->tabs = array(); // Boxes //------ $this->boxes = array(); // Permissions //------------ $this->rights = array(); $this->rights_class = 'webservices'; $r = 0; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modBoutique($db) { parent::__construct($db); $this->numero = 800; $this->family = "products"; // 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 = "Interface de visualisation d'une boutique OSCommerce ou OSCSS"; $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 1; // Data directories to create when module is enabled $this->dirs = array(); // Config pages // $this->config_page_url = array("boutique.php","osc-languages.php"); $this->config_page_url = array("boutique.php@boutique"); // Dependancies $this->depends = array(); $this->requiredby = array(); $this->conflictwith = array("modOSCommerceWS"); $this->langfiles = array("shop"); // Constants $this->const = array(); $r = 0; $this->const[$r][0] = "OSC_DB_HOST"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "localhost"; $this->const[$r][3] = "Host for OSC database for OSCommerce module 1"; $this->const[$r][4] = 0; $r++; // Boites $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'boutique'; }
$confirm = GETPOST("confirm"); $module = GETPOST("module"); // Defini si peux lire les permissions $canreadperms = ($user->admin || $user->rights->user->user->lire); // Defini si peux modifier les permissions $caneditperms = ($user->admin || $user->rights->user->user->creer); // Advanced permissions $canreadperms = ($user->admin || ($user->rights->user->group_advance->read && $user->rights->user->group_advance->readperms)); $caneditperms = ($user->admin || $user->rights->user->group_advance->write); if (!$canreadperms) accessforbidden(); $fgroup = new Usergroup($db); $object = new DolibarrModules($db); /** * Actions */ if ($action == 'add' && $caneditperms) { $editgroup = new Usergroup($db); try { $editgroup->load($id); $editgroup->values->rights->$_GET['pid'] = true; $editgroup->record(); } catch (Exception $e) { $mesg = $e->getMessage(); } Header("Location: " . $_SERVER['PHP_SELF'] . "?id=".$id."&mesg=" . urlencode($mesg));
* * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT . "/core/lib/functions2.lib.php"; require_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"; $langs->load("admin"); $langs->load("users"); $langs->load("other"); $action = GETPOST('action'); if (!$user->admin) { accessforbidden(); } $object = new DolibarrModules($db); /* * Actions */ if ($action == 'add') { try { $object->load($_GET['id']); $object->rights[$_GET['pid']]->default = true; $object->record(); dol_delcache("DolibarrModules:default_right"); } catch (Exception $e) { dol_print_error('', $e->getMessage()); } } if ($action == 'remove') { try {
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modProjet($db) { parent::__construct($db); $this->numero = 400; $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) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Gestion des projets"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->config_page_url = array("project.php"); $this->picto = 'project'; // Data directories to create when module is enabled $this->dirs = array("/projet/temp"); // Dependancies $this->depends = array(); $this->requiredby = array(); // Constants $this->const = array(); $r = 0; $this->const[$r][0] = "PROJECT_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "baleine"; $this->const[$r][3] = 'Nom du gestionnaire de generation des projets en PDF'; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "PROJECT_ADDON"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_project_simple"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des projets'; $this->const[$r][4] = 0; $r++; // Boxes $this->boxes = array(); // Permissions $this->rights = array(); $this->rights_class = 'projet'; $r = 0; $r++; $this->rights[$r][0] = 41; // id de la permission $this->rights[$r][1] = "Lire les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 42; // id de la permission $this->rights[$r][1] = "Creer/modifier les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 44; // id de la permission $this->rights[$r][1] = "Supprimer les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'supprimer'; $r++; $this->rights[$r][0] = 141; // id de la permission $this->rights[$r][1] = "Lire tous les projets et taches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'lire'; $r++; $this->rights[$r][0] = 142; // id de la permission $this->rights[$r][1] = "Creer/modifier tous les projets et taches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'creer'; $r++; $this->rights[$r][0] = 144; // id de la permission $this->rights[$r][1] = "Supprimer tous les projets et taches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'supprimer'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modCommande($db) { global $conf; parent::__construct($db); $this->numero = 25; $this->family = "crm"; // 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 commandes clients"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->picto = 'order'; // Data directories to create when module is enabled $this->dirs = array("/commande/temp"); // Config pages $this->config_page_url = array("commande.php"); // Dependancies $this->depends = array("modSociete"); $this->requiredby = array("modExpedition"); $this->conflictwith = array(); $this->langfiles = array("orders", "bills", "companies", "products"); // Constantes $this->const = array(); $r = 0; $this->const[$r][0] = "COMMANDE_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "einstein"; $this->const[$r][3] = 'Nom du gestionnaire de generation des commandes en PDF'; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "COMMANDE_ADDON"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_commande_marbre"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des commandes'; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "COMMANDE_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/orders"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; // Boites $this->boxes = array(); $this->boxes[0][1] = "box_commandes.php"; // Permissions $this->rights = array(); $this->rights_class = 'commande'; $r = 0; $r++; $this->rights[$r][0] = 81; $this->rights[$r][1] = 'Lire les commandes clients'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 82; $this->rights[$r][1] = 'Creer/modifier les commandes clients'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 84; $this->rights[$r][1] = 'Valider les commandes clients'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'valider'; $r++; $this->rights[$r][0] = 86; $this->rights[$r][1] = 'Envoyer les commandes clients'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'order_advance'; $this->rights[$r][5] = 'send'; $r++; $this->rights[$r][0] = 87; $this->rights[$r][1] = 'Cloturer les commandes clients'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'cloturer'; $r++; $this->rights[$r][0] = 88; $this->rights[$r][1] = 'Annuler les commandes clients'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'annuler'; $r++; $this->rights[$r][0] = 89; $this->rights[$r][1] = 'Supprimer les commandes clients'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'supprimer'; $r++; $this->rights[$r][0] = 1421; $this->rights[$r][1] = 'Exporter les commandes clients et attributs'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'commande'; $this->rights[$r][5] = 'export'; // Exports //-------- $r = 0; $r++; $this->export_code[$r] = $this->rights_class . '_' . $r; $this->export_label[$r] = 'CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("commande", "commande", "export")); $this->export_fields_array[$r] = array('s.rowid' => "IdCompany", 's.nom' => 'CompanyName', 's.address' => 'Address', 's.cp' => 'Zip', 's.ville' => 'Town', 's.fk_pays' => 'Country', 's.tel' => 'Phone', 's.siren' => 'ProfId1', 's.siret' => 'ProfId2', 's.ape' => 'ProfId3', 's.idprof4' => 'ProfId4', 'c.rowid' => "Id", 'c.ref' => "Ref", 'c.ref_client' => "RefClient", 'c.fk_soc' => "IdCompany", 'c.date_creation' => "DateCreation", 'c.date_commande' => "DateOrder", 'c.amount_ht' => "Amount", 'c.remise_percent' => "GlobalDiscount", 'c.total_ht' => "TotalHT", 'c.total_ttc' => "TotalTTC", 'c.facture' => "OrderShortStatusInvoicee", 'c.fk_statut' => 'Status', 'c.note' => "Note", 'c.date_livraison' => 'DeliveryDate', 'cd.rowid' => 'LineId', 'cd.description' => "LineDescription", 'cd.product_type' => 'TypeOfLineServiceOrProduct', 'cd.tva_tx' => "LineVATRate", 'cd.qty' => "LineQty", 'cd.total_ht' => "LineTotalHT", 'cd.total_tva' => "LineTotalVAT", 'cd.total_ttc' => "LineTotalTTC", 'p.rowid' => 'ProductId', 'p.ref' => 'ProductRef', 'p.label' => 'Label'); $this->export_entities_array[$r] = array('s.rowid' => "company", 's.nom' => 'company', 's.address' => 'company', 's.cp' => 'company', 's.ville' => 'company', 's.fk_pays' => 'company', 's.tel' => 'company', 's.siren' => 'company', 's.ape' => 'company', 's.idprof4' => 'company', 's.siret' => 'company', 'c.rowid' => "order", 'c.ref' => "order", 'c.ref_client' => "order", 'c.fk_soc' => "order", 'c.date_creation' => "order", 'c.date_commande' => "order", 'c.amount_ht' => "order", 'c.remise_percent' => "order", 'c.total_ht' => "order", 'c.total_ttc' => "order", 'c.facture' => "order", 'c.fk_statut' => "order", 'c.note' => "order", 'c.date_livraison' => "order", 'cd.rowid' => 'order_line', 'cd.description' => "order_line", 'cd.product_type' => 'order_line', 'cd.tva_tx' => "order_line", 'cd.qty' => "order_line", 'cd.total_ht' => "order_line", 'cd.total_tva' => "order_line", 'cd.total_ttc' => "order_line", 'p.rowid' => 'product', 'p.ref' => 'product', 'p.label' => 'product'); $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM (' . MAIN_DB_PREFIX . 'commande as c, ' . MAIN_DB_PREFIX . 'societe as s, ' . MAIN_DB_PREFIX . 'commandedet as cd)'; $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product as p on (cd.fk_product = p.rowid)'; $this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande'; $this->export_sql_end[$r] .= ' AND c.entity = ' . $conf->entity; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modECM($db) { parent::__construct($db); // Id for module (must be unique). // Use here a free id. $this->numero = 2500; // Family can be 'crm','financial','hr','projects','product','ecm','technic','other' // It is used to sort modules in module setup page $this->family = "ecm"; // 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)); // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value) $this->description = "Electronic Content Management"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (XXX is id value) $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=other) $this->special = 0; // Name of png file (without png) used for this module $this->picto = 'dir'; // Data directories to create when module is enabled $this->dirs = array("/ecm/temp"); // Config pages. Put here list of php page names stored in admmin directory used to setup module $this->config_page_url = array(); // Dependencies $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled // Constants $this->const = array(); // List of parameters // Boxes $this->boxes = array(); // List of boxes $r = 0; // Add here list of php file(s) stored in core/boxes that contains class to show a box. // Example: //$this->boxes[$r][1] = "myboxa.php"; //$r++; //$this->boxes[$r][1] = "myboxb.php"; //$r++; // Permissions $this->rights_class = 'ecm'; // Permission key $this->rights = array(); // Permission array used by this module $r++; $this->rights[$r][0] = 2501; $this->rights[$r][1] = 'Consulter/Télécharger les documents'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'read'; $r++; $this->rights[$r][0] = 2503; $this->rights[$r][1] = 'Soumettre ou supprimer des documents'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'upload'; $r++; $this->rights[$r][0] = 2515; $this->rights[$r][1] = 'Administrer les rubriques de documents'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'setup'; // Menus //------ $this->menus = array(); // List of menus to add $r = 0; // Top menu $this->menu[$r] = array('fk_menu' => 0, 'type' => 'top', 'titre' => 'MenuECM', 'mainmenu' => 'ecm', 'url' => '/ecm/index.php', 'langs' => 'ecm', 'position' => 100, 'perms' => '$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup', 'enabled' => '$conf->ecm->enabled', 'target' => '', 'user' => 2); // 0=Menu for internal users, 1=external users, 2=both $r++; // Left menu linked to top menu $this->menu[$r] = array('fk_menu' => 'r=0', 'type' => 'left', 'titre' => 'ECMArea', 'mainmenu' => 'ecm', 'url' => '/ecm/index.php', 'langs' => 'ecm', 'position' => 101, 'perms' => '$user->rights->ecm->read || $user->rights->ecm->upload', 'enabled' => '$user->rights->ecm->read || $user->rights->ecm->upload', 'target' => '', 'user' => 2); // 0=Menu for internal users, 1=external users, 2=both $r++; $this->menu[$r] = array('fk_menu' => 'r=1', 'type' => 'left', 'titre' => 'ECMNewSection', 'mainmenu' => 'ecm', 'url' => '/ecm/docdir.php?action=create', 'langs' => 'ecm', 'position' => 100, 'perms' => '$user->rights->ecm->setup', 'enabled' => '$user->rights->ecm->setup', 'target' => '', 'user' => 2); // 0=Menu for internal users, 1=external users, 2=both $r++; $this->menu[$r] = array('fk_menu' => 'r=1', 'type' => 'left', 'titre' => 'ECMFileManager', 'mainmenu' => 'ecm', 'url' => '/ecm/index.php?action=file_manager', 'langs' => 'ecm', 'position' => 102, 'perms' => '$user->rights->ecm->read || $user->rights->ecm->upload', 'enabled' => '$user->rights->ecm->read || $user->rights->ecm->upload', 'target' => '', 'user' => 2); // 0=Menu for internal users, 1=external users, 2=both $r++; $this->menu[$r] = array('fk_menu' => 'r=1', 'type' => 'left', 'titre' => 'Search', 'mainmenu' => 'ecm', 'url' => '/ecm/search.php', 'langs' => 'ecm', 'position' => 103, 'perms' => '$user->rights->ecm->read', 'enabled' => '$user->rights->ecm->read', 'target' => '', 'user' => 2); // 0=Menu for internal users, 1=external users, 2=both $r++; }
/** * Load setup values into conf object (read llx_const) * * @param DoliDB $db Handler d'acces base * @return int < 0 if KO, >= 0 if OK */ function setValues() { global $conf; dol_syslog(get_class($this) . "::setValues", LOG_INFO, get_class($this)); // Avoid warning if not defined if (empty($this->db->dolibarr_main_db_encryption)) { $this->db->dolibarr_main_db_encryption = 0; } if (empty($this->db->dolibarr_main_db_cryptkey)) { $this->db->dolibarr_main_db_cryptkey = ''; } /* * Definition de toutes les constantes globales d'environnement * - En constante php (TODO a virer) * - En $this->global->key=value */ $found = false; $result = dol_getcache("const"); if (is_object($result)) { $found = true; } if (!$found) { $result = array(); try { $result = $this->load('const'); //print_r($result); dol_setcache("const", $result); } catch (Exception $e) { dol_print_error("", $e->getMessage()); exit; } } $i = 0; if (count($result->values) == 0) { dol_print_error("", "Error in const document : values is empty !"); exit; } foreach ($result->values as $key => $value) { if ($key) { if (!defined("{$key}")) { define("{$key}", $value); } // In some cases, the constant might be already forced (Example: SYSLOG_FILE_ON and SYSLOG_FILE during install) $this->global->{$key} = $value; if ($value && preg_match('/^MAIN_MODULE_/', $key)) { // If this is constant for a new tab page activated by a module. if (preg_match('/^MAIN_MODULE_([A-Z_]+)_TABS_/i', $key)) { $params = explode(':', $value, 2); $this->tabs_modules[$params[0]][] = $value; } elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i', $key, $reg)) { $modulename = strtolower($reg[1]); $this->sms_engine_modules[$modulename] = $modulename; // Add this module in list of modules that provide SMS } elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_([A-Z]+)$/i', $key, $reg)) { $modulename = strtolower($reg[1]); $partname = strtolower($reg[2]); //$varname = $partname.'_modules'; // TODO deprecated //if (! isset($this->$varname) || ! is_array($this->$varname)) { $this->$varname = array(); } // TODO deprecated if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); } $arrValue = json_decode($value, true); if (is_array($arrValue) && !empty($arrValue)) { $value = $arrValue; } else { if (in_array($partname, array('login', 'menus', 'substitutions', 'triggers', 'tpl', 'theme'))) { $value = '/' . $modulename . '/core/' . $partname . '/'; } else { if (in_array($partname, array('models'))) { $value = '/' . $modulename . '/'; } else { if ($value == 1) { $value = '/' . $modulename . '/core/modules/' . $partname . '/'; } } } } //$this->$varname = array_merge($this->$varname, array($modulename => $value)); // TODO deprecated $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); } } } $i++; } // load configuration module $object = new DolibarrModules($this->db); $result = $object->getView("list", array(), true); foreach ($result->rows as $aRow) { $modulename = $aRow->key; $this->{$modulename} = $aRow->value; $this->modules[] = $modulename; } //print_r($this);exit; //var_dump($this->modules); //var_dump($this->modules_parts); // Second or others levels object $this->propal->cloture = (object) array(); $this->propal->facturation = (object) array(); $this->commande->client = (object) array(); $this->commande->fournisseur = (object) array(); $this->facture->client = (object) array(); $this->facture->fournisseur = (object) array(); $this->fournisseur->commande = (object) array(); $this->fournisseur->facture = (object) array(); $this->contrat->services = (object) array(); $this->contrat->services->inactifs = (object) array(); $this->contrat->services->expires = (object) array(); $this->adherent->cotisation = (object) array(); $this->bank->rappro = (object) array(); $this->bank->cheque = (object) array(); // Clean some variables if (empty($this->global->MAIN_MENU_STANDARD)) { $this->global->MAIN_MENU_STANDARD = "eldy_backoffice.php"; } if (empty($this->global->MAIN_MENUFRONT_STANDARD)) { $this->global->MAIN_MENUFRONT_STANDARD = "eldy_frontoffice.php"; } if (empty($this->global->MAIN_MENU_SMARTPHONE)) { $this->global->MAIN_MENU_SMARTPHONE = "eldy_backoffice.php"; } // Use eldy by default because smartphone does not work on all phones if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) { $this->global->MAIN_MENUFRONT_SMARTPHONE = "eldy_frontoffice.php"; } // Ue eldy by default because smartphone does not work on all phones // Variable globales LDAP if (empty($this->global->LDAP_FIELD_FULLNAME)) { $this->global->LDAP_FIELD_FULLNAME = ''; } if (!isset($this->global->LDAP_KEY_USERS)) { $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME; } if (!isset($this->global->LDAP_KEY_GROUPS)) { $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME; } if (!isset($this->global->LDAP_KEY_CONTACTS)) { $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME; } if (!isset($this->global->LDAP_KEY_MEMBERS)) { $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME; } // Load translation object with current language if (empty($this->global->MAIN_LANG_DEFAULT)) { $this->global->MAIN_LANG_DEFAULT = "en_US"; } // By default, we repeat info on all tabs if (!isset($this->global->MAIN_REPEATCONTACTONEACHTAB)) { $this->global->MAIN_REPEATCONTACTONEACHTAB = 1; } if (!isset($this->global->MAIN_REPEATADDRESSONEACHTAB)) { $this->global->MAIN_REPEATADDRESSONEACHTAB = 1; } $rootfordata = DOL_DATA_ROOT; $rootforuser = DOL_DATA_ROOT; // Define default dir_output and dir_temp for directories of modules foreach ($this->modules as $module) { $this->{$module}->multidir_output = array($this->entity => $rootfordata . "/" . $module); $this->{$module}->multidir_temp = array($this->entity => $rootfordata . "/" . $module . "/temp"); // For backward compatibility $this->{$module}->dir_output = $rootfordata . "/" . $module; $this->{$module}->dir_temp = $rootfordata . "/" . $module . "/temp"; } // For mycompany storage $this->mycompany->dir_output = $rootfordata . "/mycompany"; $this->mycompany->dir_temp = $rootfordata . "/mycompany/temp"; // For admin storage $this->admin->dir_output = $rootfordata . '/admin'; $this->admin->dir_temp = $rootfordata . '/admin/temp'; // For user storage $this->user->multidir_output = array($this->entity => $rootfordata . "/users"); $this->user->multidir_temp = array($this->entity => $rootfordata . "/users/temp"); // For backward compatibility $this->user->dir_output = $rootforuser . "/users"; $this->user->dir_temp = $rootforuser . "/users/temp"; // For propal storage $this->propal->dir_output = $rootforuser . "/propale"; $this->propal->dir_temp = $rootforuser . "/propale/temp"; // Exception: Some dir are not the name of module. So we keep exception here // for backward compatibility. // Sous module bons d'expedition $this->expedition_bon->enabled = defined("MAIN_SUBMODULE_EXPEDITION") ? MAIN_SUBMODULE_EXPEDITION : 0; // Sous module bons de livraison $this->livraison_bon->enabled = defined("MAIN_SUBMODULE_LIVRAISON") ? MAIN_SUBMODULE_LIVRAISON : 0; // Module fournisseur $this->fournisseur->commande->dir_output = $rootfordata . "/fournisseur/commande"; $this->fournisseur->commande->dir_temp = $rootfordata . "/fournisseur/commande/temp"; $this->fournisseur->facture->dir_output = $rootfordata . "/fournisseur/facture"; $this->fournisseur->facture->dir_temp = $rootfordata . "/fournisseur/facture/temp"; // Module product/service $this->product->multidir_output = array($this->entity => $rootfordata . "/produit"); $this->product->multidir_temp = array($this->entity => $rootfordata . "/produit/temp"); $this->service->multidir_output = array($this->entity => $rootfordata . "/produit"); $this->service->multidir_temp = array($this->entity => $rootfordata . "/produit/temp"); // For backward compatibility $this->product->dir_output = $rootfordata . "/produit"; $this->product->dir_temp = $rootfordata . "/produit/temp"; $this->service->dir_output = $rootfordata . "/produit"; $this->service->dir_temp = $rootfordata . "/produit/temp"; // Module contrat $this->contrat->dir_output = $rootfordata . "/contracts"; $this->contrat->dir_temp = $rootfordata . "/contracts/temp"; // Set some default values // societe if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) { $this->global->SOCIETE_CODECLIENT_ADDON = "mod_codeclient_leopard"; } if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) { $this->global->SOCIETE_CODEFOURNISSEUR_ADDON = $this->global->SOCIETE_CODECLIENT_ADDON; } if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) { $this->global->SOCIETE_CODECOMPTA_ADDON = "mod_codecompta_panicum"; } // Security if (empty($this->global->USER_PASSWORD_GENERATED)) { $this->global->USER_PASSWORD_GENERATED = 'standard'; } // Default password generator if (empty($this->global->MAIN_UMASK)) { $this->global->MAIN_UMASK = '0664'; } // Default mask // conf->use_javascript_ajax $this->use_javascript_ajax = 1; if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) { $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT; } // If no javascript_ajax, Ajax features are disabled. if (!$this->use_javascript_ajax) { $this->global->PRODUIT_USE_SEARCH_TO_SELECT = 0; } // conf->currency if (empty($this->global->MAIN_MONNAIE)) { $this->global->MAIN_MONNAIE = 'EUR'; } $this->currency = $this->global->MAIN_MONNAIE; // conf->global->COMPTA_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...) if (empty($this->global->COMPTA_MODE)) { $this->global->COMPTA_MODE = 'RECETTES-DEPENSES'; } // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES' // conf->liste_limit = constante de taille maximale des listes if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) { $this->global->MAIN_SIZE_LISTE_LIMIT = 25; } $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT; // conf->liste_limit = constante de taille maximale des listes if (empty($this->global->MAIN_SIZE_VIEW_LIMIT)) { $this->global->MAIN_SIZE_VIEW_LIMIT = 10000; } $this->view_limit = $this->global->MAIN_SIZE_VIEW_LIMIT; // conf->product->limit_size = constante de taille maximale des select de produit if (!isset($this->global->PRODUIT_LIMIT_SIZE)) { $this->global->PRODUIT_LIMIT_SIZE = 100; } $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE; // conf->theme et $this->css if (empty($this->global->MAIN_THEME)) { $this->global->MAIN_THEME = "eldy"; } $this->theme = $this->global->MAIN_THEME; $this->css = "/theme/" . $this->theme . "/style.css.php"; // conf->email_from = email pour envoi par dolibarr des mails automatiques $this->email_from = "*****@*****.**"; if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) { $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM; } // conf->notification->email_from = email pour envoi par Dolibarr des notifications $this->notification->email_from = $this->email_from; if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) { $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM; } // conf->mailing->email_from = email pour envoi par Dolibarr des mailings $this->mailing->email_from = $this->email_from; if (!empty($this->global->MAILING_EMAIL_FROM)) { $this->mailing->email_from = $this->global->MAILING_EMAIL_FROM; } // Format for date (used by default when not found or searched in lang) $this->format_date_short = "%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions) $this->format_date_short_java = "dd/MM/yyyy"; // Format of day with Java tags $this->format_hour_short = "%H:%M"; $this->format_hour_short_duration = "%H:%M"; $this->format_date_text_short = "%d %b %Y"; $this->format_date_text = "%d %B %Y"; $this->format_date_hour_short = "%d/%m/%Y %H:%M"; $this->format_date_hour_text_short = "%d %b %Y %H:%M"; $this->format_date_hour_text = "%d %B %Y %H:%M"; // Limites decimales si non definie (peuvent etre egale a 0) if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) { $this->global->MAIN_MAX_DECIMALS_UNIT = 5; } if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) { $this->global->MAIN_MAX_DECIMALS_TOT = 2; } if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) { $this->global->MAIN_MAX_DECIMALS_SHOWN = 8; } // Timeouts if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) { $this->global->MAIN_USE_CONNECT_TIMEOUT = 10; } if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) { $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30; } // Set default variable to calculate VAT as if option tax_mode was 0 (standard) if (empty($this->global->TAX_MODE_SELL_PRODUCT)) { $this->global->TAX_MODE_SELL_PRODUCT = 'invoice'; } if (empty($this->global->TAX_MODE_BUY_PRODUCT)) { $this->global->TAX_MODE_BUY_PRODUCT = 'invoice'; } if (empty($this->global->TAX_MODE_SELL_SERVICE)) { $this->global->TAX_MODE_SELL_SERVICE = 'payment'; } if (empty($this->global->TAX_MODE_BUY_SERVICE)) { $this->global->TAX_MODE_BUY_SERVICE = 'payment'; } // Delay before warnings $this->actions->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 24 * 60 * 60; $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 24 * 60 * 60; $this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 24 * 60 * 60; $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 24 * 60 * 60; $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 24 * 60 * 60; $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 24 * 60 * 60; $this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 24 * 60 * 60; $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 24 * 60 * 60; $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 24 * 60 * 60; $this->adherent->cotisation->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? $this->global->MAIN_DELAY_MEMBERS : 0) * 24 * 60 * 60; $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 24 * 60 * 60; $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 24 * 60 * 60; // For backward compatibility if (isset($this->product)) { $this->produit = $this->product; } if (isset($this->facture)) { $this->invoice = $this->facture; } if (isset($this->commande)) { $this->order = $this->commande; } if (isset($this->contrat)) { $this->contract = $this->contrat; } if (isset($this->categorie)) { $this->category = $this->categorie; } // Define menu manager in setup if (empty($user->societe_id)) { // If internal user or not defined $this->top_menu = empty($this->global->MAIN_MENU_STANDARD_FORCED) ? $this->global->MAIN_MENU_STANDARD : $this->global->MAIN_MENU_STANDARD_FORCED; $this->smart_menu = empty($this->global->MAIN_MENU_SMARTPHONE_FORCED) ? $this->global->MAIN_MENU_SMARTPHONE : $this->global->MAIN_MENU_SMARTPHONE_FORCED; } else { // If external user $this->top_menu = empty($this->global->MAIN_MENUFRONT_STANDARD_FORCED) ? $this->global->MAIN_MENUFRONT_STANDARD : $this->global->MAIN_MENUFRONT_STANDARD_FORCED; $this->smart_menu = empty($this->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) ? $this->global->MAIN_MENUFRONT_SMARTPHONE : $this->global->MAIN_MENUFRONT_SMARTPHONE_FORCED; } }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modContrat($db) { parent::__construct($db); $this->numero = 54; $this->family = "crm"; // 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 contrats de services"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; $this->picto = 'contract'; // Data directories to create when module is enabled $this->dirs = array("/contracts/temp"); // Dependances $this->depends = array("modSociete", "modService"); $this->requiredby = array(); // Config pages $this->config_page_url = array("contract.php@contrat"); // Constantes $this->const = array(); $this->const[0][0] = "CONTRACT_ADDON"; $this->const[0][1] = "chaine"; $this->const[0][2] = "mod_contract_serpis"; $this->const[0][3] = 'Nom du gestionnaire de numerotation des contrats'; $this->const[0][4] = 0; $this->const[1] = array("CONTRAT_ADDON_PDF_ODT_PATH", "chaine", "DOL_DATA_ROOT/doctemplates/contracts", "Directory models"); // Boxes $this->boxes = array(); $this->boxes[0][1] = "box_contracts.php"; $this->boxes[1][1] = "box_services_expired.php"; // Permissions $this->rights = array(); $this->rights_class = 'contrat'; $this->rights[1][0] = 161; $this->rights[1][1] = 'Lire les contrats'; $this->rights[1][2] = 'r'; $this->rights[1][3] = 1; $this->rights[1][4] = 'lire'; $this->rights[2][0] = 162; $this->rights[2][1] = 'Creer / modifier les contrats'; $this->rights[2][2] = 'w'; $this->rights[2][3] = 0; $this->rights[2][4] = 'creer'; $this->rights[3][0] = 163; $this->rights[3][1] = 'Activer un service d\'un contrat'; $this->rights[3][2] = 'w'; $this->rights[3][3] = 0; $this->rights[3][4] = 'activer'; $this->rights[4][0] = 164; $this->rights[4][1] = 'Desactiver un service d\'un contrat'; $this->rights[4][2] = 'w'; $this->rights[4][3] = 0; $this->rights[4][4] = 'desactiver'; $this->rights[5][0] = 165; $this->rights[5][1] = 'Supprimer un contrat'; $this->rights[5][2] = 'd'; $this->rights[5][3] = 0; $this->rights[5][4] = 'supprimer'; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function modFTP($db) { parent::__construct($db); // Id for module (must be unique). // Use here a free id. $this->numero = 2800; // Family can be 'crm','financial','hr','projects','product','ecm','technic','other' // It is used to sort modules in module setup page $this->family = "other"; // 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)); // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value) $this->description = "FTP Client"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (XXX is id value) $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 1; // Name of png file (without png) used for this module $this->picto = 'dir'; // Data directories to create when module is enabled $this->dirs = array("/ftp/temp"); // Langs file within the module $this->langfiles = array("ftp"); // Config pages. Put here list of php page names stored in admmin directory used to setup module $this->config_page_url = array('ftpclient.php@ftp'); // Dependencies $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled // Constants $this->const = array(); // List of parameters // Boxes $this->boxes = array(); // List of boxes $r = 0; // Add here list of php file(s) stored in core/boxes that contains class to show a box. // Example: //$this->boxes[$r][1] = "myboxa.php"; //$r++; //$this->boxes[$r][1] = "myboxb.php"; //$r++; // Permissions $this->rights_class = 'ftp'; // Permission key $this->rights = array(); // Permission array used by this module $r++; $this->rights[$r][0] = 2801; $this->rights[$r][1] = 'Use FTP client in read mode (browse and download only)'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'read'; $r++; $this->rights[$r][0] = 2802; $this->rights[$r][1] = 'Use FTP client in write mode (delete or upload files)'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'write'; // Menus //------ $this->menus = array(); // List of menus to add $r = 0; // Top menu $this->menu[$r] = array('fk_menu' => 0, 'type' => 'top', 'titre' => 'FTP', 'mainmenu' => 'ftp', 'url' => '/ftp/index.php', 'langs' => 'ftp', 'position' => 100, 'enabled' => '$conf->ftp->enabled', 'perms' => '$user->rights->ftp->read || $user->rights->ftp->write || $user->rights->ftp->setup', 'target' => '', 'user' => 2); // 0=Menu for internal users, 1=external users, 2=both $r++; }
/** * Disable a module * * @param string $value Nom du module a desactiver * @param int $requiredby 1=Desactive aussi modules dependants * @return string Error message or ''; */ function unActivateModule($value, $requiredby = 1) { global $db, $modules, $conf; // Check parameters if (empty($value)) { return 'ErrorBadParameter'; } $ret = ''; $modName = $value; $modFile = $modName . ".class.php"; // Loop on each directory to fill $modulesdir $modulesdir = dolGetModulesDirs(); // Loop on each modulesdir directories $found = false; foreach ($modulesdir as $dir) { if (file_exists($dir . $modFile)) { $found = @(include_once $dir . $modFile); if ($found) { break; } } } if ($found) { $objMod = new $modName($db); $result = $objMod->remove(); if ($result <= 0) { $ret = $objMod->error; } } else { //print $dir.$modFile; // TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded $genericMod = new DolibarrModules($db); $genericMod->name = preg_replace('/^mod/i', '', $modName); $genericMod->rights_class = strtolower(preg_replace('/^mod/i', '', $modName)); $genericMod->const_name = 'MAIN_MODULE_' . strtoupper(preg_replace('/^mod/i', '', $modName)); dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName); $genericMod->_remove(array()); } // Desactivation des modules qui dependent de lui if (!$ret && $requiredby) { $countrb = count($objMod->requiredby); for ($i = 0; $i < $countrb; $i++) { //var_dump($objMod->requiredby[$i]); unActivateModule($objMod->requiredby[$i]); } } return $ret; }
/** * Disable a module * @param value Nom du module a desactiver * @param requiredby 1=Desactive aussi modules dependants * @return string Error message or ''; */ function UnActivate($value,$requiredby=1) { global $db, $modules, $conf; $modName = $value; $ret=''; $modulesdir=array(); // Desactivation du module if ($modName) { $modFile = $modName . ".class.php"; // Loop on each directory $found=false; foreach ($conf->file->dol_document_root as $type => $dirroot) { $modulesdir[] = $dirroot."/includes/modules/"; if ($type == 'alt') { $handle=@opendir($dirroot); if (is_resource($handle)) { while (($file = readdir($handle))!==false) { if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') { if (is_dir($dirroot . '/' . $file . '/includes/modules/')) { $modulesdir[] = $dirroot . '/' . $file . '/includes/modules/'; } } } closedir($handle); } } } foreach ($modulesdir as $dir) { if (file_exists($dir.$modFile)) { $found=@include_once($dir.$modFile); if ($found) break; } } if ($found) { $objMod = new $modName($db); $result=$objMod->remove(); } else { $genericMod = new DolibarrModules($db); $genericMod->name=preg_replace('/^mod/i','',$modName); $genericMod->style_sheet=1; $genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName)); $genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName)); dol_syslog("modules::UnActivate Failed to find module file, we use generic function with name ".$genericMod->name); $genericMod->_remove(); } } // Desactivation des modules qui dependent de lui if ($requiredby) { for ($i = 0; $i < sizeof($objMod->requiredby); $i++) { UnActivate($objMod->requiredby[$i]); } } return $ret; }
/** * Constructor. Define names, constants, directories, boxes, permissions * * @param DoliDB $db Database handler */ function __construct($db) { parent::__construct($db); // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). $this->numero = 6000; // Key text used to identify module (for permissions, menus, etc...) $this->rights_class = 'workflow'; $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)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Workflow management"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // 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); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) $this->special = 2; // Name of png file (without png) used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' $this->picto = 'technic'; // Data directories to create when module is enabled $this->dirs = array("/workflow/temp"); // Config pages. Put here list of php page names stored in admmin directory used to setup module. $this->config_page_url = array('workflow.php'); // Dependencies $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->phpmin = array(5, 2); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 8); // Minimum version of Dolibarr required by module $this->langfiles = array("@workflow"); // Constants // List of particular constants to add when module is enabled //Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0), // 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) ); $this->const = array(); // Boxes $this->boxes = array(); //$this->boxes[0][1] = "box_workflow@workflow"; // Permissions $this->rights = array(); $r = 0; /* $r++; $this->rights[$r][0] = 6001; // id de la permission $this->rights[$r][1] = "Lire les workflow"; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'read'; */ // Main menu entries $this->menus = array(); // List of menus to add $r = 0; /* $this->menu[$r]=array('fk_menu'=>0, 'type'=>'top', 'titre'=>'Workflow', 'mainmenu'=>'workflow', 'url'=>'/workflow/index.php', 'langs'=>'@workflow', 'position'=>100, 'perms'=>'$user->rights->workflow->read', 'enabled'=>'$conf->workflow->enabled', 'target'=>'', 'user'=>0); $r++; $this->menu[$r]=array( 'fk_menu'=>'r=0', 'type'=>'left', 'titre'=>'Workflow', 'mainmenu'=>'workflow', 'url'=>'/workflow/index.php', 'langs'=>'@workflow', 'position'=>101, 'enabled'=>1, 'perms'=>'$user->rights->workflow->read', 'target'=>'', 'user'=>0); $r++; */ }