From 48480974d9b6fc70e43dd8efac469c6c46213dac Mon Sep 17 00:00:00 2001 From: moyooo Date: Sat, 19 May 2007 15:34:45 +0000 Subject: [PATCH] Modif mineure pour modif massive git-svn-id: https://forge.glpi-project.org/svn/example/trunk@28 349b9182-4a13-0410-896f-e5e9767dd1b3 --- db.sql | 4 ++-- setup.php | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/db.sql b/db.sql index 6d76562..6284c4f 100644 --- a/db.sql +++ b/db.sql @@ -1,12 +1,12 @@ CREATE TABLE `glpi_plugin_example` ( - `ID` int(11) NOT NULL, + `ID` int(11) NOT NULL auto_increment, `name` varchar(255) collate utf8_unicode_ci default NULL, `FK_dropdown` int(11) NOT NULL default '0', `deleted` smallint(6) NOT NULL default '0', `is_template` smallint(6) NOT NULL default '0', `tplname` varchar(255) collate utf8_unicode_ci default NULL, PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE `glpi_dropdown_plugin_example` ( `ID` int(11) NOT NULL auto_increment, diff --git a/setup.php b/setup.php index 11524d7..fa147c8 100755 --- a/setup.php +++ b/setup.php @@ -76,10 +76,18 @@ function plugin_init_example() { $PLUGIN_HOOKS['add_javascript']['example']="example.js"; $PLUGIN_HOOKS['add_css']['example']="example.css"; - // Params : plugin name - string type - number - tabke - form page - pluginNewType('example',"PLUGIN_EXAMPLE_TYPE",1001,"glpi_plugin_example","example.form.php"); + // Params : plugin name - string type - ID - class - table - form page + pluginNewType('example',"PLUGIN_EXAMPLE_TYPE",1001,"pluginExample","glpi_plugin_example","example.form.php"); + } +class pluginExample extends CommonDBTM { + function pluginExample () { + $this->table="glpi_plugin_example"; + $this->type=PLUGIN_EXAMPLE_TYPE; + } +}; + // Get the name and the version of the plugin - Needed function plugin_version_example(){ @@ -395,4 +403,6 @@ function plugin_central_action_example(){ function cron_plugin_example(){ echo "tttt"; } + + ?>