['js/libs/gal/gal.js',
'js/libs/gal/gal.filesystem.js',],
'raphael' =>
- ['js/libs/raphael/raphael.min.js',
- 'js/libs/gsap/plugins/RaphaelPlugin.min.js'],
+ [
+ 'js/libs/raphael/raphael.min.js',
+ //'js/libs/gsap/plugins/RaphaelPlugin.min.js'
+ ],
'countup' =>
['js/libs/countup/countup.min.js'],
'clipboard' => ['js/libs/clipboard.min.js'],
if ($this->config->form == 'bulle') {
$this->addJsLib('bulle', 'js/libs/fluidbook/forms/fluidbook.form.bulle.js');
} else if ($this->config->form == 'bourbon') {
- $this->addJsLib('parsley', 'js/libs/parsley.min.js');
+ $this->addParsley();
$this->addJsLib('bourbon', 'js/libs/fluidbook/forms/fluidbook.form.bourbon.js');
} else if ($this->config->form == 'avery') {
- $this->addJsLib('parsley', 'js/libs/parsley.min.js');
+ $this->addParsley();
$this->addJsLib('avery', 'js/libs/fluidbook/forms/fluidbook.form.avery.js');
$this->addLess('form/avery');
$this->writeCountries();
$this->config->seoArticles = $this->seoArticles;
}
+ protected function addParsley()
+ {
+ $this->addJsLib('parsley', ['js/libs/parsley/parsley.min.js', 'js/libs/parsley/i18n/' . mb_strtolower($this->config->defaultLang) . '.js']);
+
+ }
+
protected function checkPageLabels()
{
$this->log('PWA written');
$this->writeExtras();
$this->log('Extras written');
+ $this->writePDF();
+ // Adding js libraries or CSS must be done before this.
$this->populateConfig();
$this->log('Config populated');
$this->writeCSS($linksCSS);
$favicon .= '<link rel="apple-touch-icon" href="' . $assetsPrefix . 'data/apple-touch-icon.png" />';
}
- $print = $this->writePDF();
$message = 'An error occured when trying to show the publication. Please check if JavaScript is enabled or try to update your browser.';
$this->log('Got index vars 4');
$pwa = $this->getPWAMarkup();
$this->log('Got index vars 5');
- $vars = array('lang', 'titre', 'credits', 'style', 'script', 'pagesContents', 'print', 'splash', 'splashstyles', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard', 'description', 'console', 'pwa');
+ $vars = array('lang', 'titre', 'credits', 'style', 'script', 'pagesContents', 'splash', 'splashstyles', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard', 'description', 'console', 'pwa');
$res = [];
foreach ($vars as $v) {
$dirminimized = Files::mkdir($this->compiledAssets . '/js/min');
foreach ($finals as $jsfinal => $files) {
- $mintime = 0;
+
$hash = hash('sha256', json_encode($files));
$minimized = $dirminimized . $jsfinal . '-' . $hash . '-min.js';
if (file_exists($minimized) && filesize($minimized) > 0) {
foreach ($files as $file) {
$f = $this->assets . '/' . $file;
if (!file_exists($f)) {
+ FluidbookHealthIssues::addIssue($this->book_id, FluidbookHealthIssues::TYPE_MISSING_JS, ['file' => $f]);
continue;
}
if (strpos($f, '.min.') === false) {
$destination_css = $tmp . '/' . $f . '.css';
if (!file_exists($source_less)) {
- die($source_less);
+ FluidbookHealthIssues::addIssue($this->book_id, FluidbookHealthIssues::TYPE_MISSING_CSS, ['file' => $source_less]);
continue;
}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin\Operations\FluidbookPublication\Services;
+
+use App\Http\Middleware\CheckIfAdmin;
+use App\Http\Middleware\VerifyCsrfToken;
+use Cubist\Util\Str;
+use Illuminate\Mail\Message;
+use Illuminate\Support\Facades\Mail;
+use Illuminate\Support\Facades\Route;
+
+trait FormOperation
+{
+ protected function setupFormRoutes($segment, $routeName, $controller)
+ {
+ foreach (['services', 's'] as $s) {
+ Route::match(['post'], $s . '/form', $controller . '@form')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]);
+ }
+ }
+
+ public function form()
+ {
+ $f = Str::ucfirst(Str::camel(request('form')));
+ if (method_exists($this, 'handleForm' . $f)) {
+ $res = $this->{"handleForm{$f}"}();
+ } else {
+ return ['ok' => false];
+ }
+ return response()->json($res);
+ }
+
+ public function handleFormChristaud()
+ {
+ $dep = ["01" => "lyon@christaud.com",
+ "02" => "reims@christaud.com",
+ "03" => "clermont@christaud.com",
+ "04" => "gap@christaud.com",
+ "05" => "gap@christaud.com",
+ "06" => "grenoble@christaud.com",
+ "07" => "valence@christaud.com",
+ "08" => "reims@christaud.com",
+ "09" => "grenoble@christaud.com",
+ "10" => "reims@christaud.com",
+ "11" => "grenoble@christaud.com",
+ "12" => "clermont@christaud.com",
+ "13" => "grenoble@christaud.com",
+ "14" => "caen@billmat.fr",
+ "15" => "clermont@christaud.com",
+ "16" => "aquitaine@christaud.com",
+ "17" => "aquitaine@christaud.com",
+ "18" => "tours@billmat.fr",
+ "19" => "clermont@christaud.com",
+ "2A" => "grenoble@christaud.com",
+ "2B" => "grenoble@christaud.com",
+ "21" => "lyon@christaud.com",
+ "22" => "guingamp@billmat.fr",
+ "23" => "clermont@christaud.com",
+ "24" => "aquitaine@christaud.com",
+ "25" => "etupes@christaud.com",
+ "26" => "valence@christaud.com",
+ "27" => "rouen@billmat.fr",
+ "28" => "tours@billmat.fr",
+ "29" => "guingamp@billmat.fr",
+ "30" => "valence@christaud.com",
+ "31" => "aquitaine@christaud.com",
+ "32" => "aquitaine@christaud.com",
+ "33" => "aquitaine@christaud.com",
+ "34" => "grenoble@christaud.com",
+ "35" => "rennes@billmat.fr",
+ "36" => "tours@billmat.fr",
+ "37" => "tours@billmat.fr",
+ "38" => "grenoble@christaud.com",
+ "39" => "etupes@christaud.com",
+ "40" => "aquitaine@christaud.com",
+ "41" => "tours@billmat.fr",
+ "42" => "talaudiere@christaud.com",
+ "43" => "le-puy@christaud.com",
+ "44" => "rennes@billmat.fr",
+ "45" => "lagny@christaud.com",
+ "46" => "castelculier@christaud.com",
+ "47" => "castelculier@christaud.com",
+ "48" => "le-puy@christaud.com",
+ "49" => "rennes@billmat.fr",
+ "50" => "coutances@billmat.fr",
+ "51" => "reims@christaud.com",
+ "52" => "reims@christaud.com",
+ "53" => "rennes@billmat.fr",
+ "54" => "haguenau@christaud.com",
+ "55" => "reims@christaud.com",
+ "56" => "lorientàbillmat.fr",
+ "57" => "woustviller@christaud.com",
+ "58" => "clermont@christaud.com",
+ "59" => "lens@christaud.com",
+ "60" => "rouen@billmat.fr",
+ "61" => "caen@billmat.fr",
+ "62" => "lens@christaud.com",
+ "63" => "clermont@christaud.com",
+ "64" => "aquitaine@christaud.com",
+ "65" => "aquitaine@christaud.com",
+ "66" => "grenoble@christaud.com",
+ "67" => "haguenau@christaud.com",
+ "68" => "richwiller@christaud.com",
+ "69" => "lyon@christaud.com",
+ "70" => "richwiller@christaud.com",
+ "71" => "lyon@christaud.com",
+ "72" => "rennes@billmat.fr",
+ "73" => "savoies@christaud.com",
+ "74" => "savoies@christaud.com",
+ "75" => "lagny@christaud.com",
+ "76" => "rouen@billmat.fr",
+ "77" => "lagny@christaud.com",
+ "78" => "lagny@christaud.com",
+ "79" => "tours@billmat.fr",
+ "80" => "lens@christaud.com",
+ "81" => "castelculier@christaud.com",
+ "82" => "castelculier@christaud.com",
+ "83" => "grenoble@christaud.com",
+ "84" => "valence@christaud.com",
+ "85" => "rennes@billmat.fr",
+ "86" => "tours@billmat.fr",
+ "87" => "clermont@christaud.com",
+ "88" => "richwiller@christaud.com",
+ "89" => "reims@christaud.com",
+ "90" => "richwiller@christaud.com",
+ "91" => "lagny@christaud.com",
+ "92" => "lagny@christaud.com",
+ "93" => "lagny@christaud.com",
+ "94" => "lagny@christaud.com",
+ "95" => "lagny@christaud.com",
+ "971" => "grenoble@christaud.com",
+ "972" => "grenoble@christaud.com",
+ "973" => "grenoble@christaud.com",
+ "974" => "grenoble@christaud.com",
+ "976" => "grenoble@christaud.com"];
+ $labels = ['fluidbook_id' => 'Fluidbook', 'firstname' => 'Prénom', 'name' => 'Nom', 'company' => 'Société', 'email' => 'E-mail', 'phone' => 'Téléphone', 'departement' => 'Département'];
+
+ $body = '';
+ foreach ($labels as $name => $label) {
+ $body .= $label . ' : ' . request($name) . "\r\n";
+ if ($name === 'departement' && isset($dep[request($name)])) {
+ $cc = $dep[request($name)];
+ }
+ }
+ $fluidbook_id = request('fluidbook_id');
+
+ dispatch(function () use ($body, $cc, $fluidbook_id) {
+ Mail::raw($body, function (Message $message) use ($body, $cc, $fluidbook_id) {
+ $message->subject('[Fluidbook #' . $fluidbook_id . '] Téléchargement du PDF');
+ $message->to('contact@christaud.com');
+ if (isset($cc)) {
+ $message->cc($cc);
+ }
+ });
+ });
+
+ return ['ok' => true];
+ }
+}