Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
viewdestroydoc.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Difference between 2 documents
9  *
10  * @author Anakeen 2006
11  * @version $Id: diffdoc.php,v 1.5 2008/08/14 09:59:14 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 
19 include_once ("FDL/Class.Dir.php");
20 include_once ("FDL/Class.DocLog.php");
21 /**
22  * View last history items of destroyed documents
23  * @param Action &$action current action
24  * @global id Http var : document to see
25  */
27 {
28  $docid = $action->getArgument("id");
29  $dbaccess = $action->GetParam("FREEDOM_DB");
30  $d = new_doc($dbaccess, $docid);
31  if ($d->isAffected()) {
32  $action->exitError(sprintf(_("document %s [%d] is not destroyed") , $d->getTitle() , $d->id));
33  }
34 
35  $q = new QueryDb($dbaccess, "dochisto");
36  $q->AddQuery("id=" . $docid);
37  $l = $q->Query(0, 1, "TABLE");
38  if (is_array($l)) {
39 
40  $initid = $l[0]["initid"];
41  if ($initid) {
42  $q = new QueryDb($dbaccess, "dochisto");
43  $q->AddQuery("initid=" . $initid);
44  $q->order_by = 'date desc';
45  $limit = 10;
46  $l = $q->Query(0, $limit, "TABLE");
47  $action->lay->setBlockData("HISTO", $l);
48  $q = new QueryDb($dbaccess, "doclog");
49  $q->AddQuery("initid=" . $initid);
50  $limit = 0;
51  $q->order_by = 'date desc';
52  $l = $q->Query(0, $limit, "TABLE");
53  if ($q->nb > 0) {
54  $title = $l[0]["title"];
55  $action->lay->setBlockData("LOG", $l);
56  }
57  }
58  }
59 
60  $action->lay->set("title", $title);
61  $action->lay->set("trace", sprintf(_("Last traces of %s document : %s") , $docid, $title));
62 }
63 ?>
← centre documentaire © anakeen - published under CC License - Dynacase