function move()
 {
     if (logged_user()->isGuest()) {
         flash_error(lang('no access permissions'));
         ajx_current("empty");
         return;
     }
     ajx_current("empty");
     $ids = array_var($_GET, 'ids');
     if (!$ids) {
         return;
     }
     $wsid = array_var($_GET, 'ws');
     $keep = array_var($_GET, 'keep', 1) == 1;
     $atts = array_var($_GET, 'atts', 0) == 1;
     $workspace = Projects::findById($wsid);
     if (!$workspace instanceof Project) {
         flash_error(lang('project dnx'));
         return;
     }
     $id_list = explode(",", $ids);
     $err = 0;
     $succ = 0;
     foreach ($id_list as $cid) {
         list($manager, $id) = explode(":", $cid);
         if (isset($maganer) && $maganer == 'Projects') {
             continue;
         }
         try {
             $obj = get_object_by_manager_and_id($id, $manager);
             if ($obj instanceof ProjectDataObject && $obj->canEdit(logged_user())) {
                 if ($obj instanceof MailContent) {
                     $conversation = MailContents::getMailsFromConversation($obj);
                     $count = 0;
                     foreach ($conversation as $conv_email) {
                         $count += MailController::addEmailToWorkspace($conv_email->getId(), $workspace, $keep);
                         if (array_var($_GET, 'atts') && $conv_email->getHasAttachments()) {
                             MailUtilities::parseMail($conv_email->getContent(), $decoded, $parsedEmail, $warnings);
                             $classification_data = array();
                             for ($j = 0; $j < count(array_var($parsedEmail, "Attachments", array())); $j++) {
                                 $classification_data["att_" . $j] = true;
                             }
                             $tags = implode(",", $conv_email->getTagNames());
                             MailController::classifyFile($classification_data, $conv_email, $parsedEmail, array($workspace), $keep, $tags);
                         }
                     }
                     $succ++;
                 } else {
                     $remain = 0;
                     if (!$keep || $obj instanceof ProjectTask || $obj instanceof ProjectMilestone) {
                         // Tasks and Milestones can have only 1 workspace
                         $removed = "";
                         $ws = $obj->getWorkspaces();
                         foreach ($ws as $w) {
                             if (can_add(logged_user(), $w, get_class($obj->manager()))) {
                                 $obj->removeFromWorkspace($w);
                                 $removed .= $w->getId() . ",";
                             } else {
                                 $remain++;
                             }
                         }
                         $removed = substr($removed, 0, -1);
                         $log_action = ApplicationLogs::ACTION_MOVE;
                         $log_data = ($removed == "" ? "" : "from:{$removed};") . "to:{$wsid}";
                     } else {
                         $log_action = ApplicationLogs::ACTION_COPY;
                         $log_data = "to:{$wsid}";
                     }
                     if ($remain > 0 && ($obj instanceof ProjectTask || $obj instanceof ProjectMilestone)) {
                         $err++;
                     } else {
                         $obj->addToWorkspace($workspace);
                         ApplicationLogs::createLog($obj, $obj->getWorkspaces(), $log_action, false, null, true, $log_data);
                         $succ++;
                     }
                 }
             } else {
                 $err++;
             }
         } catch (Exception $e) {
             $err++;
         }
     }
     if ($err > 0) {
         flash_error(lang("error move objects", $err));
     } else {
         flash_success(lang("success move objects", $succ));
     }
 }