コード例 #1
0
ファイル: solution.php プロジェクト: gaforeror/glpi
GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
$AJAX_INCLUDE = 1;
include '../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkLoginUser();
$rand = mt_rand();
Html::initEditorSystem("solution{$rand}");
if (isset($_POST['value']) && $_POST['value'] > 0) {
    $template = new SolutionTemplate();
    if ($template->getFromDB($_POST['value'])) {
        echo "<textarea id='solution{$rand}' name='solution' rows='12' cols='80'>";
        echo $template->getField('content');
        echo "</textarea>\n";
        echo "<script type='text/javascript'>document.getElementById('" . $_POST["type_id"] . "').\n             value = " . $template->getField('solutiontypes_id') . "</script>";
    }
} else {
    echo "<textarea id='solution{$rand}' name='solution' rows='12' cols='80'></textarea>";
}
コード例 #2
0
ファイル: solution.php プロジェクト: kipman/glpi
GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
$AJAX_INCLUDE = 1;
include '../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkLoginUser();
$rand = mt_rand();
Html::initEditorSystem("solution{$rand}");
if (isset($_POST['value']) && $_POST['value'] > 0) {
    $template = new SolutionTemplate();
    if ($template->getFromDB($_POST['value'])) {
        echo "<textarea id='solution{$rand}' name='solution' rows='12' cols='80'>";
        echo $template->getField('content');
        echo "</textarea>\n";
        echo "<script type='text/javascript'>" . Html::jsSetDropdownValue($_POST["type_id"], $template->getField('solutiontypes_id')) . "</script>";
    }
} else {
    echo "<textarea id='solution{$rand}' name='solution' rows='12' cols='80'></textarea>";
}