protected function singleton($r)
{
- if (isset($r->id)) {
- $book = new wsBook();
- $book->book_id = $r->id;
- $book->cid = $r->cid;
- $book->nom = $r->name;
- $book->lang = $r->locale;
- $book->theme = $r->theme;
- $book->proprietaire = $r->proprietaire_nom;
- $book->proprietaire_id = $r->owner;
- $book->proprietaire_utilisateur = $r->proprietaire_utilisateur;
- $book->hash = $r->hash;
- $book->compteur_visites = $r->visits_counter;
- $book->status = $r->status;
- $book->date_status = self::_toTimestamp($r->status_date);
- $book->date = self::_toTimestamp($r->created_at);
- $book->pages = array();
- $book->chapters = $r->chapters;
- $book->traductions = $r->translations;
-// $book->specialLinks = $r->specialLinks;
-// $book->specialRulers = $r->specialRulers;
- $book->parametres = new wsBookParametres($this);
- $book->parametres->importFromJson($r->settings);
- //$book->extras = $r->extras;
- $book->numerotation = $r->page_numbers;
- $book->changedate = self::_toTimestamp($r->updated_at);
- $book->compilehtml5date = $book->compile1date = $book->compiledate = self::_toTimestamp($r->compilation_date);
- $book->facturable = $r->facturable;
- $book->facturable_id = $r->facturable_id;
- $book->tache = $r->extranet_task;
- if (isset($r->projet)) {
- $book->projet = $r->projet;
- }
- $book->version = 2;
- $book->composition_update = self::_toTimestamp($r->composition_updated_at);
-// $book->demo_counter = $r->demo_counter;
- $book->exportdatas = $r->exportdatas;
- } else {
- $book = new wsBook();
- $book->book_id = $r->book_id;
- $book->cid = $r->cid;
- $book->nom = $r->nom;
- $book->lang = $r->lang;
- $book->theme = $r->theme;
+
+ $book = new wsBook();
+ $book->book_id = $r->book_id;
+ $book->cid = $r->cid;
+ $book->nom = $r->nom;
+ $book->lang = $r->lang;
+ $book->theme = $r->theme;
+ if (isset($r->proprietaire_nom)) {
$book->proprietaire = $r->proprietaire_nom;
+ }
+ if (isset($r->proprietaire_id)) {
$book->proprietaire_id = $r->proprietaire_id;
+ }
+ if (isset($r->proprietaire_utilisateur)) {
$book->proprietaire_utilisateur = $r->proprietaire_utilisateur;
- $book->hash = $r->hash;
- $book->compteur_visites = $r->compteur_visites;
- $book->status = $r->status;
- $book->date_status = $r->date_status;
- $book->date = $r->date;
- $book->pages = array();
- $book->chapters = $r->chapters;
- $book->traductions = $r->traductions;
- $book->specialLinks = $r->specialLinks;
- $book->specialRulers = $r->specialRulers;
- $book->parametres = $r->parametres;
- $book->extras = $r->extras;
- $book->numerotation = $r->numerotation;
- $book->changedate = $r->changedate;
- $book->compiledate = $r->compiledate;
- $book->compile1date = $r->compile1date;
- $book->compilehtml5date = $r->compilehtml5date;
+ }
+ $book->hash = $r->hash;
+ $book->compteur_visites = $r->compteur_visites;
+ $book->status = $r->status;
+ $book->date_status = $r->date_status;
+ $book->date = $r->date;
+ $book->pages = array();
+ $book->chapters = $r->chapters;
+ $book->traductions = $r->traductions;
+ $book->specialLinks = $r->specialLinks;
+ $book->specialRulers = $r->specialRulers;
+ $book->parametres = $r->parametres;
+ $book->extras = $r->extras;
+ $book->numerotation = $r->numerotation;
+ $book->changedate = $r->changedate;
+ $book->compiledate = $r->compiledate;
+ $book->compile1date = $r->compile1date;
+ $book->compilehtml5date = $r->compilehtml5date;
+ if (isset($r->facturable)) {
$book->facturable = $r->facturable;
+ }
+ if (isset($r->facturable_id)) {
$book->facturable_id = $r->facturable_id;
- $book->tache = $r->tache;
- if (isset($r->projet)) {
- $book->projet = $r->projet;
- }
- $book->version = $r->version;
- $book->composition_update = $r->composition_update;
- $book->demo_counter = $r->demo_counter;
- $book->exportdatas = $r->exportdatas;
}
+ $book->tache = $r->tache;
+ if (isset($r->projet)) {
+ $book->projet = $r->projet;
+ }
+ $book->version = $r->version;
+ $book->composition_update = $r->composition_update;
+ $book->demo_counter = $r->demo_counter;
+ $book->exportdatas = $r->exportdatas;
+
return $book;
}
}
-
public function compileTemp($book_id, $version, $dir)
{
if ($version == 'ha' || $version == 'hi') {