Esempio n. 1
0
function moveDocumentProcess($uid)
{
    DOCMAN_token::check() or die('Invalid Token');
    global $database, $_DMUSER;
    $doc = new mosDMDocument($database);
    $doc->load($uid);
    //check user permissions
    $err = $_DMUSER->canPreformTask($doc, 'Move');
    if ($err) {
        _returnTo('cat_view', $err, $doc->catid);
    }
    // get the id of the category to move the document to
    $move = (int) mosGetParam($_POST, 'catid');
    // preform move
    $doc = new mosDMDocument($database);
    $doc->move(array($uid), $move);
    _returnTo('cat_view', _DML_DOCMOVED, $move);
}
Esempio n. 2
0
function moveDocumentProcess($cid)
{
    DOCMAN_token::check() or die('Invalid Token');
    $mainframe = JFactory::getApplication();
    $database = JFactory::getDBO();
    $my = JFactory::getUser();
    // get the id of the category to move the document to
    $categoryMove = JRequest::getInt('catid', '', 'post');
    // preform move
    $doc = new mosDMDocument($database);
    $doc->move($cid, $categoryMove);
    // output status message
    $cids = implode(',', $cid);
    $total = count($cid);
    $cat = new mosDMCategory($database);
    $cat->load($categoryMove);
    $msg = $total . ' ' . _DML_DOCUMENTS_MOVED_TO . ' ' . $cat->name;
    $mainframe->redirect('index.php?option=com_docman&section=documents', $msg);
}
function moveDocumentProcess($uid)
{
    DOCMAN_token::check() or die('Invalid Token');
    global $_DMUSER;
    $database = JFactory::getDBO();
    $doc = new mosDMDocument($database);
    $doc->load($uid);
    //check user permissions
    $err = $_DMUSER->canPreformTask($doc, 'Move');
    if ($err) {
        _returnTo('cat_view', $err, $doc->catid);
    }
    // get the id of the category to move the document to
    $move = JRequest::getInt('catid', 0, 'post');
    // preform move
    $doc = new mosDMDocument($database);
    $doc->move(array($uid), $move);
    _returnTo('cat_view', _DML_DOCMOVED, $move);
}
Esempio n. 4
0
function moveDocumentProcess($cid)
{
    DOCMAN_token::check() or die('Invalid Token');
    global $database, $my;
    // get the id of the category to move the document to
    $categoryMove = mosGetParam($_POST, 'catid', '');
    // preform move
    $doc = new mosDMDocument($database);
    $doc->move($cid, $categoryMove);
    // output status message
    $cids = implode(',', $cid);
    $total = count($cid);
    $cat = new mosDMCategory($database);
    $cat->load($categoryMove);
    $msg = $total . ' ' . _DML_DOCUMENTS_MOVED_TO . ' ' . $cat->name;
    mosRedirect('index2.php?option=com_docman&section=documents', $msg);
}