Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
48b8973
ding2 -> ding2tal
ubcudvikler Aug 15, 2012
66bb630
tag -> branch
ubcudvikler Aug 27, 2012
337565e
Hiding the branch selector of the reserve form on periodical issues
wiredloose Feb 11, 2013
dc4ca64
adding availability classes to periodical issues
wiredloose Feb 11, 2013
553eaae
adding classes to indicate whether foldable periodical volumes are op…
wiredloose Feb 11, 2013
2b13206
Changed sort, need to push to test as I don' have issues info availab…
zorp Mar 13, 2013
7f3f5f9
Resolved merge conflict with PH libraries
cableman Mar 19, 2013
705ec92
Changed blackhold to virtual field
cableman Mar 22, 2013
5c33beb
Added update function from blackhole to virtual field
cableman Mar 22, 2013
e5f5f14
Merge remote-tracking branch 'origin/artesis' into development
cableman Mar 27, 2013
5011128
Added virtual field module to the make file
cableman Apr 22, 2013
ad75855
Stream line of the make file
cableman Apr 22, 2013
998e0bd
Removed extra call to the provider and removed the use of sessions (p…
cableman Apr 30, 2013
b434f53
Removed un-needed module ding periodical reservation
cableman Apr 30, 2013
c4ddc32
Added the DingPeriodicalReservable class from the deprecated sub module
cableman Apr 30, 2013
86ec7ad
Added dependency to ding reservation
cableman Apr 30, 2013
f1e6a13
Merge branch 'release' into development
cableman Apr 30, 2013
83e94ab
Optimized the filed formatter and started on new ajax formatter.
cableman May 2, 2013
7118b96
Added new formatter that load holdings information via ajax
cableman May 2, 2013
da26632
Merge branch 'release' into development
cableman May 2, 2013
dfc3283
Only display reservation button for issues that has copies available
cableman May 2, 2013
2ab0064
Merge branch 'release' into development
cableman May 2, 2013
69bb30f
Changed makefile to point to ding2 on github
cableman May 6, 2013
db0808a
Added missing new lines
cableman Jun 4, 2013
de956d2
Merge branch 'core-pr-3' into release
cableman Jun 4, 2013
0e62917
Updated makefile to point to ding2tal
cableman Jun 4, 2013
736f62d
Merge branch 'release' into development
cableman Jun 4, 2013
781b15a
Merge remote-tracking branch 'origin' into release
cableman Jun 4, 2013
55ad16a
Merge branch 'release' into development
cableman Jun 5, 2013
c75a052
Merge remote-tracking branch 'origin' into release
cableman Jun 10, 2013
b7c78bd
Changed makefile to use development branch
cableman Jun 24, 2013
92aa649
Merge pull request #3 from ding2tal/core-pr-3
kasperg Jul 3, 2013
76c3ead
Merge branch 'master' into release
cableman Jul 3, 2013
ee2672d
Updated makefile to point to development branch and ding2tal
cableman Jul 3, 2013
2c67a95
Merge branch 'release' into development
cableman Jul 3, 2013
2ae982e
Merge remote-tracking branch 'origin' into release
cableman Jul 3, 2013
401cd2b
Removed provider dependent code and match holdings information to tha…
cableman Oct 30, 2013
219d3b3
Fixed reservation buttons for periodicals
cableman Oct 30, 2013
daa2fb7
Merge remote-tracking branch 'origin' into release
cableman Nov 4, 2013
42f185d
Updated makefile to point to tag 7.x-1.0-beta2
cableman Nov 4, 2013
d680865
Updated makefile to point to tag 7.x-1.0-beta3
cableman Nov 26, 2013
d8889c6
Updated makefile to point to tag 7.x-1.0-beta4
cableman Dec 12, 2013
dcdc169
Updated makefile to point to tag 7.x-1.0-beta5
cableman Dec 18, 2013
0820d4c
Updated makefile to point to tag 7.x-1.0-rc1
cableman Dec 20, 2013
06df02d
Updated makefile to point to tag 7.x-1.0-rc2
cableman Jan 8, 2014
18059b5
Updated makefile to point to tag 7.x-1.0-rc3
cableman Jan 20, 2014
0475774
Updated makefile to point to ding2 master branches
cableman Feb 3, 2014
ef6d246
Changed the reservation button to use ajax link and not forms
cableman Feb 26, 2014
c8f8d38
Fixed function documentation in reservation object
cableman Feb 26, 2014
0742639
Merge pull request #4 from ding2tal/core-pr-4
kasperg Mar 27, 2014
6bd6e91
Updated virtual field to version 1.2
cableman May 6, 2014
5a9851f
Merge branch 'master' into development
cableman Oct 6, 2014
37a1907
Updated make file to point to development branch
cableman Oct 6, 2014
1775521
Updated make file to point to master branch
cableman Oct 7, 2014
0c5dfc4
Merge pull request #5 from ding2tal/core-pr-5
kasperg Oct 21, 2014
e700a9b
Issue 1454 by xendk: Add reservable class to reserve link.
xendk Oct 17, 2015
657518f
Merge pull request #7 from reload/reserve-buttons
cableman Oct 20, 2015
4f105e6
Issue #1337 by Inlead: Encode periodical id into a uniform string.
Nov 18, 2015
10835eb
Merge branch 'DDBCMS-1'
Nov 18, 2015
c73d86e
Issue #1337 by Inlead: Do not encode imploded item id chunks.
Nov 25, 2015
bd2d193
Merge pull request #6 from inleadmedia/DDBCMS-1
kasperg Dec 1, 2015
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
85 changes: 0 additions & 85 deletions css/ding_periodical.css

This file was deleted.

3 changes: 3 additions & 0 deletions ding-periodical-issues.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class='ding-periodical-issues-ajax <?php print drupal_html_class($ding_entity_id); ?>'>
<span class='ding-periodical-loading'><?php print t('Loading issue information about the periodical.'); ?></span>
</div>
82 changes: 63 additions & 19 deletions ding_periodical.field.inc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ function ding_periodical_field_formatter_info() {
'ding_periodical_issues',
),
),
'ding_periodical_issues_ajax' => array(
'label' => t('Ajax load'),
'field types' => array(
'ding_periodical_issues',
),
),
);
}

Expand All @@ -63,30 +69,68 @@ function ding_periodical_field_formatter_info() {
*/
function ding_periodical_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
foreach ($items as $delta => $item) {

if ( !ding_provider_implements('availability', 'holdings') ) {
return $element;
}

$availability = ding_provider_invoke('availability', 'holdings', array($entity->provider_id));
if (isset($availability[$entity->provider_id])) {
$issues = $availability[$entity->provider_id]['issues'];
// array_walk($issues, 'asort') complains about 'Notice: A non
// well formed numeric value encountered'.
foreach ($issues as $k => $v) {
asort($v);
}
ksort($issues);
// Check that the provider provides holdings information.
if (!ding_provider_implements('availability', 'holdings')) {
return $element;
}

if ($issues) {
// Switch over the different formatters.
switch ($display['type']) {
case 'ding_periodical_issues_ajax':
foreach ($items as $delta => $item) {
$element[$delta] = array(
'#theme' => 'ding_periodical_issues',
'#entity' => $entity,
'#issues' => $issues,
'#theme' => 'ding_periodical_issues_ajax',
'#ding_entity_id' => $entity->ding_entity_id,
'#attached' => array(
'js' => array(
array(
'data' => drupal_get_path('module', 'ding_periodical') . '/js/ding_periodical_ajax.js',
),
array(
'data' => array(
'ding_periodical' => array(
'id' => drupal_html_class($entity->ding_entity_id),
'ding_entity_id' => $entity->ding_entity_id,
),
),
'type' => 'setting',
),
),
),
);
}
}
break;

default:
// Handles the default formatter.
foreach ($items as $delta => $item) {
$availability = ding_provider_invoke('availability', 'holdings', array($entity->provider_id));
if (isset($availability[$entity->provider_id])) {
$issues = $availability[$entity->provider_id]['issues'];
krsort($issues);

if ($issues) {
$element[$delta] = array(
'#theme' => 'ding_periodical_issues',
'#entity' => $entity,
'#issues' => $issues,
'#availability' => $availability,
);
}
}
}
break;
}

// Add script to collapsed the issue list, if any elements found.
if (!empty($element)) {
$element['#attached']['js'] = array(
array(
'data' => drupal_get_path('module', 'ding_periodical') . '/js/ding_periodical.js',
),
);
}

return $element;
}
5 changes: 3 additions & 2 deletions ding_periodical.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ package = Ding!
version = "7.x-1.9.4"
core = 7.x
files[] = ding_periodical.module
scripts[] = ding_periodical.js
dependencies[] = blackhole
files[] = ding_periodical_reservable.class.inc
dependencies[] = virtual_field
dependencies[] = ding_provider
dependencies[] = ding_entity
dependencies[] = ding_reservation
16 changes: 15 additions & 1 deletion ding_periodical.install
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function ding_periodical_ding_entity_fields() {
'field' => array(
'locked' => TRUE,
'storage' => array(
'type' => 'blackhole',
'type' => 'virtual_field',
),
),
'instance' => array(
Expand All @@ -23,3 +23,17 @@ function ding_periodical_ding_entity_fields() {
),
);
}


/**
* Convert blackhole field storage to virtual field.
*/
function ding_periodical_update_7000() {
return db_update('field_config')
->fields(array(
'storage_type' => 'virtual_field',
'storage_module' => 'virtual_field',
))
->condition('module', 'ding_periodical')
->execute();
}
22 changes: 0 additions & 22 deletions ding_periodical.js

This file was deleted.

16 changes: 16 additions & 0 deletions ding_periodical.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
api = 2
core = 7.x

; Ding!
projects[ding_provider][type] = "module"
projects[ding_provider][download][type] = "git"
projects[ding_provider][download][url] = "git@github.com:ding2/ding_provider.git"
projects[ding_provider][download][branch] = "master"

projects[ding_entity][type] = "module"
projects[ding_entity][download][type] = "git"
projects[ding_entity][download][url] = "git@github.com:ding2/ding_entity.git"
projects[ding_entity][download][branch] = "master"

projects[virtual_field][subdir] = "contrib"
projects[virtual_field][version] = "1.2"
Loading