<component name="ChangeListManager">
<list default="true" id="5d2ecd5e-a05a-4f96-a195-fa6372618165" name="Default Changelist" comment="wip #5265 @0.5">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/config/backup.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/backup.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/resources/emailconfig/postfix-main.cf" beforeDir="false" afterPath="$PROJECT_DIR$/resources/emailconfig/postfix-main.cf" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/Http/Controllers/Admin/Operations/Tools/PDF2SVGOperation.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Admin/Operations/Tools/PDF2SVGOperation.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/Models/CubedesignersEmails.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/CubedesignersEmails.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/Models/FluidbookQuote.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/FluidbookQuote.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/composer.json" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/composer.lock" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1651398713511" duration="1801000" />
<workItem from="1651561264763" duration="4820000" />
<workItem from="1651587683461" duration="1063000" />
- <workItem from="1651655455708" duration="30000" />
- </task>
- <task id="LOCAL-00224" summary="wip #5045 @1">
- <created>1643386780400</created>
- <option name="number" value="00224" />
- <option name="presentableId" value="LOCAL-00224" />
- <option name="project" value="LOCAL" />
- <updated>1643386780400</updated>
+ <workItem from="1651655455708" duration="641000" />
+ <workItem from="1651746630722" duration="1339000" />
+ <workItem from="1651753148416" duration="6255000" />
</task>
<task id="LOCAL-00225" summary="wip #5045 @0.5">
<created>1643389174195</created>
<option name="project" value="LOCAL" />
<updated>1651565022545</updated>
</task>
- <option name="localTasksCounter" value="273" />
+ <task id="LOCAL-00273" summary="wip #5265 @0.5">
+ <created>1651655495699</created>
+ <option name="number" value="00273" />
+ <option name="presentableId" value="LOCAL-00273" />
+ <option name="project" value="LOCAL" />
+ <updated>1651655495699</updated>
+ </task>
+ <option name="localTasksCounter" value="274" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
use Cubist\Util\Files\Files;
use Cubist\Util\Str;
use Cubist\Util\Zip;
+use DOMDocument;
use Fluidbook\Tools\Document;
use Fluidbook\Tools\Jobs\ProcessFile;
use Fluidbook\Tools\Jobs\ProcessPage;
trait PDF2SVGOperation
{
+ /**
+ * @var int
+ */
+ protected static $_svgAttr = 0;
+
public function pdf2svg()
{
$form = new Form(backpack_url('tools/convertpdf'));
$f = new ProcessFile($format, $resolution, $withGraphics, $withTexts);
$pageJob = new ProcessPage($doc, $page, [$f]);
$f->setJob($pageJob);
- rename($f->getPath(), $dir . '/' . $n . '-' . $page . '.' . $format);
+ $fname = $n . '-' . $page ;
+ $dest = $dir . '/' . $fname. '.' . $format;
+ rename($f->getPath(), $dest);
+ if ($format === 'svg') {
+ self::identifySVG($dest);
+ }
+ }
+
+ if (count($pages) === 1) {
+ $ext = $format;
+ $tmpfile = $dest;
+ } else {
+ $ext = 'zip';
+ $fname = $file->getClientOriginalName();
+ $tmpfile = Files::tempnam() . '.zip';
+ Zip::archive($dir, $tmpfile);
}
- $tmpfile = Files::tempnam() . '.zip';
- $zip = Zip::archive($dir, $tmpfile);
+ return response()->download($tmpfile, $fname . '.' . $ext)->deleteFileAfterSend(true);
+ }
+
+ public static function identifySVG($path)
+ {
+ self::$_svgAttr = 0;
+ $svg = new DOMDocument();
+ $svg->preserveWhiteSpace = true;
+ $svg->load($path, LIBXML_PARSEHUGE);
+ self::_identifySVGNode($svg);
+
+ file_put_contents($path, $svg->saveXML());
+ }
- return response()->download($tmpfile, $file->getClientOriginalName() . '.zip')->deleteFileAfterSend(true);
+
+ public static function _identifySVGNode(\DOMNode $node)
+ {
+
+ if ($node instanceof \DOMElement) {
+ if (!$node->hasAttribute('id')) {
+ self::$_svgAttr++;
+ $node->setAttribute('id', 'e-' . self::$_svgAttr);
+
+ }
+ }
+
+ if ($node->hasChildNodes()) {
+ foreach ($node->childNodes as $childNode) {
+ self::_identifySVGNode($childNode);
+ }
+ }
}
}
}
$allAliases[$from . '@' . $domain] = array_merge($allAliases[$from . '@' . $domain], $dest);
}
+// $allAliases['@' . $domain] = ['postmaster+catchall@' . $maindomain];
}
$aliasesFile = [];
foreach ($allAliases as $from => $dest) {
}
$my_networks = array_unique($my_networks);
- $this->_replaceInFile('postfix-main.cf',['my_networks'=> implode(', ', $my_networks)]);
- $this->_replaceInFile('fail2ban-jail.cf',['ignoreip'=> implode(',', $my_networks)]);
+ $this->_replaceInFile('postfix-main.cf', ['my_networks' => implode(', ', $my_networks)]);
+ $this->_replaceInFile('fail2ban-jail.cf', ['ignoreip' => implode(',', $my_networks)]);
touch(storage_path('emailconfig/__UPDATED__'));
}
use App\Http\Controllers\Admin\Operations\FluidbookQuote\CreateFromWebsite;
use App\Models\Base\ToolboxModel;
use App\Widgets;
+use Cubist\Backpack\Magic\Fields\Hidden;
use Cubist\Backpack\Magic\Fields\Integer;
+use Cubist\Backpack\Magic\Fields\ModelAttribute;
use Cubist\Backpack\Magic\Fields\Number;
+use Cubist\Backpack\Magic\Fields\StaticValue;
class FluidbookQuote extends ToolboxModel
{
{
parent::setFields();
- $this->addField('type', 'Hidden');
- $this->addField('pages', 'Hidden');
- $this->addField('links', 'Hidden');
- $this->addField('langs', 'Hidden');
$this->addField('user', FluidbookUser::class, __('Utilisateur'),
[
'can_write' => 'fluidbook-quote:admin',
]);
+ $this->addField('email', ModelAttribute::class, __('Email'), ['column' => true, 'attribute' => 'useremail', 'column_type' => 'email']);
+
$this->addField(['name' => 'created_at',
'label' => __('Date'),
'type' => 'Datetime',
]
);
+ $this->addField('type', Hidden::class, __('Type'));
+ $this->addField('pages', Hidden::class, __('Pages'));
+ $this->addField('links', Hidden::class, __('Liens'));
+ $this->addField('langs', Hidden::class, __('Langues'));
+
$this->addField('gclid', 'Text', 'Google Adwords ID (gclid)', ['can' => 'fluidbook-quote:admin',]);
$this->addField('coupon', 'Hidden', __('Coupon'), ['can' => 'fluidbook-quote:admin',]);
return $this->getAttribute('gclid') ? 'Paid' : 'Organic';
}
+ public function getUseremailAttribute()
+ {
+ return User::find($this->getAttribute('user'))->getAttribute('email');
+ }
+
public function addWidgets()
{
Widgets::fluidbookQuoteWidgets();
"php": ">=8.0",
"ext-json": "*",
"ext-simplexml": "*",
+ "ext-dom": "*",
+ "ext-libxml": "*",
"ext-tidy": "*",
"ext-zip": "*",
"ahmadshah/lucy": "dev-master",
"mxl/laravel-job": "^1.3",
"php-ffmpeg/php-ffmpeg": "^0.18.0",
"phpoffice/phpspreadsheet": "^1.22",
- "rustici-software/scormcloud-api-v2-client-php": "^2.0"
+ "rustici-software/scormcloud-api-v2-client-php": "^2.0",
+
},
"require-dev": {
"facade/ignition": "^2.17",
},
{
"name": "laravel/framework",
- "version": "v8.83.10",
+ "version": "v8.83.11",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "148ae59b7da6c3db6736374d357c5aaef9506fb7"
+ "reference": "d85c34179f209977043502441f9e44ca432a14b4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/148ae59b7da6c3db6736374d357c5aaef9506fb7",
- "reference": "148ae59b7da6c3db6736374d357c5aaef9506fb7",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/d85c34179f209977043502441f9e44ca432a14b4",
+ "reference": "d85c34179f209977043502441f9e44ca432a14b4",
"shasum": ""
},
"require": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2022-04-27T14:07:37+00:00"
+ "time": "2022-05-03T14:47:00+00:00"
},
{
"name": "laravel/serializable-closure",
},
{
"name": "nesbot/carbon",
- "version": "2.57.0",
+ "version": "2.58.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "4a54375c21eea4811dbd1149fe6b246517554e78"
+ "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78",
- "reference": "4a54375c21eea4811dbd1149fe6b246517554e78",
+ "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055",
+ "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055",
"shasum": ""
},
"require": {
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.54 || ^1.0",
- "phpunit/phpunit": "^7.5.20 || ^8.5.14",
+ "phpunit/php-file-iterator": "^2.0.5",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23",
"squizlabs/php_codesniffer": "^3.4"
},
"bin": [
"type": "tidelift"
}
],
- "time": "2022-02-13T18:13:33+00:00"
+ "time": "2022-04-25T19:31:17+00:00"
},
{
"name": "neutron/temporary-filesystem",
},
{
"name": "psy/psysh",
- "version": "v0.11.2",
+ "version": "v0.11.3",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
- "reference": "7f7da640d68b9c9fec819caae7c744a213df6514"
+ "reference": "6833626ee48ef9bcc8aca8f9f166760441c12573"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/bobthecow/psysh/zipball/7f7da640d68b9c9fec819caae7c744a213df6514",
- "reference": "7f7da640d68b9c9fec819caae7c744a213df6514",
+ "url": "https://api.github.com/repos/bobthecow/psysh/zipball/6833626ee48ef9bcc8aca8f9f166760441c12573",
+ "reference": "6833626ee48ef9bcc8aca8f9f166760441c12573",
"shasum": ""
},
"require": {
"symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.2",
- "hoa/console": "3.17.05.02"
+ "bamarni/composer-bin-plugin": "^1.2"
},
"suggest": {
"ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)",
"ext-pdo-sqlite": "The doc command requires SQLite to work.",
"ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.",
- "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.",
- "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit."
+ "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history."
},
"bin": [
"bin/psysh"
],
"support": {
"issues": "https://github.com/bobthecow/psysh/issues",
- "source": "https://github.com/bobthecow/psysh/tree/v0.11.2"
+ "source": "https://github.com/bobthecow/psysh/tree/v0.11.3"
},
- "time": "2022-02-28T15:28:54+00:00"
+ "time": "2022-05-05T02:19:43+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",