Commit 0296185f authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+14 −0
Changes for .gitlab-ci.yml: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
image: registre.unicaen.fr:5000/unicaen-dev-php7.3-apache

stages:
- publish

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
  - vendor/

update-satis:
  stage: publish
  script:
    - curl https://gest.unicaen.fr/packagist/update

Module.php

0 → 100755
+56 −0
Changes for Module.php: 56 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace UnicaenMail;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\Stdlib\ArrayUtils;
use Zend\Stdlib\Glob;
use Zend\Config\Factory as ConfigFactory;

class Module
{
    public function onBootstrap(MvcEvent $e)
    {
        $e->getApplication()->getServiceManager()->get('translator');
        $eventManager        = $e->getApplication()->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

        /* Active un layout spécial si la requête est de type AJAX. Valable pour TOUS les modules de l'application. */
        $eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch',
            function (MvcEvent $e) {
                $request = $e->getRequest();
                if ($request instanceof HttpRequest && $request->isXmlHttpRequest()) {
                    $e->getTarget()->layout('layout/ajax.phtml');
                }
            }
        );

    }

    public function getConfig()
    {
        $configInit = [
            __DIR__ . '/config/module.config.php'
        ];
        $configFiles = ArrayUtils::merge(
            $configInit,
            Glob::glob(__DIR__ . '/config/merged/{,*.}{config}.php', Glob::GLOB_BRACE)
        );

        return ConfigFactory::fromFiles($configFiles);
    }


    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }
}

SQL/001_tables.sql

0 → 100644
+16 −0
Changes for SQL/001_tables.sql: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
create table unicaen_mail_mail
(
    id serial not null constraint umail_pkey primary key,
    date_envoi timestamp not null,
    status_envoi integer not null,
    destinataires text not null,
    redirection boolean not null,
    sujet text,
    corps text,
    attachement_type varchar(256),
    attachement_id integer,
    template_code varchar(256)
);

create unique index ummail_id_uindex on unicaen_mail_mail (id);

SQL/002_privileges.sql

0 → 100644
+0 −0

Empty file added.

composer.json

0 → 100755
+21 −0
Changes for composer.json: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "name": "unicaen/mail",
  "description": "Module d'envoi de mail",
  "repositories": [
    {
      "type": "composer",
      "url": "https://gest.unicaen.fr/packagist"
    }
  ],
  "require": {
    "unicaen/app":                                  "^3.0",
    "unicaen/privilege":                            "dev-master"
  },
  "autoload": {
    "psr-0": {
    },
    "classmap": [
      "./Module.php"
    ]
  }
}
Loading