public static function install()
 {
     $notifications = array('plugin_formcreator_form_created' => array('name' => __('A form has been created', 'formcreator'), 'subject' => __('Your request have been saved', 'formcreator'), 'content' => __('Hi,\\nYour request from GLPI have been successfully saved with number ##formcreator.request_id## and transmetted to the helpdesk team.\\nYou can see your answers onto the following link:\\n##formcreator.validation_link##', 'formcreator'), 'notified' => self::AUTHOR), 'plugin_formcreator_need_validation' => array('name' => __('A form need to be validate', 'formcreator'), 'subject' => __('A form from GLPI need to be validate', 'formcreator'), 'content' => __('Hi,\\nA form from GLPI need to be validate and you have been choosen as the validator.\\nYou can access it by clicking onto this link:\\n##formcreator.validation_link##', 'formcreator'), 'notified' => self::APPROVER), 'plugin_formcreator_refused' => array('name' => __('The form is refused', 'formcreator'), 'subject' => __('Your form have been refused by the validator', 'formcreator'), 'content' => __('Hi,\\nWe are sorry to inform you that your form have been refused by the validator for the reason below:\\n##formcreator.validation_comment##\\n\\nYou can still modify and resubmit it by clicking onto this link:\\n##formcreator.validation_link##', 'formcreator'), 'notified' => self::AUTHOR), 'plugin_formcreator_accepted' => array('name' => __('The form is accepted', 'formcreator'), 'subject' => __('Your form have been accepted by the validator', 'formcreator'), 'content' => __('Hi,\\nWe are pleased to inform you that your form have been accepted by the validator.\\nYour request will be considered soon.', 'formcreator'), 'notified' => self::AUTHOR), 'plugin_formcreator_deleted' => array('name' => __('The form is deleted', 'formcreator'), 'subject' => __('Your form have been deleted by an administrator', 'formcreator'), 'content' => __('Hi,\\nWe are sorry to inform you that your request cannot be considered and have been deleted by an administrator.', 'formcreator'), 'notified' => self::AUTHOR));
     // Create the notification template
     $notification = new Notification();
     $notification_target = new NotificationTarget();
     $template = new NotificationTemplate();
     $translation = new NotificationTemplateTranslation();
     foreach ($notifications as $event => $datas) {
         // Check if notification allready exists
         $exists = $notification->find("itemtype = 'PluginFormcreatorFormanswer' AND event = '{$event}'");
         // If it doesn't exists, create it
         if (count($exists) == 0) {
             $template_id = $template->add(array('name' => addslashes($datas['name']), 'comment' => '', 'itemtype' => 'PluginFormcreatorFormanswer'));
             // Add a default translation for the template
             $translation->add(array('notificationtemplates_id' => $template_id, 'language' => '', 'subject' => addslashes($datas['subject']), 'content_text' => addslashes($datas['content']), 'content_html' => '<p>' . str_replace('\\n', '<br />', $datas['content']) . '</p>'));
             // Create the notification
             $notification_id = $notification->add(array('name' => addslashes($datas['name']), 'comment' => '', 'entities_id' => 0, 'is_recursive' => 1, 'is_active' => 1, 'itemtype' => 'PluginFormcreatorFormanswer', 'notificationtemplates_id' => $template_id, 'event' => $event, 'mode' => 'mail'));
             // Add default notification targets
             $notification_target->add(array("items_id" => $datas['notified'], "type" => Notification::USER_TYPE, "notifications_id" => $notification_id));
         }
     }
 }