Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
foliolist.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Folio List Containt
8  *
9  * @author Anakeen
10  * @version $Id: foliolist.php,v 1.16 2007/10/19 15:20:14 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ('FREEDOM/freedom_view.php');
18 include_once ('FREEDOM/Lib.portfolio.php');
19 /**
20  * View a containt of portfolio separator
21  * @param Action &$action current action
22  * @global string $dirid Http var : separator identifier to see
23  * @global string $folioid Http var : portfolio of separator
24  */
26 {
27  // Get all the params
28  $dirid = GetHttpVars("dirid"); // directory to see
29  $folioid = GetHttpVars("folioid"); // portfolio id
30  $refreshtab = (GetHttpVars("refreshtab", "N") == "Y"); // need refresh tabs
31  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/resizeimg.js");
32 
33  $filter = array();
34  if (($dirid == $folioid) || ($folioid == 0)) {
35  $filter[] = "doctype != 'S'";
36  $filter[] = "doctype != 'D'";
37  }
38  $dir = new_Doc($action->dbaccess, $dirid);
39  if (($dir->doctype == 'S')) {
40  if ($dir->usefor == 'G') {
41  // recompute search to restriction to local folder
42  // only for filters
43  $dir->id = "";
44  $dir->initid = "";
45  $dir->doctype = 'T';
46  $dir->setValue("SE_IDFLD", $folioid);
47  $dir->setValue("SE_SUBLEVEL", "1");
48  $dir->setValue("SE_ORDERBY", "title");
49  $dir->Add();
50  $dir->preRefresh();
51  $dir->Modify();
52  SetHttpVar("dirid", $dir->initid); // redirect dirid to new temporary search
53 
54  } else {
55  // recompute search to add current father folder
56  // $dir->id="";
57  // $dir->initid="";
58  // $dir->doctype='T';
59  if (($folioid > 0) && ($dir->getRawValue("SE_IDCFLD") != $folioid)) {
60  $dir->setValue("SE_IDCFLD", $folioid);
61  $dir->setValue("SE_ORDERBY", "title");
62  // $dir->Add();
63  $dir->preRefresh();
64  $dir->Modify();
65  }
66  // SetHttpVar("dirid",$dir->initid); // redirect dirid to new temporary search
67 
68 
69  }
70  }
71 
72  $pfctx = portfolio_get_context($dir);
73  $action->lay->set("LISTICON", $pfctx['listtype'] == 'icon');
74 
75  if ($folioid) {
76  $dir = new_Doc($action->dbaccess, $folioid);
77  }
78 
79  $action->lay->set("docid", $dir->initid);
80  $pfctx = portfolio_get_context($dir);
81  $action->lay->set("FRAMELISTWIDTH", '180');
82  if (isset($pfctx['framelistwidth'])) {
83  $action->lay->set("FRAMELISTWIDTH", $pfctx['framelistwidth']);
84  }
85 
86  setHttpVar("sqlorder", "title");
87  $action->parent->SetVolatileParam("FREEDOM_VIEW", "icon");
88  $nbdoc = viewfolder($action, false, true, false, 100, $filter);
89  if ($nbdoc > 1) $action->lay->set("docs", _("documents"));
90  else $action->lay->set("docs", _("document"));
91 
92  $action->lay->set("refreshtab", $refreshtab);
93 }
global $action
SetHttpVar($name, $def)
Definition: Lib.Http.php:150
portfolio_get_context($doc)
viewfolder(Action &$action, $with_abstract=false, $with_popup=true, $column=false, $slice="-", $sqlfilters=array(), $famid="", $paginationType="none")
Definition: viewfolder.php:34
new_Doc($dbaccess, $id= '', $latest=false)
$dir
Definition: resizeimg.php:144
foliolist(Action &$action)
Definition: foliolist.php:25
← centre documentaire © anakeen