Core  3.2
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  * @package FDL
5 */
6 /**
7  * Difference between 2 documents
8  *
9  * @author Anakeen
10  * @version $Id: diffdoc.php,v 1.5 2008/08/14 09:59:14 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Dir.php");
18 include_once ("FDL/Class.DocLog.php");
19 /**
20  * View last history items of destroyed documents
21  * @param Action &$action current action
22  * @global id int Http var : document to see
23  */
25 {
26  $docid = $action->getArgument("id");
27  $dbaccess = $action->dbaccess;
28  $d = new_doc($dbaccess, $docid);
29  if ($d->isAffected()) {
30  $action->exitError(sprintf(_("document %s [%d] is not destroyed") , $d->getTitle() , $d->id));
31  }
32 
33  $q = new QueryDb($dbaccess, "dochisto");
34  $q->AddQuery("id=" . $docid);
35  $l = $q->Query(0, 1, "TABLE");
36  $title = '';
37  if (is_array($l)) {
38 
39  $initid = $l[0]["initid"];
40  if ($initid) {
41  $q = new QueryDb($dbaccess, "dochisto");
42  $q->AddQuery("initid=" . $initid);
43  $q->order_by = 'date desc';
44  $limit = 10;
45  $l = $q->Query(0, $limit, "TABLE");
46  $action->lay->eSetBlockData("HISTO", $l);
47  $q = new QueryDb($dbaccess, "doclog");
48  $q->AddQuery("initid=" . $initid);
49  $limit = 0;
50  $q->order_by = 'date desc';
51  $l = $q->Query(0, $limit, "TABLE");
52  if ($q->nb > 0) {
53  $title = $l[0]["title"];
54  $action->lay->eSetBlockData("LOG", $l);
55  }
56  }
57  }
58 
59  $action->lay->eSet("title", $title);
60  $action->lay->eSet("trace", sprintf(_("Last traces of %s document : %s") , $docid, $title));
61 }
global $action
$d
Definition: dav.php:77
viewdestroydoc(Action &$action)
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
static getArgument($k, $def= '')
$dbaccess
Definition: checkVault.php:17
← centre documentaire © anakeen