From: vincent@cubedesigners.com Date: Fri, 22 Apr 2011 13:51:22 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=531ac9e62744caed6fd2a67641b85343e20bb753;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index a71052728..c4bae8d1f 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -675,6 +675,17 @@ class wsAjax extends cubeAjax { $dao->reinitDemande($demande_id); $x->addContent('listeDemandes' , wsUrl::listeDemandes()); } + + public static function restoreLinksVersion($args, &$x) + { + global $core; + + $book_id = $args[1]; + $date = $args[2]; + + $dao = new wsDAODocument($core->con); + $dao->restoreLinksVersion($book_id, $date); + } } ?> \ No newline at end of file diff --git a/inc/ws/DAO/class.ws.dao.document.php b/inc/ws/DAO/class.ws.dao.document.php index 7d42e3a02..7fea96e8c 100644 --- a/inc/ws/DAO/class.ws.dao.document.php +++ b/inc/ws/DAO/class.ws.dao.document.php @@ -33,6 +33,11 @@ class wsDAODocument extends commonDAO { } } + public function restoreLinksVersion($book_id, $update) + { + $core->con->execute('INSERT INTO document_links_version SELECT document_id,links,rulers,' . TIME . ' FROM document_links_version WHERE `update`=' . $update . ' AND document_id IN (SELECT document_id FROM book_pages WHERE book_id=' . $book_id . ')'); + } + public function putLinksFromCSV($document_id) { $log = array('Copie des liens du PDF vers la base de données'); diff --git a/js/ws.js b/js/ws.js index 4f83309fa..521913e07 100644 --- a/js/ws.js +++ b/js/ws.js @@ -35,7 +35,7 @@ function load_ws(){ function restoreLink(){ $.ajax({ - url : SITE_PATH+'ajax/restoreLink/'+$(this).attr('rel'), + url : SITE_PATH+'ajax/restoreLinksVersion/'+$(this).attr('rel'), success : function(data){window.opener.location=window.opener.location;window.close();} }); return false;