- '/home/toolbox/www:/application'
- '/home/toolbox/www/storage/app/public/:/application/public/storage/'
- '/mnt/sshfs/godzilla/data/fluidbook/docs/:/application/protected/fluidbookpublication/docs/'
+ - '/mnt/sshfs/godzilla/data/fluidbook/docs/:/application/fluidbook/docs/'
- '/data/extranet/www/fluidbook/books/working/:/application/protected/fluidbookpublication/working/'
- '/home/extranet:/home/extranet'
- '/data/extranet:/data/extranet'
- '/home/toolbox/www:/application'
- '/home/toolbox/www/storage/app/public/:/application/public/storage/'
- '/mnt/sshfs/godzilla/data/fluidbook/docs/:/application/protected/fluidbookpublication/docs/'
+ - '/mnt/sshfs/godzilla/data/fluidbook/docs/:/application/fluidbook/docs/'
- '/data/extranet/www/fluidbook/books/working/:/application/protected/fluidbookpublication/working/'
- '/home/extranet:/home/extranet'
- '/data/extranet:/data/extranet'
class WorkshopMigration extends CubistCommand
{
- protected $signature = 'ws:migrate {--publications=v2} {--documents=v2}';
+ protected $signature = 'ws:migrate {--publications=v2} {--documents=missing}';
protected $description = 'Migrate data from Workshop V2';
protected $_wsRanks = [];
protected $_oldDB = 'extranet_clean';
protected function importDocuments()
{
- if($this->option('documents')==='none'){
+ if ($this->option('documents') === 'none') {
return;
}
$q = DB::table($this->_oldDB . '.documents')->orderBy('document_id', 'desc');
- if ($this->option('documents') === 'v2') {
+ if ($this->option('documents') === 'missing') {
+ $maxID = FluidbookDocument::where('id', '<', $ws3step)->orderBy('id', 'DESC')->first()->id;
+ $q = DB::table($this->_oldDB . '.documents')->where('document_id', '>', $maxID)->orderBy('document_id', 'desc');
+
+ } else if ($this->option('documents') === 'v2') {
DB::update('DELETE FROM fluidbook_document WHERE id<' . $ws3step);
} else if ($this->option('documents') === 'all') {
FluidbookDocument::truncate();
protected function importPublications($reset = false)
{
- if($this->option('publications')==='none'){
+ if ($this->option('publications') === 'none') {
return;
}
class FluidbookDocument extends ToolboxModel
{
- public const WS_DOCS = '/application/protected/fluidbookpublication/docs/';
+ public const WS_DOCS = '/application/fluidbook/docs/';
protected $table = 'fluidbook_document';
protected $_options = ['name' => 'fluidbook-document',
'singular' => 'document',
return sqrt($a4surface / $docSurface);
}
+ public function getPageSize($page)
+ {
+ return $this->pdf_data['page'][$page]['size'];
+ }
+
public function processUpload($uploadID, $sync = false)
{
$this->processSync = $sync;
public function _getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html')
{
if (!$this->hasFile($page, $format, $resolution, $withText, $withGraphics, $version)) {
- return FluidbookFarm::getFile($page, $format, $resolution, $withText, $withGraphics, $version, $this->getResolutionRatio(), $this->getMobileFirstRatio(), $this->path() . '/');
+ return FluidbookFarm::getFile($page, $format, $resolution, $withText, $withGraphics, $version, $this->getResolutionRatio(), $this->getMobileFirstRatio(), $this->path());
}
$path = $this->_getPath($page, $format, $resolution, $withText, $withGraphics, $version);
{
/** @var \App\Models\User $owner */
$owner = \App\Models\User::find($this->owner);
+ if (null === $owner) {
+ $this->owner = 1;
+ $this->saveQuietly();
+ $owner = \App\Models\User::find(1);
+ }
/** @var Company $company */
$company = Company::find($owner->company);
public function getDocumentSize($page = 1)
{
- $sizes = $this->getDocumentSizes();
- return $sizes[$this->composition[$page][0]];
+ $document=$this->getDocument($page);
+ return $document->getPageSize($this->composition[$page][1]);
}
public function getPageWidth($page = 1)
this.loader.loadPage(this.currentPage + 1, 'right');
}
$("#linkeditor-page-field input").val(this.currentPage);
+ if (this.mobileFirst) {
+ this.zoom.reset();
+ }
this.resize.resize();
this.loader.preloadPages();
},
this.updateWindowDimensions();
this.resizeMain();
this.resizeCanvas();
- if(this.linkeditor.panels) {
+ if (this.linkeditor.panels) {
this.linkeditor.panels.resize(this.ww);
}
this.linkeditor.rulers.updateRulers();
- if(this.linkeditor.popup){
+ if (this.linkeditor.popup) {
this.linkeditor.popup.resize();
}
},
var aw = this.linkeditor.canvasRect.width - 30;
var ah = this.linkeditor.canvasRect.height - 30;
this.linkeditor.fs = Math.min(aw / this.linkeditor.fw, ah / this.linkeditor.fh);
- var left = ((this.linkeditor.canvasRect.width * 2) - this.linkeditor.fw * this.linkeditor.fs) / 2;
- var top = ((this.linkeditor.canvasRect.height * 2) - this.linkeditor.fh * this.linkeditor.fs) / 2;
+
+ let left, top;
+
+ if (!this.linkeditor.mobileFirst) {
+ left = ((this.linkeditor.canvasRect.width * 2) - this.linkeditor.fw * this.linkeditor.fs) / 2;
+ top = ((this.linkeditor.canvasRect.height * 2) - this.linkeditor.fh * this.linkeditor.fs) / 2;
+ } else {
+ left = (this.linkeditor.canvasRect.width - this.linkeditor.fw * this.linkeditor.fs) / 2;
+ top = 100;
+ }
$("#linkeditor-fluidbook").css({left: left, top: top, transform: 'scale(' + this.linkeditor.fs + ')'});
},
};
},
+ maxPageHeight: function () {
+
+ },
+
normalizePage: function (page) {
page = parseInt(page);
if (page % 2 === 1 && !this.linkeditor.single) {
this.zoom = 1;
this.zoomdragging = false;
- $("#linkeditor-main").on('wheel', function (e) {
- var step = $this.zoom >= 1 ? 0.25 : 0.1;
- $this.linkeditor.setMouseCoordinates(e);
- let delta = e.originalEvent.deltaY;
- if (delta === 0) {
- return true;
- }
- e.stopPropagation();
- e.stopImmediatePropagation();
- e.preventDefault();
- if (delta < 0) {
- if ($this.setZoom($this.zoom + step)) {
- $this.moveZoom(e);
+ if (!this.linkeditor.mobileFirst) {
+ $("#linkeditor-main").on('wheel', function (e) {
+ var step = $this.zoom >= 1 ? 0.25 : 0.1;
+ $this.linkeditor.setMouseCoordinates(e);
+ let delta = e.originalEvent.deltaY;
+ if (delta === 0) {
+ return true;
}
- } else {
- $this.setZoom($this.zoom - step);
- }
- return false;
- });
+ e.stopPropagation();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ if (delta < 0) {
+ if ($this.setZoom($this.zoom + step)) {
+ $this.moveZoom(e);
+ }
+ } else {
+ $this.setZoom($this.zoom - step);
+ }
+ return false;
+ });
+ }
},
mouseUp: function () {
},
setZoom: function (z, force) {
+ if (!this.linkeditor.mobileFirst) {
+ z = 1;
+ }
let $this = this;
z = this.normalizeZoom(z);
- if (force !== true && z === this.zoom) {
- return false;
- }
+
this.zoom = z;
- let cw2 = this.linkeditor.canvasRect.width * 2;
- let ch2 = this.linkeditor.canvasRect.height * 2;
- let zh = ch2;
- if (this.zoom < 1) {
- zh *= this.zoom;
+
+ let cw2, ch2, zh;
+ if (this.linkeditor.mobileFirst) {
+ cw2 = this.linkeditor.canvasRect.width;
+ zh = parseFloat(FLUIDBOOK_DATA.pages_max_height) + 200;
+ } else {
+ cw2 = this.linkeditor.canvasRect.width * 2;
+ ch2 = this.linkeditor.canvasRect.height * 2;
+ zh = ch2;
+ if (this.zoom < 1) {
+ zh *= this.zoom;
+ }
}
+
$("#linkeditor-canvas").attr('data-z', this.zoom);
$("#linkeditor-zoom").css({
transform: 'scale(' + this.zoom + ')', overflow: 'visible',
reset: function () {
this.setZoom(1);
- $("#linkeditor-canvas").scrollTo({top: '50%', left: '50%'});
+ var top = this.linkeditor.mobileFirst ? 0 : '50%';
+ $("#linkeditor-canvas").scrollTo({top: top, left: '50%'});
this.resetZoomDrag();
},
};
$fbdata['settings']['width']=$fbdata['width']=$fluidbook->getPageWidth();
$fbdata['settings']['height']=$fbdata['height']=$fluidbook->getPageHeight();
$fbdata['settings']['pages']=$fbdata['pages']=$fluidbook->getPagesNumber();
+ $mh = 0;
+ for($i=1;$i<=$fbdata['pages'];$i++){
+ $mh = max($mh, $fluidbook->getPageHeight($i));
+ }
+ $fbdata['pages_max_height']=$mh;
+
$translations=[
'success_save'=>__('Liens sauvegardés'),
'error_save'=>__('Une erreur s\'est produite lors de la sauvegarde des liens'),
<div class="popup" data-popup="moveLinks" style="max-width: 300px">
<h2>{{__('Déplacer les liens')}}</h2>
<a nohref="" class="close" data-icon="close"></a>
- <form action="/fluidbook-publication/{{$fbdata['id']}}/edit/links/move" data-save-before-submit="{{__("Sauvegarde avant le déplacement de liens")}}" class="reloadAfterSuccess" method="post">
+ <form action="/fluidbook-publication/{{$fbdata['id']}}/edit/links/move"
+ data-save-before-submit="{{__("Sauvegarde avant le déplacement de liens")}}"
+ class="reloadAfterSuccess" method="post">
@csrf
<p>{!! __('Déplacer les liens de :nb pages :br à partir de la page :page',
['br'=>'</p><p>','nb'=>'<input type="number" name="number">','page'=>'<input type="text" name="start">'])!!}</p>
<div class="separator"></div>
<div data-icon="import-links"
data-tooltip="{{__('Importer les liens (Remplacer)')}}">
- <form class="importExcel" data-save-before-submit="{{__("Sauvegarde avant l'import d'un fichier excel")}}"
+ <form class="importExcel"
+ data-save-before-submit="{{__("Sauvegarde avant l'import d'un fichier excel")}}"
action="/fluidbook-publication/{{$fbdata['id']}}/edit/links/import/replace" method="post"
enctype="multipart/form-data">
<input type="file"
</div>
<div data-icon="merge-links"
data-tooltip="{{__('Importer les liens (Ajouter)')}}">
- <form class="importExcel" data-save-before-submit="{{__("Sauvegarde avant l'import d'un fichier excel")}}"
+ <form class="importExcel"
+ data-save-before-submit="{{__("Sauvegarde avant l'import d'un fichier excel")}}"
action="/fluidbook-publication/{{$fbdata['id']}}/edit/links/import/merge" method="post"
enctype="multipart/form-data">
<input type="file"