-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,016 additions
and
30 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
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ vendor/ | |
.gh_token | ||
composer.lock | ||
*.min.* | ||
|
||
lib/ |
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 @@ | ||
engine-strict=true |
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,55 @@ | ||
<?php | ||
|
||
/** | ||
* ------------------------------------------------------------------------- | ||
* Deploy plugin for GLPI | ||
* ------------------------------------------------------------------------- | ||
* | ||
* LICENSE | ||
* | ||
* This file is part of Deploy. | ||
* | ||
* Deploy 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. | ||
* | ||
* Deploy 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 Deploy. If not, see <http://www.gnu.org/licenses/>. | ||
* ------------------------------------------------------------------------- | ||
* @copyright Copyright (C) 2022-2024 by Deploy plugin team. | ||
* @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html | ||
* @link https://github.com/pluginsGLPI/deploy | ||
* ------------------------------------------------------------------------- | ||
*/ | ||
|
||
namespace GlpiPlugin\Deploy; | ||
|
||
use Glpi\Application\View\TemplateRenderer; | ||
|
||
include("../../../inc/includes.php"); | ||
|
||
\Session::checkLoginUser(); | ||
$trange = new TimeslotRange(); | ||
$id = $_POST['plugin_deploy_timeslots_id']; | ||
TimeslotRange::cleanOldData($_POST); | ||
$_POST = TimeslotRange::cleanInput($_POST); | ||
foreach ($_POST as $timeslot) { | ||
foreach ($timeslot as $range) { | ||
if ((bool)$range['is_enable'] == true) { | ||
$trange->add($range); | ||
} | ||
} | ||
} | ||
$timeslots_data = TimeslotRange::getForTimeslot(Timeslot::getById($id)); | ||
echo TemplateRenderer::getInstance()->render('@deploy/timeslot/timeslotrange.html.twig', [ | ||
'rand' => mt_rand(), | ||
'timeslot_id' => $id, | ||
'days_list' => TimeslotRange ::getDayList(), | ||
'timeslots_data' => $timeslots_data | ||
]); |
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,40 @@ | ||
<?php | ||
|
||
/** | ||
* ------------------------------------------------------------------------- | ||
* Deploy plugin for GLPI | ||
* ------------------------------------------------------------------------- | ||
* | ||
* LICENSE | ||
* | ||
* This file is part of Deploy. | ||
* | ||
* Deploy 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. | ||
* | ||
* Deploy 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 Deploy. If not, see <http://www.gnu.org/licenses/>. | ||
* ------------------------------------------------------------------------- | ||
* @copyright Copyright (C) 2022-2024 by Deploy plugin team. | ||
* @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html | ||
* @link https://github.com/pluginsGLPI/deploy | ||
* ------------------------------------------------------------------------- | ||
*/ | ||
|
||
namespace GlpiPlugin\Deploy; | ||
|
||
use Html; | ||
use Session; | ||
|
||
include('../../../inc/includes.php'); | ||
|
||
Session::checkRight("entity", UPDATE); | ||
$dropdown = new Timeslot(); | ||
include(GLPI_ROOT . "/front/dropdown.common.form.php"); |
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,41 @@ | ||
<?php | ||
|
||
/** | ||
* ------------------------------------------------------------------------- | ||
* Deploy plugin for GLPI | ||
* ------------------------------------------------------------------------- | ||
* | ||
* LICENSE | ||
* | ||
* This file is part of Deploy. | ||
* | ||
* Deploy 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. | ||
* | ||
* Deploy 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 Deploy. If not, see <http://www.gnu.org/licenses/>. | ||
* ------------------------------------------------------------------------- | ||
* @copyright Copyright (C) 2022-2024 by Deploy plugin team. | ||
* @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html | ||
* @link https://github.com/pluginsGLPI/deploy | ||
* ------------------------------------------------------------------------- | ||
*/ | ||
|
||
namespace GlpiPlugin\Deploy; | ||
|
||
use Html; | ||
use Search; | ||
use Session; | ||
|
||
include('../../../inc/includes.php'); | ||
|
||
Session::checkRight("entity", UPDATE); | ||
$dropdown = new Timeslot(); | ||
include(GLPI_ROOT . "/front/dropdown.common.php"); |
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,59 @@ | ||
<?php | ||
|
||
/** | ||
* ------------------------------------------------------------------------- | ||
* Deploy plugin for GLPI | ||
* ------------------------------------------------------------------------- | ||
* | ||
* LICENSE | ||
* | ||
* This file is part of Deploy. | ||
* | ||
* Deploy 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. | ||
* | ||
* Deploy 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 Deploy. If not, see <http://www.gnu.org/licenses/>. | ||
* ------------------------------------------------------------------------- | ||
* @copyright Copyright (C) 2022-2024 by Deploy plugin team. | ||
* @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html | ||
* @link https://github.com/pluginsGLPI/deploy | ||
* ------------------------------------------------------------------------- | ||
*/ | ||
|
||
namespace GlpiPlugin\Deploy; | ||
|
||
use Html; | ||
use Session; | ||
|
||
include('../../../inc/includes.php'); | ||
|
||
Session::checkRight("entity", UPDATE); | ||
|
||
if (!isset($_GET["id"])) { | ||
$_GET["id"] = ""; | ||
} | ||
|
||
$trange = new TimeslotRange(); | ||
|
||
if (isset($_POST['timeslot']) && !empty($_POST['timeslot'])) { | ||
$_POST['timeslot'] = json_decode($_POST['timeslot'], true); | ||
TimeslotRange::cleanOldData($_POST); | ||
$_POST = TimeslotRange::cleanInput($_POST); | ||
foreach ($_POST as $timeslot) { | ||
foreach ($timeslot as $range) { | ||
if ($range['is_enable'] == true) { | ||
$trange->add($range); | ||
} | ||
} | ||
} | ||
Session::addMessageAfterRedirect(__('Range options saved', 'deploy'), true, INFO); | ||
} | ||
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
Oops, something went wrong.