head     1.1;
branch   1.1.1;
access   ;
symbols  webdox:1.1.1.1 start:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     2004.01.16.02.55.28;  author spike;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     2004.01.16.02.55.28;  author spike;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@<?
include_once "./setting.php";

include_once $global["root"] . "/include/handle.php";
include_once $global["root"] . "/include/print_array.php";

include_once $global["root"] . "/lib/Site.php";
include_once $global["root"] . "/lib/Basic_Doc_Group.php";
include_once $global["root"] . "/lib/Item.php";

if (! $_POST["group_no"]) goprev();
if (! $_POST["items"]) goprev();

// escape error.
$Site = new Site;
$Site->init();
$Site->set_permission("user");

extract($_POST);

$Site->DB->transaction_start(true);

switch ($_POST["action"]) {

	case ("copy") :
		$Group = new Basic_Doc_Group;
		$retval = $Group->add_item($group_no, $items);
	break;

	case ("move") :
		$Group = new Basic_Doc_Group;

		if ($src_group_no == "a") {
			$retval = $Group->add_item($group_no, $items);
		} else {
			$retval = $Group->move_item($src_group_no, $group_no, $items);
		}
	break;

	case ("remove") :
		if ($src_group_no != "a") {
			$Group = new Basic_Doc_Group;
			$retval = $Group->remove_item($group_no, $items);
		} else {
			$Site->end1();
			goprev();
		}
	break;

	case ("trash") :
		$Group = new Basic_Doc_Group;

		// remove items in all group.
		$retval = $Group->remove_item_in_all_group($items);

	break;

	case ("real_remove") :

		$Group = new Basic_Doc_Group;
		$Item = new Item;

		// remove items in all group.
		$retval = $Group->remove_item_in_all_group($items);

		$a = explode(",", $items);
		while (list($i, $j) = each($a)) {
			$n = $Item->get_no($j, $_SESSION["user_item_type_rv"]["doc"]);
			$Item->set($n);
			$Item->remove(true);
		}

	break;

	default :
		$Site->end1();
		goprev();
}

//-------------------------------------------------------------------------------
$Site->DB->retval = $retval;
$Site->DB->close();

if ($retval) {
	$url = sprintf("Location: %s/mail.php?mode=doc&no=%s&pg=%s",
		$_SESSION["user_global_url"], $_SESSION["user_doc_group_no"],
		$_SESSION["user_doc_page_number"]);

	$Site->end1();

	Header($url);
	exit;
} else {
	$Site->end1();

	goprev();
}

/*
Description
-----------

Author
------
 Spike^ekipS <spike@@spikeekips.net>

Changelog
---------

Usage
-----

*/

?>
@


1.1.1.1
log
@Mesian
@
text
@@
