Code Monkey home page Code Monkey logo

plugin-collectiontree's Introduction

Welcome to Omeka

© 2016-present Corporation for Digital Scholarship, 2008-2016 Roy Rosenzweig Center for History and New Media

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Omeka includes:

Use and modifications of these libraries must comply with their respective licenses.

Release notes for Omeka are available at http://omeka.org/codex/Release_Notes.

plugin-collectiontree's People

Contributors

daniel-km avatar jimsafley avatar kimisgold avatar miniol avatar patrickmj avatar rsanc77 avatar zerocrates avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin-collectiontree's Issues

Table_CollectionTree::findPairsForSelectForm() has a useless parameter

This is a bug in the source code and its documentation that has no effect in practice, other than misleading those who may read the code documentation.

In the method Table_CollectionTree::findPairsForSelectForm() :

/**
     * Return the collection tree hierarchy as a one-dimensional array.
     *
     * @param array $options (optional) Set of parameters for searching/
     * filtering results.
     * @param string $padding The string representation of the collection depth.
     * @return array
     */
    public function findPairsForSelectForm(array $options = array(), $padding = '-')
    {
        if (isset($params['padding'])) {
            $padding = $params['padding'];
        } else {
            $padding = '-';
        }
        $options = array(); /////////////////////////////////  <<<<<<<<<< THIS
     
        //.....

The first parameter, $options, is completely unused, as it's overwritten with an empty array before it's ever used. No matter what you pass to the method in this parameter, it will have no effect whatsoever.

More importantly, the documentation for the parameter doesn't say so:

/*
     * @param array $options (optional) Set of parameters for searching/
     * filtering results.
...
*/

Whatever that is supposed to mean, it's not true, as the argument has no effect.

Change the plugin name to "Nested Collections"

"Nested" is ambiguous. Since the plugin is already in use, this will require a specialized upgrade path for early adopters:

  1. Delete the old Nested plugin directory without uninstalling or disabling the plugin;
  2. Save the new NestedCollections plugin directory;
  3. Install the "Nested Collections" plugin.

During installation (not upgrade), if a plugin names "Nested" exists in the plugins table:

  1. Delete the "Nested" plugin from the plugins table
  2. Perform any alterations to the plugin tables.

Confirm that collection assignment and the hierarchy tree works

@sheilabrennan, @leeannghajar

I suggest that you first create at least ten collections named in a series, e.g. one, two, three, four, ... When adding/editing the collections, under "Parent Collection", assign a parent collection to each of these collections. Afterwards, check that the hierarchy tree represents these changes on the collection's show page and the "Collection Tree" page.

If you encounter anomalies, try to remember the steps you took before seeing them.

Represent collection hierarchy in collection select form

On this discussion, Jeremy made the following suggestion:

Looks like this would be a great opportunity to add a filter to the collections select menu on the Item form. (LIkely just have a filter for _select_from_table). Having a list of nested collections separate from the form input where you actually choose the collection is less than ideal.

This will be a two step process. First, in Omeka core, filter the select options returned from findPairsForSelectForm(), using something like this (note the apply_filters()):

<?php
function _select_from_table($tableClass, $props = array(), $value = null, $label = null, $searchParams = array())
    $options = get_db()->getTable($tableClass)->findPairsForSelectForm($searchParams);
    $options = apply_filters(Inflector::underscore($tableClass) . '_select_options', $options);
    return select($props, $options, $value, $label);
}

Second, in the CollectionTree plugin, add a collections_select_options filter callback that returns the collection hierarchy represented as a one-dimensional array where individual characters (probably spaces) represent the collection depth. For example:

<?php
array(
    1 => "Collection One",
    3 => "    Collection Three",
    4 => "        Collection Four",
    6 => "        Collection Six",
    2 => "Collection Two",
    5 => "    Collection Five",
)

This way the collection select form on the item add/edit page will be easier to use.

Multi nesting

Need to add the ability to do multi level nesting.

Sorting

I think sorting would be a nice feature to have. I would like to be able to add sort alphabetically.

advanced search field mislabeled

On the advanced search form, the field "Expand to subcollections" has a label 'for="public"', but the 'public' field ID is already used by the search-by-public field, and the checkbox of the 'Expand to subcollections' field has the ID 'subcollections'.

Hence, on line 332 of /CollectionTree/CollectionTreePlugin.php the label should be changed to 'for-"subcollections"'.

Padding not configurable

I believe there is an issue with the padding for collections list: in models/Table/CollectionTree.php it's supposed to be passable as a parameter, but then it's hardcoded ignoring the parameter.

I suggest to remove the following code from findPairsForSelectForm function:

        if (isset($params['padding'])) {
            $padding = $params['padding'];
        } else {
            $padding = '-';
        }

Test upgrade from earlier plugin version (tag v0.1)

Install tag v0.1, insert test data, and test the upgrade from v0.1 (Nested) to the current version (NestedCollections). Due to the nature of the the upgrade, the upgrade code is located in the install hook.

3.1 issue with collection names

On a 3.1 installation, when the plugin is enabled, collections appear to lose their names when viewed in any dropdown of collections:

collections
collections-actual
timelinecollections

(The last image is the dropdown in the Timeline plugin)

The only thing that I can see differentiating the "Public Domain Items" collection from the others is that none of my collections have any metadata filled out, except that one. It has Description and Creator values.

Multi nesting

Need to add the ability to do multi level nesting.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.