helpFooter() static public method

Print footer for help page
static public helpFooter ( )
Esempio n. 1
0
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

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
*/
include '../inc/includes.php';
Session::checkLoginUser();
if (!isset($_GET["reservationitems_id"])) {
    $_GET["reservationitems_id"] = '';
}
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
    Html::helpHeader(__('Simplified interface'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]);
} else {
    Html::header(Reservation::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "reservation");
}
Reservation::showCalendar($_GET["reservationitems_id"]);
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
    Html::helpFooter();
} else {
    Html::footer();
}
Esempio n. 2
0
function plugin_surveyticket_post_init()
{
    if (strpos($_SERVER['PHP_SELF'], "ticket.form.php") && !isset($_GET['id']) && (!isset($_POST['id']) || $_POST['id'] == 0) || strpos($_SERVER['PHP_SELF'], "helpdesk.public.php") && isset($_GET['create_ticket']) || strpos($_SERVER['PHP_SELF'], "tracking.injector.php")) {
        if (isset($_POST)) {
            $psQuestion = new PluginSurveyticketQuestion();
            $psAnswer = new PluginSurveyticketAnswer();
            //print_r($_POST);exit;
            $description = '';
            foreach ($_POST as $question => $answer) {
                if (strstr($question, "question") && !strstr($question, "realquestion")) {
                    $psQuestion->getFromDB(str_replace("question", "", $question));
                    if (is_array($answer)) {
                        // Checkbox
                        $description .= _n('Question', 'Questions', 1, 'surveyticket') . " : " . $psQuestion->fields['name'] . "\n";
                        foreach ($answer as $answers_id) {
                            if ($psAnswer->getFromDB($answers_id)) {
                                $description .= _n('Answer', 'Answers', 1, 'surveyticket') . " : " . $psAnswer->fields['name'] . "\n";
                                $qid = str_replace("question", "", $question);
                                if (isset($_POST["text-" . $qid . "-" . $answers_id]) and $_POST["text-" . $qid . "-" . $answers_id] != '') {
                                    $description .= "Texte : " . $_POST["text-" . $qid . "-" . $answers_id] . "\n";
                                }
                            }
                        }
                        $description .= "\n";
                        unset($_POST[$question]);
                    } else {
                        $real = 0;
                        if (isset($_POST['realquestion' . str_replace("question", "", $question)])) {
                            $realanswer = $answer;
                            $answer = $_POST['realquestion' . str_replace("question", "", $question)];
                            $real = 1;
                        }
                        if ($psAnswer->getFromDB($answer)) {
                            $description .= _n('Question', 'Questions', 1, 'surveyticket') . " : " . $psQuestion->fields['name'] . "\n";
                            if ($real == 1) {
                                $description .= _n('Answer', 'Answers', 1, 'surveyticket') . " : " . $realanswer . "\n";
                            } else {
                                $description .= _n('Answer', 'Answers', 1, 'surveyticket') . " : " . $psAnswer->fields['name'] . "\n";
                            }
                            $qid = str_replace("question", "", $question);
                            if (isset($_POST["text-" . $qid . "-" . $answer]) and $_POST["text-" . $qid . "-" . $answer] != '') {
                                $description .= "Texte : " . $_POST["text-" . $qid . "-" . $answer] . "\n";
                            }
                            $description .= "\n";
                            unset($_POST[$question]);
                        }
                    }
                }
            }
            if ($description != '') {
                $_POST['content'] = addslashes($description);
            }
        }
        if (!isset($_POST['add'])) {
            if (strpos($_SERVER['PHP_SELF'], "ticket.form.php")) {
                Html::header(__('New ticket'), '', "maintain", "ticket");
                PluginSurveyticketSurvey::getCentral();
                Html::footer();
                exit;
            } else {
                if (strpos($_SERVER['PHP_SELF'], "helpdesk.public.php") || strpos($_SERVER['PHP_SELF'], "tracking.injector.php")) {
                    Html::helpHeader(__('Simplified interface'), '', $_SESSION["glpiname"]);
                    PluginSurveyticketSurvey::getHelpdesk();
                    Html::helpFooter();
                    exit;
                }
            }
        }
    }
}