コード例 #1
0
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::checkCentralAccess();
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$notificationtemplate = new NotificationTemplate();
if (isset($_POST["add"])) {
    $notificationtemplate->check(-1, CREATE, $_POST);
    $newID = $notificationtemplate->add($_POST);
    Event::log($newID, "notificationtemplates", 4, "notification", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
    $language = new NotificationTemplateTranslation();
    $url = Toolbox::getItemTypeFormURL('NotificationTemplateTranslation', true);
    $url .= "?notificationtemplates_id={$newID}";
    Html::redirect($url);
} else {
    if (isset($_POST["purge"])) {
        $notificationtemplate->check($_POST["id"], PURGE);
        $notificationtemplate->delete($_POST, 1);
        Event::log($_POST["id"], "notificationtemplates", 4, "notification", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
        $notificationtemplate->redirectToList();
    } else {
        if (isset($_POST["update"])) {
            $notificationtemplate->check($_POST["id"], UPDATE);
コード例 #2
0
along with GLPI; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$notificationtemplate = new NotificationTemplate();
if (isset($_POST["add"])) {
    $notificationtemplate->check(-1, 'w', $_POST);
    $newID = $notificationtemplate->add($_POST);
    Event::log($newID, "notificationtemplates", 4, "notification", $_SESSION["glpiname"] . " " . $LANG['log'][20] . " :  " . $_POST["name"] . ".");
    $language = new NotificationTemplateTranslation();
    $url = getItemTypeFormURL('NotificationTemplateTranslation', true);
    $url .= "?notificationtemplates_id={$newID}";
    glpi_header($url);
} else {
    if (isset($_POST["delete"])) {
        $notificationtemplate->check($_POST["id"], 'd');
        $notificationtemplate->delete($_POST);
        Event::log($_POST["id"], "notificationtemplates", 4, "notification", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
        $notificationtemplate->redirectToList();
    } else {
        if (isset($_POST["delete_languages"])) {
            $notificationtemplate->check(-1, 'd');