first commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
{**
|
||||
* templates/controllers/wizard/fileUpload/fileUploadWizard.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* A wizard to add files or revisions of files.
|
||||
*
|
||||
* Parameters:
|
||||
* $submissionId: The submission to which files should be uploaded.
|
||||
* $stageId: The workflow stage from which the wizard was called.
|
||||
* $revisedFileId: A pre-selected file to be revised (optional).
|
||||
*}
|
||||
|
||||
{assign var=uploadWizardId value="fileUploadWizard"|uniqid}
|
||||
<script type="text/javascript">
|
||||
// Attach the JS file upload wizard handler.
|
||||
$(function() {ldelim}
|
||||
$('#{$uploadWizardId}').pkpHandler(
|
||||
'$.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler',
|
||||
{ldelim}
|
||||
csrfToken: {csrf type=json},
|
||||
cancelButtonText: {translate|json_encode key="common.cancel"},
|
||||
continueButtonText: {translate|json_encode key="common.continue"},
|
||||
finishButtonText: {translate|json_encode key="common.complete"},
|
||||
deleteUrl: {url|json_encode component="api.file.ManageFileApiHandler" op="deleteFile" submissionId=$submissionId stageId=$stageId fileStage=$fileStage suppressNotification=true escape=false},
|
||||
metadataUrl: {url|json_encode op="editMetadata" submissionId=$submissionId stageId=$stageId reviewRoundId=$reviewRoundId fileStage=$fileStage assocType=$assocType assocId=$assocId queryId=$queryId escape=false},
|
||||
finishUrl: {url|json_encode op="finishFileSubmission" submissionId=$submissionId stageId=$stageId reviewRoundId=$reviewRoundId fileStage=$fileStage assocType=$assocType assocId=$assocId queryId=$queryId escape=false},
|
||||
cancelUrl: {url|json_encode component="api.file.ManageFileApiHandler" op="cancelFileUpload" submissionId=$submissionId stageId=$stageId fileStage=$fileStage escape=false}
|
||||
{rdelim}
|
||||
);
|
||||
{rdelim});
|
||||
</script>
|
||||
|
||||
<div id="{$uploadWizardId}">
|
||||
<ul>
|
||||
<li><a href="{url op="displayFileUploadForm" submissionId=$submissionId stageId=$stageId uploaderRoles=$uploaderRoles fileStage=$fileStage revisionOnly=$revisionOnly reviewRoundId=$reviewRoundId revisedFileId=$revisedFileId assocType=$assocType assocId=$assocId dependentFilesOnly=$dependentFilesOnly queryId=$queryId}">{translate key="submission.submit.uploadStep"}</a></li>
|
||||
<li><a href="metadata">{translate key="submission.submit.metadataStep"}</a></li>
|
||||
<li><a href="finish">{translate key="submission.submit.finishingUpStep"}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
{**
|
||||
* fileSubmissionComplete.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Last step of the file upload wizard.
|
||||
*}
|
||||
<div id="finishSubmissionForm" class="pkp_helpers_text_center">
|
||||
<h2>{translate key="submission.submit.fileAdded"}</h2>
|
||||
{if $fileStage != \PKP\submissionFile\SubmissionFile::SUBMISSION_FILE_PROOF}
|
||||
<button class="pkp_button" type="button" name="newFile" id="newFile">{translate key='submission.submit.newFile'}</button>
|
||||
{/if}
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
@@ -0,0 +1,198 @@
|
||||
{**
|
||||
* templates/controllers/wizard/fileUpload/form/fileUploadForm.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Files upload form.
|
||||
*
|
||||
* Parameters:
|
||||
* $submissionId: The submissionId for which a file is being uploaded.
|
||||
* $stageId: The workflow stage in which the file uploader was called.
|
||||
* $revisionOnly: Whether the user can upload new files or not.
|
||||
* $revisedFileId: The id of the file to be revised (optional).
|
||||
* When set to a number then the user may not choose the file
|
||||
* to be revised.
|
||||
* $revisedFileName: The name of the file to be revised (if any).
|
||||
* $genreId: The preset genre of the file to be uploaded (optional).
|
||||
* $submissionFileOptions: A list of submission files that can be
|
||||
* revised.
|
||||
* $currentSubmissionFileGenres: An array that assigns genres to the submission
|
||||
* files that can be revised.
|
||||
* $submissionFileGenres: A list of all available submission file genres.
|
||||
*
|
||||
* This form implements several states:
|
||||
*
|
||||
* 1) Uploading of a revision to an existing file with the
|
||||
* file to be revised already known:
|
||||
* - $revisionOnly is true.
|
||||
* - $revisedFileId is set to a number.
|
||||
* - $submissionFileOptions will be ignored.
|
||||
* -> No file selector will be shown.
|
||||
* -> A file genre cannot be set.
|
||||
*
|
||||
* 2) Uploading of a revision to an existing file where the
|
||||
* file to be revised must still be selected by the user.
|
||||
* - $revisionOnly is true.
|
||||
* - $revisedFileId is not set to a number.
|
||||
* - $submissionFileOptions must not be empty.
|
||||
* -> A selector with files that can be revised will
|
||||
* be shown. Selection of a revised file is mandatory.
|
||||
* If a revised file id is given then that file will
|
||||
* be pre-selected.
|
||||
* -> A file genre cannot be set.
|
||||
*
|
||||
* 3) Uploading of a file that may or may not be a revision
|
||||
* of an existing file (free upload).
|
||||
* - $revisionOnly is false.
|
||||
* - $revisedFileId does not have to be a number.
|
||||
* - $submissionFileOptions is not empty.
|
||||
* -> A selector with files that can be revised will
|
||||
* be shown. Selection of a revised file is optional.
|
||||
* If the revised file id is set then this file will
|
||||
* be pre-selected in the drop-down.
|
||||
* -> A file genre selector will be shown but will be
|
||||
* deactivated as soon as the user selects a file
|
||||
* to be revised. Otherwise selection of a genre is
|
||||
* mandatory.
|
||||
* -> Uploaded files will be checked against existing
|
||||
* files to identify possible revisions.
|
||||
*
|
||||
* 4) Uploading of a new file when no previous files
|
||||
* exist at all at this workflow stage.
|
||||
* - $revisionOnly is false.
|
||||
* - $revisedFileId must not be a number.
|
||||
* - $submissionFileOptions is empty.
|
||||
* -> No file selector will be shown.
|
||||
* -> A file genre selector will be shown. Selection of
|
||||
* a genre is mandatory.
|
||||
*
|
||||
* The following decision tree shows the input parameters
|
||||
* and the corresponding use cases (RO: $revisionOnly,
|
||||
* RF: $revisedFileId, FO: $submissionFileOptions,
|
||||
* y=given, n=not given, o=any/ignored):
|
||||
*
|
||||
* RO RF FO
|
||||
* y y o -> 1)
|
||||
* | n y -> 2)
|
||||
* | | n -> not allowed (skip loading form and show a message to user)
|
||||
*
|
||||
* FO RF
|
||||
* n y o -> 3)
|
||||
* | n y -> not allowed
|
||||
* | | n -> 4)
|
||||
*}
|
||||
|
||||
{* Implement the above decision tree and configure the form based on the identified use case. *}
|
||||
{assign var="showFileNameOnly" value=false}
|
||||
{if $revisionOnly}
|
||||
{assign var="showGenreSelector" value=false}
|
||||
{if is_numeric($revisedFileId)}
|
||||
{* Use case 1: Revision of a known file *}
|
||||
{assign var="showFileSelector" value=false}
|
||||
{assign var="showFileNameOnly" value=true}
|
||||
{else}
|
||||
{* Use case 2: Revision of a file which still must be chosen *}
|
||||
{if empty($submissionFileOptions)}{assign var="revisionOnlyWithoutFileOptions" value=true}{/if}
|
||||
{assign var="showFileSelector" value=true}
|
||||
{/if}
|
||||
{else}
|
||||
{assign var="showGenreSelector" value=true}
|
||||
{if empty($submissionFileOptions)}
|
||||
{* Use case 4: Upload a new file *}
|
||||
{if is_numeric($revisedFileId)}{"A revised file id cannot be given when uploading a new file!"|fatalError}{/if}
|
||||
{assign var="showFileSelector" value=false}
|
||||
{else}
|
||||
{* Use case 3: Upload a new file or a revision *}
|
||||
{assign var="showFileSelector" value=true}
|
||||
{/if}
|
||||
|
||||
{* Disable the genre selector for reviewer attachements *}
|
||||
{if $isReviewAttachment}{assign var="showGenreSelector" value=false}{/if}
|
||||
{/if}
|
||||
|
||||
{if $revisionOnlyWithoutFileOptions}
|
||||
<br /><br />
|
||||
{translate key="submission.upload.noAvailableReviewFiles"}
|
||||
<br /><br />
|
||||
{else}
|
||||
|
||||
{assign var=uploadFormId value="uploadForm"|uniqid}
|
||||
{assign var=pluploadControl value="plupload"|uniqid}
|
||||
{assign var=browseButtonId value="browseButton"|uniqid}
|
||||
<script type="text/javascript">
|
||||
$(function() {ldelim}
|
||||
// Attach the upload form handler.
|
||||
$('#{$uploadFormId}').pkpHandler(
|
||||
'$.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler',
|
||||
{ldelim}
|
||||
hasFileSelector: {if $showFileSelector}true{else}false{/if},
|
||||
hasGenreSelector: {if $showGenreSelector}true{else}false{/if},
|
||||
presetRevisedFileId: {$revisedFileId|json_encode},
|
||||
// File genres currently assigned to submission files.
|
||||
fileGenres: {ldelim}
|
||||
{foreach name=currentSubmissionFileGenres from=$currentSubmissionFileGenres key=submissionFileId item=fileGenre}
|
||||
{if !empty($fileGenre)}
|
||||
{$submissionFileId|json_encode}: {$fileGenre|json_encode}{if !$smarty.foreach.currentSubmissionFileGenres.last},{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{rdelim},
|
||||
$uploader: $('#{$pluploadControl}'),
|
||||
uploaderOptions: {ldelim}
|
||||
uploadUrl: {url|json_encode op="uploadFile" submissionId=$submissionId stageId=$stageId fileStage=$fileStage reviewRoundId=$reviewRoundId assocType=$assocType assocId=$assocId queryId=$queryId escape=false},
|
||||
baseUrl: {$baseUrl|json_encode},
|
||||
browse_button: '{$browseButtonId}'
|
||||
{rdelim}
|
||||
{rdelim});
|
||||
{rdelim});
|
||||
</script>
|
||||
|
||||
<form class="pkp_form" id="{$uploadFormId}" action="#" method="post">
|
||||
{include file="controllers/notification/inPlaceNotification.tpl" notificationId=$uploadFormId|concat:"Notification"}
|
||||
{csrf}
|
||||
{fbvFormArea id="file"}
|
||||
{if $assocType && $assocId}
|
||||
<input type="hidden" name="assocType" value="{$assocType|escape}" />
|
||||
<input type="hidden" name="assocId" value="{$assocId|escape}" />
|
||||
{/if}
|
||||
|
||||
{if $showFileNameOnly}
|
||||
{fbvFormSection title="submission.submit.currentFile"}
|
||||
{$revisedFileName}
|
||||
{/fbvFormSection}
|
||||
|
||||
{* Save the revised file ID in a hidden input field. *}
|
||||
<input type="hidden" id="revisedFileId" name="revisedFileId" value="{$revisedFileId}" />
|
||||
{elseif $showFileSelector}
|
||||
{* TODO: This should be a radio button selection, where the select is displayed only if the user chooses to replace a file *}
|
||||
{if $revisionOnly}
|
||||
{assign var=revisionSelectTitle value="submission.upload.selectMandatoryFileToRevise"}
|
||||
{else}
|
||||
{assign var=revisionSelectTitle value="submission.upload.selectOptionalFileToRevise"}
|
||||
{/if}
|
||||
{fbvFormSection title=$revisionSelectTitle required=$revisionOnly}
|
||||
{fbvElement type="select" name="revisedFileId" id="revisedFileId" from=$submissionFileOptions selected=$revisedFileId translate=false}
|
||||
{/fbvFormSection}
|
||||
{/if}
|
||||
|
||||
{if $showGenreSelector}
|
||||
{fbvFormSection title="submission.upload.fileContents" required=true}
|
||||
{capture assign="defaultLabel"}{translate key="submission.upload.selectComponent"}{/capture}
|
||||
{fbvElement type="select" name="genreId" id="genreId" from=$submissionFileGenres translate=false defaultLabel=$defaultLabel defaultValue="" required="true" selected=$genreId required=true}
|
||||
{/fbvFormSection}
|
||||
{/if}
|
||||
|
||||
{fbvFormSection}
|
||||
{* The uploader widget *}
|
||||
{include file="controllers/fileUploadContainer.tpl" id=$pluploadControl browseButton=$browseButtonId}
|
||||
{/fbvFormSection}
|
||||
|
||||
{if $ensuringLink}
|
||||
<div id="{$ensuringLink->getId()}" class="pkp_linkActions">
|
||||
{include file="linkAction/linkAction.tpl" action=$ensuringLink contextId="uploadForm"}
|
||||
</div>
|
||||
{/if}
|
||||
{/fbvFormArea}
|
||||
</form>
|
||||
{/if}
|
||||
@@ -0,0 +1,76 @@
|
||||
{**
|
||||
* templates/controllers/wizard/fileUpload/form/submissionFileMetadataForm.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* File metadata form.
|
||||
*
|
||||
* Parameters:
|
||||
* $submissionFile: The submission file.
|
||||
* $stageId: The workflow stage id from which the upload
|
||||
* wizard was called.
|
||||
* $showButtons: True iff form buttons should be presented.
|
||||
*}
|
||||
{assign var=metadataFormId value="metadataForm"|uniqid}
|
||||
<script type="text/javascript">
|
||||
$(function() {ldelim}
|
||||
// Attach the form handler.
|
||||
$('#{$metadataFormId}').pkpHandler('$.pkp.controllers.form.AjaxFormHandler');
|
||||
{rdelim});
|
||||
</script>
|
||||
|
||||
<form class="pkp_form" id="{$metadataFormId}" action="{url component="api.file.ManageFileApiHandler" op="saveMetadata" submissionId=$submissionFile->getData('submissionId') stageId=$stageId reviewRoundId=$reviewRoundId fileStage=$submissionFile->getData('fileStage') submissionFileId=$submissionFile->getId() escape=false}" method="post">
|
||||
{csrf}
|
||||
|
||||
{* Editable metadata *}
|
||||
{fbvFormArea id="fileMetaData"}
|
||||
|
||||
{* File name and detail summary *}
|
||||
{fbvFormSection for="name" size=$fbvStyles.size.LARGE title="submission.form.name" required=true}
|
||||
{fbvElement type="text" id="name" value=$submissionFile->getData('name') multilingual=true maxlength="255" required=true}
|
||||
{/fbvFormSection}
|
||||
|
||||
{* Supplementary file metadata *}
|
||||
{if $genre && $genre->getCategory() == $smarty.const.GENRE_CATEGORY_SUPPLEMENTARY}
|
||||
{fbvFormSection}
|
||||
{fbvElement label="common.description" type="textarea" id="description" value=$submissionFile->getData('description') multilingual=true}
|
||||
{fbvElement label="submission.supplementary.creator" inline=true size=$fbvStyles.size.MEDIUM type="text" id="creator" value=$submissionFile->getData('creator') multilingual=true maxlength="255"}
|
||||
{fbvElement label="submission.supplementary.publisher" inline=true size=$fbvStyles.size.MEDIUM type="text" id="publisher" value=$submissionFile->getData('publisher') multilingual=true maxlength="255"}
|
||||
{fbvElement label="common.source" inline=true size=$fbvStyles.size.MEDIUM type="text" id="source" value=$submissionFile->getData('source') multilingual=true maxlength="255"}
|
||||
{fbvElement label="submission.supplementary.subject" inline=true size=$fbvStyles.size.MEDIUM type="text" id="subject" value=$submissionFile->getData('subject') multilingual=true maxlength="255"}
|
||||
{fbvElement label="submission.supplementary.sponsor" inline=true size=$fbvStyles.size.MEDIUM type="text" id="sponsor" value=$submissionFile->getData('sponsor') multilingual=true maxlength="255"}
|
||||
{fbvElement label="common.date" inline=true size=$fbvStyles.size.SMALL type="text" id="dateCreated" value=$submissionFile->getData('dateCreated') class="datepicker"}
|
||||
{fbvElement label="common.language" inline=true size=$fbvStyles.size.SMALL type="text" id="language" value=$submissionFile->getData('language') maxlength="255"}
|
||||
{/fbvFormSection}
|
||||
{/if}
|
||||
|
||||
{* Artwork metadata *}
|
||||
{if $genre && $genre->getCategory() == $smarty.const.GENRE_CATEGORY_ARTWORK}
|
||||
{fbvFormSection title="grid.artworkFile.caption" inline=true size=$fbvStyles.size.MEDIUM}
|
||||
{fbvElement type="textarea" id="artworkCaption" height=$fbvStyles.height.SHORT value=$submissionFile->getData('caption')}
|
||||
{/fbvFormSection}
|
||||
{fbvFormSection title="grid.artworkFile.credit" inline=true size=$fbvStyles.size.MEDIUM}
|
||||
{fbvElement type="textarea" id="artworkCredit" height=$fbvStyles.height.SHORT value=$submissionFile->getData('credit')}
|
||||
{/fbvFormSection}
|
||||
{fbvFormSection title="grid.artworkFile.copyrightOwner" inline=true size=$fbvStyles.size.MEDIUM}
|
||||
{fbvElement type="textarea" id="artworkCopyrightOwner" height=$fbvStyles.height.SHORT value=$submissionFile->getData('copyrightOwner')}
|
||||
{/fbvFormSection}
|
||||
{fbvFormSection title="grid.artworkFile.permissionTerms" inline=true size=$fbvStyles.size.MEDIUM}
|
||||
{fbvElement type="textarea" id="artworkPermissionTerms" height=$fbvStyles.height.SHORT value=$submissionFile->getData('terms')}
|
||||
{/fbvFormSection}
|
||||
{/if}
|
||||
|
||||
{/fbvFormArea}
|
||||
|
||||
{if $supportsDependentFiles}
|
||||
{capture assign=dependentFilesGridUrl}{url router=\PKP\core\PKPApplication::ROUTE_COMPONENT component="grid.files.dependent.DependentFilesGridHandler" op="fetchGrid" submissionId=$submissionFile->getData('submissionId') submissionFileId=$submissionFile->getId() stageId=$stageId reviewRoundId=$reviewRoundId escape=false}{/capture}
|
||||
{load_url_in_div id="dependentFilesGridDiv" url=$dependentFilesGridUrl}
|
||||
{/if}
|
||||
|
||||
{if $showButtons}
|
||||
{fbvElement type="hidden" id="showButtons" value=$showButtons}
|
||||
{fbvFormButtons submitText="common.save"}
|
||||
{/if}
|
||||
</form>
|
||||
Reference in New Issue
Block a user