You are not logged in.
Pages: 1
Is it possible to add a standard time window in the config database?? Like you have in planning.
The following code worked for me , obviously i copy pasted the planning settings.
What failed to achieve is to get the standard minutes, I do not know where adjust those settings.
sql
CREATE TABLE `glpi_config` (
`planning_begin` time NOT NULL default '08:00:00',
`planning_end` time NOT NULL default '20:00:00',
`reservation_begin` time NOT NULL default '09:00:00',
`reservation_end` time NOT NULL default '19:00:00',
)
reservation.function.php
function showAddReservationForm($target,$ID,$date,$resaID=-1){
global $cfg_glpi,$lang,$HTMLRel;
if (!haveRight("reservation_helpdesk","1")) return false;
$resa= new ReservationResa;
if ($resaID!=-1)
$resa->getFromDB($resaID);
else {
$resa->getEmpty();
$resa->fields["begin"]=$date.$cfg_glpi["reservation_begin"];
$resa->fields["end"]=$date.$cfg_glpi["reservation_end"];
config.class.php
if (isset($input["planning_begin"]))
$input["planning_begin"]=$input["planning_begin"].":00:00";
if (isset($input["planning_end"]))
$input["planning_end"]=$input["planning_end"].":00:00";
if (isset($input["reservation_begin"]))
$input["reservation_begin"]=$input["reservation_begin"].":00:00";
if (isset($input["reservation_end"]))
$input["reservation_end"]=$input["reservation_end"].":00:00";
return $input;
en_GB.php
$lang["setup"][299]="Standard timeframe for resarvations";
setup.function.php
$reserv_begin=split(":",$cfg_glpi["reservation_begin"]);
$reserv_end=split(":",$cfg_glpi["reservation_end"]);
echo "<tr class='tab_bg_2'><td align='center'>".$lang["setup"][299]."</td><td>";
echo "<select name='reservation_begin'>";
for ($i=0;$i<=24;$i++) echo "<option value='$i'".($reserv_begin[0]==$i?" selected ":"").">$i</option>";
echo "</select>";
echo " -> ";
echo "<select name='reservation_end'>";
for ($i=0;$i<=24;$i++) echo "<option value='$i' ".($reserv_end[0]==$i?" selected ":"").">$i</option>";
echo "</select>";
PereXereP
Offline
what do you want to do set the default reservation time to the current day ?
MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI : Support Contribute References Freshmeat
Offline
we lend laptops / beamers, mostly per day,
your standard time frame is 12:00-13:00, i thougt it would be handy to make a global setting in the database.
PereXereP
Offline
Pages: 1