forked from fusioninventory/fusioninventory-for-glpi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miss update code for the moment
- Loading branch information
David Durieux
committed
Mar 13, 2014
1 parent
de1157e
commit c4c0efb
Showing
14 changed files
with
1,008 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
|
||
/* | ||
------------------------------------------------------------------------ | ||
FusionInventory | ||
Copyright (C) 2010-2013 by the FusionInventory Development Team. | ||
http://www.fusioninventory.org/ http://forge.fusioninventory.org/ | ||
------------------------------------------------------------------------ | ||
LICENSE | ||
This file is part of FusionInventory project. | ||
FusionInventory is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FusionInventory 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 Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with FusionInventory. If not, see <http://www.gnu.org/licenses/>. | ||
------------------------------------------------------------------------ | ||
@package FusionInventory | ||
@author David Durieux | ||
@co-author | ||
@copyright Copyright (c) 2010-2013 FusionInventory team | ||
@license AGPL License 3.0 or (at your option) any later version | ||
http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
@link http://www.fusioninventory.org/ | ||
@link http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/ | ||
@since 2014 | ||
------------------------------------------------------------------------ | ||
*/ | ||
|
||
include ("../../../inc/includes.php"); | ||
|
||
Session::checkRight('plugin_fusioninventory_task', READ); | ||
|
||
if (!isset($_GET["id"])) { | ||
$_GET["id"] = ""; | ||
} | ||
|
||
|
||
|
||
$pfTimeslot = new PluginFusioninventoryTimeslot(); | ||
//Add a new timeslot | ||
if (isset($_POST["add"])) { | ||
$pfTimeslot->check(-1, CREATE, $_POST); | ||
if ($newID = $pfTimeslot->add($_POST)) { | ||
if ($_SESSION['glpibackcreated']) { | ||
Html::redirect($pfTimeslot->getFormURL()."?id=".$newID); | ||
} | ||
} | ||
Html::back(); | ||
|
||
// delete a timeslot | ||
} else if (isset($_POST["delete"])) { | ||
$pfTimeslot->check($_POST['id'], DELETE); | ||
$ok = $pfTimeslot->delete($_POST); | ||
$pfTimeslot->redirectToList(); | ||
|
||
} else if (isset($_POST["purge"])) { | ||
$pfTimeslot->check($_POST['id'], PURGE); | ||
$pfTimeslot->delete($_POST,1); | ||
$pfTimeslot->redirectToList(); | ||
|
||
//update a timeslot | ||
} else if (isset($_POST["update"])) { | ||
$pfTimeslot->check($_POST['id'], UPDATE); | ||
$pfTimeslot->update($_POST); | ||
Html::back(); | ||
|
||
} else {//print timeslot information | ||
Html::header(PluginFusioninventoryTimeslot::GetTypeName(2), | ||
$_SERVER['PHP_SELF'], | ||
"plugins", | ||
"pluginfusioninventorymenu", | ||
"timeslot"); | ||
$pfTimeslot->display(array('id' => $_GET["id"])); | ||
Html::footer(); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
/* | ||
------------------------------------------------------------------------ | ||
FusionInventory | ||
Copyright (C) 2010-2013 by the FusionInventory Development Team. | ||
http://www.fusioninventory.org/ http://forge.fusioninventory.org/ | ||
------------------------------------------------------------------------ | ||
LICENSE | ||
This file is part of FusionInventory project. | ||
FusionInventory is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FusionInventory 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 Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with FusionInventory. If not, see <http://www.gnu.org/licenses/>. | ||
------------------------------------------------------------------------ | ||
@package FusionInventory | ||
@author David Durieux | ||
@co-author | ||
@copyright Copyright (c) 2010-2013 FusionInventory team | ||
@license AGPL License 3.0 or (at your option) any later version | ||
http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
@link http://www.fusioninventory.org/ | ||
@link http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/ | ||
@since 2014 | ||
------------------------------------------------------------------------ | ||
*/ | ||
|
||
include ("../../../inc/includes.php"); | ||
|
||
Session::checkRight('plugin_fusioninventory_task', READ); | ||
|
||
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], | ||
"plugins", "pluginfusioninventorymenu", "timeslot"); | ||
|
||
Search::show('PluginFusioninventoryTimeslot'); | ||
|
||
Html::footer(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
/* | ||
------------------------------------------------------------------------ | ||
FusionInventory | ||
Copyright (C) 2010-2013 by the FusionInventory Development Team. | ||
http://www.fusioninventory.org/ http://forge.fusioninventory.org/ | ||
------------------------------------------------------------------------ | ||
LICENSE | ||
This file is part of FusionInventory project. | ||
FusionInventory is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FusionInventory 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 Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with FusionInventory. If not, see <http://www.gnu.org/licenses/>. | ||
------------------------------------------------------------------------ | ||
@package FusionInventory | ||
@author David Durieux | ||
@co-author | ||
@copyright Copyright (c) 2010-2013 FusionInventory team | ||
@license AGPL License 3.0 or (at your option) any later version | ||
http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
@link http://www.fusioninventory.org/ | ||
@link http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/ | ||
@since 2014 | ||
------------------------------------------------------------------------ | ||
*/ | ||
|
||
include ("../../../inc/includes.php"); | ||
|
||
Session::checkRight('plugin_fusioninventory_task', READ); | ||
|
||
if (!isset($_GET["id"])) { | ||
$_GET["id"] = ""; | ||
} | ||
|
||
$pfTimeslotEntry = new PluginFusioninventoryTimeslotEntry(); | ||
|
||
$pfTimeslotEntry->addEntry($_POST); | ||
|
||
Html::back(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
<?php | ||
|
||
/* | ||
------------------------------------------------------------------------ | ||
FusionInventory | ||
Copyright (C) 2010-2014 by the FusionInventory Development Team. | ||
http://www.fusioninventory.org/ http://forge.fusioninventory.org/ | ||
------------------------------------------------------------------------ | ||
LICENSE | ||
This file is part of FusionInventory project. | ||
FusionInventory is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FusionInventory 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 Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with FusionInventory. If not, see <http://www.gnu.org/licenses/>. | ||
------------------------------------------------------------------------ | ||
@package FusionInventory | ||
@author David Durieux | ||
@co-author | ||
@copyright Copyright (c) 2010-2013 FusionInventory team | ||
@license AGPL License 3.0 or (at your option) any later version | ||
http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
@link http://www.fusioninventory.org/ | ||
@link http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/ | ||
@since 2014 | ||
------------------------------------------------------------------------ | ||
*/ | ||
|
||
if (!defined('GLPI_ROOT')) { | ||
die("Sorry. You can't access directly to this file"); | ||
} | ||
|
||
class PluginFusioninventoryTimeslot extends CommonDBTM { | ||
|
||
public $dohistory = TRUE; | ||
|
||
static $rightname = 'plugin_fusioninventory_task'; | ||
|
||
|
||
/** | ||
* Get name of this type | ||
* | ||
* @return text name of this type by language of the user connected | ||
* | ||
**/ | ||
static function getTypeName($nb=0) { | ||
return __('Time slot', 'fusioninventory'); | ||
} | ||
|
||
|
||
|
||
function getSearchOptions() { | ||
|
||
$tab = array(); | ||
|
||
$tab['common'] = __('Time slot', 'fusioninventory'); | ||
|
||
$tab[1]['table'] = $this->getTable(); | ||
$tab[1]['field'] = 'name'; | ||
$tab[1]['linkfield'] = 'name'; | ||
$tab[1]['name'] = __('Name'); | ||
$tab[1]['datatype'] = 'itemlink'; | ||
|
||
$tab[2]['table'] = 'glpi_entities'; | ||
$tab[2]['field'] = 'completename'; | ||
$tab[2]['name'] = __('Entity'); | ||
|
||
$tab[3]['table'] = $this->getTable(); | ||
$tab[3]['field'] = 'is_recursive'; | ||
$tab[3]['linkfield'] = 'is_recursive'; | ||
$tab[3]['name'] = __('Child entities'); | ||
$tab[3]['datatype'] = 'bool'; | ||
|
||
$tab[4]['table'] = $this->getTable(); | ||
$tab[4]['field'] = 'name'; | ||
$tab[4]['linkfield'] = ''; | ||
$tab[4]['name'] = __('Name'); | ||
$tab[4]['datatype'] = 'string'; | ||
|
||
return $tab; | ||
} | ||
|
||
|
||
|
||
function defineTabs($options=array()){ | ||
|
||
$ong = array(); | ||
$this->addDefaultFormTab($ong); | ||
|
||
return $ong; | ||
} | ||
|
||
|
||
|
||
/** | ||
* Display form for agent configuration | ||
* | ||
* @param $computers_id integer ID of the agent | ||
* @param $options array | ||
* | ||
* @return bool TRUE if form is ok | ||
* | ||
**/ | ||
function showForm($ID, $options=array()) { | ||
|
||
$this->initForm($ID, $options); | ||
$this->showFormHeader($options); | ||
|
||
echo "<tr class='tab_bg_1'>"; | ||
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL | ||
echo "<td>".sprintf(__('%1$s%2$s'),__('Name'), | ||
(isset($options['withtemplate']) && $options['withtemplate']?"*":"")). | ||
"</td>"; | ||
echo "<td>"; | ||
$objectName = autoName($this->fields["name"], "name", | ||
(isset($options['withtemplate']) && ( $options['withtemplate']== 2)), | ||
$this->getType(), $this->fields["entities_id"]); | ||
Html::autocompletionTextField($this, 'name', array('value' => $objectName)); | ||
echo "</td>"; | ||
echo "<td>".__('Comments')."</td>"; | ||
echo "<td class='middle'>"; | ||
echo "<textarea cols='45' rows='4' name='comment' >".$this->fields["comment"]; | ||
echo "</textarea></td></tr>\n"; | ||
|
||
$this->showFormButtons($options); | ||
|
||
$pf = new PluginFusioninventoryTimeslotEntry(); | ||
$pf->formEntry($ID); | ||
|
||
return true; | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.