diff --git a/codepot/src/codepot/controllers/wiki.php b/codepot/src/codepot/controllers/wiki.php index f75b93fe..4c7123ce 100644 --- a/codepot/src/codepot/controllers/wiki.php +++ b/codepot/src/codepot/controllers/wiki.php @@ -470,9 +470,6 @@ class Wiki extends Controller function attachment0 ($projectid = '', $target = '') { - //$target => projectid:wikiname:attachment - //$target => projectid:#I1:file - $login = $this->login->getUser (); if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') redirect ("main/signin/" . $this->converter->AsciiTohex(current_url())); @@ -489,6 +486,8 @@ class Wiki extends Controller $part = explode (':', $target); if (count($part) == 3) { + //$target => projectid:wikiname:attachment + //$target => projectid:#I1:file if ($part[0] == '') $part[0] = $projectid; if ($part[1][0] == '#' && $part[1][1] == 'I') { @@ -500,6 +499,20 @@ class Wiki extends Controller $this->_handle_wiki_attachment ($login, $part[0], $part[1], $part[2]); } } + else if (count($part) == 2) + { + //$target => wikiname:attachment + //$target => #I1:file + if ($part[0][0] == '#' && $part[0][1] == 'I') + { + $issueid = substr ($part[0],2); + $this->_handle_issue_file ($login, $projectid, $issueid, $part[1]); + } + else + { + $this->_handle_wiki_attachment ($login, $projectid, $part[0], $part[1]); + } + } } function attachment ($projectid = '', $wikiname = '', $filename = '') @@ -538,6 +551,25 @@ class Wiki extends Controller } if ($part[2] != '') $filename = $part[2]; } + else if (count($part) == 2) + { + //$target => wikiname:attachment + //$target => #I1:file + if ($part[0] != '') + { + if ($part[0][0] == '#' && $part[0][1] == 'I') + { + $issueid = substr ($part[0],2); + $wikiname = ''; + } + else + { + $wikiname = $part[0]; + $issueid = ''; + } + } + if ($part[1] != '') $filename = $part[1]; + } if ($wikiname != '') $this->_handle_wiki_attachment ($login, $projectid, $wikiname, $filename); diff --git a/codepot/src/codepot/views/wiki_edit.php b/codepot/src/codepot/views/wiki_edit.php index b709d2a7..af34fc77 100644 --- a/codepot/src/codepot/views/wiki_edit.php +++ b/codepot/src/codepot/views/wiki_edit.php @@ -32,6 +32,10 @@ $file_count = count($wiki->attachments);