$db->books->numerotation('text', 0, false);\r
$db->books->changedate('integer', 0, false);\r
$db->books->compiledate('integer', 0, false);\r
+ $db->books->version('integer',0,false,2);\r
// Clés\r
$db->books->primary('pk_books', 'book_id');\r
$db->books->index('index_books_nom', 'BTREE', 'nom');\r
}\r
if ($droits->revendeur) {\r
$res .= '<th>' . commonUrl::orderby(__('Status'), 'status', $settings, 'sort' . $change) . '</th>';\r
+ $res.='<th>' . __('V') . '</th>';\r
}\r
$res .= str_repeat('<th class="min"></th>', $droits->creation ? 5 : 4);\r
$res .= '</tr>';\r
} else if ($book->status > 1) {\r
$res .= '<td>' . $core->books_status[1] . '</td>';\r
}\r
+ $res.='<td>'.$book->version.'</td>';\r
+ }\r
+ if ($book->version > 1 || $droits->admin) {\r
+ $res .= '<td class="bouton"><a class="popupFSBar" rel="toolbar=yes" rev="viewer_' . $book->book_id . '" href="' . SITE_PATH . 'viewer/' . $book->book_id . '_' . $book->hash . '/">' . $btVoir . '</a></td>';\r
+ $res .= '<td class="bouton"><a class="popupFSBar" rel="toolbar=yes" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '">' . $btEdit . '</a></td>';\r
+ } else {\r
+ $res.='<td></td><td></td>';\r
}\r
- $res .= '<td class="bouton"><a class="popupFSBar" rel="toolbar=yes" rev="viewer_' . $book->book_id . '" href="' . SITE_PATH . 'viewer/' . $book->book_id . '_' . $book->hash . '/">' . $btVoir . '</a></td>';\r
- $res .= '<td class="bouton"><a class="popupFSBar" rel="toolbar=yes" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '">' . $btEdit . '</a></td>';\r
$res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '">' . $btStats . '</a></td>';\r
- $res .= '<td class="bouton"><a href="#" class="openContextMenu" rel="' . $context_download_id . '" rev="' . $book->book_id . '">' . $btDownload . '</a></td>';\r
+ if ($book->version > 1) {\r
+ $res .= '<td class="bouton"><a href="#" class="openContextMenu" rel="' . $context_download_id . '" rev="' . $book->book_id . '">' . $btDownload . '</a></td>';\r
+ } else {\r
+ $res.='<td></td>';\r
+ }\r
if ($droits->creation) {\r
$res .= '<td class="bouton"><a href="#" rel="supprimeBook/' . $book->book_id . '" class="ajax" title="' . __('Êtes-vous certain de vouloir supprimer cette publication ?') . '">' . $btDel . '</a></td>';\r
}\r
$res .= '<td>' . date('Y-m-d H:i:s', $time) . '</td>';\r
$res .= '<td class="center">' . $infos['links'] . '</td>';\r
$res .= '<td class="center">' . $infos['rulers'] . '</td>';\r
- $res.='<td class="center">'.$infos['user'].'</td>';\r
- $res.='<td class="center">'.$infos['comments'].'</td>';\r
+ $res.='<td class="center">' . $infos['user'] . '</td>';\r
+ $res.='<td class="center">' . $infos['comments'] . '</td>';\r
$res .= '<td><a href="#" rel="' . $book_id . '/' . $time . '" class="restoreLink">' . __('Restaurer') . '</a></td>';\r
$res .= '<td><a href="' . SITE_PATH . 'exportLinksAsExcel/' . $book_id . '/' . $time . '">' . str_replace(' ', ' ', __('Export Excel')) . '</a></td>';\r
$res .= '</tr>';\r
protected static function checkDocumentVersionOfBook($book_id) {\r
global $core;\r
cubePHP::neverStop();\r
- $dao = new wsDAOBook($core->con);\r
+ $daoBook = new wsDAOBook($core->con);\r
+ $book = $daoBook->selectById($book_id);\r
+ if ($book->version == 2) {\r
+ return;\r
+ }\r
$pages = $dao->getPagesOfBook($book_id);\r
$toUpdate = array();\r
foreach ($pages as $p => $infos) {\r
$daoDoc = new wsDAODocument($core->con);\r
$daoDoc->setLinksFromOldFluidbook($book_id);\r
}\r
+\r
+ $daoBook->setVersion($book_id, 2);\r
}\r
\r
public static function testOldLink($args) {\r
$book->facturable_id = $r->facturable_id;\r
$book->tache = $r->tache;\r
$book->projet = $r->projet;\r
+ $book->version=$r->version;\r
\r
return $book;\r
}\r
$book->parametres = new wsBookParametres();\r
$book->tache = 0;\r
$book->pages = array();\r
+ $book->version=2;\r
return $book;\r
}\r
\r
$c->theme = $r->theme;\r
$c->changedate = TIME;\r
$c->compiledate = 0;\r
+ $c->version=2;\r
$book_id = $c->book_id = $this->getNextId();\r
$c->insert();\r
\r
$c->lang = $lang;\r
$c->changedate = TIME;\r
$c->compiledate = TIME;\r
+ $c->version=2;\r
$book_id = $c->book_id = $this->getNextId();\r
$c->insert();\r
return $this->selectById($book_id);\r
$c->status = 2;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
+ \r
+ public function setVersion($book_id,$version){\r
+ $c=$this->con->openCursor('books');\r
+ $c->version=$version;\r
+ $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+ \r
+ }\r
\r
public function touch($book_id) {\r
$c = $this->con->openCursor('books');\r