solution.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  * @version $Id: solution.php 20129 2013-02-04 16:53:59Z moyo $
00004  -------------------------------------------------------------------------
00005  GLPI - Gestionnaire Libre de Parc Informatique
00006  Copyright (C) 2003-2013 by the INDEPNET Development Team.
00007 
00008  http://indepnet.net/   http://glpi-project.org
00009  -------------------------------------------------------------------------
00010 
00011  LICENSE
00012 
00013  This file is part of GLPI.
00014 
00015  GLPI is free software; you can redistribute it and/or modify
00016  it under the terms of the GNU General Public License as published by
00017  the Free Software Foundation; either version 2 of the License, or
00018  (at your option) any later version.
00019 
00020  GLPI is distributed in the hope that it will be useful,
00021  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  GNU General Public License for more details.
00024 
00025  You should have received a copy of the GNU General Public License
00026  along with GLPI. If not, see <http://www.gnu.org/licenses/>.
00027  --------------------------------------------------------------------------
00028  */
00029 
00030 /** @file
00031 * @brief
00032 */
00033 
00034 $AJAX_INCLUDE = 1;
00035 
00036 include ('../inc/includes.php');
00037 header("Content-Type: text/html; charset=UTF-8");
00038 Html::header_nocache();
00039 
00040 Session::checkLoginUser();
00041 
00042 $rand = mt_rand();
00043 
00044 Html::initEditorSystem("solution$rand");
00045 
00046 if (isset($_POST['value']) && ($_POST['value'] > 0)) {
00047    $template = new SolutionTemplate();
00048 
00049    if ($template->getFromDB($_POST['value'])) {
00050       echo "<textarea id='solution$rand' name='solution' rows='12' cols='80'>";
00051       echo $template->getField('content');
00052       echo "</textarea>\n";
00053       echo "<script type='text/javascript'>document.getElementById('".$_POST["type_id"]."').
00054              value = ".$template->getField('solutiontypes_id')."</script>";
00055    }
00056 
00057 } else {
00058       echo "<textarea id='solution$rand' name='solution' rows='12' cols='80'></textarea>";
00059 }
00060 ?>