Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
desaffect.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Functions to un-affect document to an user
8  *
9  * @author Anakeen
10  * @version $Id: desaffect.php,v 1.2 2006/08/11 15:48:17 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Doc.php");
18 include_once ("FDL/mailcard.php");
19 /**
20  * Edition to un-saffect document
21  * @param Action &$action current action
22  * @global id int Http var : document id to affect
23  * @global _id_affectuser int Http var : user identifier to affect
24  * @global _actioncomment string Http var : description of the action
25  */
26 function desaffect(&$action)
27 {
28  $docid = GetHttpVars("id");
29  $dbaccess = $action->dbaccess;
30 
31  $doc = new_doc($dbaccess, $docid);
32  if (!$doc->isAlive()) $action->exitError(sprintf(_("document #%s not found. Unaffectation aborded") , $docid));
33 
34  $err = $doc->unallocate();
35  if ($err != "") $action->exitError($err);
36 
37  if ($err == "") {
38  $action->AddActionDone("UNLOCKDOC", $doc->id);
39 
40  $action->addWarningMsg(sprintf(_("document %s has been unaffected") , $doc->title));
41  }
42 
43  redirect($action, GetHttpVars("redirect_app", "FDL") , GetHttpVars("redirect_act", "FDL_CARD&latest=Y&refreshfld=Y&id=" . $doc->id) , $action->GetParam("CORE_STANDURL"));
44 }
global $action
$docid
Definition: cleanFamily.php:13
$dbaccess
Definition: checkVault.php:17
desaffect(&$action)
Definition: desaffect.php:26
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen