Skip to content

Commit

Permalink
Update for 3.4.0; deprecate strftime
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Mar 30, 2022
1 parent d47c480 commit aeef7a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions PLNPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

use APP\notification\Notification;
use APP\notification\NotificationManager;
use APP\facades\Repo;

import('classes.publication.Publication');
import('classes.issue.Issue');
Expand Down Expand Up @@ -513,13 +514,21 @@ public function getServiceDocument($contextId) {
* @param $notificationType int
*/
public function createJournalManagerNotification($contextId, $notificationType) {
$roleDao = DAORegistry::getDAO('RoleDAO');
$journalManagers = $roleDao->getUsersByRoleId(Role::ROLE_ID_MANAGER, $contextId);
// Get a list of all managerial user group IDs
$userGroupDao = DAORegistry::getDAO('UserGroupDAO');
$userGroups = $userGroupDao->getByRoleId(Role::ROLE_ID_MANAGER, $contextId);
$userGroupIds = [];
foreach ($userGroups as $userGroup) {
$userGroupIds[] = $userGroup->getId();
}

$collector = Repo::user()->getCollector();
$collector->filterByUserGroupIds($userGroupIds);
$journalManagers = Repo::user()->getMany($collector);
$notificationManager = new NotificationManager();
// TODO: this currently gets sent to all journal managers - perhaps only limit to the technical contact's account?
while ($journalManager = $journalManagers->next()) {
foreach ($journalManagers as $journalManager) {
$notificationManager->createTrivialNotification($journalManager->getId(), $notificationType);
unset($journalManager);
}
}

Expand Down
4 changes: 2 additions & 2 deletions classes/DepositPackage.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function generateAtomDocument() {

$entry->appendChild($this->_generateElement($atom, 'id', 'urn:uuid:'.$this->_deposit->getUUID()));

$entry->appendChild($this->_generateElement($atom, 'updated', strftime("%Y-%m-%d %H:%M:%S", strtotime($this->_deposit->getDateModified()))));
$entry->appendChild($this->_generateElement($atom, 'updated', date("Y-m-d H:i:s", strtotime($this->_deposit->getDateModified()))));

$url = $dispatcher->url($request, ROUTE_PAGE, $journal->getPath()) . '/' . PLN_PLUGIN_ARCHIVE_FOLDER . '/deposits/' . $this->_deposit->getUUID();
$pkpDetails = $this->_generateElement($atom, 'pkp:content', $url, 'http://pkp.sfu.ca/SWORD');
Expand Down Expand Up @@ -194,7 +194,7 @@ public function generateAtomDocument() {

$pkpDetails->setAttribute('volume', $objectVolume);
$pkpDetails->setAttribute('issue', $objectIssue);
$pkpDetails->setAttribute('pubdate', strftime('%Y-%m-%d', strtotime($objectPublicationDate)));
$pkpDetails->setAttribute('pubdate', date('Y-m-d', strtotime($objectPublicationDate)));

// Add OJS Version
$versionDao = DAORegistry::getDAO('VersionDAO');
Expand Down

0 comments on commit aeef7a3

Please sign in to comment.