Platform  3.1
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  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Functions to un-affect document to an user
9  *
10  * @author Anakeen 2000
11  * @version $Id: desaffect.php,v 1.2 2006/08/11 15:48:17 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.Doc.php");
20 include_once ("FDL/mailcard.php");
21 /**
22  * Edition to un-saffect document
23  * @param Action &$action current action
24  * @global id Http var : document id to affect
25  * @global _id_affectuser Http var : user identificator to affect
26  * @global _actioncomment Http var : description of the action
27  */
28 function desaffect(&$action)
29 {
30  $docid = GetHttpVars("id");
31  $dbaccess = $action->GetParam("FREEDOM_DB");
32 
33  $doc = new_doc($dbaccess, $docid);
34  if (!$doc->isAlive()) $action->exitError(sprintf(_("document #%s not found. Unaffectation aborded") , $docid));
35 
36  $err = $doc->unallocate();
37  if ($err != "") $action->exitError($err);
38 
39  if ($err == "") {
40  $action->AddActionDone("UNLOCKDOC", $doc->id);
41 
42  $action->addWarningMsg(sprintf(_("document %s has been unaffected") , $doc->title, $docu->title));
43  }
44 
45  redirect($action, GetHttpVars("redirect_app", "FDL") , GetHttpVars("redirect_act", "FDL_CARD&latest=Y&refreshfld=Y&id=" . $doc->id) , $action->GetParam("CORE_STANDURL"));
46 }
47 ?>
← centre documentaire © anakeen - published under CC License - Dynacase