Skip to content

Commit

Permalink
Merge pull request #3 from PluginsOCSInventory-NG/rework
Browse files Browse the repository at this point in the history
Rework
  • Loading branch information
RudyLaurent authored Apr 17, 2019
2 parents 45111e1 + d639f30 commit d2e529e
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 34 deletions.
1 change: 0 additions & 1 deletion APACHE/CrontabTaks.conf

This file was deleted.

9 changes: 4 additions & 5 deletions APACHE/Map.pm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

package Apache::Ocsinventory::Plugins::CrontabTasks::Map;

package Apache::Ocsinventory::Plugins::Crontabtasks::Map;

use strict;

use Apache::Ocsinventory::Map;

$DATA_MAP{crontabtasks} = {
Expand All @@ -25,4 +25,3 @@ $DATA_MAP{crontabtasks} = {
}
};
1;

1 change: 1 addition & 0 deletions APACHE/crontabtasks.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PerlModule Apache::Ocsinventory::Plugins::Crontabtasks::Map
13 changes: 13 additions & 0 deletions hook.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<hookstore>
<hook type="lang">
<value>en_GB</value>
<value>fr_FR</value>
</hook>
<hook type="cdentry">
<identifier>cd_crontabtasks</identifier>
<translation>24000</translation>
<category>config</category>
<available>crontabtasks</available>
</hook>
</hookstore>
2 changes: 2 additions & 0 deletions infos.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"author" : ["Guillaume PROTET", "Valentin DEVILLE"],
"contributor" : ["Frank BOURDEAU"],
"supportedAgent" : ["Unix"],
"version" : "2.0",
"licence" : "GPLv2",
"description" : {
"fr" : "Remonte les crontab",
"en" : "Retrieve crontab tasks"
Expand Down
57 changes: 29 additions & 28 deletions install.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
<?php
function plugin_version_crontabTasks()
{
return array('name' => 'crontabTasks',
'version' => '1.1',
'author'=> 'Guillaume PROTET, Valentin DEVILLE',
'license' => 'GPLv2',
'verMinOcs' => '2.2');
}

function plugin_init_crontabTasks()
/**
* This function is called on installation and is used to create database schema for the plugin
*/
function extension_install_crontabtasks()
{
$object = new plugins;
$object -> add_cd_entry("crontabtasks","config");
$commonObject = new ExtensionCommon;

$object -> sql_query("CREATE TABLE IF NOT EXISTS `crontabtasks` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`HARDWARE_ID` INT(11) NOT NULL,
`USER` varchar(255) DEFAULT NULL,
`CRON` varchar(255) DEFAULT NULL,
`MINUTE` varchar(3) DEFAULT NULL,
`HOUR` varchar(2) DEFAULT NULL,
`DOM` varchar(1) DEFAULT NULL,
`MONTH` varchar(1) DEFAULT NULL,
`DOW` varchar(1) DEFAULT NULL,
PRIMARY KEY (`ID`,`HARDWARE_ID`)
) ENGINE=INNODB;"
);
$commonObject -> sqlQuery("CREATE TABLE IF NOT EXISTS `crontabtasks` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`HARDWARE_ID` INT(11) NOT NULL,
`USER` varchar(255) DEFAULT NULL,
`CRON` varchar(255) DEFAULT NULL,
`MINUTE` varchar(3) DEFAULT NULL,
`HOUR` varchar(2) DEFAULT NULL,
`DOM` varchar(1) DEFAULT NULL,
`MONTH` varchar(1) DEFAULT NULL,
`DOW` varchar(1) DEFAULT NULL,
PRIMARY KEY (`ID`,`HARDWARE_ID`)
) ENGINE=INNODB;");
}

/**
* This function is called on removal and is used to destroy database schema for the plugin
*/
function extension_delete_crontabtasks()
{
$commonObject = new ExtensionCommon;
$commonObject -> sqlQuery("DROP TABLE `crontabtasks`");
}

function plugin_delete_crontabTasks()
/**
* This function is called on plugin upgrade
*/
function extension_upgrade_crontabtasks()
{
$object = new plugins;
$object -> del_cd_entry("crontabtasks");
$object -> sql_query("DROP TABLE `crontabtasks`");

}
1 change: 1 addition & 0 deletions language/en_GB/en_GB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24000 Crontab Tasks
1 change: 1 addition & 0 deletions language/fr_FR/fr_FR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24000 Crontab Tasks

0 comments on commit d2e529e

Please sign in to comment.