Skip to content

Commit

Permalink
*6739* Minor tune-ups to related native import/export plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jul 6, 2011
1 parent 40ce98d commit 6f3cc0c
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/pkp"]
path = lib/pkp
url = [email protected]:pkp/pkp-lib.git
[submodule "plugins/importexport/duracloud/lib/DuraCloud-PHP"]
path = plugins/importexport/duracloud/lib/DuraCloud-PHP
url = [email protected]:asmecher/DuraCloud-PHP
1 change: 1 addition & 0 deletions plugins/importexport/duracloud/lib/DuraCloud-PHP
Submodule DuraCloud-PHP added at 99c9da
24 changes: 12 additions & 12 deletions plugins/importexport/native/NativeImportExportPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ function display(&$args, $request) {

$issueDao =& DAORegistry::getDAO('IssueDAO');

$journal =& Request::getJournal();
$journal =& $request->getJournal();
switch (array_shift($args)) {
case 'exportIssues':
$issueIds = Request::getUserVar('issueId');
$issueIds = $request->getUserVar('issueId');
if (!isset($issueIds)) $issueIds = array();
$issues = array();
foreach ($issueIds as $issueId) {
$issue =& $issueDao->getIssueById($issueId);
if (!$issue) Request::redirect();
$issue =& $issueDao->getIssueById($issueId, $journal->getId());
if (!$issue) $request->redirect();
$issues[] =& $issue;
}
$this->exportIssues($journal, $issues);
break;
case 'exportIssue':
$issueId = array_shift($args);
$issue =& $issueDao->getIssueById($issueId);
if (!$issue) Request::redirect();
$issue =& $issueDao->getIssueById($issueId, $journal->getId());
if (!$issue) $request->redirect();
$this->exportIssue($journal, $issue);
break;
case 'exportArticle':
Expand All @@ -83,7 +83,7 @@ function display(&$args, $request) {
$this->exportArticle($journal, $result['issue'], $result['section'], $result['publishedArticle']);
break;
case 'exportArticles':
$articleIds = Request::getUserVar('articleId');
$articleIds = $request->getUserVar('articleId');
if (!isset($articleIds)) $articleIds = array();
$results =& ArticleSearch::formatResults($articleIds);
$this->exportArticles($results);
Expand Down Expand Up @@ -115,10 +115,10 @@ function display(&$args, $request) {
import('classes.file.TemporaryFileManager');
$issueDao =& DAORegistry::getDAO('IssueDAO');
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$user =& Request::getUser();
$user =& $request->getUser();
$temporaryFileManager = new TemporaryFileManager();

if (($existingFileId = Request::getUserVar('temporaryFileId'))) {
if (($existingFileId = $request->getUserVar('temporaryFileId'))) {
// The user has just entered more context. Fetch an existing file.
$temporaryFile = TemporaryFileManager::getFile($existingFileId, $user->getId());
} else {
Expand All @@ -130,11 +130,11 @@ function display(&$args, $request) {
'user' => $user
);

if (($sectionId = Request::getUserVar('sectionId'))) {
if (($sectionId = $request->getUserVar('sectionId'))) {
$context['section'] = $sectionDao->getSection($sectionId);
}

if (($issueId = Request::getUserVar('issueId'))) {
if (($issueId = $request->getUserVar('issueId'))) {
$context['issue'] = $issueDao->getIssueById($issueId, $journal->getId());
}

Expand Down Expand Up @@ -435,7 +435,7 @@ function executeCLI($scriptName, &$args) {
echo Locale::translate('plugins.importexport.native.export.error.articleNotFound', array('articleId' => $articleId)) . "\n\n";
return;
}
$issue =& $issueDao->getIssueById($publishedArticle->getIssueId());
$issue =& $issueDao->getIssueById($publishedArticle->getIssueId(), $journal->getId());

$sectionDao =& DAORegistry::getDAO('SectionDAO');
$section =& $sectionDao->getSection($publishedArticle->getSectionId());
Expand Down
1 change: 0 additions & 1 deletion plugins/importexport/native/articleContext.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* Prompt for "context" for article import: section and issue
*
* $Id$
*}
{strip}
{assign var="pageTitle" value="plugins.importexport.native.import.articles"}
Expand Down
1 change: 0 additions & 1 deletion plugins/importexport/native/articles.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* List of articles to potentially export
*
* $Id$
*}
{strip}
{assign var="pageTitle" value="plugins.importexport.native.selectArticle"}
Expand Down
1 change: 0 additions & 1 deletion plugins/importexport/native/importError.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* Display an error message for an aborted import process.
*
* $Id$
*}
{strip}
{assign var="pageTitle" value="plugins.importexport.native.import.error"}
Expand Down
1 change: 0 additions & 1 deletion plugins/importexport/native/importSuccess.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* Display a list of the successfully-imported entities.
*
* $Id$
*}
{strip}
{assign var="pageTitle" value="plugins.importexport.native.import.success"}
Expand Down
3 changes: 0 additions & 3 deletions plugins/importexport/native/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*
*/

// $Id$


require_once('NativeImportExportPlugin.inc.php');

return new NativeImportExportPlugin();
Expand Down
1 change: 0 additions & 1 deletion plugins/importexport/native/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* List of operations this plugin can perform
*
* $Id$
*}
{strip}
{assign var="pageTitle" value="plugins.importexport.native.displayName"}
Expand Down
1 change: 0 additions & 1 deletion plugins/importexport/native/issues.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* List of issues to potentially export
*
* $Id$
*}
{strip}
{assign var="pageTitle" value="plugins.importexport.native.selectIssue"}
Expand Down

0 comments on commit 6f3cc0c

Please sign in to comment.