Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
setlogicalname.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * add new logical name
8  *
9  * @author Anakeen
10  * @version $Id: setlogicalname.php,v 1.3 2008/09/26 12:34:57 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Doc.php");
18 
20 {
21  $dbaccess = $action->dbaccess;
22  $docid = GetHttpVars("id");
23  $name = GetHttpVars("name");
24  if ($docid) {
25  $doc = new_Doc($dbaccess, $docid, true);
26  if (!$doc->isAlive()) {
27  $action->addWarningMsg(sprintf(_("Document %s is not alive") , $doc->getTitle()));
28  } else {
29  $oldName = $doc->name;
30  $err = $doc->setLogicalName($name, true);
31  if ($err != "") {
32  $action->addWarningMsg($err);
33  } elseif (!empty($name)) {
34  if ($oldName) {
35  $doc->addHistoryEntry(sprintf(_("update logical name from %s to %s") , $oldName, $doc->name));
36  } else {
37  $doc->addHistoryEntry(sprintf(_("set logical name to %s") , $doc->name));
38  }
39  }
40  }
41  }
42  redirect($action, "FDL", "IMPCARD&zone=FDL:VIEWPROPERTIES:T&id=" . $docid);
43 }
addWarningMsg($msg)
global $action
setlogicalname(Action &$action)
$docid
Definition: cleanFamily.php:13
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen