function fetchMethodForm($uid, $step, $update = false)
 {
     global $task;
     switch ($step) {
         case 2:
             $lists = array();
             $lists['action'] = _taskLink($task, $uid, array('step' => $step + 1), false);
             return HTML_DMUploadMethod::linkFileForm($lists);
             break;
         case 3:
             $url = stripslashes(JRequest::getString('url', 'http://'));
             $err = DMUploadMethod::linkFileProcess($uid, $step, $url);
             if ($err['_error']) {
                 _returnTo($task, $err['_errmsg'], '', array("method" => 'link', "step" => $step - 1, "localfile" => '', "url" => DOCMAN_Utils::safeEncodeURL($url)));
             }
             $uploaded = DOCMAN_Utils::safeEncodeURL(_DM_DOCUMENT_LINK . $url);
             $catid = $update ? 0 : $uid;
             $docid = $update ? $uid : 0;
             $session = JFactory::getSession();
             $session->set('docman.dmfilename', _DM_DOCUMENT_LINK);
             $session->set('docman.document_url', $url);
             return fetchEditDocumentForm($docid, $uploaded, $catid);
             break;
         default:
             break;
     }
     return true;
 }
 function fetchMethodForm($uid, $step, $update)
 {
     global $task;
     switch ($step) {
         case 2:
             $lists = array();
             $lists['action'] = _taskLink($task, $uid, array('step' => $step + 1), false);
             return HTML_DMUploadMethod::uploadFileForm($lists);
             break;
         case 3:
             //upload file
             $file = JRequest::getVar('upload', array(), 'files', 'array');
             $err = DMUploadMethod::uploadFileProcess($uid, $step, $file);
             if ($err['_error']) {
                 _returnTo($task, $err['_errmsg'], '', array('step' => $step - 1, 'method' => 'http'));
             }
             $catid = $update ? 0 : $uid;
             $docid = $update ? $uid : 0;
             $session = JFactory::getSession();
             $session->set('docman.dmfilename', $file->name);
             $session->set('docman.document_url', null);
             return fetchEditDocumentForm($docid, $file->name, $catid);
             break;
         default:
             break;
     }
     return true;
 }
 function fetchMethodForm($uid, $step, $update = false)
 {
     global $task;
     switch ($step) {
         case 2:
             $lists = array();
             $lists['action'] = _taskLink($task, $uid, array('step' => $step + 1), false);
             $lists['url'] = '';
             $lists['localfile'] = '';
             return HTML_DMUploadMethod::transferFileForm($lists);
             break;
         case 3:
             $url = stripslashes(mosGetParam($_REQUEST, 'url', 'http://'));
             $file = stripslashes(mosGetParam($_REQUEST, 'localfile', ''));
             $err = DMUploadMethod::transferFileProcess($uid, $step, $url, $file);
             if ($err['_error']) {
                 _returnTo($task, $err['_errmsg'], '', array("method" => 'transfer', "step" => $step - 1, "localfile" => $file, "url" => DOCMAN_Utils::safeEncodeURL($url)));
             }
             $catid = $update ? 0 : $uid;
             $docid = $update ? $uid : 0;
             return fetchEditDocumentForm($docid, $file->name, $catid);
             break;
         default:
             break;
     }
     return true;
 }
Example #4
0
 function fetchMethodForm($uid, $step, $update)
 {
     global $task;
     switch ($step) {
         case 2:
             $lists = array();
             $lists['action'] = _taskLink($task, $uid, array('step' => $step + 1), false);
             return HTML_DMUploadMethod::uploadFileForm($lists);
             break;
         case 3:
             //upload file
             //$file = mosGetParam(DOCMAN_Utils::stripslashes($_FILES), 'upload');
             $file_upload = mosGetParam($_FILES, 'upload');
             $err = DMUploadMethod::uploadFileProcess($uid, $step, $file);
             if ($err['_error']) {
                 _returnTo($task, $err['_errmsg'], '', array('step' => $step - 1, 'method' => 'http'));
             }
             $catid = $update ? 0 : $uid;
             $docid = $update ? $uid : 0;
             return fetchEditDocumentForm($docid, $file->name, $catid);
             break;
         default:
             break;
     }
     return true;
 }
function showDocumentEdit($gid, $script)
{
    if ($script) {
        HTML_docman::scriptDocumentEdit();
        return;
    }
    $html = new StdClass();
    $html->menu = fetchMenu($gid);
    $html->docedit = fetchEditDocumentForm($gid);
    HTML_docman::pageDocumentEdit($html);
}