Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PURR][#2470] Hide the download link for 10-year dataset #1667

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@
.editform input.short {
width: 6em;
}
.editform input[type="checkbox"] {
width: 1em;
}
.editform td {
vertical-align: top;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ public function saveTask($redirect = false)
{
$this->model->version->version_label = $version_label;
}
$this->model->version->downloadDisabled = Request::getBool('disabledownloadlink', false, 'post');

// Get DOI service
$doiService = new Models\Doi($this->model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ COM_PUBLICATIONS_SUCCESS_TYPE_CURATION_SAVED="Curation saved"
COM_PUBLICATIONS_FIELDSET_LICENSE="License"
COM_PUBLICATIONS_FIELD_LICENSE_TEXT="License text"
COM_PUBLICATIONS_FIELD_LICENSE_TYPE="License type"
COM_PUBLICATIONS_FIELD_DISABLE_DOWNLOAD_LINK="Disable download Link"
COM_PUBLICATIONS_FIELD_DISABLE_DOWNLOAD_DESCRIPTION="Disable the download button on dataset page"
COM_PUBLICATIONS_FIELD_ACCESS="Access"
COM_PUBLICATIONS_FIELD_USER_ID="User ID"
COM_PUBLICATIONS_ADD_AUTHOR="Add author"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@
<textarea name="license_text" id="license_text" cols="40" rows="5" class="pubinput"><?php echo preg_replace("/\r\n/", "\r", trim($this->model->get('license_text'))); ?></textarea>
</div>
</fieldset>
<fieldset class="adminform">
<legend><span><?php echo Lang::txt('COM_PUBLICATIONS_FIELD_DISABLE_DOWNLOAD_LINK'); ?></span></legend>
<div class="input-wrap">
<input type="checkbox" name="disabledownloadlink" id="disabledownloadlink" <?php if ($this->model->version->downloadDisabled) {echo "checked";} ?>/>
<label for="disabledownloadlink"><?php echo Lang::txt('COM_PUBLICATIONS_FIELD_DISABLE_DOWNLOAD_DESCRIPTION'); ?></label>
</div>
</fieldset>
</div>
<div class="col span5">
<table class="meta">
Expand Down
dbenham marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ COM_PUBLICATIONS_DOWNLOAD_ARCHIVE_PACKAGE="Download Bundle"
COM_PUBLICATIONS_ARCHIVE_PACKAGE="Bundle"
COM_PUBLICATIONS_BROWSE_ARCHIVE_PACKAGE="Show bundle contents"
COM_PUBLICATIONS_LICENSE_TERMS="License terms"
COM_PUBLICATIONS_DOWNLOAD_DATASET_DISABLED="The downloading to this dataset has been disabled."
COM_PUBLICATIONS_PLEASE=" Please "
COM_PUBLICATIONS_SUBMIT_TICKET="submit a ticket"
COM_PUBLICATIONS_TO_INQUIRE_DATASET_STATUS=" to inquire about the current status of this dataset."

; Primary button actions
COM_PUBLICATIONS_DOWNLOAD_FILE="Download Publication File"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
?>
</div><!-- / .overviewcontainer -->
<div class="aside launcharea">
<?php if ($this->publication->version->get('downloadDisabled')): ?>
<p>
<?php echo Lang::txt('COM_PUBLICATIONS_DOWNLOAD_DATASET_DISABLED'); echo Lang::txt('COM_PUBLICATIONS_PLEASE')?>
<a href="/support/ticket/new" target="_blank"><?php echo Lang::txt('COM_PUBLICATIONS_SUBMIT_TICKET');?></a>
<?php echo Lang::txt('COM_PUBLICATIONS_TO_INQUIRE_DATASET_STATUS'); ?>
</p>
<?php else: ?>
<?php
$html = '';

Expand Down Expand Up @@ -122,6 +129,7 @@
}
}
?>
<?php endif; ?>
</div><!-- / .aside launcharea -->
<div class="clear"></div>

Expand Down
40 changes: 40 additions & 0 deletions core/migrations/Migration20230828215637ComPublications.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* @package hubzero-cms
* @copyright Copyright (c) 2005-2023 The Regents of the University of California.
* @license http://opensource.org/licenses/MIT MIT
*/

use Hubzero\Content\Migration\Base;

/**
* Migration script for ...
**/
class Migration20230828215637ComPublications extends Base
{
/**
* Up
**/
public function up()
{
if ($this->db->tableExists('#__publication_versions') && !$this->db->tableHasField('#__publication_versions', 'downloadDisabled'))
{
$query = "ALTER TABLE `#__publication_versions` ADD COLUMN `downloadDisabled` BOOL DEFAULT FALSE";
$this->db->setQuery($query);
$this->db->query();
}
}

/**
* Down
**/
public function down()
{
if ($this->db->tableExists('#__publication_versions') && $this->db->tableHasField('#__publication_versions', 'downloadDisabled'))
{
$query = "ALTER TABLE `#__publication_versions` DROP COLUMN `downloadDisabled`";
$this->db->setQuery($query);
$this->db->query();
}
}
}