From 39608839ef9ebfc0763e26ccd3443b0116914c3b Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 19 May 2015 17:02:10 +0200 Subject: [PATCH 01/66] Additional translatable strings (tiny ones, but relation texts can now be translated as well) + German translation --- ItemRelationsPlugin.php | 5 +- config_form.php | 2 +- formal_vocabularies.php | 460 ++++++++++----------- languages/de_DE.mo | Bin 0 -> 29979 bytes languages/de_DE.po | 861 ++++++++++++++++++++++++++++++++++++++++ languages/template.pot | 720 +++++++++++++++++++++++++++++++++ 6 files changed, 1815 insertions(+), 233 deletions(-) create mode 100644 languages/de_DE.mo create mode 100644 languages/de_DE.po diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 457c59f..3fb089f 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -88,6 +88,7 @@ public function hookInstall() $db->query($sql); // Install the formal vocabularies and their properties. + self::hookInitialize(); // Make sure that the i18n file is already loaded $formalVocabularies = include 'formal_vocabularies.php'; foreach ($formalVocabularies as $formalVocabulary) { $vocabulary = new ItemRelationsVocabulary; @@ -112,8 +113,8 @@ public function hookInstall() // Install a custom vocabulary. $customVocabulary = new ItemRelationsVocabulary; - $customVocabulary->name = 'Custom'; - $customVocabulary->description = 'Custom vocabulary containing relations defined for this Omeka instance.'; + $customVocabulary->name = __('Custom'); + $customVocabulary->description = __('Custom vocabulary containing relations defined for this Omeka instance.'); $customVocabulary->namespace_prefix = ''; // cannot be NULL $customVocabulary->namespace_uri = null; $customVocabulary->custom = 1; diff --git a/config_form.php b/config_form.php index c849d01..08ce2be 100644 --- a/config_form.php +++ b/config_form.php @@ -23,6 +23,6 @@ . 'prefer to show. If one is unavailable the other will be used.'); ?>

- formSelect('item_relations_relation_format', $relationFormat, null, array('prefix_local_part' => 'prefix:localPart', 'label' => 'label')); ?> + formSelect('item_relations_relation_format', $relationFormat, null, array('prefix_local_part' => __('prefix:localPart'), 'label' => __('label'))); ?> diff --git a/formal_vocabularies.php b/formal_vocabularies.php index 2949eec..f171fca 100644 --- a/formal_vocabularies.php +++ b/formal_vocabularies.php @@ -8,598 +8,598 @@ return $formalVocabularies = array( array( 'name' => 'Dublin Core', - 'description' => 'Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/', + 'description' => __('Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/'), 'namespace_prefix' => 'dcterms', 'namespace_uri' => 'http://purl.org/dc/terms/', 'properties' => array( array( 'local_part' => 'relation', - 'label' => 'Relation', - 'description' => 'A related resource.' + 'label' => __('Relation'), + 'description' => __('A related resource.') ), array( 'local_part' => 'conformsTo', - 'label' => 'Conforms To', - 'description' => 'An established standard to which the described resource conforms.' + 'label' => __('Conforms To'), + 'description' => __('An established standard to which the described resource conforms.') ), array( 'local_part' => 'hasFormat', - 'label' => 'Has Format', - 'description' => 'A related resource that is substantially the same as the pre-existing described resource, but in another format.' + 'label' => __('Has Format'), + 'description' => __('A related resource that is substantially the same as the pre-existing described resource, but in another format.') ), array( 'local_part' => 'hasPart', - 'label' => 'Has Part', - 'description' => 'A related resource that is included either physically or logically in the described resource.' + 'label' => __('Has Part'), + 'description' => __('A related resource that is included either physically or logically in the described resource.') ), array( 'local_part' => 'hasVersion', - 'label' => 'Has Version', - 'description' => 'A related resource that is a version, edition, or adaptation of the described resource.' + 'label' => __('Has Version'), + 'description' => __('A related resource that is a version, edition, or adaptation of the described resource.') ), array( 'local_part' => 'isFormatOf', - 'label' => 'Is Format Of', - 'description' => 'A related resource that is substantially the same as the described resource, but in another format.' + 'label' => __('Is Format Of'), + 'description' => __('A related resource that is substantially the same as the described resource, but in another format.') ), array( 'local_part' => 'isPartOf', - 'label' => 'Is Part Of', - 'description' => 'A related resource in which the described resource is physically or logically included.' + 'label' => __('Is Part Of'), + 'description' => __('A related resource in which the described resource is physically or logically included.') ), array( 'local_part' => 'isReferencedBy', - 'label' => 'Is Referenced By', - 'description' => 'A related resource that references, cites, or otherwise points to the described resource.' + 'label' => __('Is Referenced By'), + 'description' => __('A related resource that references, cites, or otherwise points to the described resource.') ), array( 'local_part' => 'isReplacedBy', - 'label' => 'Is Replaced By', - 'description' => 'A related resource that supplants, displaces, or supersedes the described resource.' + 'label' => __('Is Replaced By'), + 'description' => __('A related resource that supplants, displaces, or supersedes the described resource.') ), array( 'local_part' => 'isRequiredBy', - 'label' => 'Is Required By', - 'description' => 'A related resource that requires the described resource to support its function, delivery, or coherence.' + 'label' => __('Is Required By'), + 'description' => __('A related resource that requires the described resource to support its function, delivery, or coherence.') ), array( 'local_part' => 'isVersionOf', - 'label' => 'Is Version Of', - 'description' => 'A related resource of which the described resource is a version, edition, or adaptation.' + 'label' => __('Is Version Of'), + 'description' => __('A related resource of which the described resource is a version, edition, or adaptation.') ), array( 'local_part' => 'references', - 'label' => 'References', - 'description' => 'A related resource that is referenced, cited, or otherwise pointed to by the described resource.' + 'label' => __('References'), + 'description' => __('A related resource that is referenced, cited, or otherwise pointed to by the described resource.') ), array( 'local_part' => 'replaces', - 'label' => 'Replaces', - 'description' => 'A related resource that is supplanted, displaced, or superseded by the described resource.' + 'label' => __('Replaces'), + 'description' => __('A related resource that is supplanted, displaced, or superseded by the described resource.') ), array( 'local_part' => 'requires', - 'label' => 'Requires', - 'description' => 'A related resource that is required by the described resource to support its function, delivery, or coherence.' + 'label' => __('Requires'), + 'description' => __('A related resource that is required by the described resource to support its function, delivery, or coherence.') ), array( 'local_part' => 'source', - 'label' => 'Source', - 'description' => 'A related resource from which the described resource is derived.' + 'label' => __('Source'), + 'description' => __('A related resource from which the described resource is derived.') ), array( 'local_part' => 'abstract', - 'label' => 'Abstract', - 'description' => 'A summary of the resource.' + 'label' => __('Abstract'), + 'description' => __('A summary of the resource.') ), array( 'local_part' => 'accessRights', - 'label' => 'Access Rights', - 'description' => 'Information about who can access the resource or an indication of its security status.' + 'label' => __('Access Rights'), + 'description' => __('Information about who can access the resource or an indication of its security status.') ), array( 'local_part' => 'accrualMethod', - 'label' => 'Accrual Method', - 'description' => 'The method by which items are added to a collection.' + 'label' => __('Accrual Method'), + 'description' => __('The method by which items are added to a collection.') ), array( 'local_part' => 'accrualPeriodicity', - 'label' => 'Accrual Periodicity', - 'description' => 'The frequency with which items are added to a collection.' + 'label' => __('Accrual Periodicity'), + 'description' => __('The frequency with which items are added to a collection.') ), array( 'local_part' => 'accrualPolicy', - 'label' => 'Accrual Policy', - 'description' => 'The policy governing the addition of items to a collection.' + 'label' => __('Accrual Policy'), + 'description' => __('The policy governing the addition of items to a collection.') ), array( 'local_part' => 'audience', - 'label' => 'Audience', - 'description' => 'A class of entity for whom the resource is intended or useful.' + 'label' => __('Audience'), + 'description' => __('A class of entity for whom the resource is intended or useful.') ), array( 'local_part' => 'contributor', - 'label' => 'Contributor', - 'description' => 'An entity responsible for making contributions to the resource.' + 'label' => __('Contributor'), + 'description' => __('An entity responsible for making contributions to the resource.') ), array( 'local_part' => 'coverage', - 'label' => 'Coverage', - 'description' => 'The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.' + 'label' => __('Coverage'), + 'description' => __('The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.') ), array( 'local_part' => 'creator', - 'label' => 'Creator', - 'description' => 'An entity primarily responsible for making the resource.' + 'label' => __('Creator'), + 'description' => __('An entity primarily responsible for making the resource.') ), array( 'local_part' => 'description', - 'label' => 'Description', - 'description' => 'An account of the resource.' + 'label' => __('Description'), + 'description' => __('An account of the resource.') ), array( 'local_part' => 'educationLevel', - 'label' => 'Audience Education Level', - 'description' => 'A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.' + 'label' => __('Audience Education Level'), + 'description' => __('A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.') ), array( 'local_part' => 'extent', - 'label' => 'Extent', - 'description' => 'The size or duration of the resource.' + 'label' => __('Extent'), + 'description' => __('The size or duration of the resource.') ), array( 'local_part' => 'format', - 'label' => 'Format', - 'description' => 'The file format, physical medium, or dimensions of the resource.' + 'label' => __('Format'), + 'description' => __('The file format, physical medium, or dimensions of the resource.') ), array( 'local_part' => 'instructionalMethod', - 'label' => 'Instructional Method', - 'description' => 'A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.' + 'label' => __('Instructional Method'), + 'description' => __('A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.') ), array( 'local_part' => 'language', - 'label' => 'Language', - 'description' => 'A language of the resource.' + 'label' => __('Language'), + 'description' => __('A language of the resource.') ), array( 'local_part' => 'license', - 'label' => 'License', - 'description' => 'A legal document giving official permission to do something with the resource.' + 'label' => __('License'), + 'description' => __('A legal document giving official permission to do something with the resource.') ), array( 'local_part' => 'mediator', - 'label' => 'Mediator', - 'description' => 'An entity that mediates access to the resource and for whom the resource is intended or useful.' + 'label' => __('Mediator'), + 'description' => __('An entity that mediates access to the resource and for whom the resource is intended or useful.') ), array( 'local_part' => 'medium', - 'label' => 'Medium', - 'description' => 'The material or physical carrier of the resource.' + 'label' => __('Medium'), + 'description' => __('The material or physical carrier of the resource.') ), array( 'local_part' => 'provenance', - 'label' => 'Provenance', - 'description' => 'A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.' + 'label' => __('Provenance'), + 'description' => __('A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.') ), array( 'local_part' => 'publisher', - 'label' => 'Publisher', - 'description' => 'An entity responsible for making the resource available.' + 'label' => __('Publisher'), + 'description' => __('An entity responsible for making the resource available.') ), array( 'local_part' => 'rights', - 'label' => 'Rights', - 'description' => 'Information about rights held in and over the resource.' + 'label' => __('Rights'), + 'description' => __('Information about rights held in and over the resource.') ), array( 'local_part' => 'rightsHolder', - 'label' => 'Rights Holder', - 'description' => 'A person or organization owning or managing rights over the resource.' + 'label' => __('Rights Holder'), + 'description' => __('A person or organization owning or managing rights over the resource.') ), array( 'local_part' => 'spatial', - 'label' => 'Spatial Coverage', - 'description' => 'Spatial characteristics of the resource.' + 'label' => __('Spatial Coverage'), + 'description' => __('Spatial characteristics of the resource.') ), array( 'local_part' => 'subject', - 'label' => 'Subject', - 'description' => 'The topic of the resource.' + 'label' => __('Subject'), + 'description' => __('The topic of the resource.') ), array( 'local_part' => 'tableOfContents', - 'label' => 'Table Of Contents', - 'description' => 'A list of subunits of the resource.' + 'label' => __('Table Of Contents'), + 'description' => __('A list of subunits of the resource.') ), array( 'local_part' => 'temporal', - 'label' => 'Temporal Coverage', - 'description' => 'Temporal characteristics of the resource.' + 'label' => __('Temporal Coverage'), + 'description' => __('Temporal characteristics of the resource.') ), array( 'local_part' => 'type', - 'label' => 'Type', - 'description' => 'The nature or genre of the resource.' + 'label' => __('Type'), + 'description' => __('The nature or genre of the resource.') ), ) ), array( 'name' => 'BIBO', - 'description' => 'Relations defined by the Bibliographic Ontology (BIBO): http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html', + 'description' => __('Relations defined by the Bibliographic Ontology (BIBO): http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html'), 'namespace_prefix' => 'bibo', 'namespace_uri' => 'http://purl.org/ontology/bibo/', 'properties' => array( array( 'local_part' => 'annotates', - 'label' => 'annotates', - 'description' => 'Critical or explanatory note for a Document.' + 'label' => __('annotates'), + 'description' => __('Critical or explanatory note for a Document.') ), array( 'local_part' => 'citedBy', - 'label' => 'cited by', - 'description' => 'Relates a document to another document that cites the first document.' + 'label' => __('cited by'), + 'description' => __('Relates a document to another document that cites the first document.') ), array( 'local_part' => 'cites', - 'label' => 'cites', - 'description' => 'Relates a document to another document that is cited by the first document as reference, comment, review, quotation or for another purpose.' + 'label' => __('cites'), + 'description' => __('Relates a document to another document that is cited by the first document as reference, comment, review, quotation or for another purpose.') ), array( 'local_part' => 'reviewOf', - 'label' => 'review of', - 'description' => 'Relates a review document to a reviewed thing (resource, item, etc.).' + 'label' => __('review of'), + 'description' => __('Relates a review document to a reviewed thing (resource, item, etc.).') ), array( 'local_part' => 'reproducedIn', - 'label' => 'reproduced in', - 'description' => 'The resource in which another resource is reproduced.' + 'label' => __('reproduced in'), + 'description' => __('The resource in which another resource is reproduced.') ), array( 'local_part' => 'affirmedBy', - 'label' => 'affirmed by', - 'description' => 'A legal decision that affirms a ruling.' + 'label' => __('affirmed by'), + 'description' => __('A legal decision that affirms a ruling.') ), array( 'local_part' => 'reversedBy', - 'label' => 'reversed by', - 'description' => 'A legal decision that reverses a ruling.' + 'label' => __('reversed by'), + 'description' => __('A legal decision that reverses a ruling.') ), array( 'local_part' => 'subsequentLegalDecision', - 'label' => 'subsequent legal decision', - 'description' => 'A legal decision on appeal that takes action on a case (affirming it, reversing it, etc.).' + 'label' => __('subsequent legal decision'), + 'description' => __('A legal decision on appeal that takes action on a case (affirming it, reversing it, etc.).') ), array( 'local_part' => 'transcriptOf', - 'label' => 'transcript of', - 'description' => 'Relates a document to some transcribed original.' + 'label' => __('transcript of'), + 'description' => __('Relates a document to some transcribed original.') ), array( 'local_part' => 'translationOf', - 'label' => 'translation of', - 'description' => 'Relates a translated document to the original document.' + 'label' => __('translation of'), + 'description' => __('Relates a translated document to the original document.') ), ) ), array( 'name' => 'FOAF', - 'description' => 'Relations defined by the Friend of a Friend vocabulary (FOAF): http://xmlns.com/foaf/spec/', + 'description' => __('Relations defined by the Friend of a Friend vocabulary (FOAF): http://xmlns.com/foaf/spec/'), 'namespace_prefix' => 'foaf', 'namespace_uri' => 'http://xmlns.com/foaf/0.1/', 'properties' => array( array( 'local_part' => 'based_near', - 'label' => 'based near', - 'description' => 'A location that something is based near, for some broadly human notion of near.' + 'label' => __('based near'), + 'description' => __('A location that something is based near, for some broadly human notion of near.') ), array( 'local_part' => 'depiction', - 'label' => 'depiction', - 'description' => 'A depiction of some thing.' + 'label' => __('depiction'), + 'description' => __('A depiction of some thing.') ), array( 'local_part' => 'depicts', - 'label' => 'depicts', - 'description' => 'A thing depicted in this representation.' + 'label' => __('depicts'), + 'description' => __('A thing depicted in this representation.') ), array( 'local_part' => 'fundedBy', - 'label' => 'funded by', - 'description' => 'An organization funding a project or person.' + 'label' => __('funded by'), + 'description' => __('An organization funding a project or person.') ), array( 'local_part' => 'img', - 'label' => 'image', - 'description' => 'An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one\'s photo on a homepage).' + 'label' => __('image'), + 'description' => __('An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one\'s photo on a homepage).') ), array( 'local_part' => 'isPrimaryTopicOf', - 'label' => 'is primary topic of', - 'description' => 'A document that this thing is the primary topic of.' + 'label' => __('is primary topic of'), + 'description' => __('A document that this thing is the primary topic of.') ), array( 'local_part' => 'knows', - 'label' => 'knows', - 'description' => 'A person known by this person (indicating some level of reciprocated interaction between the parties).' + 'label' => __('knows'), + 'description' => __('A person known by this person (indicating some level of reciprocated interaction between the parties).') ), array( 'local_part' => 'logo', - 'label' => 'logo', - 'description' => 'A logo representing some thing.' + 'label' => __('logo'), + 'description' => __('A logo representing some thing.') ), array( 'local_part' => 'made', - 'label' => 'made', - 'description' => 'Something that was made by this agent.' + 'label' => __('made'), + 'description' => __('Something that was made by this agent.') ), array( 'local_part' => 'maker', - 'label' => 'maker', - 'description' => 'An agent that made this thing.' + 'label' => __('maker'), + 'description' => __('An agent that made this thing.') ), array( 'local_part' => 'member', - 'label' => 'member', - 'description' => 'Indicates a member of a Group.' + 'label' => __('member'), + 'description' => __('Indicates a member of a Group.') ), array( 'local_part' => 'page', - 'label' => 'page', - 'description' => 'A page or document about this thing.' + 'label' => __('page'), + 'description' => __('A page or document about this thing.') ), array( 'local_part' => 'primaryTopic', - 'label' => 'primary topic', - 'description' => 'The primary topic of some page or document.' + 'label' => __('primary topic'), + 'description' => __('The primary topic of some page or document.') ), array( 'local_part' => 'thumbnail', - 'label' => 'thumbnail', - 'description' => 'A derived thumbnail image.' + 'label' => __('thumbnail'), + 'description' => __('A derived thumbnail image.') ), ) ), array( 'name' => 'FRBR', - 'description' => 'Relations defined by the Functional Requirements for Bibliographic Records (FRBR): http://vocab.org/frbr/core.html', + 'description' => __('Relations defined by the Functional Requirements for Bibliographic Records (FRBR): http://vocab.org/frbr/core.html'), 'namespace_prefix' => 'frbr', 'namespace_uri' => 'http://purl.org/vocab/frbr/core#', 'properties' => array( array( 'local_part' => 'abridgement', - 'label' => 'abridgement', - 'description' => 'A property representing an abridgment of an expression.' + 'label' => __('abridgement'), + 'description' => __('A property representing an abridgment of an expression.') ), array( 'local_part' => 'abridgementOf', - 'label' => 'abridgement of', - 'description' => 'A property representing an expression that is abridged.' + 'label' => __('abridgement of'), + 'description' => __('A property representing an expression that is abridged.') ), array( 'local_part' => 'adaption', - 'label' => 'adaption', - 'description' => 'A property representing an adaption of a work or expression.' + 'label' => __('adaption'), + 'description' => __('A property representing an adaption of a work or expression.') ), array( 'local_part' => 'adaptionOf', - 'label' => 'adaption of', - 'description' => 'A property representing a work or expression that is adapted.' + 'label' => __('adaption of'), + 'description' => __('A property representing a work or expression that is adapted.') ), array( 'local_part' => 'alternate', - 'label' => 'alternate', - 'description' => 'A property representing an alternative to a manifestation.' + 'label' => __('alternate'), + 'description' => __('A property representing an alternative to a manifestation.') ), array( 'local_part' => 'alternateOf', - 'label' => 'alternate of', - 'description' => 'A property representing a manifestation that is alternated.' + 'label' => __('alternate of'), + 'description' => __('A property representing a manifestation that is alternated.') ), array( 'local_part' => 'arrangement', - 'label' => 'arrangement', - 'description' => 'A property representing an arrangement of an expression.' + 'label' => __('arrangement'), + 'description' => __('A property representing an arrangement of an expression.') ), array( 'local_part' => 'arrangementOf', - 'label' => 'arrangement of', - 'description' => 'A property representing an expression that is arranged.' + 'label' => __('arrangement of'), + 'description' => __('A property representing an expression that is arranged.') ), array( 'local_part' => 'complement', - 'label' => 'complement', - 'description' => 'A property representing a complement to a work or expression.' + 'label' => __('complement'), + 'description' => __('A property representing a complement to a work or expression.') ), array( 'local_part' => 'complementOf', - 'label' => 'complement of', - 'description' => 'A property representing a work or expression that is complemented.' + 'label' => __('complement of'), + 'description' => __('A property representing a work or expression that is complemented.') ), array( 'local_part' => 'creator', - 'label' => 'creator', - 'description' => 'A property representing an entity in some way responsible for the creation of a work.' + 'label' => __('creator'), + 'description' => __('A property representing an entity in some way responsible for the creation of a work.') ), array( 'local_part' => 'creatorOf', - 'label' => 'creator of', - 'description' => 'A property representing a work that was in some way created by of an entity.' + 'label' => __('creator of'), + 'description' => __('A property representing a work that was in some way created by of an entity.') ), array( 'local_part' => 'embodiment', - 'label' => 'embodiment', - 'description' => 'A property representing a manifestation that embodies an expression.' + 'label' => __('embodiment'), + 'description' => __('A property representing a manifestation that embodies an expression.') ), array( 'local_part' => 'embodimentOf', - 'label' => 'embodiment of', - 'description' => 'A property representing an expression that is embodied by a manifestation.' + 'label' => __('embodiment of'), + 'description' => __('A property representing an expression that is embodied by a manifestation.') ), array( 'local_part' => 'exemplar', - 'label' => 'exemplar', - 'description' => 'A property representing an item that is an exemplar of a manifestation.' + 'label' => __('exemplar'), + 'description' => __('A property representing an item that is an exemplar of a manifestation.') ), array( 'local_part' => 'exemplarOf', - 'label' => 'exemplar of', - 'description' => 'A property representing the manifestation that is exemplified by a item.' + 'label' => __('exemplar of'), + 'description' => __('A property representing the manifestation that is exemplified by a item.') ), array( 'local_part' => 'imitation', - 'label' => 'imitation', - 'description' => 'A property representing an imitation of a work or expression.' + 'label' => __('imitation'), + 'description' => __('A property representing an imitation of a work or expression.') ), array( 'local_part' => 'imitationOf', - 'label' => 'imitation of', - 'description' => 'A property representing a work or expression that is imitated.' + 'label' => __('imitation of'), + 'description' => __('A property representing a work or expression that is imitated.') ), array( 'local_part' => 'owner', - 'label' => 'owner', - 'description' => 'A property representing an entity that owns an item.' + 'label' => __('owner'), + 'description' => __('A property representing an entity that owns an item.') ), array( 'local_part' => 'ownerOf', - 'label' => 'owner of', - 'description' => 'A property representing an item that is in some way owned an entity.' + 'label' => __('owner of'), + 'description' => __('A property representing an item that is in some way owned an entity.') ), array( 'local_part' => 'part', - 'label' => 'part', - 'description' => 'A property representing a part of an endeavour.' + 'label' => __('part'), + 'description' => __('A property representing a part of an endeavour.') ), array( 'local_part' => 'partOf', - 'label' => 'part of', - 'description' => 'A property representing an endeavour incorporating an endeavour.' + 'label' => __('part of'), + 'description' => __('A property representing an endeavour incorporating an endeavour.') ), array( 'local_part' => 'producer', - 'label' => 'producer', - 'description' => 'A property representing an entity in some way responsible for producing a manifestation.' + 'label' => __('producer'), + 'description' => __('A property representing an entity in some way responsible for producing a manifestation.') ), array( 'local_part' => 'producerOf', - 'label' => 'producer of', - 'description' => 'A property representing a manifestation that was in some way produced an entity.' + 'label' => __('producer of'), + 'description' => __('A property representing a manifestation that was in some way produced an entity.') ), array( 'local_part' => 'realization', - 'label' => 'realization', - 'description' => 'A property representing an expression that is an intellectual or artistic realization of a work.' + 'label' => __('realization'), + 'description' => __('A property representing an expression that is an intellectual or artistic realization of a work.') ), array( 'local_part' => 'realizationOf', - 'label' => 'realization of', - 'description' => 'A property representing the work that has been realized by an expression.' + 'label' => __('realization of'), + 'description' => __('A property representing the work that has been realized by an expression.') ), array( 'local_part' => 'realizer', - 'label' => 'realizer', - 'description' => 'A property representing an entity in some way responsible for realizing an expression.' + 'label' => __('realizer'), + 'description' => __('A property representing an entity in some way responsible for realizing an expression.') ), array( 'local_part' => 'realizerOf', - 'label' => 'realizer of', - 'description' => 'A property representing an expression that was in some way realized by an entity.' + 'label' => __('realizer of'), + 'description' => __('A property representing an expression that was in some way realized by an entity.') ), array( 'local_part' => 'reconfiguration', - 'label' => 'reconfiguration', - 'description' => 'A property representing a recongifuration of an item.' + 'label' => __('reconfiguration'), + 'description' => __('A property representing a recongifuration of an item.') ), array( 'local_part' => 'reconfigurationOf', - 'label' => 'reconfiguration of', - 'description' => 'A property representing an item that is reconfigured.' + 'label' => __('reconfiguration of'), + 'description' => __('A property representing an item that is reconfigured.') ), array( 'local_part' => 'relatedEndeavour', - 'label' => 'related endeavour', - 'description' => 'A property representing another endeavour that is related in some way to an endeavour.' + 'label' => __('related endeavour'), + 'description' => __('A property representing another endeavour that is related in some way to an endeavour.') ), array( 'local_part' => 'reproduction', - 'label' => 'reproduction', - 'description' => 'A property representing a reproduction of a manifestation or item.' + 'label' => __('reproduction'), + 'description' => __('A property representing a reproduction of a manifestation or item.') ), array( 'local_part' => 'reproductionOf', - 'label' => 'reproduction of', - 'description' => 'A property representing a manifestation or item that is reproduced.' + 'label' => __('reproduction of'), + 'description' => __('A property representing a manifestation or item that is reproduced.') ), array( 'local_part' => 'responsibleEntity', - 'label' => 'responsible entity', - 'description' => 'A property representing an entity in some way responsible for an endeavour.' + 'label' => __('responsible entity'), + 'description' => __('A property representing an entity in some way responsible for an endeavour.') ), array( 'local_part' => 'responsibleEntityOf', - 'label' => 'responsible entity of', - 'description' => 'A property representing an endeavour that is the responsibility of an entity.' + 'label' => __('responsible entity of'), + 'description' => __('A property representing an endeavour that is the responsibility of an entity.') ), array( 'local_part' => 'revision', - 'label' => 'revision', - 'description' => 'A property representing a revision of an expression.' + 'label' => __('revision'), + 'description' => __('A property representing a revision of an expression.') ), array( 'local_part' => 'revisionOf', - 'label' => 'revision of', - 'description' => 'A property representing an expression that is revised.' + 'label' => __('revision of'), + 'description' => __('A property representing an expression that is revised.') ), array( 'local_part' => 'successor', - 'label' => 'successor', - 'description' => 'A property representing a successor to a work or expression.' + 'label' => __('successor'), + 'description' => __('A property representing a successor to a work or expression.') ), array( 'local_part' => 'successorOf', - 'label' => 'successor of', - 'description' => 'A property representing a work or expression that is succeeded.' + 'label' => __('successor of'), + 'description' => __('A property representing a work or expression that is succeeded.') ), array( 'local_part' => 'summarization', - 'label' => 'summarization', - 'description' => 'A property representing a summarization of a work or expression.' + 'label' => __('summarization'), + 'description' => __('A property representing a summarization of a work or expression.') ), array( 'local_part' => 'summarizationOf', - 'label' => 'summarization of', - 'description' => 'A property representing a work or expression that is summarized.' + 'label' => __('summarization of'), + 'description' => __('A property representing a work or expression that is summarized.') ), array( 'local_part' => 'supplement', - 'label' => 'supplement', - 'description' => 'A property representing a supplement to a work or expression.' + 'label' => __('supplement'), + 'description' => __('A property representing a supplement to a work or expression.') ), array( 'local_part' => 'supplementOf', - 'label' => 'supplement of', - 'description' => 'A property representing a work or expression that is supplemented.' + 'label' => __('supplement of'), + 'description' => __('A property representing a work or expression that is supplemented.') ), array( 'local_part' => 'transformation', - 'label' => 'transformation', - 'description' => 'A property representing a transformation of a work or expression.' + 'label' => __('transformation'), + 'description' => __('A property representing a transformation of a work or expression.') ), array( 'local_part' => 'transformationOf', - 'label' => 'transformation of', - 'description' => 'A property representing a work or expression that is transformed.' + 'label' => __('transformation of'), + 'description' => __('A property representing a work or expression that is transformed.') ), array( 'local_part' => 'translation', - 'label' => 'translation', - 'description' => 'A property representing a translation of an expression.' + 'label' => __('translation'), + 'description' => __('A property representing a translation of an expression.') ), array( 'local_part' => 'translationOf', - 'label' => 'translation of', - 'description' => 'A property representing an expression that is translated.' + 'label' => __('translation of'), + 'description' => __('A property representing an expression that is translated.') ), ) ), diff --git a/languages/de_DE.mo b/languages/de_DE.mo new file mode 100644 index 0000000000000000000000000000000000000000..96efe73e43139a0accac0d55660c728d0768a0cf GIT binary patch literal 29979 zcmcJX3!G$Cb?y%eiX#vN6?}3sip)TF&y0Y=AV|-PX=a8QdS)0vQL4L6RUNvjPIFGx z^h}$p5j95CL@&f^d<3Hy6XPpB(5v|Dpt;7x__#N@K7vsbjV8ng#8=e(zqR){b*j6% zr+d))&7SW(_G9g}*IsMwwfE_NJmuIw2>2a$Ob|R4+;V&nT*r0uWIYXnuRS6NE&=}u zd>I%%G6)_GzTM+rf#-7n4e&AGX{QCjwcxqnS>W%1Yrs3eE5N(KCx9cT2f=P|96SSj zBltw{6JQPe7Pu9>;!!~`4c-b~3?4`0o59WC7VyR3Mc`+^J>c;Wu@1ZjJRf`sxC#6y zcpmrwI{7s4som{f1G>X0#*LcLGj@p@af?2<6Zd{sQ2#xRsQ?n zPVihhrFwoFd>Z%xa3gphcmcRRbme1k7x!-kcYr?zuLigLW)NHjz8>5U-V2KU%U8R4 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<77(~mSHPuV67D|6fe`xa?}&m3?Mt_yZ_(^-FVuY7H8UB27IA42he zjuFvB*`-T+tw3jKLaG8>_PN{O8G`R4$T}e&;J4>T2jssRjdUVkq=?A~3QzJ2tKa5! zV9V>mllNZo#y-EgM}$6(;Rr2}gx;0aMZh0~QWADi zPp~xb)ZW5ZzsWG_&PHLrO9y%Ryvg62KJUB9%a_8^^G*?I)E0m1sjsmHOSC}N2=shb z-SwZSop)>b_f8X;M1{yw;Tq`ZK9a>rc^hqaj<$4ZWftxt^q+}U%f0igrAsS4?^6-N adRnQ+H79dr{w`#8`TVKtjhyLxDE=EVQ>=dg literal 0 HcmV?d00001 diff --git a/languages/de_DE.po b/languages/de_DE.po new file mode 100644 index 0000000..dcb9de0 --- /dev/null +++ b/languages/de_DE.po @@ -0,0 +1,861 @@ +# Translation for the Exhibit Builder plugin for Omeka. +# Copyright (C) 2014 Roy Rosenzweig Center for History and New Media +# This file is distributed under the same license as the Omeka package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Item Relations\n" +"Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" +"POT-Creation-Date: 2014-01-13 12:59-0500\n" +"PO-Revision-Date: 2015-05-19 16:31+0100\n" +"Language: de_DE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Last-Translator: \n" +"Language-Team: \n" +"X-Generator: Poedit 1.7.6\n" + +#: ItemRelationsPlugin.php:116 +msgid "Custom" +msgstr "Benutzerdefiniert" + +#: ItemRelationsPlugin.php:117 +msgid "Custom vocabulary containing relations defined for this Omeka instance." +msgstr "Benutzerdefiniertes Vokabular, das Beziehungen enthält, die für diese Omeka-Installation definiert wurden." + +#: ItemRelationsPlugin.php:357 ItemRelationsPlugin.php:407 views/admin/common/item-relations-show.php:2 views/public/common/item-relations-show.php:2 +#: views/shared/common/item-relations-advanced-search.php:3 +msgid "Item Relations" +msgstr "Objekt-Beziehungen" + +#: ItemRelationsPlugin.php:361 +msgid "Subjects" +msgstr "Subjekt-Ressourcen" + +#: ItemRelationsPlugin.php:363 item_relations_form.php:17 views/shared/common/item-relations-advanced-search.php:17 +msgid "Object" +msgstr "Objekt-Ressource" + +#: ItemRelationsPlugin.php:368 +msgid "These Items" +msgstr "Diese Objekte" + +#: ItemRelationsPlugin.php:371 item_relations_form.php:41 +msgid "Item ID" +msgstr "Objekt-ID" + +#: config_form.php:3 +msgid "Append to Public Items Show" +msgstr "Auf der öffentlichen Seite anzeigen" + +#: config_form.php:8 +msgid "Check this if you want to display an item's relations on its public show page." +msgstr "Aktivieren Sie diese Einstellung, wenn Sie die Objekt-Beziehungen auf der öffentlichen Seite anzeigen wollen." + +#: config_form.php:17 +msgid "Relation Format" +msgstr "Beziehungs-Format" + +#: config_form.php:22 +msgid "Select the format of an item's relations that you would prefer to show. If one is unavailable the other will be used." +msgstr "Wählen Sie das Format einer Objekt-Beziehung, die Sie vornehmlich anzeigen möchten. Ist eine davon nicht verfügbar, wird die andere verwendet." + +#: config_form.php:26 +msgid "prefix:localPart" +msgstr "Präfix:Lokaler Teil" + +#: config_form.php:26 +msgid "label" +msgstr "Bezeichnung" + +#: controllers/VocabulariesController.php:50 +msgid "The vocabulary was successfully edited." +msgstr "Das Vokabular wurde erfolgreich editiert." + +#: item_relations_form.php:4 views/admin/vocabularies/browse.php:1 +msgid "Browse Vocabularies" +msgstr "Vokabular durchsuchen" + +#: item_relations_form.php:6 +#, php-format +msgid "" +"Here you can relate this item to another item and delete existing relations. For descriptions of the relations, see the %s page. Invalid item IDs will be ignored." +msgstr "" +"Hier können Sie ein Objekt mit einem anderen Objekt in Beziehung setzen oder bestehende Beziehungen löschen. Für die Beschreibungen der Beziehungen, lesen Sie bitte " +"unter %s weiter. Unzulässige Objekt-IDs werden ignoriert." + +#: item_relations_form.php:24 item_relations_form.php:34 item_relations_form.php:39 views/admin/common/item-relations-show.php:10 +#: views/admin/common/item-relations-show.php:19 views/public/common/item-relations-show.php:9 views/public/common/item-relations-show.php:18 +msgid "This Item" +msgstr "Dieses Objekt" + +#: item_relations_form.php:46 +msgid "Add a Relation" +msgstr "Beziehung hinzufügen" + +#: models/ItemRelationsProperty.php:62 +msgid "[unknown]" +msgstr "[unbekannt]" + +#: views/admin/common/item-relations-show.php:5 views/public/common/item-relations-show.php:4 +msgid "This item has no relations." +msgstr "Dieses Objekt besitzt keine Beziehungen." + +#: views/admin/vocabularies/browse.php:8 +msgid "Namespace Prefix" +msgstr "Namensraum-Präfix" + +#: views/admin/vocabularies/browse.php:9 +msgid "Namespace URI" +msgstr "Namensraum-URI" + +#: views/admin/vocabularies/edit.php:1 +msgid "Edit Custom Vocabulary" +msgstr "Benutzerdefiniertes Vokabular editieren" + +#: views/admin/vocabularies/edit.php:8 +msgid "" +"Here you can add, edit, and delete properties in your custom vocabulary. Property labels must be unique. You cannot edit property labels once they have been created, " +"so make sure they are spelled correctly and convey the exact relation you want them to convey." +msgstr "" +"Hier können Sie Eigenschaften in das benutzerdefinierte Vokabular hinzufügen, sowie bestehende editieren oder löschen. Die Eigenschafts-Bezeichnungen müssen " +"eindeutig sein. Sie können die Eigenschafts-Bezeichnungen nach dem Anlegen nicht mehr nachträglich editieren. Stellen Sie daher bitte sicher, dass diese fehlerfrei " +"geschrieben sind und die zu definierende Beziehung exakt beschreiben." + +#: views/admin/vocabularies/edit.php:37 +msgid "Add a Property" +msgstr "Eigenschaft hinzufügen" + +#: views/admin/vocabularies/show.php:2 +msgid "Vocabulary Properties" +msgstr "Vokabular-Eigenschaften" + +#: views/admin/vocabularies/show.php:7 +msgid "Edit Vocabulary" +msgstr "Vokabular editieren" + +#: views/admin/vocabularies/show.php:14 +msgid "This vocabulary has no properties." +msgstr "Dieses Vokabular besitzt keine Eigenschaften." + +#: views/admin/vocabularies/show.php:16 +msgid "Why don't you add some?" +msgstr "Möchten Sie einige hinzufügen?" + +#: views/admin/vocabularies/show.php:23 +msgid "Local Part" +msgstr "Lokaler Teil" + +#: views/shared/common/item-relations-advanced-search.php:8 +msgid "" +"Filter this search for items with the selected relation. For example, when selecting \"Subject\" items with the \"hasPart\" relation, the search will return all " +"items that have parts. When selecting \"Object\" items with the same relation, the search will return all items that are parts of other items." +msgstr "" +"Diese Suche auf Objekte mit einer bestimmten Beziehung begrenzen. Wenn Sie z.B. eine \"Subjekt\"- Ressource mit der \"Enthält Teil\"-Beziehung auswählen, wird diese " +"Suche alle Objekte auflisten, die Teile enthalten. Wenn Sie eine \"Objekt\"-Ressource mit derselben Beziehung auswählen, wird die Suche alle Objekte auflisten, die " +"Teile anderer Objekte sind." + +# -------------------------------------------------- +msgid "Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/" +msgstr "Beziehungs-Definitionen gemäß DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/" + +msgid "Relation" +msgstr "Beziehung" + +msgid "A related resource." +msgstr "Eine verwandte Ressource." + +msgid "Conforms To" +msgstr "Konform mit" + +msgid "An established standard to which the described resource conforms." +msgstr "Ein etablierter Standard, mit dem die bezeichnete Ressource konform geht." + +msgid "Has Format" +msgstr "Enthält Format" + +msgid "A related resource that is substantially the same as the pre-existing described resource, but in another format." +msgstr "Verwandte Ressource, die i.W. der zuvor existierenden, bezeichneten Ressource entspricht, aber in einem anderen Format." + +msgid "Has Part" +msgstr "Enthält Teil" + +msgid "A related resource that is included either physically or logically in the described resource." +msgstr "Verwandte Ressource, die entweder physisch oder logisch in der bezeichneten Ressource enthalten ist." + +msgid "Has Version" +msgstr "Enthält Version" + +msgid "A related resource that is a version, edition, or adaptation of the described resource." +msgstr "Verwandte Ressource, die eine Version, Edition oder Adaption der bezeichneten Ressource darstellt." + +msgid "Is Format Of" +msgstr "Ist Format von" + +msgid "A related resource that is substantially the same as the described resource, but in another format." +msgstr "Verwandte Ressource, die i.W. der bezeichneten Ressource entspricht, aber in einem anderen Format." + +msgid "Is Part Of" +msgstr "Ist Teil von" + +msgid "A related resource in which the described resource is physically or logically included." +msgstr "Verwandte Ressource, in der die bezeichnete Ressource physisch oder logisch enthalten ist." + +msgid "Is Referenced By" +msgstr "Wird referenziert von" + +msgid "A related resource that references, cites, or otherwise points to the described resource." +msgstr "Verwandte Ressource, die die bezeichnete Ressource referenziert, zitiert oder anderweitig auf sie verweist." + +msgid "Is Replaced By" +msgstr "Wird ersetzt von" + +msgid "A related resource that supplants, displaces, or supersedes the described resource." +msgstr "Verwandte Ressource, die die bezeichnete Ressource ablöst, verdrängt oder ersetzt." + +msgid "Is Required By" +msgstr "Ist erforderlich durch" + +msgid "A related resource that requires the described resource to support its function, delivery, or coherence." +msgstr "Verwandte Ressource, die die bezeichnete Ressource für ihre Funktion, Lieferung oder ihre Kohärenz erfordert." + +msgid "Is Version Of" +msgstr "Ist Version von" + +msgid "A related resource of which the described resource is a version, edition, or adaptation." +msgstr "Verwandte Ressource, von der die bezeichnete Ressource eine Version, Edition oder Adaption darstellt." + +msgid "References" +msgstr "Referenziert" + +msgid "A related resource that is referenced, cited, or otherwise pointed to by the described resource." +msgstr "Verwandte Ressource, die von der bezeichneten Ressource referenziert, zitiert oder anderweitig auf sie verwiesen wird." + +msgid "Replaces" +msgstr "Ersetzt" + +msgid "A related resource that is supplanted, displaced, or superseded by the described resource." +msgstr "Verwandte Ressource, die durch die bezeichnete Ressource abgelöst, verdrängt oder ersetzt wird." + +msgid "Requires" +msgstr "Erfordert" + +msgid "A related resource that is required by the described resource to support its function, delivery, or coherence." +msgstr "Verwandte Ressource, für die die bezeichnete Ressource für deren Funktion, Lieferung oder ihre Kohärenz erfordert ist." + +msgid "Source" +msgstr "Quelle" + +msgid "A related resource from which the described resource is derived." +msgstr "Verwandte Ressource, aus der die bezeichnete Ressource abgeleitet ist." + +msgid "Abstract" +msgstr "Zusammenfassung" + +msgid "A summary of the resource." +msgstr "Eine Zusammenfassung der Ressource." + +msgid "Access Rights" +msgstr "Zugriffsrechte" + +msgid "Information about who can access the resource or an indication of its security status." +msgstr "Informationen darüber, wer auf die Ressource zugreifen darf, oder ein Hinweis auf ihren Sicherheitsstatus." + +msgid "Accrual Method" +msgstr "Periodenrechnung" + +msgid "The method by which items are added to a collection." +msgstr "Eine Methode, durch die Objekte zu einer Kollektion hinzugefügt werden." + +msgid "Accrual Periodicity" +msgstr "Periodenhäufigkeit" + +msgid "The frequency with which items are added to a collection." +msgstr "Die Häufigkeit, mit der Objekte zu einer Kollektion hinzugefügt werden." + +msgid "Accrual Policy" +msgstr "Periodenrichtlinie" + +msgid "The policy governing the addition of items to a collection." +msgstr "Richtlinie, die das Hinzufügen von Objekten zu einer Kollektion regelt." + +msgid "Audience" +msgstr "Zielgruppe" + +msgid "A class of entity for whom the resource is intended or useful." +msgstr "Eine Klasse von Personen oder Organisationen, für die die Ressource gedacht bzw. nützlich ist." + +msgid "Contributor" +msgstr "Mitarbeiter" + +msgid "An entity responsible for making contributions to the resource." +msgstr "Eine Person oder Organisation, die verantwortlich ist für die Mitwirkung an dieser Ressource." + +msgid "Coverage" +msgstr "Abdeckung" + +msgid "The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant." +msgstr "" +"Das räumliche oder zeitliche Rahmen der Ressource, die räumliche Anwendbarkeit der Ressource, oder der Zuständigkeitsbereich, für die die Ressource relevant ist." + +msgid "Creator" +msgstr "Urheber" + +msgid "An entity primarily responsible for making the resource." +msgstr "Die Person oder Organisation, die hauptverantwortlich für die Erstellung der Ressource ist." + +msgid "Description" +msgstr "Beschreibung" + +msgid "An account of the resource." +msgstr "Ein Bericht über die Ressource." + +msgid "Audience Education Level" +msgstr "Zielgruppen-Bildungsgrad" + +msgid "A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended." +msgstr "" +"Eine Klasse von Personen oder Organisationen, definiert in Hinblick auf deren Bildungs- oder Ausbildungsfortschritt, für den die bezeichnete Ressource gedacht ist." + +msgid "Extent" +msgstr "Umfang" + +msgid "The size or duration of the resource." +msgstr "Die Größe oder die Zeitdauer der Ressource." + +msgid "Format" +msgstr "Format" + +msgid "The file format, physical medium, or dimensions of the resource." +msgstr "Das Dateiformat, das physische Medium oder die räumlichen Ausmaße der Ressource." + +msgid "Instructional Method" +msgstr "Lehrmethode" + +msgid "A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support." +msgstr "" +"Ein Prozess, der dazu verwendet wird, Wissen, Einstellungen und Fertigkeiten hervorzubringen, zu dessen Unterstützung die bezeichnete Ressource entwickelt wurde." + +msgid "Language" +msgstr "Sprache" + +msgid "A language of the resource." +msgstr "Die Sprache der Ressource." + +msgid "License" +msgstr "Lizenz" + +msgid "A legal document giving official permission to do something with the resource." +msgstr "Eine Rechtsurkunde, die die Berechtigung erteilt, die Ressource auf eine bestimmte Weise zu nutzen." + +msgid "Mediator" +msgstr "Vermittler" + +msgid "An entity that mediates access to the resource and for whom the resource is intended or useful." +msgstr "Eine Person oder Organisation, die für den- oder diejenigen den Zugriff auf die Ressource vermittelt, für den die Ressource gedacht und nützlich ist." + +msgid "Medium" +msgstr "Medium" + +msgid "The material or physical carrier of the resource." +msgstr "Das Material oder das physische Trägermedium der Ressource." + +msgid "Provenance" +msgstr "Herkunft" + +msgid "A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation." +msgstr "" +"Eine Aussage über jedwede Änderung der Eigentümerschaft der Ressource seit ihrer Erstellung, die Bedeutung für ihre Authentizität, Richtigkeit und Deutung besitzt." + +msgid "Publisher" +msgstr "Verleger" + +msgid "An entity responsible for making the resource available." +msgstr "Eine Person oder Organisation, die verantwortlich für die Verfügbarkeit der Ressource ist." + +msgid "Rights" +msgstr "Rechte" + +msgid "Information about rights held in and over the resource." +msgstr "Informationen über die Rechte, die im Rahmen oder hinsichtlich der Ressource gehalten werden." + +msgid "Rights Holder" +msgstr "Rechteinhaber" + +msgid "A person or organization owning or managing rights over the resource." +msgstr "Eine Person oder Organisation, die die Rechte über die Ressource besitzt oder verwaltet." + +msgid "Spatial Coverage" +msgstr "Räumlicher Umfang" + +msgid "Spatial characteristics of the resource." +msgstr "Räumliche Charakteristiken der Ressource." + +msgid "Subject" +msgstr "Betreff" + +msgid "The topic of the resource." +msgstr "Das Thema der Ressource." + +msgid "Table Of Contents" +msgstr "Inhaltsverzeichnis" + +msgid "A list of subunits of the resource." +msgstr "Eine Liste der Untereinheiten der Ressource." + +msgid "Temporal Coverage" +msgstr "Zeitlicher Umfang" + +msgid "Temporal characteristics of the resource." +msgstr "Zeitliche Charakteristiken der Ressource." + +msgid "Type" +msgstr "Typ" + +msgid "The nature or genre of the resource." +msgstr "Die Art oder das Genre der Ressource." + +# -------------------------------------------------- +msgid "Relations defined by the Bibliographic Ontology (BIBO): http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html" +msgstr "Beziehungsdefinitionen gemäß Bibliographic Ontology (BIBO): http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html" + +msgid "annotates" +msgstr "kommentiert" + +msgid "Critical or explanatory note for a Document." +msgstr "Kritische oder erklärende Notiz für ein Dokument." + +msgid "cited by" +msgstr "zitiert von" + +msgid "Relates a document to another document that cites the first document." +msgstr "Setzt ein Dokument mit einem anderen Dokument in Beziehung, das ersteres Dokument zitiert." + +msgid "cites" +msgstr "zitiert" + +msgid "Relates a document to another document that is cited by the first document as reference, comment, review, quotation or for another purpose." +msgstr "" +"Setzt ein Dokument mit einem anderen Dokument in Beziehung, das von ersterem Dokument referenziert, kommentiert, rezensiert, zitiert oder auf andere Weise genannt " +"wird." + +msgid "review of" +msgstr "Rezension von" + +msgid "Relates a review document to a reviewed thing (resource, item, etc.)." +msgstr "Bezieht eine Rezension auf ein referenziertes Objekt (Ressource, Gegenstand etc.)." + +msgid "reproduced in" +msgstr "Reproduziert in" + +msgid "The resource in which another resource is reproduced." +msgstr "Die Ressource, in der eine andere Ressource wiedergegeben wird." + +msgid "affirmed by" +msgstr "Bestätigt von" + +msgid "A legal decision that affirms a ruling." +msgstr "Ein Rechtsentscheid, der eine Regelung bestätigt." + +msgid "reversed by" +msgstr "Aufgehoben von" + +msgid "A legal decision that reverses a ruling." +msgstr "Ein Rechtsentscheid, der eine Regelung aufhebt." + +msgid "subsequent legal decision" +msgstr "Späterer Rechtsentscheid" + +msgid "A legal decision on appeal that takes action on a case (affirming it, reversing it, etc.)." +msgstr "Eine Rechtsentscheid-Revision, die weitere Schritte einleitet (bestätigen, aufheben, etc.)." + +msgid "transcript of" +msgstr "Abschrift von" + +msgid "Relates a document to some transcribed original." +msgstr "Bezieht ein Dokument auf ein niedergeschriebenes Original." + +# double - see below +msgid "translation of" +msgstr "Übersetzung von" + +msgid "Relates a translated document to the original document." +msgstr "Bezieht ein übersetztes Dokument auf das Original-Dokument." + +# -------------------------------------------------- +msgid "Relations defined by the Friend of a Friend vocabulary (FOAF): http://xmlns.com/foaf/spec/" +msgstr "Beziehungs-Definitionen gemäß Friend of a Friend Vokabular (FOAF): http://xmlns.com/foaf/spec/" + +msgid "based near" +msgstr "In der Nähe von" + +msgid "A location that something is based near, for some broadly human notion of near." +msgstr "Ein Ort, der im weitesten Sinne in der Nähe von etwas liegt." + +msgid "depiction" +msgstr "Abbildung" + +msgid "A depiction of some thing." +msgstr "Die Abbildung von etwas." + +msgid "depicts" +msgstr "stellt dar" + +msgid "A thing depicted in this representation." +msgstr "Etwas ist in dieser Repräsentation abgebildet." + +msgid "funded by" +msgstr "gegründet von" + +msgid "An organization funding a project or person." +msgstr "Eine Organisation, die ein Projekt oder eine Person finanziert." + +msgid "image" +msgstr "Bild" + +msgid "An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage)." +msgstr "" +"Ein Bild, das dazu verwendet werden kann, etwas zu repräsentieren (d.h. solcherlei Darstellungen, die besonders repräsentativ für etwas sind, beispielsweise das " +"Porträtfoto auf einer Homepage)." + +msgid "is primary topic of" +msgstr "ist Hauptthema von" + +msgid "A document that this thing is the primary topic of." +msgstr "Ein Dokument, dessen Hauptthema etwas ist." + +msgid "knows" +msgstr "weiß" + +msgid "A person known by this person (indicating some level of reciprocated interaction between the parties)." +msgstr "Eine andere Person, die diese Person kennt (was auf eine gegenseitige Interaktion zwischen beiden Parteien hindeutet)." + +msgid "logo" +msgstr "Logo" + +msgid "A logo representing some thing." +msgstr "Ein Logo, das etwas repräsentiert." + +msgid "made" +msgstr "hergestellt" + +msgid "Something that was made by this agent." +msgstr "Etwas, das von diesem Akteur hergestellt worden ist." + +msgid "maker" +msgstr "Hersteller" + +msgid "An agent that made this thing." +msgstr "Ein Akteur, der dieses Objekt hergestellt hat." + +msgid "member" +msgstr "Mitglied" + +msgid "Indicates a member of a Group." +msgstr "Deutet auf ein Mitglied einer Gruppe hin." + +msgid "page" +msgstr "Seite" + +msgid "A page or document about this thing." +msgstr "Eine Seite oder ein Dokument über dieses Objekt." + +msgid "primary topic" +msgstr "Hauptthema" + +msgid "The primary topic of some page or document." +msgstr "Das Hauptthema einer Seite oder eines Dokuments." + +msgid "thumbnail" +msgstr "Miniaturansicht" + +msgid "A derived thumbnail image." +msgstr "Eine abgeleitete Miniaturansicht eines Bildes." + +# -------------------------------------------------- +msgid "Relations defined by the Functional Requirements for Bibliographic Records (FRBR): http://vocab.org/frbr/core.html" +msgstr "Beziehungsdefinitionen gemäß Functional Requirements for Bibliographic Records (FRBR): http://vocab.org/frbr/core.html" + +msgid "abridgement" +msgstr "Kurzfassung" + +msgid "A property representing an abridgment of an expression." +msgstr "Eigenschaft, die eine verkürzte Fassung einer Aussage darstellt." + +msgid "abridgement of" +msgstr "Kurzfassung von" + +msgid "A property representing an expression that is abridged." +msgstr "Eigenschaft, die eine verkürzte Aussage darstellt." + +msgid "adaption" +msgstr "Adaption" + +msgid "A property representing an adaption of a work or expression." +msgstr "Eigenschaft, die eine Ableitung eines Werks oder einer Aussage darstellt." + +msgid "adaption of" +msgstr "Adaption von" + +msgid "A property representing a work or expression that is adapted." +msgstr "Eigenschaft, die eine abgeleitetes Werk oder eine abgeleitete Aussage darstellt." + +msgid "alternate" +msgstr "Alternative" + +msgid "A property representing an alternative to a manifestation." +msgstr "Eigenschaft, die die die Alternative zu einer Erscheinungsform darstellt." + +msgid "alternate of" +msgstr "Alternative von" + +msgid "A property representing a manifestation that is alternated." +msgstr "Eigenschaft, die die eine alternative Erscheinungsform darstellt." + +msgid "arrangement" +msgstr "Anordnung" + +msgid "A property representing an arrangement of an expression." +msgstr "Eigenschaft, die eine Anordnung einer Aussage darstellt. " + +msgid "arrangement of" +msgstr "Anordnung von" + +msgid "A property representing an expression that is arranged." +msgstr "Eigenschaft, die eine angeordnete Aussage darstellt." + +msgid "complement" +msgstr "Gegenteil" + +msgid "A property representing a complement to a work or expression." +msgstr "Eigenschaft, die das Gegenteil einer Arbeit oder einer Aussage darstellt." + +msgid "complement of" +msgstr "Gegenteil von" + +msgid "A property representing a work or expression that is complemented." +msgstr "Eigenschaft, die eine gegenteilige Arbeit oder Aussage darstellt." + +msgid "creator" +msgstr "Erschaffer" + +msgid "A property representing an entity in some way responsible for the creation of a work." +msgstr "Eigenschaft, die die Körperschaft darstellt, die in bestimmter Weise für die Herstellung eines Werks verantwortlich ist." + +msgid "creator of" +msgstr "Erschaffen von" + +msgid "A property representing a work that was in some way created by of an entity." +msgstr "Eigenschaft, die ein Werk darstellt, das in bestimmter Weise von einer Körperschaft hergestellt worden ist." + +msgid "embodiment" +msgstr "Verkörperung" + +msgid "A property representing a manifestation that embodies an expression." +msgstr "Eigenschaft, die eine Erscheinungsform darstellt, die eine Aussage verkörpert." + +msgid "embodiment of" +msgstr "Verkörperung von" + +msgid "A property representing an expression that is embodied by a manifestation." +msgstr "Eigenschaft, die eine Aussage verkörpert, die durch eine Erscheinungsform dargestellt wird." + +msgid "exemplar" +msgstr "Muster" + +msgid "A property representing an item that is an exemplar of a manifestation." +msgstr "Eigenschaft, die einen Gegenstand repräsentiert, die ein Muster einer Erscheinungsform darstellt." + +msgid "exemplar of" +msgstr "Muster von" + +msgid "A property representing the manifestation that is exemplified by a item." +msgstr "Eigenschaft, die eine Erscheinungsform darstellt, die ein Muster eines Gegenstandes repräsentiert." + +msgid "imitation" +msgstr "Nachahmung" + +msgid "A property representing an imitation of a work or expression." +msgstr "Eigenschaft, die eine Nachahmung eines Werks oder eines Ausdrucks darstellt." + +msgid "imitation of" +msgstr "Nachahmung von" + +msgid "A property representing a work or expression that is imitated." +msgstr "Eigenschaft, die ein nachgeahmtes Werk oder eine nachgeahmte Aussage darstellt." + +msgid "owner" +msgstr "Besitzer" + +msgid "A property representing an entity that owns an item." +msgstr "Eigenschaft, die eine Körperschaft darstellt, die einen Gegenstand besitzt." + +msgid "owner of" +msgstr "Besitzer von" + +msgid "A property representing an item that is in some way owned an entity." +msgstr "Eigenschaft, die einen Gegenstand darstellt, die eine Körperschaft besitzt." + +msgid "part" +msgstr "Teil" + +msgid "A property representing a part of an endeavour." +msgstr "Eigenschaft, die einen Teil einer Aufgabe darstellt." + +msgid "part of" +msgstr "Teil von" + +msgid "A property representing an endeavour incorporating an endeavour." +msgstr "Eigenschaft, die eine Aufgabe einschließlich einer Unter-Aufgabe darstellt." + +msgid "producer" +msgstr "Produzent" + +msgid "A property representing an entity in some way responsible for producing a manifestation." +msgstr "Eigenschaft, die die Körperschaft darstellt, die in bestimmter Weise für die Produktion eines Werks verantwortlich ist." + +msgid "producer of" +msgstr "Produzent von" + +msgid "A property representing a manifestation that was in some way produced an entity." +msgstr "Eigenschaft, die ein Werk darstellt, das in bestimmter Weise von einer Körperschaft produziert worden ist." + +msgid "realization" +msgstr "Ausführung" + +msgid "A property representing an expression that is an intellectual or artistic realization of a work." +msgstr "Eigenschaft, die eine Aussage repräsentiert, die eine intellektuelle oder künstlerische Ausführung einer Arbeit bildet." + +msgid "realization of" +msgstr "Ausführung von" + +msgid "A property representing the work that has been realized by an expression." +msgstr "Eigenschaft, die eine Arbeit repräsentiert, die durch eine Aussage ausgeführt wurde." + +msgid "realizer" +msgstr "Ausführender" + +msgid "A property representing an entity in some way responsible for realizing an expression." +msgstr "Eigenschaft, die eine Körperschaft repräsentiert, die in bestimmter Weise für die Ausführung einer Aussage verantwortlich ist." + +msgid "realizer of" +msgstr "Ausführender von" + +msgid "A property representing an expression that was in some way realized by an entity." +msgstr "Eigenschaft, die eine Aussage repräsentiert, die in bestimmter Weise durch eine Körperschaft ausgeführt wurde." + +msgid "reconfiguration" +msgstr "Umgestaltung" + +msgid "A property representing a recongifuration of an item." +msgstr "Eigenschaft, die eine Umgestaltung eines Gegenstandes repräsentiert." + +msgid "reconfiguration of" +msgstr "Umgestaltung von" + +msgid "A property representing an item that is reconfigured." +msgstr "Eigenschaft, die einen Gegenstand repräsentiert, der umgestaltet wird." + +msgid "related endeavour" +msgstr "Verwandte Aufgabe" + +msgid "A property representing another endeavour that is related in some way to an endeavour." +msgstr "Eigenschaft, die eine andere Aufgabe repräsentiert, die in bestimmter Weise mit einer Aufgabe verwandt ist." + +msgid "reproduction" +msgstr "Reproduktion" + +msgid "A property representing a reproduction of a manifestation or item." +msgstr "Eigenschaft, die eine Reproduktion eines Werkes oder eines Gegenstandes repräsentiert." + +msgid "reproduction of" +msgstr "Reproduktion von" + +msgid "A property representing a manifestation or item that is reproduced." +msgstr "Eigenschaft, die ein Werk oder einen Gegenstand repräsentiert, der reproduziert wird." + +msgid "responsible entity" +msgstr "Verantwortliche Körperschaft" + +msgid "A property representing an entity in some way responsible for an endeavour." +msgstr "Eigenschaft, die eine Körperschaft repräsentiert, die auf bestimmte Weise verantwortlich für eine Aufgabe ist." + +msgid "responsible entity of" +msgstr "Verantwortliche Körperschaft von" + +msgid "A property representing an endeavour that is the responsibility of an entity." +msgstr "Eigenschaft, die eine Aufgabe repräsentiert, für die eine Körperschaft verantwortlich ist." + +msgid "revision" +msgstr "Überarbeitung" + +msgid "A property representing a revision of an expression." +msgstr "Eigenschaft, die eine Überarbeitung eines Ausdrucks repräsentiert." + +msgid "revision of" +msgstr "Überarbeitung von" + +msgid "A property representing an expression that is revised." +msgstr "Eigenschaft, die einen Ausdruck repräsentiert, der überarbeitet wird." + +msgid "successor" +msgstr "Nachfolger" + +msgid "A property representing a successor to a work or expression." +msgstr "Eigenschaft, die einen Nachfolger bezüglich einer Arbeit oder eines Ausdrucks repräsentiert." + +msgid "successor of" +msgstr "Nachfolger von" + +msgid "A property representing a work or expression that is succeeded." +msgstr "Eigenschaft, die eine Arbeit oder einen Ausdruck repräsentiert, auf den nachgefolgt wird." + +msgid "summarization" +msgstr "Zusammenfassung" + +msgid "A property representing a summarization of a work or expression." +msgstr "Eigenschaft, die eine Zusammenfassung einer Arbeit oder eines Ausdrucks repräsentiert." + +msgid "summarization of" +msgstr "Zusammenfassung von" + +msgid "A property representing a work or expression that is summarized." +msgstr "Eigenschaft, die eine Arbeit oder einen Ausdruck repräsentiert, der zusammengefasst wird." + +msgid "supplement" +msgstr "Ergänzung" + +msgid "A property representing a supplement to a work or expression." +msgstr "Eigenschaft, die eine Ergänzung eines Werks oder eines Ausdrucks repräsentiert." + +msgid "supplement of" +msgstr "Ergänzung von" + +msgid "A property representing a work or expression that is supplemented." +msgstr "Eigenschaft, die ein Werk oder einen Ausdruck repräsentiert, der ergänzt wird." + +msgid "transformation" +msgstr "Umgestaltung" + +msgid "A property representing a transformation of a work or expression." +msgstr "Eigenschaft, die eine Umgestaltung eines Werks oder eines Ausdrucks repräsentiert." + +msgid "transformation of" +msgstr "Umgestaltung von" + +msgid "A property representing a work or expression that is transformed." +msgstr "Eigenschaft, die eine Arbeit oder einen Ausdruck repräsentiert, der umgestaltet wird." + +msgid "translation" +msgstr "Übersetzung" + +msgid "A property representing a translation of an expression." +msgstr "Eigenschaft, die eine Übersetzung eines Ausdrucks repräsentiert." + +# double - see above +# msgid "translation of" +# msgstr "" +msgid "A property representing an expression that is translated." +msgstr "Eigenschaft, die einen Ausdruck repräsentiert, der übersetzt wird." diff --git a/languages/template.pot b/languages/template.pot index 8754c1b..167cad7 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -17,6 +17,14 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: ItemRelationsPlugin.php:116 +msgid "Custom" +msgstr "" + +#: ItemRelationsPlugin.php:117 +msgid "Custom vocabulary containing relations defined for this Omeka instance." +msgstr "" + #: ItemRelationsPlugin.php:357 ItemRelationsPlugin.php:407 #: views/admin/common/item-relations-show.php:2 #: views/public/common/item-relations-show.php:2 @@ -61,6 +69,14 @@ msgid "" "one is unavailable the other will be used." msgstr "" +#: config_form.php:26 +msgid "prefix:localPart" +msgstr "" + +#: config_form.php:26 +msgid "label" +msgstr "" + #: controllers/VocabulariesController.php:50 msgid "The vocabulary was successfully edited." msgstr "" @@ -150,3 +166,707 @@ msgid "" "same relation, the search will return all items that are parts of other " "items." msgstr "" + +# -------------------------------------------------- + +msgid "Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/" +msgstr "" + +msgid "Relation" +msgstr "" + +msgid "A related resource." +msgstr "" + +msgid "Conforms To" +msgstr "" + +msgid "An established standard to which the described resource conforms." +msgstr "" + +msgid "Has Format" +msgstr "" + +msgid "A related resource that is substantially the same as the pre-existing described resource, but in another format." +msgstr "" + +msgid "Has Part" +msgstr "" + +msgid "A related resource that is included either physically or logically in the described resource." +msgstr "" + +msgid "Has Version" +msgstr "" + +msgid "A related resource that is a version, edition, or adaptation of the described resource." +msgstr "" + +msgid "Is Format Of" +msgstr "" + +msgid "A related resource that is substantially the same as the described resource, but in another format." +msgstr "" + +msgid "Is Part Of" +msgstr "" + +msgid "A related resource in which the described resource is physically or logically included." +msgstr "" + +msgid "Is Referenced By" +msgstr "" + +msgid "A related resource that references, cites, or otherwise points to the described resource." +msgstr "" + +msgid "Is Replaced By" +msgstr "" + +msgid "A related resource that supplants, displaces, or supersedes the described resource." +msgstr "" + +msgid "Is Required By" +msgstr "" + +msgid "A related resource that requires the described resource to support its function, delivery, or coherence." +msgstr "" + +msgid "Is Version Of" +msgstr "" + +msgid "A related resource of which the described resource is a version, edition, or adaptation." +msgstr "" + +msgid "References" +msgstr "" + +msgid "A related resource that is referenced, cited, or otherwise pointed to by the described resource." +msgstr "" + +msgid "Replaces" +msgstr "" + +msgid "A related resource that is supplanted, displaced, or superseded by the described resource." +msgstr "" + +msgid "Requires" +msgstr "" + +msgid "A related resource that is required by the described resource to support its function, delivery, or coherence." +msgstr "" + +msgid "Source" +msgstr "" + +msgid "A related resource from which the described resource is derived." +msgstr "" + +msgid "Abstract" +msgstr "" + +msgid "A summary of the resource." +msgstr "" + +msgid "Access Rights" +msgstr "" + +msgid "Information about who can access the resource or an indication of its security status." +msgstr "" + +msgid "Accrual Method" +msgstr "" + +msgid "The method by which items are added to a collection." +msgstr "" + +msgid "Accrual Periodicity" +msgstr "" + +msgid "The frequency with which items are added to a collection." +msgstr "" + +msgid "Accrual Policy" +msgstr "" + +msgid "The policy governing the addition of items to a collection." +msgstr "" + +msgid "Audience" +msgstr "" + +msgid "A class of entity for whom the resource is intended or useful." +msgstr "" + +msgid "Contributor" +msgstr "" + +msgid "An entity responsible for making contributions to the resource." +msgstr "" + +msgid "Coverage" +msgstr "" + +msgid "The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant." +msgstr "" + +msgid "Creator" +msgstr "" + +msgid "An entity primarily responsible for making the resource." +msgstr "" + +msgid "Description" +msgstr "" + +msgid "An account of the resource." +msgstr "" + +msgid "Audience Education Level" +msgstr "" + +msgid "A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended." +msgstr "" + +msgid "Extent" +msgstr "" + +msgid "The size or duration of the resource." +msgstr "" + +msgid "Format" +msgstr "" + +msgid "The file format, physical medium, or dimensions of the resource." +msgstr "" + +msgid "Instructional Method" +msgstr "" + +msgid "A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support." +msgstr "" + +msgid "Language" +msgstr "" + +msgid "A language of the resource." +msgstr "" + +msgid "License" +msgstr "" + +msgid "A legal document giving official permission to do something with the resource." +msgstr "" + +msgid "Mediator" +msgstr "" + +msgid "An entity that mediates access to the resource and for whom the resource is intended or useful." +msgstr "" + +msgid "Medium" +msgstr "" + +msgid "The material or physical carrier of the resource." +msgstr "" + +msgid "Provenance" +msgstr "" + +msgid "A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation." +msgstr "" + +msgid "Publisher" +msgstr "" + +msgid "An entity responsible for making the resource available." +msgstr "" + +msgid "Rights" +msgstr "" + +msgid "Information about rights held in and over the resource." +msgstr "" + +msgid "Rights Holder" +msgstr "" + +msgid "A person or organization owning or managing rights over the resource." +msgstr "" + +msgid "Spatial Coverage" +msgstr "" + +msgid "Spatial characteristics of the resource." +msgstr "" + +msgid "Subject" +msgstr "" + +msgid "The topic of the resource." +msgstr "" + +msgid "Table Of Contents" +msgstr "" + +msgid "A list of subunits of the resource." +msgstr "" + +msgid "Temporal Coverage" +msgstr "" + +msgid "Temporal characteristics of the resource." +msgstr "" + +msgid "Type" +msgstr "" + +msgid "The nature or genre of the resource." +msgstr "" + +# -------------------------------------------------- + +msgid "Relations defined by the Bibliographic Ontology (BIBO): http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html" +msgstr "" + +msgid "annotates" +msgstr "" + +msgid "Critical or explanatory note for a Document." +msgstr "" + +msgid "cited by" +msgstr "" + +msgid "Relates a document to another document that cites the first document." +msgstr "" + +msgid "cites" +msgstr "" + +msgid "Relates a document to another document that is cited by the first document as reference, comment, review, quotation or for another purpose." +msgstr "" + +msgid "review of" +msgstr "" + +msgid "Relates a review document to a reviewed thing (resource, item, etc.)." +msgstr "" + +msgid "reproduced in" +msgstr "" + +msgid "The resource in which another resource is reproduced." +msgstr "" + +msgid "affirmed by" +msgstr "" + +msgid "A legal decision that affirms a ruling." +msgstr "" + +msgid "reversed by" +msgstr "" + +msgid "A legal decision that reverses a ruling." +msgstr "" + +msgid "subsequent legal decision" +msgstr "" + +msgid "A legal decision on appeal that takes action on a case (affirming it, reversing it, etc.)." +msgstr "" + +msgid "transcript of" +msgstr "" + +msgid "Relates a document to some transcribed original." +msgstr "" + +# double - see below +msgid "translation of" +msgstr "" + +msgid "Relates a translated document to the original document." +msgstr "" + + +# -------------------------------------------------- + +msgid "Relations defined by the Friend of a Friend vocabulary (FOAF): http://xmlns.com/foaf/spec/" +msgstr "" + +msgid "based near" +msgstr "" + +msgid "A location that something is based near, for some broadly human notion of near." +msgstr "" + +msgid "depiction" +msgstr "" + +msgid "A depiction of some thing." +msgstr "" + +msgid "depicts" +msgstr "" + +msgid "A thing depicted in this representation." +msgstr "" + +msgid "funded by" +msgstr "" + +msgid "An organization funding a project or person." +msgstr "" + +msgid "image" +msgstr "" + +msgid "An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage)." +msgstr "" + +msgid "is primary topic of" +msgstr "" + +msgid "A document that this thing is the primary topic of." +msgstr "" + +msgid "knows" +msgstr "" + +msgid "A person known by this person (indicating some level of reciprocated interaction between the parties)." +msgstr "" + +msgid "logo" +msgstr "" + +msgid "A logo representing some thing." +msgstr "" + +msgid "made" +msgstr "" + +msgid "Something that was made by this agent." +msgstr "" + +msgid "maker" +msgstr "" + +msgid "An agent that made this thing." +msgstr "" + +msgid "member" +msgstr "" + +msgid "Indicates a member of a Group." +msgstr "" + +msgid "page" +msgstr "" + +msgid "A page or document about this thing." +msgstr "" + +msgid "primary topic" +msgstr "" + +msgid "The primary topic of some page or document." +msgstr "" + +msgid "thumbnail" +msgstr "" + +msgid "A derived thumbnail image." +msgstr "" + + +# -------------------------------------------------- + +msgid "Relations defined by the Functional Requirements for Bibliographic Records (FRBR): http://vocab.org/frbr/core.html" +msgstr "" + +msgid "abridgement" +msgstr "" + +msgid "A property representing an abridgment of an expression." +msgstr "" + +msgid "abridgement of" +msgstr "" + +msgid "A property representing an expression that is abridged." +msgstr "" + +msgid "adaption" +msgstr "" + +msgid "A property representing an adaption of a work or expression." +msgstr "" + +msgid "adaption of" +msgstr "" + +msgid "A property representing a work or expression that is adapted." +msgstr "" + +msgid "alternate" +msgstr "" + +msgid "A property representing an alternative to a manifestation." +msgstr "" + +msgid "alternate of" +msgstr "" + +msgid "A property representing a manifestation that is alternated." +msgstr "" + +msgid "arrangement" +msgstr "" + +msgid "A property representing an arrangement of an expression." +msgstr "" + +msgid "arrangement of" +msgstr "" + +msgid "A property representing an expression that is arranged." +msgstr "" + +msgid "complement" +msgstr "" + +msgid "A property representing a complement to a work or expression." +msgstr "" + +msgid "complement of" +msgstr "" + +msgid "A property representing a work or expression that is complemented." +msgstr "" + +msgid "creator" +msgstr "" + +msgid "A property representing an entity in some way responsible for the creation of a work." +msgstr "" + +msgid "creator of" +msgstr "" + +msgid "A property representing a work that was in some way created by of an entity." +msgstr "" + +msgid "embodiment" +msgstr "" + +msgid "A property representing a manifestation that embodies an expression." +msgstr "" + +msgid "embodiment of" +msgstr "" + +msgid "A property representing an expression that is embodied by a manifestation." +msgstr "" + +msgid "exemplar" +msgstr "" + +msgid "A property representing an item that is an exemplar of a manifestation." +msgstr "" + +msgid "exemplar of" +msgstr "" + +msgid "A property representing the manifestation that is exemplified by a item." +msgstr "" + +msgid "imitation" +msgstr "" + +msgid "A property representing an imitation of a work or expression." +msgstr "" + +msgid "imitation of" +msgstr "" + +msgid "A property representing a work or expression that is imitated." +msgstr "" + +msgid "owner" +msgstr "" + +msgid "A property representing an entity that owns an item." +msgstr "" + +msgid "owner of" +msgstr "" + +msgid "A property representing an item that is in some way owned an entity." +msgstr "" + +msgid "part" +msgstr "" + +msgid "A property representing a part of an endeavour." +msgstr "" + +msgid "part of" +msgstr "" + +msgid "A property representing an endeavour incorporating an endeavour." +msgstr "" + +msgid "producer" +msgstr "" + +msgid "A property representing an entity in some way responsible for producing a manifestation." +msgstr "" + +msgid "producer of" +msgstr "" + +msgid "A property representing a manifestation that was in some way produced an entity." +msgstr "" + +msgid "realization" +msgstr "" + +msgid "A property representing an expression that is an intellectual or artistic realization of a work." +msgstr "" + +msgid "realization of" +msgstr "" + +msgid "A property representing the work that has been realized by an expression." +msgstr "" + +msgid "realizer" +msgstr "" + +msgid "A property representing an entity in some way responsible for realizing an expression." +msgstr "" + +msgid "realizer of" +msgstr "" + +msgid "A property representing an expression that was in some way realized by an entity." +msgstr "" + +msgid "reconfiguration" +msgstr "" + +msgid "A property representing a recongifuration of an item." +msgstr "" + +msgid "reconfiguration of" +msgstr "" + +msgid "A property representing an item that is reconfigured." +msgstr "" + +msgid "related endeavour" +msgstr "" + +msgid "A property representing another endeavour that is related in some way to an endeavour." +msgstr "" + +msgid "reproduction" +msgstr "" + +msgid "A property representing a reproduction of a manifestation or item." +msgstr "" + +msgid "reproduction of" +msgstr "" + +msgid "A property representing a manifestation or item that is reproduced." +msgstr "" + +msgid "responsible entity" +msgstr "" + +msgid "A property representing an entity in some way responsible for an endeavour." +msgstr "" + +msgid "responsible entity of" +msgstr "" + +msgid "A property representing an endeavour that is the responsibility of an entity." +msgstr "" + +msgid "revision" +msgstr "" + +msgid "A property representing a revision of an expression." +msgstr "" + +msgid "revision of" +msgstr "" + +msgid "A property representing an expression that is revised." +msgstr "" + +msgid "successor" +msgstr "" + +msgid "A property representing a successor to a work or expression." +msgstr "" + +msgid "successor of" +msgstr "" + +msgid "A property representing a work or expression that is succeeded." +msgstr "" + +msgid "summarization" +msgstr "" + +msgid "A property representing a summarization of a work or expression." +msgstr "" + +msgid "summarization of" +msgstr "" + +msgid "A property representing a work or expression that is summarized." +msgstr "" + +msgid "supplement" +msgstr "" + +msgid "A property representing a supplement to a work or expression." +msgstr "" + +msgid "supplement of" +msgstr "" + +msgid "A property representing a work or expression that is supplemented." +msgstr "" + +msgid "transformation" +msgstr "" + +msgid "A property representing a transformation of a work or expression." +msgstr "" + +msgid "transformation of" +msgstr "" + +msgid "A property representing a work or expression that is transformed." +msgstr "" + +msgid "translation" +msgstr "" + +msgid "A property representing a translation of an expression." +msgstr "" + +# double - see above +# msgid "translation of" +# msgstr "" + +msgid "A property representing an expression that is translated." +msgstr "" + +# -------------------------------------------------- From 9959c4810d2e708674f894793378741506190ad1 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Wed, 20 May 2015 17:05:25 +0200 Subject: [PATCH 02/66] Text correction: "Subject" == "Subjekt-Ressource", not "Betreff" --- languages/de_DE.mo | Bin 29979 -> 29990 bytes languages/de_DE.po | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/languages/de_DE.mo b/languages/de_DE.mo index 96efe73e43139a0accac0d55660c728d0768a0cf..d788b9384c525055c17e07ed4227cab8bec7a19b 100644 GIT binary patch delta 2200 zcmY+^3rv-D7{~GFD8k_;9LNh<4JR&PC@7MIWP+pz(NY8}#2_xB9EiB)rFNWHNm-i` z(?xULY^PdQurr5Sjn0dYh^Si%vpVZz3uP+xX^-jFN4xM%wEJ}ScL0Wnr*~BybH&WJ6XXhvjFbJ#drx>Vsrgw zcVhtA+djnm(934Z*W-FTi5t+jn!T`Yb9So$Rh~!x z>+le2qia};RrIqHhfo#d-Qzre2OlC%;(gwa2T-r-Pi)3YHswtF9Fs6*6J6(gTgE^i z$4{7n(Ucd5OK~a|V?35)A_g!4gE#{Z;xv2>lkpTTzzfKq#nX3v3r(o_EFQ*Gl0}?v zA21jq5mRY)JAQ#Fm{4UFg-cMsh62<)lrL>sa&3VpZ?)%tZ9 zgM)Z8=i6xps%#9yF`Rzaddy-`aVsxM9od1g*p2GQA>7Zr5RMRM^S)AX<`$>o0@N#b z0d>*XdZ(jFs0+-)peo8{pbd+0I#!?#Y(rJlg=+az7=h2DE*3&<^d_oP@4NYrQS(1T zy}}Eq{V$;xJzE{4w$guXkVrxwT{4Dn7v^HhHnS3}#60XrUFdgIODC`jqZ|02fQ_j5 z58RF=lpld-Q0va4E#>~uVNNP6X&`5F^)J`%D~H@7Gtmpr{Yf3f^O8rUN=69YUSIg zi=4oC{KS3!4XWiAQS*L7%^Sxk3~zPz_aV=Nmdrp8(ohq#(T6Kg@2bpwUV*w;J%(YY zo8RT;AHxLly*LF!r~;0m=D+90CsF5}L9c%QU;R5U`ySPSpHUlJMlHPRKDRcr>xd&! z8{CAdFco$2EYyMdsE)05^P5ox1yK7xg6h~4%Io*v$3P3-a3>796HeoeZVuR*xTX6 z(+0N1`!gdJWhO6NlAGCceEF-Ba-w=Z%Fh^hCjaZ?*!d-OZEejRtu=KcyPxaXUcKl4 anSm)abkj_m#Mch<)CI_GJ-Jc$X|Qe>8fJ1_+g!{WyT7xcn|+*oVt-0?EmW?>1}3Cov2EMwVD|2}xip zvbP<_wHVH3iZ@|79>wJtS7t`;)=(BOyN||O1a!b9)PepbW)I;m=P#&vi|+9f+l?*s ze?zTXxztO1uk&ZjA)a=x8B?qg*Wd@(j&U6F814wr=%#TQw_rD?Xu%X_Vi{>Gz7=)j z3#ihkRhV&kdlq%$uTdK(a6PT>!5aM5^>gp{=0Alk#807~Dv2=R7TQq#FL4hpAXv)z zc8tbx0?`kf-HG4ejX1N44+wKmzlLJeL2K|4?8FE>>m0{0`WG=2gDFEMM&b-CK$X4% zBXJm$Ip02~p_@%$2>PgZbr4lR_1k$URb(?p;nS#!yo5WM*NO&VlftvpX z>Ir{B?f)nG&>B6%8mYfFh$WzpE)fsn7R<%DO_U4QVjjMaN@yHa(n+ks@bzX-U^A+J z4mV>t*AK-{QR~j268`~J$ITD@f@e@0O}Y5AR&P83mB<2| zkA76b4OogtP>Bcg!IWSj-h@4_KMyNR%LFy9JR0#gR$Ag zH@NuY7)!hdr(qxJ0 Date: Thu, 28 May 2015 15:46:56 +0200 Subject: [PATCH 03/66] Visually select relation object in sortable / filterable item list inside a Lity lightbox --- item_relations_form.php | 62 +++++-- item_relations_script.js | 197 ++++++++++++++++++++ item_relations_styles.css | 12 ++ languages/de_DE.mo | Bin 29990 -> 30391 bytes languages/de_DE.po | 38 +++- languages/template.pot | 34 +++- lity/lity.css | 160 ++++++++++++++++ lity/lity.js | 373 ++++++++++++++++++++++++++++++++++++++ lity/lity.min.css | 3 + lity/lity.min.js | 4 + 10 files changed, 866 insertions(+), 17 deletions(-) create mode 100644 item_relations_script.js create mode 100644 item_relations_styles.css create mode 100644 lity/lity.css create mode 100644 lity/lity.js create mode 100644 lity/lity.min.css create mode 100644 lity/lity.min.js diff --git a/item_relations_form.php b/item_relations_form.php index 5ee0fda..a209df2 100644 --- a/item_relations_form.php +++ b/item_relations_form.php @@ -38,20 +38,56 @@ formSelect('item_relations_property_id[]', null, array('multiple' => false), $formSelectProperties); ?> - formText('item_relations_item_relation_object_item_id[]', null, array('size' => 8)); ?> - n/a + + +
+ []
+ formText('item_relations_item_relation_object_item_id[]', null, array('size' => 8)); ?> +
+ + - + + + + +Item} items + LEFT JOIN {$db->Element_Texts} elementtexts on (items.id=elementtexts.id) + LEFT JOIN {$db->Item_Types} itemtypes on (items.item_type_id=itemtypes.id) + WHERE true + ORDER BY itemtypes.name ASC, text ASC"; + + $items = $db->fetchAll($sql); + + # echo "
"; print_r($items); echo "
\n"; # DEBUG + echo "\n"; +?> +
\ No newline at end of file diff --git a/item_relations_script.js b/item_relations_script.js new file mode 100644 index 0000000..e1bcdfb --- /dev/null +++ b/item_relations_script.js @@ -0,0 +1,197 @@ +jQuery(document).ready(function () { + + var $ = jQuery; // use noConflict version of jQuery as the short $ within this block + var lightbox = lity(); // Lity lightbox for item selector "popup" + + var my_input = null; // Reference to currently active input + var allItemsSortedArr = null; // Room for a pre-sorted array + var itemTypes = null; // Room for the pre-calculated item types + var filterItemTyp = null; // Room for filter by type + var curListOrder = null; // Room for sort order + var curFilter = null; // Room for filter word + + // --- START: moved from \n"; + // --- 1. Fetch all item typs together with ther IDs and names + $sql = "SELECT id, name from {$db->Item_Types} ORDER BY id"; + $itemtypes = $db->fetchAll($sql); + $lines=array(); + $lines[]="0:'".__("[n/a]")."'"; + foreach($itemtypes as $itemtyp) { + $lines[]=$itemtyp["id"].":'".htmlspecialchars($itemtyp["name"], ENT_QUOTES)."'"; + } + // JavaScript object + echo "var itemTypes={\n". + implode(",\n",$lines)."\n". + "};\n"; + // --- 2. Fetch all items together with their IDs, titles, and item type IDs and names + $sql = "SELECT items.id, text, item_type_id, UNIX_TIMESTAMP(modified) FROM {$db->Item} items LEFT JOIN {$db->Element_Texts} elementtexts on (items.id=elementtexts.id) - LEFT JOIN {$db->Item_Types} itemtypes on (items.item_type_id=itemtypes.id) WHERE true - ORDER BY itemtypes.name ASC, text ASC"; - + ORDER BY items.item_type_id ASC, text ASC"; $items = $db->fetchAll($sql); - - # echo "
"; print_r($items); echo "
\n"; # DEBUG - echo "\n"; diff --git a/item_relations_script.js b/item_relations_script.js index e1bcdfb..1f37a80 100644 --- a/item_relations_script.js +++ b/item_relations_script.js @@ -5,7 +5,6 @@ jQuery(document).ready(function () { var my_input = null; // Reference to currently active input var allItemsSortedArr = null; // Room for a pre-sorted array - var itemTypes = null; // Room for the pre-calculated item types var filterItemTyp = null; // Room for filter by type var curListOrder = null; // Room for sort order var curFilter = null; // Room for filter word @@ -65,13 +64,12 @@ jQuery(document).ready(function () { $("#searchTerm").on("input",searchTermChange); $("#resetBtn").click("input",resetBtnClick); + $("#itemTypeIds").empty().append(itemTypeOptions()); $('input:radio[name=itemsListSort]').change(function() { curListOrder=this.value; updateList(); }); selectObjectSortTimestamp(); // fill item selector - // finally fill item type selector, based on item selector pre-processing - $("#itemTypeIds").empty().append(itemTypeOptions()); lightbox.open("#selectObjectId"); // and off we go @@ -99,7 +97,7 @@ jQuery(document).ready(function () { allItemsSortedArr=allItemsArr.slice(); // correct operation to copy an array allItemsSortedArr.sort(function(a,b) { // sort it via compare function var catdiff=a[2]-b[2]; // different category? then sort asc for that - return ( catdiff==0 ? (b[4]-a[4]) : catdiff ); // otherwise sort desc for timestamp + return ( catdiff==0 ? (b[3]-a[3]) : catdiff ); // otherwise sort desc for timestamp }); } $("#allItemIds").empty().append(allItemsOptions(allItemsSortedArr)); @@ -113,10 +111,7 @@ jQuery(document).ready(function () { var opencat=false; var lastcat=-1; - var fillItemTypes=(itemTypes==null); // no itemTypes array yet? - if (fillItemTypes) { itemTypes=new Array(); } - - var result=""; + var result=""; $.each(ItemsArr, function (itemIndex, item) { // all items var showThisItem=true; @@ -135,8 +130,7 @@ jQuery(document).ready(function () { opencat=false; } if (!opencat) { // no currently open group? - var groupname=( item[3]!='0' ? String(item[3]) : nATxt); - if (fillItemTypes) { itemTypes[item[2]]=groupname; } // also store group name + var groupname=itemTypes[item[2]]; result+=""; opencat=true; } @@ -152,11 +146,7 @@ jQuery(document).ready(function () { // generate tages corresponding the existing item types function itemTypeOptions() { var result=""; - $.each(itemTypes, function (itemIndex, item) { // all items - if (typeof item != 'undefined') { - result+=""; - } - }); + $.each(itemTypes, function (itemIndex, item) { result+=""; }); return result; } diff --git a/languages/de_DE.mo b/languages/de_DE.mo index b1b0a9a2b3a95c59843ebdc6a419d6bd0fdc62d7..754fc0dbdd7c53bd01abb23351109e6b436428a3 100644 GIT binary patch delta 5711 zcmYk=30#&%0>|+|0YOj!Q9x1gL_kqN$h^P<6%W+ZQd|Y^)HJ;F>M1wr&^8Uv@-EAB zt+349E;qs4vX)Y_P*d~Bt8^<S8`Sj;IGtV_M@AEwGYkRKxExGFFos95b zZYZIC#>C>hAY;Z+KOUxDV;-w%Oh=rJi}78og;`P7d`zW17i;4#%*9VJ9-BlP(-dW%;UU)_P}iQI3u+|_F#}6569X8%F3=5i z{Il2_KSiA*rSKpXE*cp4_5*&=j@j*;$V9X#~jGDn2)QO{5 z$9(LIYQKR!@dr%DRF?C8oPhoDRqTK_usgPH%qn-KGLMRuY9H!?zhMu|X<|$^uEb0{ zjSpc1K3ENK4yyeX4#Olq=zM$@C*vg?g+mhTNBBPG(oRmKPx~dZ{tr|6o{j<7JIR>p zxB)ldZscP&gPPf!r~rd#uf{6439I58sN+6#?XR3?oY#@t!I+IqRQ6 zWxDIwjd`@MVkhjAY|P8}0&)(M#GR!R4Mq)QI!5Ds)Bsjs4sOE`yyXmNY4;DuO7z!4 zov(pMC6G#A?2Zqj4qS&kX=WQ%!+ogz$}qvtm}9P8A;p-=^arB`6p1>%4*IiS0&b$6 zoN8xYhPqd-p+0J_DR)$)Dj15(P$%4o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Version: Item Relations\n" "Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" -"PO-Revision-Date: 2015-05-28 15:28+0100\n" +"PO-Revision-Date: 2015-05-29 11:38+0100\n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -103,27 +103,23 @@ msgstr "[n.v.]" msgid "Add a Relation" msgstr "Beziehung hinzufügen" -#: item_relations_form.php:80 -msgid "All Items" -msgstr "Alle Objekte" - -#: models/ItemRelationsProperty.php:84 +#: models/ItemRelationsProperty.php:96 msgid "Sort within item types by" msgstr "Innerhalb Objekttyp sortieren nach" -#: models/ItemRelationsProperty.php:85 +#: models/ItemRelationsProperty.php:97 msgid "Last Update (desc)" msgstr "Letzte Änderung (abst.)" -#: models/ItemRelationsProperty.php:86 +#: models/ItemRelationsProperty.php:98 msgid "Name (asc)" msgstr "Name (aufst.)" -#: models/ItemRelationsProperty.php:89 +#: models/ItemRelationsProperty.php:99 msgid "Search Term" msgstr "Suchbegriff" -#: models/ItemRelationsProperty.php:90 +#: models/ItemRelationsProperty.php:100 msgid "Reset" msgstr "Zurücksetzen" diff --git a/languages/template.pot b/languages/template.pot index de1db37..1e532b4 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -113,27 +113,23 @@ msgstr "" msgid "Add a Relation" msgstr "" -#: item_relations_form.php:80 -msgid "All Items" -msgstr "" - -#: models/ItemRelationsProperty.php:84 +#: models/ItemRelationsProperty.php:96 msgid "Sort within item types by" msgstr "" -#: models/ItemRelationsProperty.php:85 +#: models/ItemRelationsProperty.php:97 msgid "Last Update (desc)" msgstr "" -#: models/ItemRelationsProperty.php:86 +#: models/ItemRelationsProperty.php:98 msgid "Name (asc)" msgstr "" -#: models/ItemRelationsProperty.php:89 +#: models/ItemRelationsProperty.php:99 msgid "Search Term" msgstr "" -#: models/ItemRelationsProperty.php:90 +#: models/ItemRelationsProperty.php:100 msgid "Reset" msgstr "" From eb5d4e8891536425c9b870e414bce7dc922ec520 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Fri, 29 May 2015 14:04:09 +0200 Subject: [PATCH 05/66] Added missing "All" i18n string --- item_relations_form.php | 2 +- languages/de_DE.mo | Bin 30352 -> 30377 bytes languages/de_DE.po | 6 +++++- languages/template.pot | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/item_relations_form.php b/item_relations_form.php index 497178a..4f2b701 100644 --- a/item_relations_form.php +++ b/item_relations_form.php @@ -91,7 +91,7 @@ "];\n"; // -------- echo "var itemTypesTxt='".__("Item Types")."';\n"; - echo "var allTxt='".__("Alle")."';\n"; + echo "var allTxt='".__("All")."';\n"; echo "var itemTypeTxt='".__("Item Type")."';\n"; echo "var sortWithinItemTypeByTxt='".__("Sort within item types by")."';\n"; echo "var updDateDescTxt='".__("Last Update (desc)")."';\n"; diff --git a/languages/de_DE.mo b/languages/de_DE.mo index 754fc0dbdd7c53bd01abb23351109e6b436428a3..373a143b24bf56ea8bbbaae56fd12f8467554a1d 100644 GIT binary patch delta 5733 zcmX}w30zfG0>|-#f`AIKi9jNlptzu@V2%r`8@Lder6!8|60T&6rq9ew1xFpq63Z+# zm$FQvX*Hd+oE%$b#!Ma5Y_J&;%_Vagv)})nun4+1J1<)dS^4HIVH%7Zn`7p%e%+=IdRjq?-+Q9qBG$xYYp$AhE+L|_=k zqV}htuGh`&&p{^QF$3L>A*hZ_LZ)_7W+`&gr!)EEQWc6M_=t* zP&2GU?~+r|3Ub&Eq37*CzyoCPrZ<_I`pbir-6qB79$Qxq{Fcaq?=a`SM6J9}9-6Zv} zpPYrre`XPX+Tm_wQA{l+Vmu#v<=7Wv@ECepQ}~5~W)jP%gJ#kO@5C<1XN}26U!09i z@KJ1vD^M%58Fk+4sOwaro|V0*iGA(bk2-5m$6x5h`s-o4;Ti(?eANZQP#0*9dT5eS z7wU%UFw3>~L*0sdQ4d*>YoCnjpv1M$ckNH3j$ehk-u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now uses "Subject " (with a blank) --- formal_vocabularies.php | 2 +- item_relations_form.php | 2 +- languages/de_DE.mo | Bin 30377 -> 30378 bytes languages/de_DE.po | 4 ++-- languages/template.pot | 2 +- .../common/item-relations-advanced-search.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/formal_vocabularies.php b/formal_vocabularies.php index f171fca..9f918d7 100644 --- a/formal_vocabularies.php +++ b/formal_vocabularies.php @@ -204,7 +204,7 @@ ), array( 'local_part' => 'subject', - 'label' => __('Subject'), + 'label' => __('Subject '), 'description' => __('The topic of the resource.') ), array( diff --git a/item_relations_form.php b/item_relations_form.php index 4f2b701..ec381ef 100644 --- a/item_relations_form.php +++ b/item_relations_form.php @@ -12,7 +12,7 @@ - + diff --git a/languages/de_DE.mo b/languages/de_DE.mo index 373a143b24bf56ea8bbbaae56fd12f8467554a1d..83dd6403cbb95b974299c5424daa1c848c1247a6 100644 GIT binary patch delta 3015 zcmXZddra0<9LMp4az_vzP`Q*mpgJbN`<6d;IX4-$&Q{4mJlk z!N!<}@{N%x7=>BZLQJP#jfL2PqwotHj<+xe(;qixFxDV{%sT!Wf+sN-uVM-&jW*_8 z9Eb6EVYG2f8ijudgyFz3#)M!7CSVRGV-@;i6ZXTGZ~$(`0NjHbw;wgn5sbjEQ3pF~ z!V3#0LZZSS$(L}li#)fBkn12B+yn5}zI3&x`Q zCt00T3flP)jKplz4ogu3s!I?Ap}UY5m5EH$2J%oFD8M+ZK()_DP1t~1pape+ji@VYN5%KxgUs6c3Df~P zF^cug1qxc=8mi$oKIg~cMaI-pUs`NT2X8x*4cI*0-T67xU6qh$ zrFt)ak$rO?b@DRuIUjeRCJKC-w}N%J0=rNLDC7RreiC2AWCqX04^UTi4;yfyGs_q@ zW6on74&@m8a2yW8zi=4Fkfy#^iV-*sBXJ%^V>5d24IF^&sISV0{&*U_*o9fxgUXmQ zkQbpxv5LPG=*De0a*lgNzcRA{^}TOJWo9?F((efV zO1H5f9d_6TAEpyOg*s6Wj>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ages/de_DE.po +++ b/languages/de_DE.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Item Relations\n" "Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" -"PO-Revision-Date: 2015-05-29 14:00+0100\n" +"PO-Revision-Date: 2015-05-29 17:53+0100\n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -425,7 +425,7 @@ msgstr "Räumlicher Umfang" msgid "Spatial characteristics of the resource." msgstr "Räumliche Charakteristiken der Ressource." -msgid "Subject" +msgid "Subject " msgstr "Subjekt-Ressource" msgid "The topic of the resource." diff --git a/languages/template.pot b/languages/template.pot index 566d5d1..fb1c1c4 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -432,7 +432,7 @@ msgstr "" msgid "Spatial characteristics of the resource." msgstr "" -msgid "Subject" +msgid "Subject " msgstr "" msgid "The topic of the resource." diff --git a/views/shared/common/item-relations-advanced-search.php b/views/shared/common/item-relations-advanced-search.php index 701112a..de91e06 100644 --- a/views/shared/common/item-relations-advanced-search.php +++ b/views/shared/common/item-relations-advanced-search.php @@ -13,7 +13,7 @@ ?>

- +

formSelect('item_relations_property_id', @$_GET['item_relations_property_id'], array(), $formSelectProperties); ?> From 818381b240fe456952509b254c33f257f6cb1175 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Fri, 29 May 2015 18:31:37 +0200 Subject: [PATCH 07/66] =?UTF-8?q?Bugfix=20bugfix=20:-/=20=E2=80=93=20Dubli?= =?UTF-8?q?n=20Core=20relations=20actually=20require=20"Subject",=20not=20?= =?UTF-8?q?"Subject=20"=20(as=20it=20refers=20to=20the=20subject=20of=20a?= =?UTF-8?q?=20resource,=20not=20to=20a=20subject=20resource)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- formal_vocabularies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formal_vocabularies.php b/formal_vocabularies.php index 9f918d7..f171fca 100644 --- a/formal_vocabularies.php +++ b/formal_vocabularies.php @@ -204,7 +204,7 @@ ), array( 'local_part' => 'subject', - 'label' => __('Subject '), + 'label' => __('Subject'), 'description' => __('The topic of the resource.') ), array( From 4871cd816bacaf235fb836f3a9220bf106f9ede0 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Mon, 1 Jun 2015 18:38:50 +0200 Subject: [PATCH 08/66] =?UTF-8?q?Bugfix=20=E2=80=93=C2=A0fix=20faulty=20it?= =?UTF-8?q?em=20titles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- item_relations_form.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/item_relations_form.php b/item_relations_form.php index ec381ef..56e011e 100644 --- a/item_relations_form.php +++ b/item_relations_form.php @@ -73,8 +73,8 @@ // --- 2. Fetch all items together with their IDs, titles, and item type IDs and names $sql = "SELECT items.id, text, item_type_id, UNIX_TIMESTAMP(modified) FROM {$db->Item} items - LEFT JOIN {$db->Element_Texts} elementtexts on (items.id=elementtexts.id) - WHERE true + LEFT JOIN {$db->Element_Texts} elementtexts on (items.id=elementtexts.record_id) + WHERE elementtexts.element_id=50 ORDER BY items.item_type_id ASC, text ASC"; $items = $db->fetchAll($sql); // For efficiency, we use a regular JavaScript array notation instead of JSON @@ -99,5 +99,6 @@ echo "var searchTermTxt='".__("Search Term")."';\n"; echo "var resetTxt='".__("Reset")."';\n"; echo "\n"; + # echo "$sql
\n"; ?>
\ No newline at end of file From a0fa4c5d8dc99860b2fa9f9459005aff6660941b Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 2 Jun 2015 18:47:07 +0200 Subject: [PATCH 09/66] (1) Removed current item ID from selection list | (2) added (dormant) simulation code for stress testing --- item_relations_form.php | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/item_relations_form.php b/item_relations_form.php index 56e011e..b4fd20d 100644 --- a/item_relations_form.php +++ b/item_relations_form.php @@ -1,3 +1,12 @@ +

' @@ -59,8 +68,14 @@ // Put all database items into JavaScript arrays, that will later be used via jQuery. echo " - - -\n"; - // --- 1. Fetch all item typs together with ther IDs and names - if (defined("SIMULATION")) { - $itemtypes=array(); - for($i=1; ($i<=SIM_CATEGORIES); $i++) { $itemtypes[]=array("id" => $i, "name" => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, SIM_CATLEN)); } - } - else { - $sql = "SELECT id, name from {$db->Item_Types} ORDER BY id"; - $itemtypes = $db->fetchAll($sql); - } - $lines=array(); - $lines[]="0:'".__("[n/a]")."'"; - foreach($itemtypes as $itemtyp) { - $lines[]=$itemtyp["id"].":'".htmlspecialchars($itemtyp["name"], ENT_QUOTES)."'"; - } - // JavaScript object - echo "var itemTypes={\n". - implode(",\n",$lines)."\n". - "};\n"; - // --- 2. Fetch all items together with their IDs, titles, and item type IDs and names - if (defined("SIMULATION")) { - $items=array(); - for($i=1; ($i<=SIM_ITEMS); $i++) { - $items[]=array($i, substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, SIM_ITEMLEN), rand(0,SIM_CATEGORIES), time()-rand(0,3600)); - } - usort($items, function($a, $b) { return ( $a[2]!=$b[2] ? $a[2]-$b[2] : ( $a[1]!=$b[1] ? ($a[1]>$b[1] ? 1 : -1 ) : 0 ) ); } ); - } - else { - $item_id_suffix=($item->id ? "and items.id<>".$item->id : "" ); - $sql = "SELECT items.id, text, item_type_id, UNIX_TIMESTAMP(modified) - FROM {$db->Item} items - LEFT JOIN {$db->Element_Texts} elementtexts on (items.id=elementtexts.record_id) - WHERE elementtexts.element_id=50 $item_id_suffix - GROUP BY elementtexts.record_id - ORDER BY items.item_type_id ASC, text ASC"; - $items = $db->fetchAll($sql); - } - // For efficiency, we use a regular JavaScript array notation instead of JSON - $lines=array(); - foreach($items as $item) { - foreach (array_keys($item) as $key) { - if (!$item[$key]) { $item[$key]=0; } # Transform all empty values to zero - if (intval($item[$key])!==$item[$key]) { $item[$key]="'".htmlspecialchars($item[$key], ENT_QUOTES)."'"; } # Non-ints i.e. string into apostrophes - } - $lines[]="[[".implode("],[", $item)."]]"; # Item as a new array element - with its components in another array - } - echo "var allItemsArr=[\n". - implode(",\n",$lines)."\n". - "];\n"; - // -------- - echo "var itemTypesTxt='".__("Item Types")."';\n"; - echo "var allTxt='".__("All")."';\n"; - echo "var itemTypeTxt='".__("Item Type")."';\n"; - echo "var sortWithinItemTypeByTxt='".__("Sort within item types by")."';\n"; - echo "var updDateDescTxt='".__("Last Update (desc)")."';\n"; - echo "var nameAscTxt='".__("Name (asc)")."';\n"; - echo "var searchTermTxt='".__("Search Term")."';\n"; - echo "var resetTxt='".__("Reset")."';\n"; - echo "\n"; - # echo "$sql
\n"; -?> -

\ No newline at end of file + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
ItemRelationsProperty} where label = '$subject'"; + $subject_id = $db->fetchOne($sql); //default value to be selected in dropdown + echo get_view()->formSelect('item_relations_subject_property[]', $subject_id , array( 'id' => 'item_relations_subject_property_'.$subjectRelation['item_relation_id'] , 'multiple' => false, 'style' => 'width: 150px;'), array_slice($formSelectProperties,1)); + ?>
+ + + + Item_Types} ORDER BY name"; + $itemtypes = $db->fetchAll($sql); + $m = array( + '-1' => "- ".__('All')." -", + ); + foreach ($itemtypes as $type) { + $m[$type['id']] = $type['name']; + } + ?> +
+

+ + + formSelect('new_relation_property_id', null, array('multiple' => false), $formSelectProperties); ?>
+ +

+ formSelect('new_relation_object_item_type_id', null, array('multiple' => false), $m); ?>

+ +

+ : +

+ + + + + +
+

+ +

:

+ + + + + +
+
    +
  • <
  • +
  • >
  • +
+
+ +
    +
+ + + +
+

: formText('relation_comment', null, array('size' => 8)); ?>

+ + + + + +
+ + + + + + diff --git a/item_relations_script.js b/item_relations_script.js index 1f37a80..fd46de1 100644 --- a/item_relations_script.js +++ b/item_relations_script.js @@ -1,187 +1,161 @@ -jQuery(document).ready(function () { - - var $ = jQuery; // use noConflict version of jQuery as the short $ within this block - var lightbox = lity(); // Lity lightbox for item selector "popup" - - var my_input = null; // Reference to currently active input - var allItemsSortedArr = null; // Room for a pre-sorted array - var filterItemTyp = null; // Room for filter by type - var curListOrder = null; // Room for sort order - var curFilter = null; // Room for filter word - - // --- START: moved from - - - + + + + + diff --git a/item_relations_styles.css b/views/shared/css/item-relations.css similarity index 100% rename from item_relations_styles.css rename to views/shared/css/item-relations.css diff --git a/item_relations_script.js b/views/shared/javascripts/item-relations.js similarity index 100% rename from item_relations_script.js rename to views/shared/javascripts/item-relations.js diff --git a/lity/lity.css b/views/shared/javascripts/lity/lity.css similarity index 100% rename from lity/lity.css rename to views/shared/javascripts/lity/lity.css diff --git a/lity/lity.js b/views/shared/javascripts/lity/lity.js similarity index 100% rename from lity/lity.js rename to views/shared/javascripts/lity/lity.js diff --git a/lity/lity.min.css b/views/shared/javascripts/lity/lity.min.css similarity index 100% rename from lity/lity.min.css rename to views/shared/javascripts/lity/lity.min.css diff --git a/lity/lity.min.js b/views/shared/javascripts/lity/lity.min.js similarity index 100% rename from lity/lity.min.js rename to views/shared/javascripts/lity/lity.min.js From efa5b48fd0b049cd5e1af31ee9d20118b17c3f6d Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 22/66] Made the form themable. --- ItemRelationsPlugin.php | 18 +-- item_relations_form.php | 122 -------------------- views/helpers/ItemRelationsForm.php | 45 ++++++++ views/shared/common/item-relations-form.php | 112 ++++++++++++++++++ 4 files changed, 162 insertions(+), 135 deletions(-) delete mode 100644 item_relations_form.php create mode 100644 views/helpers/ItemRelationsForm.php create mode 100644 views/shared/common/item-relations-form.php diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 5d532a7..d76b2eb 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -571,17 +571,7 @@ public function filterAdminNavigationMain($nav) public function filterAdminItemsFormTabs($tabs, $args) { $item = $args['item']; - - $formSelectProperties = get_table_options('ItemRelationsProperty'); - $subjectRelations = self::prepareSubjectRelations($item); - $objectRelations = self::prepareObjectRelations($item); - - ob_start(); - include 'item_relations_form.php'; - $content = ob_get_contents(); - ob_end_clean(); - - $tabs['Item Relations'] = $content; + $tabs['Item Relations'] = get_view()->itemRelationsForm($item); return $tabs; } @@ -668,14 +658,16 @@ public static function insertItemRelation($subjectItem, $propertyId, $objectItem return false; } + $db = get_db(); + // Set the subject item. if (!($subjectItem instanceOf Item)) { - $subjectItem = get_db()->getTable('Item')->find($subjectItem); + $subjectItem = $db->getTable('Item')->find($subjectItem); } // Set the object item. if (!($objectItem instanceOf Item)) { - $objectItem = get_db()->getTable('Item')->find($objectItem); + $objectItem = $db->getTable('Item')->find($objectItem); } // Don't save the relation if the subject or object items don't exist. diff --git a/item_relations_form.php b/item_relations_form.php deleted file mode 100644 index 0e9ee30..0000000 --- a/item_relations_form.php +++ /dev/null @@ -1,122 +0,0 @@ -

- ' - . __('Browse Vocabularies') . ''; - - echo __('Here you can relate this item to another item and delete existing ' - . 'relations. For descriptions of the relations, see the %s page. Invalid ' - . 'item IDs will be ignored.', $link -); -$provideRelationComments = get_option('item_relations_provide_relation_comments'); -?> -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ItemRelationsProperty} where label = '$subject'"; - $subject_id = $db->fetchOne($sql); //default value to be selected in dropdown - echo get_view()->formSelect('item_relations_subject_property['.$subjectRelation['item_relation_id'].']', $subject_id , array( 'id' => 'item_relations_subject_property_'.$subjectRelation['item_relation_id'] , 'multiple' => false, 'style' => 'width: 150px;'), array_slice($formSelectProperties,1)); - ?>
- - - - Item_Types} ORDER BY name"; - $itemtypes = $db->fetchAll($sql); - $m = array( - '-1' => "- ".__('All')." -", - ); - foreach ($itemtypes as $type) { - $m[$type['id']] = $type['name']; - } - ?> -
-

- - - formSelect('new_relation_property_id', null, array('multiple' => false), $formSelectProperties); ?>
- -

- formSelect('new_relation_object_item_type_id', null, array('multiple' => false), $m); ?>

- -

- : -

- - - - - -
-

- -

:

- - - - - -
-
    -
  • <
  • -
  • >
  • -
-
- -
    -
- - - -
-

: formText('relation_comment', null, array('size' => 10, 'maxlength' => 60)); ?>

- - - - - -
- - - - - - diff --git a/views/helpers/ItemRelationsForm.php b/views/helpers/ItemRelationsForm.php new file mode 100644 index 0000000..9a512b0 --- /dev/null +++ b/views/helpers/ItemRelationsForm.php @@ -0,0 +1,45 @@ +view; + $db = get_db(); + + // Prepare list of item types for the select form. + $sql = "SELECT id, name from {$db->Item_Types} ORDER BY name"; + $itemtypes = $db->fetchAll($sql); + $itemTypesList = array( + '-1' => '- ' . __('All') . ' -', + ); + foreach ($itemtypes as $type) { + $itemTypesList[$type['id']] = $type['name']; + } + + $html = $view->partial('common/item-relations-form.php', array( + 'item' => $item, + 'provideRelationComments' => get_option('item_relations_provide_relation_comments'), + 'formSelectProperties' => get_table_options('ItemRelationsProperty'), + 'subjectRelations' => ItemRelationsPlugin::prepareSubjectRelations($item), + 'objectRelations' => ItemRelationsPlugin::prepareObjectRelations($item), + 'itemTypesList' => $itemTypesList, + )); + + $html .= ''; + $html .= ''; + $html .= js_tag('lity.min', $dir = 'javascripts/lity'); + $html .= ''; + $html .= js_tag('item-relations'); + + return $html; + } +} diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php new file mode 100644 index 0000000..ffe4115 --- /dev/null +++ b/views/shared/common/item-relations-form.php @@ -0,0 +1,112 @@ + +

' + . __('Browse Vocabularies') . ''; + echo __('Here you can relate this item to another item and delete existing relations.'); + echo ' ' . __('For descriptions of the relations, see the %s page.', $link); + echo ' ' . __('Invalid item IDs will be ignored.'); +?>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ItemRelationsProperty} where label = '$subject'"; + $subject_id = $db->fetchOne($sql); + + echo $this->formSelect('item_relations_subject_property[' . $subjectRelation['item_relation_id'] . ']', + $subject_id, + array( + 'id' => 'item_relations_subject_property_' . $subjectRelation['item_relation_id'], + 'multiple' => false, + 'style' => 'width: 150px;', + ), + array_slice($formSelectProperties, 1)); + ?>
+ + + +
+

+ + formSelect('new_relation_property_id', + null, array('multiple' => false), $formSelectProperties); ?>
+

+ formSelect('new_relation_object_item_type_id', + null, array('multiple' => false), $itemTypesList); ?>

+ +

: +

+ + + + +
+

+ +

:

+ + + + +
+
    +
  • <
  • +
  • >
  • +
+ +
+
    + + +
    +

    : formText('relation_comment', null, array('size' => 10, 'maxlength' => 60)); ?>

    + + + +
    From 4a665da575afe53e9d95506be9df08caf9a97132 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 23/66] Cleaned whitespace and normalized config form. --- ItemRelationsPlugin.php | 1284 +++++++++-------- config_form.php | 55 - .../plugins/item-relations-config-form.php | 72 + 3 files changed, 715 insertions(+), 696 deletions(-) delete mode 100644 config_form.php create mode 100644 views/admin/plugins/item-relations-config-form.php diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index d76b2eb..f282daf 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -1,687 +1,689 @@ 1, - 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', // maincontent - 'item_relations_provide_relation_comments' => 0, - 'item_relations_relation_format' => 'prefix_local_part' - ); - - /** - * Install the plugin. - */ - public function hookInstall() - { - // Create tables. - $db = $this->_db; - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsVocabulary` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `description` text, - `namespace_prefix` varchar(100) NOT NULL, - `namespace_uri` varchar(200) DEFAULT NULL, - `custom` BOOLEAN NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsProperty` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `vocabulary_id` int(10) unsigned NOT NULL, - `local_part` varchar(100) NOT NULL, - `label` varchar(100) DEFAULT NULL, - `description` text, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsRelation` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `subject_item_id` int(10) unsigned NOT NULL, - `property_id` int(10) unsigned NOT NULL, - `object_item_id` int(10) unsigned NOT NULL, - `relation_comment` varchar(60) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - // Install the formal vocabularies and their properties. - self::hookInitialize(); // Make sure that the i18n file is already loaded - $formalVocabularies = include 'formal_vocabularies.php'; - foreach ($formalVocabularies as $formalVocabulary) { - $vocabulary = new ItemRelationsVocabulary; - $vocabulary->name = $formalVocabulary['name']; - $vocabulary->description = $formalVocabulary['description']; - $vocabulary->namespace_prefix = $formalVocabulary['namespace_prefix']; - $vocabulary->namespace_uri = $formalVocabulary['namespace_uri']; - $vocabulary->custom = 0; - $vocabulary->save(); - - $vocabularyId = $vocabulary->id; - - foreach ($formalVocabulary['properties'] as $formalProperty) { - $property = new ItemRelationsProperty; - $property->vocabulary_id = $vocabularyId; - $property->local_part = $formalProperty['local_part']; - $property->label = $formalProperty['label']; - $property->description = $formalProperty['description']; - $property->save(); - } - } + /** + * @var array Hooks for the plugin. + */ + protected $_hooks = array( + 'install', + 'uninstall', + 'upgrade', + 'config', + 'config_form', + 'define_acl', + 'initialize', + 'after_save_item', + 'after_delete_item', + 'admin_items_show', + 'admin_items_show_sidebar', + 'admin_items_search', + 'admin_items_batch_edit_form', + 'items_batch_edit_custom', + 'public_items_show', + 'public_items_search', + 'items_browse_sql', + ); + + /** + * @var array Filters for the plugin. + */ + protected $_filters = array( + 'admin_items_form_tabs', + 'admin_navigation_main', + ); + + /** + * @var array Options and their default values. + */ + protected $_options = array( + 'item_relations_provide_relation_comments' => 0, + 'item_relations_relation_format' => 'prefix_local_part', + 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', + 'item_relations_public_append_to_items_show' => 1, + ); + + /** + * Install the plugin. + */ + public function hookInstall() + { + // Create tables. + $db = $this->_db; + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsVocabulary` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `description` text, + `namespace_prefix` varchar(100) NOT NULL, + `namespace_uri` varchar(200) DEFAULT NULL, + `custom` BOOLEAN NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsProperty` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vocabulary_id` int(10) unsigned NOT NULL, + `local_part` varchar(100) NOT NULL, + `label` varchar(100) DEFAULT NULL, + `description` text, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsRelation` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `subject_item_id` int(10) unsigned NOT NULL, + `property_id` int(10) unsigned NOT NULL, + `object_item_id` int(10) unsigned NOT NULL, + `relation_comment` varchar(60) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + // Install the formal vocabularies and their properties. + self::hookInitialize(); // Make sure that the i18n file is already loaded + $formalVocabularies = include 'formal_vocabularies.php'; + foreach ($formalVocabularies as $formalVocabulary) { + $vocabulary = new ItemRelationsVocabulary; + $vocabulary->name = $formalVocabulary['name']; + $vocabulary->description = $formalVocabulary['description']; + $vocabulary->namespace_prefix = $formalVocabulary['namespace_prefix']; + $vocabulary->namespace_uri = $formalVocabulary['namespace_uri']; + $vocabulary->custom = 0; + $vocabulary->save(); + + $vocabularyId = $vocabulary->id; + + foreach ($formalVocabulary['properties'] as $formalProperty) { + $property = new ItemRelationsProperty; + $property->vocabulary_id = $vocabularyId; + $property->local_part = $formalProperty['local_part']; + $property->label = $formalProperty['label']; + $property->description = $formalProperty['description']; + $property->save(); + } + } - // Install a custom vocabulary. - $customVocabulary = new ItemRelationsVocabulary; - $customVocabulary->name = __('Custom'); - $customVocabulary->description = __('Custom vocabulary containing relations defined for this Omeka instance.'); - $customVocabulary->namespace_prefix = ''; // cannot be NULL - $customVocabulary->namespace_uri = null; - $customVocabulary->custom = 1; - $customVocabulary->save(); - - $this->_installOptions(); - } - - /** - * Uninstall the plugin. - */ - public function hookUninstall() - { - $db = $this->_db; - - // Drop the vocabularies table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsVocabulary`"; - $db->query($sql); - - // Drop the properties table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsProperty`"; - $db->query($sql); - - // Drop the relations table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsRelation`"; - $db->query($sql); - - $this->_uninstallOptions(); - } - - /** - * Display the plugin configuration form. - */ - public static function hookConfigForm() - { - $publicAppendToItemsShow = get_option('item_relations_public_append_to_items_show'); - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - $provideRelationComments = get_option('item_relations_provide_relation_comments'); - $relationFormat = get_option('item_relations_relation_format'); - - require dirname(__FILE__) . '/config_form.php'; - } - - /** - * Handle the plugin configuration form. - */ - public static function hookConfig() - { - set_option('item_relations_public_append_to_items_show', - (int)(boolean) $_POST['item_relations_public_append_to_items_show']); - set_option('item_relations_admin_sidebar_or_maincontent', - $_POST['item_relations_admin_sidebar_or_maincontent']); - set_option('item_relations_provide_relation_comments', - (int)(boolean) $_POST['item_relations_provide_relation_comments']); - set_option('item_relations_relation_format', - $_POST['item_relations_relation_format']); - } - - /** - * Upgrade the plugin. - * - * @param array $args - */ - public function hookUpgrade($args) - { - $oldVersion = $args['old_version']; - $db = $this->_db; - if ($oldVersion <= '1.1') { - $sql = " - INSERT INTO `{$db->ItemRelationsProperty}` - (`vocabulary_id`, `local_part`, `label`, `description`) - VALUES - (1, 'abstract', 'Abstract', 'A summary of the resource.'), - (1, 'accessRights', 'Access Rights', 'Information about who can access the resource or an indication of its security status.'), - (1, 'accrualMethod', 'Accrual Method', 'The method by which items are added to a collection.'), - (1, 'accrualPeriodicity', 'Accrual Periodicity', 'The frequency with which items are added to a collection.'), - (1, 'accrualPolicy', 'Accrual Policy', 'The policy governing the addition of items to a collection.'), - (1, 'audience', 'Audience', 'A class of entity for whom the resource is intended or useful.'), - (1, 'contributor', 'Contributor', 'An entity responsible for making contributions to the resource.'), - (1, 'coverage', 'Coverage', 'The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.'), - (1, 'creator', 'Creator', 'An entity primarily responsible for making the resource.'), - (1, 'description', 'Description', 'An account of the resource.'), - (1, 'educationLevel', 'Audience Education Level', 'A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'), - (1, 'extent', 'Extent', 'The size or duration of the resource.'), - (1, 'format', 'Format', 'The file format, physical medium, or dimensions of the resource.'), - (1, 'instructionalMethod', 'Instructional Method', 'A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'), - (1, 'language', 'Language', 'A language of the resource.'), - (1, 'license', 'License', 'A legal document giving official permission to do something with the resource.'), - (1, 'mediator', 'Mediator', 'An entity that mediates access to the resource and for whom the resource is intended or useful.'), - (1, 'medium', 'Medium', 'The material or physical carrier of the resource.'), - (1, 'provenance', 'Provenance', 'A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.'), - (1, 'publisher', 'Publisher', 'An entity responsible for making the resource available.'), - (1, 'rights', 'Rights', 'Information about rights held in and over the resource.'), - (1, 'rightsHolder', 'Rights Holder', 'A person or organization owning or managing rights over the resource.'), - (1, 'spatial', 'Spatial Coverage', 'Spatial characteristics of the resource.'), - (1, 'subject', 'Subject', 'The topic of the resource.'), - (1, 'tableOfContents', 'Table Of Contents', 'A list of subunits of the resource.'), - (1, 'temporal', 'Temporal Coverage', 'Temporal characteristics of the resource.'), - (1, 'type', 'Type', 'The nature or genre of the resource.')"; - $db->query($sql); + // Install a custom vocabulary. + $customVocabulary = new ItemRelationsVocabulary; + $customVocabulary->name = __('Custom'); + $customVocabulary->description = __('Custom vocabulary containing relations defined for this Omeka instance.'); + $customVocabulary->namespace_prefix = ''; // cannot be NULL + $customVocabulary->namespace_uri = null; + $customVocabulary->custom = 1; + $customVocabulary->save(); + + $this->_installOptions(); } - if ($oldVersion <= '2.0') { - // Fix un-upgraded old table name if present. - $correctTableName = (bool) $db->fetchOne("SHOW TABLES LIKE '{$db->ItemRelationsRelation}'"); - if (!$correctTableName) { - $sql = "RENAME TABLE `{$db->prefix}item_relations_item_relations` TO `{$db->ItemRelationsRelation}`"; + /** + * Uninstall the plugin. + */ + public function hookUninstall() + { + $db = $this->_db; + + // Drop the vocabularies table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsVocabulary`"; + $db->query($sql); + + // Drop the properties table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsProperty`"; $db->query($sql); - } + + // Drop the relations table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsRelation`"; + $db->query($sql); + + $this->_uninstallOptions(); } - if ($oldVersion <= '2.21') { - // Insert relation_comment column - $sql = "ALTER TABLE `{$db->prefix}item_relations_relations` ADD `relation_comment` VARCHAR(60) NOT NULL DEFAULT '' AFTER `object_item_id`"; - $db->query($sql); + /** + * Display the plugin configuration form. + */ + public function hookConfigForm($args) + { + $view = get_view(); + echo $view->partial( + 'plugins/item-relations-config-form.php' + ); } - } - - /** - * Add the translations. - */ - public function hookInitialize() - { - add_translation_source(dirname(__FILE__) . '/languages'); - } - - /** - * Define the ACL. - * - * @param array $args - */ - public function hookDefineAcl($args) - { - $acl = $args['acl']; - - $indexResource = new Zend_Acl_Resource('ItemRelations_Index'); - $vocabResource = new Zend_Acl_Resource('ItemRelations_Vocabularies'); - $acl->add($indexResource); - $acl->add($vocabResource); - } - - /** - * Display item relations on the public items show page. - */ - public function hookPublicItemsShow() { - if (get_option('item_relations_public_append_to_items_show')) { - $item = get_current_record('item'); - - echo common('item-relations-show', array( - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item) - )); + /** + * Handle the plugin configuration form. + */ + public function hookConfig($args) + { + $post = $args['post']; + foreach ($this->_options as $optionKey => $optionValue) { + if (isset($post[$optionKey])) { + set_option($optionKey, $post[$optionKey]); + } + } } - } - - /** - * Display item relations on the admin items show page underneath main content. - * - * @param Item $item - */ - public function hookAdminItemsShow($args) - { - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - if ($adminSidebarOrMaincontent == "maincontent"): - - $item = $args['item']; - - echo common('item-relations-show', array( - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item) - )); - - endif; - } - - /** - * Display item relations on the admin items show page in the side bar in the lower right. - * - * @param Item $item - */ - public function hookAdminItemsShowSidebar($args) - { - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - if ($adminSidebarOrMaincontent != "maincontent"): - - $item = $args['item']; - - echo common('item-relations-show', array( - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item) - )); - - endif; - } - - /** - * Display the item relations form on the advanced search page. - */ - protected function _ItemsSearch() - { - echo common('item-relations-advanced-search', array( - 'formSelectProperties' => get_table_options('ItemRelationsProperty')) - ); - } - - /** - * Display the item relations form on the admin advanced search page. - */ - public function hookAdminItemsSearch() { SELF::_itemsSearch(); } - - /** - * Display the item relations form on the public advanced search page. - */ - public function hookPublicItemsSearch() { SELF::_itemsSearch(); } - - /** - * Save the item relations after saving an item add/edit form. - * - * @param array $args - */ - public function hookAfterSaveItem($args) - { - if (!$args['post']) { - return; + + /** + * Upgrade the plugin. + * + * @param array $args + */ + public function hookUpgrade($args) + { + $oldVersion = $args['old_version']; + $db = $this->_db; + + if ($oldVersion <= '1.1') { + $sql = " + INSERT INTO `{$db->ItemRelationsProperty}` + (`vocabulary_id`, `local_part`, `label`, `description`) + VALUES + (1, 'abstract', 'Abstract', 'A summary of the resource.'), + (1, 'accessRights', 'Access Rights', 'Information about who can access the resource or an indication of its security status.'), + (1, 'accrualMethod', 'Accrual Method', 'The method by which items are added to a collection.'), + (1, 'accrualPeriodicity', 'Accrual Periodicity', 'The frequency with which items are added to a collection.'), + (1, 'accrualPolicy', 'Accrual Policy', 'The policy governing the addition of items to a collection.'), + (1, 'audience', 'Audience', 'A class of entity for whom the resource is intended or useful.'), + (1, 'contributor', 'Contributor', 'An entity responsible for making contributions to the resource.'), + (1, 'coverage', 'Coverage', 'The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.'), + (1, 'creator', 'Creator', 'An entity primarily responsible for making the resource.'), + (1, 'description', 'Description', 'An account of the resource.'), + (1, 'educationLevel', 'Audience Education Level', 'A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'), + (1, 'extent', 'Extent', 'The size or duration of the resource.'), + (1, 'format', 'Format', 'The file format, physical medium, or dimensions of the resource.'), + (1, 'instructionalMethod', 'Instructional Method', 'A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'), + (1, 'language', 'Language', 'A language of the resource.'), + (1, 'license', 'License', 'A legal document giving official permission to do something with the resource.'), + (1, 'mediator', 'Mediator', 'An entity that mediates access to the resource and for whom the resource is intended or useful.'), + (1, 'medium', 'Medium', 'The material or physical carrier of the resource.'), + (1, 'provenance', 'Provenance', 'A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.'), + (1, 'publisher', 'Publisher', 'An entity responsible for making the resource available.'), + (1, 'rights', 'Rights', 'Information about rights held in and over the resource.'), + (1, 'rightsHolder', 'Rights Holder', 'A person or organization owning or managing rights over the resource.'), + (1, 'spatial', 'Spatial Coverage', 'Spatial characteristics of the resource.'), + (1, 'subject', 'Subject', 'The topic of the resource.'), + (1, 'tableOfContents', 'Table Of Contents', 'A list of subunits of the resource.'), + (1, 'temporal', 'Temporal Coverage', 'Temporal characteristics of the resource.'), + (1, 'type', 'Type', 'The nature or genre of the resource.')"; + $db->query($sql); + } + + if ($oldVersion <= '2.0') { + // Fix un-upgraded old table name if present. + $correctTableName = (bool) $db->fetchOne("SHOW TABLES LIKE '{$db->ItemRelationsRelation}'"); + if (!$correctTableName) { + $sql = "RENAME TABLE `{$db->prefix}item_relations_item_relations` TO `{$db->ItemRelationsRelation}`"; + $db->query($sql); + } + } + + if ($oldVersion < '2.0.2.1') { + // Insert relation_comment column + $sql = "ALTER TABLE `{$db->prefix}item_relations_relations` ADD `relation_comment` VARCHAR(60) NOT NULL DEFAULT '' AFTER `object_item_id`"; + $db->query($sql); + } } - $record = $args['record']; - $post = $args['post']; - #echo "
    "; print_r($_POST); die("
    "); - $db = $this->_db; + /** + * Add the translations. + */ + public function hookInitialize() + { + add_translation_source(dirname(__FILE__) . '/languages'); + } - // Save item relations. - if (isset($post['item_relations_property_id'])) { - foreach ($post['item_relations_property_id'] as $key => $propertyId) { - self::insertItemRelation( - $record, - $propertyId, - $post['item_relations_item_relation_object_item_id'][$key], - $post['item_relations_item_relation_relation_comment'][$key] - ); + /** + * Define the ACL. + * + * @param array $args + */ + public function hookDefineAcl($args) + { + $acl = $args['acl']; + + $indexResource = new Zend_Acl_Resource('ItemRelations_Index'); + $vocabResource = new Zend_Acl_Resource('ItemRelations_Vocabularies'); + $acl->add($indexResource); + $acl->add($vocabResource); } - } - - // update the comment when the comment is edited in subject - if (isset($post['item_relations_item_relation_subject_comment'])) { - if (isset($post['item_relations_subject_comment'])) { - $comments = array(); - foreach($post['item_relations_item_relation_subject_comment'] as $key) { - $key = intval($key); - if ($key) { $comments[$key] = $post['item_relations_subject_comment'][$key]; } - } - $commentIds = implode(",", array_keys($comments)); - - //Optimized the update query to avoid multiple execution - $sql = "UPDATE `$db->ItemRelationsRelation` set relation_comment = case id "; - foreach ($comments as $commentId => $comment) { - $sql .= sprintf(" when %d then '%s'", $commentId, addslashes($comment) ); - } - $sql .= " end where id in ($commentIds)"; - $db->query($sql); + + /** + * Display item relations on the public items show page. + */ + public function hookPublicItemsShow() + { + if (get_option('item_relations_public_append_to_items_show')) { + $item = get_current_record('item'); + + echo common('item-relations-show', array( + 'subjectRelations' => self::prepareSubjectRelations($item), + 'objectRelations' => self::prepareObjectRelations($item), + )); + } } - else { - $this->_helper->flashMessenger(__('There was an error in the item relation comments.'), 'error'); + + /** + * Display item relations on the admin items show page underneath main content. + * + * @param Item $item + */ + public function hookAdminItemsShow($args) + { + $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); + if ($adminSidebarOrMaincontent == "maincontent") { + $item = $args['item']; + + echo common('item-relations-show', array( + 'subjectRelations' => self::prepareSubjectRelations($item), + 'objectRelations' => self::prepareObjectRelations($item), + )); + } } - } - - // update the relation when the relation is edited in subject - if (isset($post['item_relations_item_relation_subject_property'])) { - if (isset($post['item_relations_subject_property'])) { - $properties = array(); - foreach($post['item_relations_item_relation_subject_property'] as $key) { - $key = intval($key); - if ($key) { - $val = intval($post['item_relations_subject_property'][$key]); - if ($val) { $properties[$key] = $val; } + + /** + * Display item relations on the admin items show page in the side bar in the lower right. + * + * @param Item $item + */ + public function hookAdminItemsShowSidebar($args) + { + $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); + if ($adminSidebarOrMaincontent != "maincontent") { + $item = $args['item']; + + echo common('item-relations-show', array( + 'subjectRelations' => self::prepareSubjectRelations($item), + 'objectRelations' => self::prepareObjectRelations($item), + )); } - } - $propertyIds = implode(",", array_keys($properties)); - - //Optimized the update query to avoid multiple execution - $sql = "UPDATE `$db->ItemRelationsRelation` set property_id = case id "; - foreach ($properties as $propertyId => $property) { - $sql .= sprintf(" when %d then %d", $propertyId, $property); - } - $sql .= " end where id in ($propertyIds)"; - $db->query($sql); } - else { - $this->_helper->flashMessenger(__('There was an error in listing the item relation.'), 'error'); + + /** + * Display the item relations form on the advanced search page. + */ + protected function _ItemsSearch() + { + echo common('item-relations-advanced-search', array( + 'formSelectProperties' => get_table_options('ItemRelationsProperty'), + )); } - } - - // Delete item relations. - if (isset($post['item_relations_item_relation_delete'])) { - foreach ($post['item_relations_item_relation_delete'] as $itemRelationId) { - $itemRelation = $db->getTable('ItemRelationsRelation')->find($itemRelationId); - // When an item is related to itself, deleting both relations - // simultaneously will result in an error. Prevent this by - // checking if the item relation exists prior to deletion. - if ($itemRelation) { - $itemRelation->delete(); - } + + /** + * Display the item relations form on the admin advanced search page. + */ + public function hookAdminItemsSearch() + { + self::_itemsSearch(); } - } -} -/** -* Delete an item's relations after deleting that item. -* -* @param array $args -*/ -public function hookAfterDeleteItem($args) -{ + /** + * Display the item relations form on the public advanced search page. + */ + public function hookPublicItemsSearch() { + self::_itemsSearch(); + } - $db = $this->_db; + /** + * Save the item relations after saving an item add/edit form. + * + * @param array $args + */ + public function hookAfterSaveItem($args) + { + if (!$args['post']) { + return; + } - $item_id = intval($args["record"]["id"]); + $record = $args['record']; + $post = $args['post']; + $db = $this->_db; + + // Save item relations. + if (isset($post['item_relations_property_id'])) { + foreach ($post['item_relations_property_id'] as $key => $propertyId) { + self::insertItemRelation( + $record, + $propertyId, + $post['item_relations_item_relation_object_item_id'][$key], + $post['item_relations_item_relation_relation_comment'][$key] + ); + } + } - if ($item_id) { - $sql = "delete from `$db->ItemRelationsRelation` where subject_item_id=$item_id or object_item_id=$item_id"; - $db->query($sql); - } + // update the comment when the comment is edited in subject + if (isset($post['item_relations_item_relation_subject_comment'])) { + if (isset($post['item_relations_subject_comment'])) { + $comments = array(); + foreach($post['item_relations_item_relation_subject_comment'] as $key) { + $key = intval($key); + if ($key) { + $comments[$key] = $post['item_relations_subject_comment'][$key]; + } + } + $commentIds = implode(",", array_keys($comments)); + + // Optimized the update query to avoid multiple execution. + $sql = "UPDATE `$db->ItemRelationsRelation` set relation_comment = case id "; + foreach ($comments as $commentId => $comment) { + $sql .= sprintf(" when %d then '%s'", $commentId, addslashes($comment) ); + } + $sql .= " end where id in ($commentIds)"; + $db->query($sql); + } + else { + $this->_helper->flashMessenger(__('There was an error in the item relation comments.'), 'error'); + } + } -} + // Update the relation when the relation is edited in subject. + if (isset($post['item_relations_item_relation_subject_property'])) { + if (isset($post['item_relations_subject_property'])) { + $properties = array(); + foreach($post['item_relations_item_relation_subject_property'] as $key) { + $key = intval($key); + if ($key) { + $val = intval($post['item_relations_subject_property'][$key]); + if ($val) { + $properties[$key] = $val; + } + } + } + $propertyIds = implode(",", array_keys($properties)); + + // Optimized the update query to avoid multiple execution. + $sql = "UPDATE `$db->ItemRelationsRelation` set property_id = case id "; + foreach ($properties as $propertyId => $property) { + $sql .= sprintf(" when %d then %d", $propertyId, $property); + } + $sql .= " end where id in ($propertyIds)"; + $db->query($sql); + } + else { + $this->_helper->flashMessenger(__('There was an error in listing the item relation.'), 'error'); + } + } -/** -* Filter for an item relation after search page submission. -* -* @param array $args -*/ -public function hookItemsBrowseSql($args) -{ - $select = $args['select']; - $params = $args['params']; - - // Set the field on which to join. - if (isset($params['item_relations_clause_part']) - && $params['item_relations_clause_part'] == 'object' - ) { - $onField = 'object_item_id'; - } else { - $onField = 'subject_item_id'; - } - - $filter_relation=( isset($params['item_relations_property_id']) && is_numeric($params['item_relations_property_id']) ); - $filter_comment=( isset($params['item_relations_comment']) && (trim($params['item_relations_comment'])) ); - - if ( $filter_relation || $filter_comment ) { - - $db = $this->_db; - $select - ->join( - array('item_relations_relations' => $db->ItemRelationsRelation), - "item_relations_relations.$onField = items.id", - array() - ); - - if ($filter_relation) { - $select->where('item_relations_relations.property_id = ?', - $params['item_relations_property_id']); - } - - if ($filter_comment) { - $select->where('item_relations_relations.relation_comment LIKE ?', - "%".trim($params['item_relations_comment'])."%" ); - } + // Delete item relations. + if (isset($post['item_relations_item_relation_delete'])) { + foreach ($post['item_relations_item_relation_delete'] as $itemRelationId) { + $itemRelation = $db->getTable('ItemRelationsRelation')->find($itemRelationId); + // When an item is related to itself, deleting both relations + // simultaneously will result in an error. Prevent this by + // checking if the item relation exists prior to deletion. + if ($itemRelation) { + $itemRelation->delete(); + } + } + } + } -} + /** + * Delete an item's relations after deleting that item. + * + * @param array $args + */ + public function hookAfterDeleteItem($args) + { + $db = $this->_db; -# echo "
    "; print_r($select); die("
    "); + $item_id = intval($args["record"]["id"]); -// $select->where('items.id = ?', 2); -} + if ($item_id) { + $sql = "delete from `$db->ItemRelationsRelation` where subject_item_id=$item_id or object_item_id=$item_id"; + $db->query($sql); + } + } -/** -* Add custom fields to the item batch edit form. -*/ -public function hookAdminItemsBatchEditForm() -{ - $formSelectProperties = get_table_options('ItemRelationsProperty'); - ?> -
    -

    - - - - - - - - - - - - - - - -
    formSelect('custom[item_relations_property_id]', null, array(), $formSelectProperties); ?> - - formText('custom[item_relations_item_relation_object_item_id]', null, array('size' => 6)); ?> -
    -
    - _db; + $select + ->join( + array('item_relations_relations' => $db->ItemRelationsRelation), + "item_relations_relations.$onField = items.id", + array() + ); + + if ($filter_relation) { + $select->where('item_relations_relations.property_id = ?', + $params['item_relations_property_id']); + } + + if ($filter_comment) { + $select->where('item_relations_relations.relation_comment LIKE ?', + "%" . trim($params['item_relations_comment']) . "%" ); + } + } -/** -* Add the Item Relations link to the admin main navigation. -* -* @param array Navigation array. -* @return array Filtered navigation array. -*/ -public function filterAdminNavigationMain($nav) -{ - $nav[] = array( - 'label' => __('Item Relations'), - 'uri' => url('item-relations'), - 'resource' => 'ItemRelations_Index', - 'privilege' => 'index' - ); - return $nav; -} + # echo "
    "; print_r($select); die("
    "); -/** -* Add the "Item Relations" tab to the admin items add/edit page. -* -* @return array -*/ -public function filterAdminItemsFormTabs($tabs, $args) -{ - $item = $args['item']; - $tabs['Item Relations'] = get_view()->itemRelationsForm($item); - return $tabs; -} + // $select->where('items.id = ?', 2); + } -/** -* Prepare subject item relations for display. -* -* @param Item $item -* @return array -*/ -public static function prepareSubjectRelations(Item $item) -{ - $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id); - $subjectRelations = array(); + /** + * Add custom fields to the item batch edit form. + */ + public function hookAdminItemsBatchEditForm() + { + $formSelectProperties = get_table_options('ItemRelationsProperty'); + ?> +
    +

    + + + + + + + + + + + + + + + +
    formSelect('custom[item_relations_property_id]', + null, array(), $formSelectProperties); ?> + formText('custom[item_relations_item_relation_object_item_id]', + null, array('size' => 6)); + ?>
    +
    + object_item_id))) { - continue; + self::insertItemRelation( + $item, + $custom['item_relations_property_id'], + $custom['item_relations_item_relation_object_item_id'], + $custom['item_relations_item_relation_relation_comment'] + ); } - $subjectRelations[] = array( - 'item_relation_id' => $subject->id, - 'object_item_id' => $subject->object_item_id, - 'relation_comment' => $subject->relation_comment, - 'object_item_title' => self::getItemTitle($item), - 'relation_text' => $subject->getPropertyText(), - 'relation_description' => $subject->property_description - ); - } - return $subjectRelations; -} -/** -* Prepare object item relations for display. -* -* @param Item $item -* @return array -*/ -public static function prepareObjectRelations(Item $item) -{ - $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id); - $objectRelations = array(); - foreach ($objects as $object) { - if (!($item = get_record_by_id('item', $object->subject_item_id))) { - continue; + /** + * Add the Item Relations link to the admin main navigation. + * + * @param array Navigation array. + * @return array Filtered navigation array. + */ + public function filterAdminNavigationMain($nav) + { + $nav[] = array( + 'label' => __('Item Relations'), + 'uri' => url('item-relations'), + 'resource' => 'ItemRelations_Index', + 'privilege' => 'index' + ); + return $nav; } - $objectRelations[] = array( - 'item_relation_id' => $object->id, - 'subject_item_id' => $object->subject_item_id, - 'relation_comment' => $object->relation_comment, - 'subject_item_title' => self::getItemTitle($item), - 'relation_text' => $object->getPropertyText(), - 'relation_description' => $object->property_description - ); - } - return $objectRelations; -} -/** -* Return a item's title. -* -* @param Item $item The item. -* @return string -*/ -public static function getItemTitle($item) -{ - $title = metadata($item, array('Dublin Core', 'Title'), array('no_filter' => true)); - if (!trim($title)) { - $title = '#' . $item->id; - } - return $title; -} + /** + * Add the "Item Relations" tab to the admin items add/edit page. + * + * @return array + */ + public function filterAdminItemsFormTabs($tabs, $args) + { + $item = $args['item']; + $tabs['Item Relations'] = get_view()->itemRelationsForm($item); + return $tabs; + } -/** -* Insert an item relation. -* -* @param Item|int $subjectItem -* @param int $propertyId -* @param Item|int $objectItem -* @return bool True: success; false: unsuccessful -*/ -public static function insertItemRelation($subjectItem, $propertyId, $objectItem, $relationComment) -{ - // Only numeric property IDs are valid. - if (!is_numeric($propertyId)) { - return false; - } - - $db = get_db(); - - // Set the subject item. - if (!($subjectItem instanceOf Item)) { - $subjectItem = $db->getTable('Item')->find($subjectItem); - } - - // Set the object item. - if (!($objectItem instanceOf Item)) { - $objectItem = $db->getTable('Item')->find($objectItem); - } - - // Don't save the relation if the subject or object items don't exist. - if (!$subjectItem || !$objectItem) { - return false; - } - - $itemRelation = new ItemRelationsRelation; - $itemRelation->subject_item_id = $subjectItem->id; - $itemRelation->property_id = $propertyId; - $itemRelation->object_item_id = $objectItem->id; - $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); - $itemRelation->save(); - - return true; -} + /** + * Prepare subject item relations for display. + * + * @param Item $item + * @return array + */ + public static function prepareSubjectRelations(Item $item) + { + $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id); + $subjectRelations = array(); + + foreach ($subjects as $subject) { + if (!($item = get_record_by_id('item', $subject->object_item_id))) { + continue; + } + $subjectRelations[] = array( + 'item_relation_id' => $subject->id, + 'object_item_id' => $subject->object_item_id, + 'relation_comment' => $subject->relation_comment, + 'object_item_title' => self::getItemTitle($item), + 'relation_text' => $subject->getPropertyText(), + 'relation_description' => $subject->property_description, + ); + } + return $subjectRelations; + } + + /** + * Prepare object item relations for display. + * + * @param Item $item + * @return array + */ + public static function prepareObjectRelations(Item $item) + { + $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id); + $objectRelations = array(); + foreach ($objects as $object) { + if (!($item = get_record_by_id('item', $object->subject_item_id))) { + continue; + } + $objectRelations[] = array( + 'item_relation_id' => $object->id, + 'subject_item_id' => $object->subject_item_id, + 'relation_comment' => $object->relation_comment, + 'subject_item_title' => self::getItemTitle($item), + 'relation_text' => $object->getPropertyText(), + 'relation_description' => $object->property_description, + ); + } + return $objectRelations; + } + + /** + * Return a item's title. + * + * @param Item $item The item. + * @return string + */ + public static function getItemTitle($item) + { + $title = metadata($item, array('Dublin Core', 'Title'), array('no_filter' => true)); + if (!trim($title)) { + $title = '#' . $item->id; + } + return $title; + } + + /** + * Insert an item relation. + * + * @param Item|int $subjectItem + * @param int $propertyId + * @param Item|int $objectItem + * @return bool True: success; false: unsuccessful + */ + public static function insertItemRelation($subjectItem, $propertyId, $objectItem, $relationComment) + { + // Only numeric property IDs are valid. + if (!is_numeric($propertyId)) { + return false; + } + + $db = get_db(); + + // Set the subject item. + if (!($subjectItem instanceOf Item)) { + $subjectItem = $db->getTable('Item')->find($subjectItem); + } + + // Set the object item. + if (!($objectItem instanceOf Item)) { + $objectItem = $db->getTable('Item')->find($objectItem); + } + + // Don't save the relation if the subject or object items don't exist. + if (!$subjectItem || !$objectItem) { + return false; + } + + $itemRelation = new ItemRelationsRelation; + $itemRelation->subject_item_id = $subjectItem->id; + $itemRelation->property_id = $propertyId; + $itemRelation->object_item_id = $objectItem->id; + $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); + $itemRelation->save(); + + return true; + } } diff --git a/config_form.php b/config_form.php deleted file mode 100644 index 1e19c31..0000000 --- a/config_form.php +++ /dev/null @@ -1,55 +0,0 @@ -
    -
    - formLabel('item_relations_public_append_to_items_show', __('Append to Public Items Show')); ?> -
    -
    -

    - -

    - formCheckbox('item_relations_public_append_to_items_show', null, array('checked' => $publicAppendToItemsShow)); ?> -
    -
    -
    -
    - formLabel('item_relations_admin_sidebar_or_maincontent', __('Display position in admin view')); ?> -
    -
    -

    - -

    - formSelect('item_relations_admin_sidebar_or_maincontent', $adminSidebarOrMaincontent, null, array('sidebar' => __('Side bar'), 'maincontent' => __('Main content'))); ?> -
    -
    -
    -
    - formLabel('item_relations_provide_relation_comments', __('Provide comment field for relations')); ?> -
    -
    -

    - -

    - formCheckbox('item_relations_provide_relation_comments', null, array('checked' => $provideRelationComments)); ?> -
    -
    -
    -
    - formLabel('item_relations_relation_format', __('Relation Format')); ?> -
    -
    -

    - -

    - formSelect('item_relations_relation_format', $relationFormat, null, array('prefix_local_part' => __('prefix:localPart'), 'label' => __('label'))); ?> -
    -
    diff --git a/views/admin/plugins/item-relations-config-form.php b/views/admin/plugins/item-relations-config-form.php new file mode 100644 index 0000000..572d074 --- /dev/null +++ b/views/admin/plugins/item-relations-config-form.php @@ -0,0 +1,72 @@ +
    +
    +
    + formLabel('item_relations_provide_relation_comments', + __('Provide comment field for relations')); ?> +
    +
    +

    + +

    + formCheckbox('item_relations_provide_relation_comments', + null, array('checked' => get_option('item_relations_provide_relation_comments'))); ?> +
    +
    +
    +
    +
    +
    + formLabel('item_relations_relation_format', + __('Relation Format')); ?> +
    +
    +

    + +

    + formSelect('item_relations_relation_format', + get_option('item_relations_relation_format'), null, array( + 'prefix_local_part' => __('prefix:localPart'), + 'label' => __('label'), + )); ?> +
    +
    +
    +
    + formLabel('item_relations_admin_sidebar_or_maincontent', + __('Display position in admin view')); ?> +
    +
    +

    + +

    + formSelect('item_relations_admin_sidebar_or_maincontent', + get_option('item_relations_admin_sidebar_or_maincontent'), null, array( + 'sidebar' => __('Side bar'), + 'maincontent' => __('Main content'), + )); ?> +
    +
    +
    +
    + formLabel('item_relations_public_append_to_items_show', + __('Append to Public Items Show')); ?> +
    +
    +

    + +

    + formCheckbox('item_relations_public_append_to_items_show', + null, array('checked' => get_option('item_relations_public_append_to_items_show'))); ?> +
    +
    +
    From 66160b340c843982e7e456dd6d41218c96b94c73 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 24/66] Avoided sql queries in view. --- views/helpers/ItemRelationsForm.php | 10 +++++++++- views/shared/common/item-relations-form.php | 10 +--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/views/helpers/ItemRelationsForm.php b/views/helpers/ItemRelationsForm.php index 9a512b0..ff65ed6 100644 --- a/views/helpers/ItemRelationsForm.php +++ b/views/helpers/ItemRelationsForm.php @@ -15,6 +15,14 @@ public function itemRelationsForm($item) $view = $this->view; $db = get_db(); + // Prepare the list of subjects to avoid sql queries in the view. + $subjectRelations = ItemRelationsPlugin::prepareSubjectRelations($item); + $sql = "SELECT id FROM {$db->ItemRelationsProperty} WHERE label = ?"; + foreach ($subjectRelations as &$subjectRelation) { + // Get the default value to be selected in dropdown. + $subjectRelation['subject_id'] = $db->fetchOne($sql, array($subjectRelation['relation_text'])); + } + // Prepare list of item types for the select form. $sql = "SELECT id, name from {$db->Item_Types} ORDER BY name"; $itemtypes = $db->fetchAll($sql); @@ -29,7 +37,7 @@ public function itemRelationsForm($item) 'item' => $item, 'provideRelationComments' => get_option('item_relations_provide_relation_comments'), 'formSelectProperties' => get_table_options('ItemRelationsProperty'), - 'subjectRelations' => ItemRelationsPlugin::prepareSubjectRelations($item), + 'subjectRelations' => $subjectRelations, 'objectRelations' => ItemRelationsPlugin::prepareObjectRelations($item), 'itemTypesList' => $itemTypesList, )); diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index ffe4115..8ceed71 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -1,6 +1,3 @@ -

    ' . __('Browse Vocabularies') . ''; @@ -25,13 +22,8 @@ ItemRelationsProperty} where label = '$subject'"; - $subject_id = $db->fetchOne($sql); - echo $this->formSelect('item_relations_subject_property[' . $subjectRelation['item_relation_id'] . ']', - $subject_id, + $subjectRelation['subject_id'], array( 'id' => 'item_relations_subject_property_' . $subjectRelation['item_relation_id'], 'multiple' => false, From 7545dc4af60d59d01df0610b548068f610d2a4aa Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 25/66] Simplified form to display only the used item types. --- views/helpers/ItemRelationsForm.php | 35 ++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/views/helpers/ItemRelationsForm.php b/views/helpers/ItemRelationsForm.php index ff65ed6..3d5484a 100644 --- a/views/helpers/ItemRelationsForm.php +++ b/views/helpers/ItemRelationsForm.php @@ -23,15 +23,11 @@ public function itemRelationsForm($item) $subjectRelation['subject_id'] = $db->fetchOne($sql, array($subjectRelation['relation_text'])); } - // Prepare list of item types for the select form. - $sql = "SELECT id, name from {$db->Item_Types} ORDER BY name"; - $itemtypes = $db->fetchAll($sql); + // Prepare list of used item types for the select form. $itemTypesList = array( '-1' => '- ' . __('All') . ' -', ); - foreach ($itemtypes as $type) { - $itemTypesList[$type['id']] = $type['name']; - } + $itemTypesList += $this->_getUsedItemTypes(); $html = $view->partial('common/item-relations-form.php', array( 'item' => $item, @@ -50,4 +46,31 @@ public function itemRelationsForm($item) return $html; } + + /** + * Get the list of used item types for select form. + * + * @return array + */ + protected function _getUsedItemTypes() + { + $db = get_db(); + + $itemTypesTable = $db->getTable('ItemType'); + $itemTypesAlias = $itemTypesTable->getTableAlias(); + + $select = $itemTypesTable->getSelect() + ->reset(Zend_Db_Select::COLUMNS) + ->from(array(), array($itemTypesAlias . '.id', $itemTypesAlias . '.name')) + ->joinInner(array('items' => $db->Item), "items.item_type_id = $itemTypesAlias.id", array()) + ->group($itemTypesAlias . '.id') + ->order($itemTypesAlias . '.name ASC'); + + $permissions = new Omeka_Db_Select_PublicPermissions('Items'); + $permissions->apply($select, 'items'); + + $itemTypes = $db->fetchPairs($select); + + return $itemTypes; + } } From 50bb359ce59db756d042b21e8b23d214a3093f7a Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 26/66] Secured an ajax input. --- controllers/LookupController.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/controllers/LookupController.php b/controllers/LookupController.php index a4eca05..3571be0 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -11,7 +11,10 @@ */ class ItemRelations_LookupController extends Omeka_Controller_AbstractActionController { - public function indexAction() { + public function indexAction() + { + $db = get_db(); + if (!$this->_hasParam('partial')) { $this->_setParam('partial', ''); } @@ -31,7 +34,7 @@ public function indexAction() { $partial = preg_replace('/[^ \.,\!\?\p{L}\p{N}\p{Mc}]/ui', '', $this->_getParam('partial')); $where_text = ''; if (strlen($partial) > 0) { - $where_text = "AND text RLIKE '$partial'"; + $where_text = 'AND text RLIKE ' . $db->quote($partial); } $item_type = intval($this->_getParam('item_type')); @@ -63,14 +66,13 @@ public function indexAction() { break; } - $title = 50; - $db = get_db(); + $titleId = 50; $query = <<Item} items LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) -WHERE elementtexts.element_id = $title +WHERE elementtexts.element_id = $titleId $where_item_type $where_text GROUP BY elementtexts.record_id @@ -88,7 +90,7 @@ public function indexAction() { FROM {$db->Item} items LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) -WHERE elementtexts.element_id = $title +WHERE elementtexts.element_id = $titleId $where_item_type $where_text GROUP BY elementtexts.record_id From a3264898c785b6b4aa4c232041d95e85b694421a Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 27/66] Secured sql used for update. --- ItemRelationsPlugin.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index f282daf..d3834b6 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -373,14 +373,14 @@ public function hookAfterSaveItem($args) $comments[$key] = $post['item_relations_subject_comment'][$key]; } } - $commentIds = implode(",", array_keys($comments)); + $commentIds = implode(',', array_keys($comments)); // Optimized the update query to avoid multiple execution. - $sql = "UPDATE `$db->ItemRelationsRelation` set relation_comment = case id "; + $sql = "UPDATE `$db->ItemRelationsRelation` SET relation_comment = CASE id "; foreach ($comments as $commentId => $comment) { - $sql .= sprintf(" when %d then '%s'", $commentId, addslashes($comment) ); + $sql .= sprintf(' WHEN %d THEN %s', $commentId, $db->quote($comment)); } - $sql .= " end where id in ($commentIds)"; + $sql .= " END WHERE id IN ($commentIds)"; $db->query($sql); } else { @@ -401,14 +401,14 @@ public function hookAfterSaveItem($args) } } } - $propertyIds = implode(",", array_keys($properties)); + $propertyIds = implode(',', array_keys($properties)); // Optimized the update query to avoid multiple execution. - $sql = "UPDATE `$db->ItemRelationsRelation` set property_id = case id "; + $sql = "UPDATE `$db->ItemRelationsRelation` SET property_id = CASE id "; foreach ($properties as $propertyId => $property) { - $sql .= sprintf(" when %d then %d", $propertyId, $property); + $sql .= sprintf(' WHEN %d THEN %d', $propertyId, $property); } - $sql .= " end where id in ($propertyIds)"; + $sql .= " END WHERE id IN ($propertyIds)"; $db->query($sql); } else { From 55c00fb12f4211cb615842b40a0eeb1952911450 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 28/66] Simplified the send of the json metadata for ajax. --- controllers/LookupController.php | 4 +++- views/admin/lookup/index.php | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 views/admin/lookup/index.php diff --git a/controllers/LookupController.php b/controllers/LookupController.php index 3571be0..f6a6613 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -108,9 +108,11 @@ public function indexAction() ); } - $this->view->metadata = array( + $metadata = array( 'count' => $m_count, 'items' => $m_items, ); + + $this->_helper->json($metadata); } } diff --git a/views/admin/lookup/index.php b/views/admin/lookup/index.php deleted file mode 100644 index 866ddc2..0000000 --- a/views/admin/lookup/index.php +++ /dev/null @@ -1,3 +0,0 @@ -metadata); -?> From 8c297e90c865c3214317d6f1098bca3b336bf3fc Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 29/66] Added an option to limit the vocabularies to use. --- ItemRelationsPlugin.php | 21 +++++++++++++ .../plugins/item-relations-config-form.php | 30 +++++++++++++++++++ views/admin/vocabularies/browse.php | 7 ++++- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index d3834b6..382f835 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -40,12 +40,14 @@ class ItemRelationsPlugin extends Omeka_Plugin_AbstractPlugin protected $_filters = array( 'admin_items_form_tabs', 'admin_navigation_main', + 'item_relations_properties_select_options', ); /** * @var array Options and their default values. */ protected $_options = array( + 'item_relations_allow_vocabularies' => '[]', 'item_relations_provide_relation_comments' => 0, 'item_relations_relation_format' => 'prefix_local_part', 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', @@ -170,6 +172,11 @@ public function hookConfig($args) { $post = $args['post']; foreach ($this->_options as $optionKey => $optionValue) { + if (in_array($optionKey, array( + 'item_relations_allow_vocabularies', + ))) { + $post[$optionKey] = json_encode($post[$optionKey]) ?: json_encode(array()); + } if (isset($post[$optionKey])) { set_option($optionKey, $post[$optionKey]); } @@ -577,6 +584,20 @@ public function filterAdminItemsFormTabs($tabs, $args) return $tabs; } + /** + * Add the "Item Relations" tab to the admin items add/edit page. + * + * @return array + */ + public function filterItemRelationsPropertiesSelectOptions($selectOptions) + { + $allowedVocabularies = json_decode(get_option('item_relations_allow_vocabularies')); + if (!empty($allowedVocabularies)) { + $selectOptions = array_intersect_key($selectOptions, array_flip($allowedVocabularies)); + } + return $selectOptions; + } + /** * Prepare subject item relations for display. * diff --git a/views/admin/plugins/item-relations-config-form.php b/views/admin/plugins/item-relations-config-form.php index 572d074..da00bb1 100644 --- a/views/admin/plugins/item-relations-config-form.php +++ b/views/admin/plugins/item-relations-config-form.php @@ -1,4 +1,34 @@

    +
    +
    + formLabel('item_relations_allow_vocabularies', + __('Limit Relations to Vocabularies')); ?> +

    +
    +
    +

    + +

    +
    + '; + foreach ($vocabularies as $vocabulary) { + echo '
  • '; + echo $this->formCheckbox('item_relations_allow_vocabularies[]', $vocabulary->name, + array('checked' => in_array($vocabulary->name, $currentVocabularies) ? 'checked' : '')); + echo $vocabulary->name; + echo '
  • '; + } + echo ''; + ?> +
    +
    +
    formLabel('item_relations_provide_relation_comments', diff --git a/views/admin/vocabularies/browse.php b/views/admin/vocabularies/browse.php index 2620e71..13631d3 100644 --- a/views/admin/vocabularies/browse.php +++ b/views/admin/vocabularies/browse.php @@ -1,8 +1,12 @@ - __('Browse Vocabularies'))); ?> + __('Browse Vocabularies'))); +?> + @@ -12,6 +16,7 @@ item_relations_vocabularies as $vocabulary): ?> + From 6cb2caa78e38d3ba7485e8a1915cb41749ec2438 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 30/66] Improved queries to get relations. --- ItemRelationsPlugin.php | 16 ++++++-------- models/Table/ItemRelationsRelation.php | 30 ++++++++++++++++++++------ 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 382f835..672ddb8 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -606,18 +606,16 @@ public function filterItemRelationsPropertiesSelectOptions($selectOptions) */ public static function prepareSubjectRelations(Item $item) { - $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id); + $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id, true); $subjectRelations = array(); foreach ($subjects as $subject) { - if (!($item = get_record_by_id('item', $subject->object_item_id))) { - continue; - } + $objectItem = get_record_by_id('Item', $subject->object_item_id); $subjectRelations[] = array( 'item_relation_id' => $subject->id, 'object_item_id' => $subject->object_item_id, + 'object_item_title' => self::getItemTitle($objectItem), 'relation_comment' => $subject->relation_comment, - 'object_item_title' => self::getItemTitle($item), 'relation_text' => $subject->getPropertyText(), 'relation_description' => $subject->property_description, ); @@ -633,17 +631,15 @@ public static function prepareSubjectRelations(Item $item) */ public static function prepareObjectRelations(Item $item) { - $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id); + $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id, true); $objectRelations = array(); foreach ($objects as $object) { - if (!($item = get_record_by_id('item', $object->subject_item_id))) { - continue; - } + $subjectItem = get_record_by_id('Item', $object->subject_item_id); $objectRelations[] = array( 'item_relation_id' => $object->id, 'subject_item_id' => $object->subject_item_id, + 'subject_item_title' => self::getItemTitle($subjectItem), 'relation_comment' => $object->relation_comment, - 'subject_item_title' => self::getItemTitle($item), 'relation_text' => $object->getPropertyText(), 'relation_description' => $object->property_description, ); diff --git a/models/Table/ItemRelationsRelation.php b/models/Table/ItemRelationsRelation.php index 859e50f..75cbe4b 100644 --- a/models/Table/ItemRelationsRelation.php +++ b/models/Table/ItemRelationsRelation.php @@ -20,7 +20,7 @@ class Table_ItemRelationsRelation extends Omeka_Db_Table */ public function getSelect() { - $db = $this->getDb(); + $db = $this->_db; return parent::getSelect() ->join( array('item_relations_properties' => $db->ItemRelationsProperty), @@ -41,27 +41,45 @@ public function getSelect() /** * Find item relations by subject item ID. - * + * + * @param integer $subjectItemId + * @param boolean $onlyExistingObjectItems * @return array */ - public function findBySubjectItemId($subjectItemId) + public function findBySubjectItemId($subjectItemId, $onlyExistingObjectItems = true) { $db = $this->getDb(); $select = $this->getSelect() ->where('item_relations_relations.subject_item_id = ?', (int) $subjectItemId); + if ($onlyExistingObjectItems) { + $select->join( + array('items' => $db->Item), + 'items.id = item_relations_relations.object_item_id', + array() + ); + } return $this->fetchObjects($select); } - + /** * Find item relations by object item ID. - * + * + * @param integer $objectItemId + * @param boolean $onlyExistingSubjectItems * @return array */ - public function findByObjectItemId($objectItemId) + public function findByObjectItemId($objectItemId, $onlyExistingSubjectItems = true) { $db = $this->getDb(); $select = $this->getSelect() ->where('item_relations_relations.object_item_id = ?', (int) $objectItemId); + if ($onlyExistingSubjectItems) { + $select->join( + array('items' => $db->Item), + 'items.id = item_relations_relations.subject_item_id', + array() + ); + } return $this->fetchObjects($select); } } From 5e3f8c2e47d4df531a479b5be7cf18e30d0b76ce Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 31/66] Added an option to display relations by item type. --- ItemRelationsPlugin.php | 9 ++- views/admin/common/item-relations-show.php | 36 ++-------- .../plugins/item-relations-config-form.php | 20 ++++++ views/public/common/item-relations-show.php | 35 +++------- views/shared/common/item-relations-form.php | 4 +- .../item-relations-show-list-by-item-type.php | 70 +++++++++++++++++++ .../common/item-relations-show-list.php | 27 +++++++ .../common/item-relations-show-table.php | 23 ++++++ 8 files changed, 164 insertions(+), 60 deletions(-) create mode 100644 views/shared/common/item-relations-show-list-by-item-type.php create mode 100644 views/shared/common/item-relations-show-list.php create mode 100644 views/shared/common/item-relations-show-table.php diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 672ddb8..f5ebd9b 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -52,6 +52,7 @@ class ItemRelationsPlugin extends Omeka_Plugin_AbstractPlugin 'item_relations_relation_format' => 'prefix_local_part', 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', 'item_relations_public_append_to_items_show' => 1, + 'item_relations_public_display_mode' => 'table', ); /** @@ -276,6 +277,7 @@ public function hookPublicItemsShow() $item = get_current_record('item'); echo common('item-relations-show', array( + 'item' => $item, 'subjectRelations' => self::prepareSubjectRelations($item), 'objectRelations' => self::prepareObjectRelations($item), )); @@ -294,6 +296,7 @@ public function hookAdminItemsShow($args) $item = $args['item']; echo common('item-relations-show', array( + 'item' => $item, 'subjectRelations' => self::prepareSubjectRelations($item), 'objectRelations' => self::prepareObjectRelations($item), )); @@ -312,6 +315,7 @@ public function hookAdminItemsShowSidebar($args) $item = $args['item']; echo common('item-relations-show', array( + 'item' => $item, 'subjectRelations' => self::prepareSubjectRelations($item), 'objectRelations' => self::prepareObjectRelations($item), )); @@ -608,12 +612,11 @@ public static function prepareSubjectRelations(Item $item) { $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id, true); $subjectRelations = array(); - foreach ($subjects as $subject) { $objectItem = get_record_by_id('Item', $subject->object_item_id); $subjectRelations[] = array( 'item_relation_id' => $subject->id, - 'object_item_id' => $subject->object_item_id, + 'object_item' => $objectItem, 'object_item_title' => self::getItemTitle($objectItem), 'relation_comment' => $subject->relation_comment, 'relation_text' => $subject->getPropertyText(), @@ -637,7 +640,7 @@ public static function prepareObjectRelations(Item $item) $subjectItem = get_record_by_id('Item', $object->subject_item_id); $objectRelations[] = array( 'item_relation_id' => $object->id, - 'subject_item_id' => $object->subject_item_id, + 'subject_item' => $subjectItem, 'subject_item_title' => self::getItemTitle($subjectItem), 'relation_comment' => $object->relation_comment, 'relation_text' => $object->getPropertyText(), diff --git a/views/admin/common/item-relations-show.php b/views/admin/common/item-relations-show.php index 05d9ed2..9155a52 100644 --- a/views/admin/common/item-relations-show.php +++ b/views/admin/common/item-relations-show.php @@ -1,4 +1,3 @@ -

    - -
      - -
    • - - - - -
    • - - -
    • - - - - -
    • - -
    - + $item, + 'subjectRelations' => $subjectRelations, + 'objectRelations' => $objectRelations, + )); + endif; ?> diff --git a/views/admin/plugins/item-relations-config-form.php b/views/admin/plugins/item-relations-config-form.php index da00bb1..e08c13a 100644 --- a/views/admin/plugins/item-relations-config-form.php +++ b/views/admin/plugins/item-relations-config-form.php @@ -99,4 +99,24 @@ null, array('checked' => get_option('item_relations_public_append_to_items_show'))); ?> +
    +
    + formLabel('item_relations_public_display_mode', + __('Public Display Mode')); ?> +
    +
    +

    + +

    + formSelect('item_relations_public_display_mode', + get_option('item_relations_public_display_mode'), null, array( + 'table' => __('As a table'), + 'list' => __('As a list'), + 'list-by-item-type' => __('By item type'), + )); ?> +
    +
    diff --git a/views/public/common/item-relations-show.php b/views/public/common/item-relations-show.php index a771f98..76dee45 100644 --- a/views/public/common/item-relations-show.php +++ b/views/public/common/item-relations-show.php @@ -1,30 +1,13 @@ -

    - +

    - -
    name, $allowedVocabularies) ? __('Yes') : __('No'); ?> id}")); ?>">name; ?> description; ?> custom ? 'n/a' : $vocabulary->namespace_prefix; ?>
    - - - - - - - - - - - - - - - - - - - - -
    Item:
    Item:
    - + $item, + 'subjectRelations' => $subjectRelations, + 'objectRelations' => $objectRelations, + )); + endif; ?>
    diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index 8ceed71..c627fbf 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -31,7 +31,7 @@ ), array_slice($formSelectProperties, 1)); ?> - + '_blank'), 'show', $subjectRelation['object_item']); ?> @@ -40,7 +40,7 @@ - + '_blank'), 'show', $objectRelation['subject_item']); ?> diff --git a/views/shared/common/item-relations-show-list-by-item-type.php b/views/shared/common/item-relations-show-list-by-item-type.php new file mode 100644 index 0000000..325d00f --- /dev/null +++ b/views/shared/common/item-relations-show-list-by-item-type.php @@ -0,0 +1,70 @@ +item_type_id; + $subjectRelationsByObjectType[$typeId][] = $subjectRelation; + } + $objectRelationsBySubjectType = array(); + foreach ($objectRelations as $objectRelation) { + $typeId = (integer) $objectRelation['subject_item']->item_type_id; + $objectRelationsBySubjectType[$typeId][] = $objectRelation; + } + // Prepare the list of types with one query. + $itemTypes = array(); + foreach (get_records('ItemType', array(), 0) as $itemType) { + $itemTypes[$itemType->id] = $itemType; + } +?> +

    + +

    + +
      + $relations): ?> +
    • name) : __('No Item Type'); ?> +
        + +
      • + + [] + +
      • + +
      +
    • + +
    + + +

    + +

    + +

      + $relations): ?> +
    • name) : __('No Item Type'); ?> +
        + +
      • + + [] + +
      • + +
      +
    • + +
    + diff --git a/views/shared/common/item-relations-show-list.php b/views/shared/common/item-relations-show-list.php new file mode 100644 index 0000000..2688ae1 --- /dev/null +++ b/views/shared/common/item-relations-show-list.php @@ -0,0 +1,27 @@ + +
      + +
    • + + + + +
    • + + +
    • + + + + +
    • + +
    diff --git a/views/shared/common/item-relations-show-table.php b/views/shared/common/item-relations-show-table.php new file mode 100644 index 0000000..ff3292c --- /dev/null +++ b/views/shared/common/item-relations-show-table.php @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + +
    From 0290fdd498de3aa4336f717fa688448354f361b5 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 23 Nov 2015 00:00:00 +0100 Subject: [PATCH 32/66] Added Readme. --- README.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..be6aa99 --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +Item Relations (plugin for Omeka) +================================= + +[Item Relations] is a plugin for [Omeka] that lets you define relations between +items. For example, you can make one item a part of another item, where +"part of" is the relation. You can also make one item a "reproduction of" or a +"translation of" another item. + +We've bundled the plugin with common relations derived from several formal +vocabularies, like Dublin Core and FRBR. You can use these or you could populate +a custom vocabulary with the relations needed in your archive. You could, for +example, define custom relations like "is parent of", "is better than", and +"fits within". + +See http://omeka.org/codex/Plugins/ItemRelations for more info. + +This fork adds a quick visual selector and made the item relations themable. + + +Installation +------------ + +Uncompress files and rename plugin folder "ItemRelations". + +Then install it like any other Omeka plugin and follow the config instructions. + + +Warning +------- + +Use it at your own risk. + +It's always recommended to backup your files and database regularly so you can +roll back if needed. + + +Troubleshooting +--------------- + +See online [plugin issues] and [fork issues]. + + +License +------- + +This plugin is published under [GNU/GPL]. + +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, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +Contact +------- + +Current maintainers: + +* [Center for History & New Media] +* [GerZah] +* Daniel Berthereau (see [Daniel-KM]) + + +Copyright +--------- + +* Copyright Center for History and New Media, 2011-2015 +* Copyright GerZah, 2015 +* Copyright Daniel Berthereau, 2015 + + +[Item Relations]: https://github.com/omeka/plugin-ItemRelations +[Omeka]: https://omeka.org +[plugin issues]: https://github.com/omeka/plugin-ItemRelations/issues +[fork issues]: https://github.com/Daniel-KM/ItemRelations/issues +[GNU/GPL]: https://www.gnu.org/licenses/gpl-3.0.html +[Center for History & New Media]: http://chnm.gmu.edu +[GerZah]: https://github.com/GerZah +[Daniel-KM]: https://github.com/Daniel-KM "Daniel Berthereau" From f52760357501258ba8f99d88b2d6c66517cd1b38 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Mon, 23 Nov 2015 18:50:00 +0100 Subject: [PATCH 33/66] =?UTF-8?q?Manual=20rollback=20to=20before=20pull=20?= =?UTF-8?q?request=20merge=20=E2=80=93=C2=A0new=20version=20will=20be=20ad?= =?UTF-8?q?dressed=20after=20latest=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ItemRelationsPlugin.php | 1306 ++++++++--------- README.md | 88 -- config_form.php | 55 + controllers/LookupController.php | 18 +- item_relations_form.php | 124 ++ ...m-relations.js => item_relations_script.js | 0 item_relations_styles.css | 7 + .../shared/javascripts/lity => lity}/lity.css | 0 .../shared/javascripts/lity => lity}/lity.js | 0 .../javascripts/lity => lity}/lity.min.css | 0 .../javascripts/lity => lity}/lity.min.js | 0 models/Table/ItemRelationsRelation.php | 30 +- views/admin/common/item-relations-show.php | 36 +- views/admin/lookup/index.php | 3 + .../plugins/item-relations-config-form.php | 122 -- views/admin/vocabularies/browse.php | 7 +- views/helpers/ItemRelationsForm.php | 76 - views/public/common/item-relations-show.php | 35 +- views/shared/common/item-relations-form.php | 104 -- .../item-relations-show-list-by-item-type.php | 70 - .../common/item-relations-show-list.php | 27 - .../common/item-relations-show-table.php | 23 - views/shared/css/item-relations.css | 15 - 23 files changed, 904 insertions(+), 1242 deletions(-) delete mode 100644 README.md create mode 100644 config_form.php create mode 100644 item_relations_form.php rename views/shared/javascripts/item-relations.js => item_relations_script.js (100%) create mode 100644 item_relations_styles.css rename {views/shared/javascripts/lity => lity}/lity.css (100%) rename {views/shared/javascripts/lity => lity}/lity.js (100%) rename {views/shared/javascripts/lity => lity}/lity.min.css (100%) rename {views/shared/javascripts/lity => lity}/lity.min.js (100%) create mode 100644 views/admin/lookup/index.php delete mode 100644 views/admin/plugins/item-relations-config-form.php delete mode 100644 views/helpers/ItemRelationsForm.php delete mode 100644 views/shared/common/item-relations-form.php delete mode 100644 views/shared/common/item-relations-show-list-by-item-type.php delete mode 100644 views/shared/common/item-relations-show-list.php delete mode 100644 views/shared/common/item-relations-show-table.php delete mode 100644 views/shared/css/item-relations.css diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index f5ebd9b..5d532a7 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -1,709 +1,695 @@ '[]', - 'item_relations_provide_relation_comments' => 0, - 'item_relations_relation_format' => 'prefix_local_part', - 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', - 'item_relations_public_append_to_items_show' => 1, - 'item_relations_public_display_mode' => 'table', - ); - - /** - * Install the plugin. - */ - public function hookInstall() - { - // Create tables. - $db = $this->_db; - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsVocabulary` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `description` text, - `namespace_prefix` varchar(100) NOT NULL, - `namespace_uri` varchar(200) DEFAULT NULL, - `custom` BOOLEAN NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsProperty` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `vocabulary_id` int(10) unsigned NOT NULL, - `local_part` varchar(100) NOT NULL, - `label` varchar(100) DEFAULT NULL, - `description` text, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsRelation` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `subject_item_id` int(10) unsigned NOT NULL, - `property_id` int(10) unsigned NOT NULL, - `object_item_id` int(10) unsigned NOT NULL, - `relation_comment` varchar(60) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - // Install the formal vocabularies and their properties. - self::hookInitialize(); // Make sure that the i18n file is already loaded - $formalVocabularies = include 'formal_vocabularies.php'; - foreach ($formalVocabularies as $formalVocabulary) { - $vocabulary = new ItemRelationsVocabulary; - $vocabulary->name = $formalVocabulary['name']; - $vocabulary->description = $formalVocabulary['description']; - $vocabulary->namespace_prefix = $formalVocabulary['namespace_prefix']; - $vocabulary->namespace_uri = $formalVocabulary['namespace_uri']; - $vocabulary->custom = 0; - $vocabulary->save(); - - $vocabularyId = $vocabulary->id; - - foreach ($formalVocabulary['properties'] as $formalProperty) { - $property = new ItemRelationsProperty; - $property->vocabulary_id = $vocabularyId; - $property->local_part = $formalProperty['local_part']; - $property->label = $formalProperty['label']; - $property->description = $formalProperty['description']; - $property->save(); - } - } - - // Install a custom vocabulary. - $customVocabulary = new ItemRelationsVocabulary; - $customVocabulary->name = __('Custom'); - $customVocabulary->description = __('Custom vocabulary containing relations defined for this Omeka instance.'); - $customVocabulary->namespace_prefix = ''; // cannot be NULL - $customVocabulary->namespace_uri = null; - $customVocabulary->custom = 1; - $customVocabulary->save(); - - $this->_installOptions(); + /** + * @var array Hooks for the plugin. + */ + protected $_hooks = array( + 'install', + 'uninstall', + 'upgrade', + 'config', + 'config_form', + 'define_acl', + 'initialize', + 'after_save_item', + 'after_delete_item', + 'admin_items_show', + 'admin_items_show_sidebar', + 'admin_items_search', + 'admin_items_batch_edit_form', + 'items_batch_edit_custom', + 'public_items_show', + 'public_items_search', + 'items_browse_sql', + ); + + /** + * @var array Filters for the plugin. + */ + protected $_filters = array( + 'admin_items_form_tabs', + 'admin_navigation_main', + ); + + /** + * @var array Options and their default values. + */ + protected $_options = array( + 'item_relations_public_append_to_items_show' => 1, + 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', // maincontent + 'item_relations_provide_relation_comments' => 0, + 'item_relations_relation_format' => 'prefix_local_part' + ); + + /** + * Install the plugin. + */ + public function hookInstall() + { + // Create tables. + $db = $this->_db; + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsVocabulary` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `description` text, + `namespace_prefix` varchar(100) NOT NULL, + `namespace_uri` varchar(200) DEFAULT NULL, + `custom` BOOLEAN NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsProperty` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vocabulary_id` int(10) unsigned NOT NULL, + `local_part` varchar(100) NOT NULL, + `label` varchar(100) DEFAULT NULL, + `description` text, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsRelation` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `subject_item_id` int(10) unsigned NOT NULL, + `property_id` int(10) unsigned NOT NULL, + `object_item_id` int(10) unsigned NOT NULL, + `relation_comment` varchar(60) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + // Install the formal vocabularies and their properties. + self::hookInitialize(); // Make sure that the i18n file is already loaded + $formalVocabularies = include 'formal_vocabularies.php'; + foreach ($formalVocabularies as $formalVocabulary) { + $vocabulary = new ItemRelationsVocabulary; + $vocabulary->name = $formalVocabulary['name']; + $vocabulary->description = $formalVocabulary['description']; + $vocabulary->namespace_prefix = $formalVocabulary['namespace_prefix']; + $vocabulary->namespace_uri = $formalVocabulary['namespace_uri']; + $vocabulary->custom = 0; + $vocabulary->save(); + + $vocabularyId = $vocabulary->id; + + foreach ($formalVocabulary['properties'] as $formalProperty) { + $property = new ItemRelationsProperty; + $property->vocabulary_id = $vocabularyId; + $property->local_part = $formalProperty['local_part']; + $property->label = $formalProperty['label']; + $property->description = $formalProperty['description']; + $property->save(); + } } - /** - * Uninstall the plugin. - */ - public function hookUninstall() - { - $db = $this->_db; - - // Drop the vocabularies table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsVocabulary`"; - $db->query($sql); - - // Drop the properties table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsProperty`"; - $db->query($sql); + // Install a custom vocabulary. + $customVocabulary = new ItemRelationsVocabulary; + $customVocabulary->name = __('Custom'); + $customVocabulary->description = __('Custom vocabulary containing relations defined for this Omeka instance.'); + $customVocabulary->namespace_prefix = ''; // cannot be NULL + $customVocabulary->namespace_uri = null; + $customVocabulary->custom = 1; + $customVocabulary->save(); + + $this->_installOptions(); + } + + /** + * Uninstall the plugin. + */ + public function hookUninstall() + { + $db = $this->_db; + + // Drop the vocabularies table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsVocabulary`"; + $db->query($sql); + + // Drop the properties table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsProperty`"; + $db->query($sql); + + // Drop the relations table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsRelation`"; + $db->query($sql); + + $this->_uninstallOptions(); + } + + /** + * Display the plugin configuration form. + */ + public static function hookConfigForm() + { + $publicAppendToItemsShow = get_option('item_relations_public_append_to_items_show'); + $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); + $provideRelationComments = get_option('item_relations_provide_relation_comments'); + $relationFormat = get_option('item_relations_relation_format'); + + require dirname(__FILE__) . '/config_form.php'; + } + + /** + * Handle the plugin configuration form. + */ + public static function hookConfig() + { + set_option('item_relations_public_append_to_items_show', + (int)(boolean) $_POST['item_relations_public_append_to_items_show']); + set_option('item_relations_admin_sidebar_or_maincontent', + $_POST['item_relations_admin_sidebar_or_maincontent']); + set_option('item_relations_provide_relation_comments', + (int)(boolean) $_POST['item_relations_provide_relation_comments']); + set_option('item_relations_relation_format', + $_POST['item_relations_relation_format']); + } + + /** + * Upgrade the plugin. + * + * @param array $args + */ + public function hookUpgrade($args) + { + $oldVersion = $args['old_version']; + $db = $this->_db; + if ($oldVersion <= '1.1') { + $sql = " + INSERT INTO `{$db->ItemRelationsProperty}` + (`vocabulary_id`, `local_part`, `label`, `description`) + VALUES + (1, 'abstract', 'Abstract', 'A summary of the resource.'), + (1, 'accessRights', 'Access Rights', 'Information about who can access the resource or an indication of its security status.'), + (1, 'accrualMethod', 'Accrual Method', 'The method by which items are added to a collection.'), + (1, 'accrualPeriodicity', 'Accrual Periodicity', 'The frequency with which items are added to a collection.'), + (1, 'accrualPolicy', 'Accrual Policy', 'The policy governing the addition of items to a collection.'), + (1, 'audience', 'Audience', 'A class of entity for whom the resource is intended or useful.'), + (1, 'contributor', 'Contributor', 'An entity responsible for making contributions to the resource.'), + (1, 'coverage', 'Coverage', 'The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.'), + (1, 'creator', 'Creator', 'An entity primarily responsible for making the resource.'), + (1, 'description', 'Description', 'An account of the resource.'), + (1, 'educationLevel', 'Audience Education Level', 'A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'), + (1, 'extent', 'Extent', 'The size or duration of the resource.'), + (1, 'format', 'Format', 'The file format, physical medium, or dimensions of the resource.'), + (1, 'instructionalMethod', 'Instructional Method', 'A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'), + (1, 'language', 'Language', 'A language of the resource.'), + (1, 'license', 'License', 'A legal document giving official permission to do something with the resource.'), + (1, 'mediator', 'Mediator', 'An entity that mediates access to the resource and for whom the resource is intended or useful.'), + (1, 'medium', 'Medium', 'The material or physical carrier of the resource.'), + (1, 'provenance', 'Provenance', 'A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.'), + (1, 'publisher', 'Publisher', 'An entity responsible for making the resource available.'), + (1, 'rights', 'Rights', 'Information about rights held in and over the resource.'), + (1, 'rightsHolder', 'Rights Holder', 'A person or organization owning or managing rights over the resource.'), + (1, 'spatial', 'Spatial Coverage', 'Spatial characteristics of the resource.'), + (1, 'subject', 'Subject', 'The topic of the resource.'), + (1, 'tableOfContents', 'Table Of Contents', 'A list of subunits of the resource.'), + (1, 'temporal', 'Temporal Coverage', 'Temporal characteristics of the resource.'), + (1, 'type', 'Type', 'The nature or genre of the resource.')"; + $db->query($sql); + } - // Drop the relations table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsRelation`"; + if ($oldVersion <= '2.0') { + // Fix un-upgraded old table name if present. + $correctTableName = (bool) $db->fetchOne("SHOW TABLES LIKE '{$db->ItemRelationsRelation}'"); + if (!$correctTableName) { + $sql = "RENAME TABLE `{$db->prefix}item_relations_item_relations` TO `{$db->ItemRelationsRelation}`"; $db->query($sql); - - $this->_uninstallOptions(); + } } - /** - * Display the plugin configuration form. - */ - public function hookConfigForm($args) - { - $view = get_view(); - echo $view->partial( - 'plugins/item-relations-config-form.php' - ); + if ($oldVersion <= '2.21') { + // Insert relation_comment column + $sql = "ALTER TABLE `{$db->prefix}item_relations_relations` ADD `relation_comment` VARCHAR(60) NOT NULL DEFAULT '' AFTER `object_item_id`"; + $db->query($sql); } - /** - * Handle the plugin configuration form. - */ - public function hookConfig($args) - { - $post = $args['post']; - foreach ($this->_options as $optionKey => $optionValue) { - if (in_array($optionKey, array( - 'item_relations_allow_vocabularies', - ))) { - $post[$optionKey] = json_encode($post[$optionKey]) ?: json_encode(array()); - } - if (isset($post[$optionKey])) { - set_option($optionKey, $post[$optionKey]); - } - } + } + + /** + * Add the translations. + */ + public function hookInitialize() + { + add_translation_source(dirname(__FILE__) . '/languages'); + } + + /** + * Define the ACL. + * + * @param array $args + */ + public function hookDefineAcl($args) + { + $acl = $args['acl']; + + $indexResource = new Zend_Acl_Resource('ItemRelations_Index'); + $vocabResource = new Zend_Acl_Resource('ItemRelations_Vocabularies'); + $acl->add($indexResource); + $acl->add($vocabResource); + } + + /** + * Display item relations on the public items show page. + */ + public function hookPublicItemsShow() { + if (get_option('item_relations_public_append_to_items_show')) { + $item = get_current_record('item'); + + echo common('item-relations-show', array( + 'subjectRelations' => self::prepareSubjectRelations($item), + 'objectRelations' => self::prepareObjectRelations($item) + )); } - - /** - * Upgrade the plugin. - * - * @param array $args - */ - public function hookUpgrade($args) - { - $oldVersion = $args['old_version']; - $db = $this->_db; - - if ($oldVersion <= '1.1') { - $sql = " - INSERT INTO `{$db->ItemRelationsProperty}` - (`vocabulary_id`, `local_part`, `label`, `description`) - VALUES - (1, 'abstract', 'Abstract', 'A summary of the resource.'), - (1, 'accessRights', 'Access Rights', 'Information about who can access the resource or an indication of its security status.'), - (1, 'accrualMethod', 'Accrual Method', 'The method by which items are added to a collection.'), - (1, 'accrualPeriodicity', 'Accrual Periodicity', 'The frequency with which items are added to a collection.'), - (1, 'accrualPolicy', 'Accrual Policy', 'The policy governing the addition of items to a collection.'), - (1, 'audience', 'Audience', 'A class of entity for whom the resource is intended or useful.'), - (1, 'contributor', 'Contributor', 'An entity responsible for making contributions to the resource.'), - (1, 'coverage', 'Coverage', 'The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.'), - (1, 'creator', 'Creator', 'An entity primarily responsible for making the resource.'), - (1, 'description', 'Description', 'An account of the resource.'), - (1, 'educationLevel', 'Audience Education Level', 'A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'), - (1, 'extent', 'Extent', 'The size or duration of the resource.'), - (1, 'format', 'Format', 'The file format, physical medium, or dimensions of the resource.'), - (1, 'instructionalMethod', 'Instructional Method', 'A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'), - (1, 'language', 'Language', 'A language of the resource.'), - (1, 'license', 'License', 'A legal document giving official permission to do something with the resource.'), - (1, 'mediator', 'Mediator', 'An entity that mediates access to the resource and for whom the resource is intended or useful.'), - (1, 'medium', 'Medium', 'The material or physical carrier of the resource.'), - (1, 'provenance', 'Provenance', 'A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.'), - (1, 'publisher', 'Publisher', 'An entity responsible for making the resource available.'), - (1, 'rights', 'Rights', 'Information about rights held in and over the resource.'), - (1, 'rightsHolder', 'Rights Holder', 'A person or organization owning or managing rights over the resource.'), - (1, 'spatial', 'Spatial Coverage', 'Spatial characteristics of the resource.'), - (1, 'subject', 'Subject', 'The topic of the resource.'), - (1, 'tableOfContents', 'Table Of Contents', 'A list of subunits of the resource.'), - (1, 'temporal', 'Temporal Coverage', 'Temporal characteristics of the resource.'), - (1, 'type', 'Type', 'The nature or genre of the resource.')"; - $db->query($sql); - } - - if ($oldVersion <= '2.0') { - // Fix un-upgraded old table name if present. - $correctTableName = (bool) $db->fetchOne("SHOW TABLES LIKE '{$db->ItemRelationsRelation}'"); - if (!$correctTableName) { - $sql = "RENAME TABLE `{$db->prefix}item_relations_item_relations` TO `{$db->ItemRelationsRelation}`"; - $db->query($sql); - } - } - - if ($oldVersion < '2.0.2.1') { - // Insert relation_comment column - $sql = "ALTER TABLE `{$db->prefix}item_relations_relations` ADD `relation_comment` VARCHAR(60) NOT NULL DEFAULT '' AFTER `object_item_id`"; - $db->query($sql); - } + } + + /** + * Display item relations on the admin items show page underneath main content. + * + * @param Item $item + */ + public function hookAdminItemsShow($args) + { + $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); + if ($adminSidebarOrMaincontent == "maincontent"): + + $item = $args['item']; + + echo common('item-relations-show', array( + 'subjectRelations' => self::prepareSubjectRelations($item), + 'objectRelations' => self::prepareObjectRelations($item) + )); + + endif; + } + + /** + * Display item relations on the admin items show page in the side bar in the lower right. + * + * @param Item $item + */ + public function hookAdminItemsShowSidebar($args) + { + $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); + if ($adminSidebarOrMaincontent != "maincontent"): + + $item = $args['item']; + + echo common('item-relations-show', array( + 'subjectRelations' => self::prepareSubjectRelations($item), + 'objectRelations' => self::prepareObjectRelations($item) + )); + + endif; + } + + /** + * Display the item relations form on the advanced search page. + */ + protected function _ItemsSearch() + { + echo common('item-relations-advanced-search', array( + 'formSelectProperties' => get_table_options('ItemRelationsProperty')) + ); + } + + /** + * Display the item relations form on the admin advanced search page. + */ + public function hookAdminItemsSearch() { SELF::_itemsSearch(); } + + /** + * Display the item relations form on the public advanced search page. + */ + public function hookPublicItemsSearch() { SELF::_itemsSearch(); } + + /** + * Save the item relations after saving an item add/edit form. + * + * @param array $args + */ + public function hookAfterSaveItem($args) + { + if (!$args['post']) { + return; } - /** - * Add the translations. - */ - public function hookInitialize() - { - add_translation_source(dirname(__FILE__) . '/languages'); - } + $record = $args['record']; + $post = $args['post']; + #echo "
    "; print_r($_POST); die("
    "); + $db = $this->_db; - /** - * Define the ACL. - * - * @param array $args - */ - public function hookDefineAcl($args) - { - $acl = $args['acl']; - - $indexResource = new Zend_Acl_Resource('ItemRelations_Index'); - $vocabResource = new Zend_Acl_Resource('ItemRelations_Vocabularies'); - $acl->add($indexResource); - $acl->add($vocabResource); + // Save item relations. + if (isset($post['item_relations_property_id'])) { + foreach ($post['item_relations_property_id'] as $key => $propertyId) { + self::insertItemRelation( + $record, + $propertyId, + $post['item_relations_item_relation_object_item_id'][$key], + $post['item_relations_item_relation_relation_comment'][$key] + ); } - - /** - * Display item relations on the public items show page. - */ - public function hookPublicItemsShow() - { - if (get_option('item_relations_public_append_to_items_show')) { - $item = get_current_record('item'); - - echo common('item-relations-show', array( - 'item' => $item, - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item), - )); - } + } + + // update the comment when the comment is edited in subject + if (isset($post['item_relations_item_relation_subject_comment'])) { + if (isset($post['item_relations_subject_comment'])) { + $comments = array(); + foreach($post['item_relations_item_relation_subject_comment'] as $key) { + $key = intval($key); + if ($key) { $comments[$key] = $post['item_relations_subject_comment'][$key]; } + } + $commentIds = implode(",", array_keys($comments)); + + //Optimized the update query to avoid multiple execution + $sql = "UPDATE `$db->ItemRelationsRelation` set relation_comment = case id "; + foreach ($comments as $commentId => $comment) { + $sql .= sprintf(" when %d then '%s'", $commentId, addslashes($comment) ); + } + $sql .= " end where id in ($commentIds)"; + $db->query($sql); } - - /** - * Display item relations on the admin items show page underneath main content. - * - * @param Item $item - */ - public function hookAdminItemsShow($args) - { - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - if ($adminSidebarOrMaincontent == "maincontent") { - $item = $args['item']; - - echo common('item-relations-show', array( - 'item' => $item, - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item), - )); - } + else { + $this->_helper->flashMessenger(__('There was an error in the item relation comments.'), 'error'); } - - /** - * Display item relations on the admin items show page in the side bar in the lower right. - * - * @param Item $item - */ - public function hookAdminItemsShowSidebar($args) - { - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - if ($adminSidebarOrMaincontent != "maincontent") { - $item = $args['item']; - - echo common('item-relations-show', array( - 'item' => $item, - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item), - )); + } + + // update the relation when the relation is edited in subject + if (isset($post['item_relations_item_relation_subject_property'])) { + if (isset($post['item_relations_subject_property'])) { + $properties = array(); + foreach($post['item_relations_item_relation_subject_property'] as $key) { + $key = intval($key); + if ($key) { + $val = intval($post['item_relations_subject_property'][$key]); + if ($val) { $properties[$key] = $val; } } + } + $propertyIds = implode(",", array_keys($properties)); + + //Optimized the update query to avoid multiple execution + $sql = "UPDATE `$db->ItemRelationsRelation` set property_id = case id "; + foreach ($properties as $propertyId => $property) { + $sql .= sprintf(" when %d then %d", $propertyId, $property); + } + $sql .= " end where id in ($propertyIds)"; + $db->query($sql); } - - /** - * Display the item relations form on the advanced search page. - */ - protected function _ItemsSearch() - { - echo common('item-relations-advanced-search', array( - 'formSelectProperties' => get_table_options('ItemRelationsProperty'), - )); + else { + $this->_helper->flashMessenger(__('There was an error in listing the item relation.'), 'error'); } - - /** - * Display the item relations form on the admin advanced search page. - */ - public function hookAdminItemsSearch() - { - self::_itemsSearch(); + } + + // Delete item relations. + if (isset($post['item_relations_item_relation_delete'])) { + foreach ($post['item_relations_item_relation_delete'] as $itemRelationId) { + $itemRelation = $db->getTable('ItemRelationsRelation')->find($itemRelationId); + // When an item is related to itself, deleting both relations + // simultaneously will result in an error. Prevent this by + // checking if the item relation exists prior to deletion. + if ($itemRelation) { + $itemRelation->delete(); + } } + } +} - /** - * Display the item relations form on the public advanced search page. - */ - public function hookPublicItemsSearch() { - self::_itemsSearch(); - } - - /** - * Save the item relations after saving an item add/edit form. - * - * @param array $args - */ - public function hookAfterSaveItem($args) - { - if (!$args['post']) { - return; - } - - $record = $args['record']; - $post = $args['post']; - $db = $this->_db; - - // Save item relations. - if (isset($post['item_relations_property_id'])) { - foreach ($post['item_relations_property_id'] as $key => $propertyId) { - self::insertItemRelation( - $record, - $propertyId, - $post['item_relations_item_relation_object_item_id'][$key], - $post['item_relations_item_relation_relation_comment'][$key] - ); - } - } +/** +* Delete an item's relations after deleting that item. +* +* @param array $args +*/ +public function hookAfterDeleteItem($args) +{ - // update the comment when the comment is edited in subject - if (isset($post['item_relations_item_relation_subject_comment'])) { - if (isset($post['item_relations_subject_comment'])) { - $comments = array(); - foreach($post['item_relations_item_relation_subject_comment'] as $key) { - $key = intval($key); - if ($key) { - $comments[$key] = $post['item_relations_subject_comment'][$key]; - } - } - $commentIds = implode(',', array_keys($comments)); - - // Optimized the update query to avoid multiple execution. - $sql = "UPDATE `$db->ItemRelationsRelation` SET relation_comment = CASE id "; - foreach ($comments as $commentId => $comment) { - $sql .= sprintf(' WHEN %d THEN %s', $commentId, $db->quote($comment)); - } - $sql .= " END WHERE id IN ($commentIds)"; - $db->query($sql); - } - else { - $this->_helper->flashMessenger(__('There was an error in the item relation comments.'), 'error'); - } - } + $db = $this->_db; - // Update the relation when the relation is edited in subject. - if (isset($post['item_relations_item_relation_subject_property'])) { - if (isset($post['item_relations_subject_property'])) { - $properties = array(); - foreach($post['item_relations_item_relation_subject_property'] as $key) { - $key = intval($key); - if ($key) { - $val = intval($post['item_relations_subject_property'][$key]); - if ($val) { - $properties[$key] = $val; - } - } - } - $propertyIds = implode(',', array_keys($properties)); - - // Optimized the update query to avoid multiple execution. - $sql = "UPDATE `$db->ItemRelationsRelation` SET property_id = CASE id "; - foreach ($properties as $propertyId => $property) { - $sql .= sprintf(' WHEN %d THEN %d', $propertyId, $property); - } - $sql .= " END WHERE id IN ($propertyIds)"; - $db->query($sql); - } - else { - $this->_helper->flashMessenger(__('There was an error in listing the item relation.'), 'error'); - } - } + $item_id = intval($args["record"]["id"]); - // Delete item relations. - if (isset($post['item_relations_item_relation_delete'])) { - foreach ($post['item_relations_item_relation_delete'] as $itemRelationId) { - $itemRelation = $db->getTable('ItemRelationsRelation')->find($itemRelationId); - // When an item is related to itself, deleting both relations - // simultaneously will result in an error. Prevent this by - // checking if the item relation exists prior to deletion. - if ($itemRelation) { - $itemRelation->delete(); - } - } - } - } - - /** - * Delete an item's relations after deleting that item. - * - * @param array $args - */ - public function hookAfterDeleteItem($args) - { - $db = $this->_db; + if ($item_id) { + $sql = "delete from `$db->ItemRelationsRelation` where subject_item_id=$item_id or object_item_id=$item_id"; + $db->query($sql); + } - $item_id = intval($args["record"]["id"]); +} - if ($item_id) { - $sql = "delete from `$db->ItemRelationsRelation` where subject_item_id=$item_id or object_item_id=$item_id"; - $db->query($sql); - } - } +/** +* Filter for an item relation after search page submission. +* +* @param array $args +*/ +public function hookItemsBrowseSql($args) +{ + $select = $args['select']; + $params = $args['params']; + + // Set the field on which to join. + if (isset($params['item_relations_clause_part']) + && $params['item_relations_clause_part'] == 'object' + ) { + $onField = 'object_item_id'; + } else { + $onField = 'subject_item_id'; + } + + $filter_relation=( isset($params['item_relations_property_id']) && is_numeric($params['item_relations_property_id']) ); + $filter_comment=( isset($params['item_relations_comment']) && (trim($params['item_relations_comment'])) ); + + if ( $filter_relation || $filter_comment ) { + + $db = $this->_db; + $select + ->join( + array('item_relations_relations' => $db->ItemRelationsRelation), + "item_relations_relations.$onField = items.id", + array() + ); + + if ($filter_relation) { + $select->where('item_relations_relations.property_id = ?', + $params['item_relations_property_id']); + } + + if ($filter_comment) { + $select->where('item_relations_relations.relation_comment LIKE ?', + "%".trim($params['item_relations_comment'])."%" ); + } - /** - * Filter for an item relation after search page submission. - * - * @param array $args - */ - public function hookItemsBrowseSql($args) - { - $select = $args['select']; - $params = $args['params']; - - // Set the field on which to join. - if (isset($params['item_relations_clause_part']) - && $params['item_relations_clause_part'] == 'object' - ) { - $onField = 'object_item_id'; - } else { - $onField = 'subject_item_id'; - } +} - $filter_relation = isset($params['item_relations_property_id']) - && is_numeric($params['item_relations_property_id']); - $filter_comment = isset($params['item_relations_comment']) - && (trim($params['item_relations_comment'])); - - if ($filter_relation || $filter_comment) { - - $db = $this->_db; - $select - ->join( - array('item_relations_relations' => $db->ItemRelationsRelation), - "item_relations_relations.$onField = items.id", - array() - ); - - if ($filter_relation) { - $select->where('item_relations_relations.property_id = ?', - $params['item_relations_property_id']); - } - - if ($filter_comment) { - $select->where('item_relations_relations.relation_comment LIKE ?', - "%" . trim($params['item_relations_comment']) . "%" ); - } - } +# echo "
    "; print_r($select); die("
    "); - # echo "
    "; print_r($select); die("
    "); +// $select->where('items.id = ?', 2); +} - // $select->where('items.id = ?', 2); - } +/** +* Add custom fields to the item batch edit form. +*/ +public function hookAdminItemsBatchEditForm() +{ + $formSelectProperties = get_table_options('ItemRelationsProperty'); + ?> +
    +

    + + + + + + + + + + + + + + + +
    formSelect('custom[item_relations_property_id]', null, array(), $formSelectProperties); ?> + + formText('custom[item_relations_item_relation_object_item_id]', null, array('size' => 6)); ?> +
    +
    + -
    -

    - - - - - - - - - - - - - - - -
    formSelect('custom[item_relations_property_id]', - null, array(), $formSelectProperties); ?> - formText('custom[item_relations_item_relation_object_item_id]', - null, array('size' => 6)); - ?>
    -
    - __('Item Relations'), + 'uri' => url('item-relations'), + 'resource' => 'ItemRelations_Index', + 'privilege' => 'index' + ); + return $nav; +} - self::insertItemRelation( - $item, - $custom['item_relations_property_id'], - $custom['item_relations_item_relation_object_item_id'], - $custom['item_relations_item_relation_relation_comment'] - ); - } +/** +* Add the "Item Relations" tab to the admin items add/edit page. +* +* @return array +*/ +public function filterAdminItemsFormTabs($tabs, $args) +{ + $item = $args['item']; - /** - * Add the Item Relations link to the admin main navigation. - * - * @param array Navigation array. - * @return array Filtered navigation array. - */ - public function filterAdminNavigationMain($nav) - { - $nav[] = array( - 'label' => __('Item Relations'), - 'uri' => url('item-relations'), - 'resource' => 'ItemRelations_Index', - 'privilege' => 'index' - ); - return $nav; - } + $formSelectProperties = get_table_options('ItemRelationsProperty'); + $subjectRelations = self::prepareSubjectRelations($item); + $objectRelations = self::prepareObjectRelations($item); - /** - * Add the "Item Relations" tab to the admin items add/edit page. - * - * @return array - */ - public function filterAdminItemsFormTabs($tabs, $args) - { - $item = $args['item']; - $tabs['Item Relations'] = get_view()->itemRelationsForm($item); - return $tabs; - } + ob_start(); + include 'item_relations_form.php'; + $content = ob_get_contents(); + ob_end_clean(); - /** - * Add the "Item Relations" tab to the admin items add/edit page. - * - * @return array - */ - public function filterItemRelationsPropertiesSelectOptions($selectOptions) - { - $allowedVocabularies = json_decode(get_option('item_relations_allow_vocabularies')); - if (!empty($allowedVocabularies)) { - $selectOptions = array_intersect_key($selectOptions, array_flip($allowedVocabularies)); - } - return $selectOptions; - } + $tabs['Item Relations'] = $content; + return $tabs; +} - /** - * Prepare subject item relations for display. - * - * @param Item $item - * @return array - */ - public static function prepareSubjectRelations(Item $item) - { - $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id, true); - $subjectRelations = array(); - foreach ($subjects as $subject) { - $objectItem = get_record_by_id('Item', $subject->object_item_id); - $subjectRelations[] = array( - 'item_relation_id' => $subject->id, - 'object_item' => $objectItem, - 'object_item_title' => self::getItemTitle($objectItem), - 'relation_comment' => $subject->relation_comment, - 'relation_text' => $subject->getPropertyText(), - 'relation_description' => $subject->property_description, - ); - } - return $subjectRelations; - } +/** +* Prepare subject item relations for display. +* +* @param Item $item +* @return array +*/ +public static function prepareSubjectRelations(Item $item) +{ + $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id); + $subjectRelations = array(); - /** - * Prepare object item relations for display. - * - * @param Item $item - * @return array - */ - public static function prepareObjectRelations(Item $item) - { - $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id, true); - $objectRelations = array(); - foreach ($objects as $object) { - $subjectItem = get_record_by_id('Item', $object->subject_item_id); - $objectRelations[] = array( - 'item_relation_id' => $object->id, - 'subject_item' => $subjectItem, - 'subject_item_title' => self::getItemTitle($subjectItem), - 'relation_comment' => $object->relation_comment, - 'relation_text' => $object->getPropertyText(), - 'relation_description' => $object->property_description, - ); - } - return $objectRelations; + foreach ($subjects as $subject) { + if (!($item = get_record_by_id('item', $subject->object_item_id))) { + continue; } + $subjectRelations[] = array( + 'item_relation_id' => $subject->id, + 'object_item_id' => $subject->object_item_id, + 'relation_comment' => $subject->relation_comment, + 'object_item_title' => self::getItemTitle($item), + 'relation_text' => $subject->getPropertyText(), + 'relation_description' => $subject->property_description + ); + } + return $subjectRelations; +} - /** - * Return a item's title. - * - * @param Item $item The item. - * @return string - */ - public static function getItemTitle($item) - { - $title = metadata($item, array('Dublin Core', 'Title'), array('no_filter' => true)); - if (!trim($title)) { - $title = '#' . $item->id; - } - return $title; +/** +* Prepare object item relations for display. +* +* @param Item $item +* @return array +*/ +public static function prepareObjectRelations(Item $item) +{ + $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id); + $objectRelations = array(); + foreach ($objects as $object) { + if (!($item = get_record_by_id('item', $object->subject_item_id))) { + continue; } + $objectRelations[] = array( + 'item_relation_id' => $object->id, + 'subject_item_id' => $object->subject_item_id, + 'relation_comment' => $object->relation_comment, + 'subject_item_title' => self::getItemTitle($item), + 'relation_text' => $object->getPropertyText(), + 'relation_description' => $object->property_description + ); + } + return $objectRelations; +} - /** - * Insert an item relation. - * - * @param Item|int $subjectItem - * @param int $propertyId - * @param Item|int $objectItem - * @return bool True: success; false: unsuccessful - */ - public static function insertItemRelation($subjectItem, $propertyId, $objectItem, $relationComment) - { - // Only numeric property IDs are valid. - if (!is_numeric($propertyId)) { - return false; - } - - $db = get_db(); - - // Set the subject item. - if (!($subjectItem instanceOf Item)) { - $subjectItem = $db->getTable('Item')->find($subjectItem); - } - - // Set the object item. - if (!($objectItem instanceOf Item)) { - $objectItem = $db->getTable('Item')->find($objectItem); - } - - // Don't save the relation if the subject or object items don't exist. - if (!$subjectItem || !$objectItem) { - return false; - } - - $itemRelation = new ItemRelationsRelation; - $itemRelation->subject_item_id = $subjectItem->id; - $itemRelation->property_id = $propertyId; - $itemRelation->object_item_id = $objectItem->id; - $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); - $itemRelation->save(); +/** +* Return a item's title. +* +* @param Item $item The item. +* @return string +*/ +public static function getItemTitle($item) +{ + $title = metadata($item, array('Dublin Core', 'Title'), array('no_filter' => true)); + if (!trim($title)) { + $title = '#' . $item->id; + } + return $title; +} - return true; - } +/** +* Insert an item relation. +* +* @param Item|int $subjectItem +* @param int $propertyId +* @param Item|int $objectItem +* @return bool True: success; false: unsuccessful +*/ +public static function insertItemRelation($subjectItem, $propertyId, $objectItem, $relationComment) +{ + // Only numeric property IDs are valid. + if (!is_numeric($propertyId)) { + return false; + } + + // Set the subject item. + if (!($subjectItem instanceOf Item)) { + $subjectItem = get_db()->getTable('Item')->find($subjectItem); + } + + // Set the object item. + if (!($objectItem instanceOf Item)) { + $objectItem = get_db()->getTable('Item')->find($objectItem); + } + + // Don't save the relation if the subject or object items don't exist. + if (!$subjectItem || !$objectItem) { + return false; + } + + $itemRelation = new ItemRelationsRelation; + $itemRelation->subject_item_id = $subjectItem->id; + $itemRelation->property_id = $propertyId; + $itemRelation->object_item_id = $objectItem->id; + $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); + $itemRelation->save(); + + return true; +} } diff --git a/README.md b/README.md deleted file mode 100644 index be6aa99..0000000 --- a/README.md +++ /dev/null @@ -1,88 +0,0 @@ -Item Relations (plugin for Omeka) -================================= - -[Item Relations] is a plugin for [Omeka] that lets you define relations between -items. For example, you can make one item a part of another item, where -"part of" is the relation. You can also make one item a "reproduction of" or a -"translation of" another item. - -We've bundled the plugin with common relations derived from several formal -vocabularies, like Dublin Core and FRBR. You can use these or you could populate -a custom vocabulary with the relations needed in your archive. You could, for -example, define custom relations like "is parent of", "is better than", and -"fits within". - -See http://omeka.org/codex/Plugins/ItemRelations for more info. - -This fork adds a quick visual selector and made the item relations themable. - - -Installation ------------- - -Uncompress files and rename plugin folder "ItemRelations". - -Then install it like any other Omeka plugin and follow the config instructions. - - -Warning -------- - -Use it at your own risk. - -It's always recommended to backup your files and database regularly so you can -roll back if needed. - - -Troubleshooting ---------------- - -See online [plugin issues] and [fork issues]. - - -License -------- - -This plugin is published under [GNU/GPL]. - -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, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -Contact -------- - -Current maintainers: - -* [Center for History & New Media] -* [GerZah] -* Daniel Berthereau (see [Daniel-KM]) - - -Copyright ---------- - -* Copyright Center for History and New Media, 2011-2015 -* Copyright GerZah, 2015 -* Copyright Daniel Berthereau, 2015 - - -[Item Relations]: https://github.com/omeka/plugin-ItemRelations -[Omeka]: https://omeka.org -[plugin issues]: https://github.com/omeka/plugin-ItemRelations/issues -[fork issues]: https://github.com/Daniel-KM/ItemRelations/issues -[GNU/GPL]: https://www.gnu.org/licenses/gpl-3.0.html -[Center for History & New Media]: http://chnm.gmu.edu -[GerZah]: https://github.com/GerZah -[Daniel-KM]: https://github.com/Daniel-KM "Daniel Berthereau" diff --git a/config_form.php b/config_form.php new file mode 100644 index 0000000..1e19c31 --- /dev/null +++ b/config_form.php @@ -0,0 +1,55 @@ +
    +
    + formLabel('item_relations_public_append_to_items_show', __('Append to Public Items Show')); ?> +
    +
    +

    + +

    + formCheckbox('item_relations_public_append_to_items_show', null, array('checked' => $publicAppendToItemsShow)); ?> +
    +
    +
    +
    + formLabel('item_relations_admin_sidebar_or_maincontent', __('Display position in admin view')); ?> +
    +
    +

    + +

    + formSelect('item_relations_admin_sidebar_or_maincontent', $adminSidebarOrMaincontent, null, array('sidebar' => __('Side bar'), 'maincontent' => __('Main content'))); ?> +
    +
    +
    +
    + formLabel('item_relations_provide_relation_comments', __('Provide comment field for relations')); ?> +
    +
    +

    + +

    + formCheckbox('item_relations_provide_relation_comments', null, array('checked' => $provideRelationComments)); ?> +
    +
    +
    +
    + formLabel('item_relations_relation_format', __('Relation Format')); ?> +
    +
    +

    + +

    + formSelect('item_relations_relation_format', $relationFormat, null, array('prefix_local_part' => __('prefix:localPart'), 'label' => __('label'))); ?> +
    +
    diff --git a/controllers/LookupController.php b/controllers/LookupController.php index f6a6613..a4eca05 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -11,10 +11,7 @@ */ class ItemRelations_LookupController extends Omeka_Controller_AbstractActionController { - public function indexAction() - { - $db = get_db(); - + public function indexAction() { if (!$this->_hasParam('partial')) { $this->_setParam('partial', ''); } @@ -34,7 +31,7 @@ public function indexAction() $partial = preg_replace('/[^ \.,\!\?\p{L}\p{N}\p{Mc}]/ui', '', $this->_getParam('partial')); $where_text = ''; if (strlen($partial) > 0) { - $where_text = 'AND text RLIKE ' . $db->quote($partial); + $where_text = "AND text RLIKE '$partial'"; } $item_type = intval($this->_getParam('item_type')); @@ -66,13 +63,14 @@ public function indexAction() break; } - $titleId = 50; + $title = 50; + $db = get_db(); $query = <<Item} items LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) -WHERE elementtexts.element_id = $titleId +WHERE elementtexts.element_id = $title $where_item_type $where_text GROUP BY elementtexts.record_id @@ -90,7 +88,7 @@ public function indexAction() FROM {$db->Item} items LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) -WHERE elementtexts.element_id = $titleId +WHERE elementtexts.element_id = $title $where_item_type $where_text GROUP BY elementtexts.record_id @@ -108,11 +106,9 @@ public function indexAction() ); } - $metadata = array( + $this->view->metadata = array( 'count' => $m_count, 'items' => $m_items, ); - - $this->_helper->json($metadata); } } diff --git a/item_relations_form.php b/item_relations_form.php new file mode 100644 index 0000000..f026b0c --- /dev/null +++ b/item_relations_form.php @@ -0,0 +1,124 @@ +

    + ' + . __('Browse Vocabularies') . ''; + + echo __('Here you can relate this item to another item and delete existing ' + . 'relations. For descriptions of the relations, see the %s page. Invalid ' + . 'item IDs will be ignored.', $link +); +$provideRelationComments = get_option('item_relations_provide_relation_comments'); +?> +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ItemRelationsProperty} where label = '$subject'"; + $subject_id = $db->fetchOne($sql); //default value to be selected in dropdown + echo get_view()->formSelect('item_relations_subject_property['.$subjectRelation['item_relation_id'].']', $subject_id , array( 'id' => 'item_relations_subject_property_'.$subjectRelation['item_relation_id'] , 'multiple' => false, 'style' => 'width: 150px;'), array_slice($formSelectProperties,1)); + ?>
    + + + + Item_Types} ORDER BY name"; + $itemtypes = $db->fetchAll($sql); + $m = array( + '-1' => "- ".__('All')." -", + ); + foreach ($itemtypes as $type) { + $m[$type['id']] = $type['name']; + } + ?> +
    +

    + + + formSelect('new_relation_property_id', null, array('multiple' => false), $formSelectProperties); ?>
    + +

    + formSelect('new_relation_object_item_type_id', null, array('multiple' => false), $m); ?>

    + +

    + : +

    + + + + + +
    +

    + +

    :

    + + + + + +
    +
      +
    • <
    • +
    • >
    • +
    +
    + +
      +
    + + + +
    +

    : formText('relation_comment', null, array('size' => 10, 'maxlength' => 60)); ?>

    + + + + + +
    + + + + + + diff --git a/views/shared/javascripts/item-relations.js b/item_relations_script.js similarity index 100% rename from views/shared/javascripts/item-relations.js rename to item_relations_script.js diff --git a/item_relations_styles.css b/item_relations_styles.css new file mode 100644 index 0000000..61b48e4 --- /dev/null +++ b/item_relations_styles.css @@ -0,0 +1,7 @@ +.pg_disabled { + visibility: hidden; +} + +.hidden { + display: none; +} diff --git a/views/shared/javascripts/lity/lity.css b/lity/lity.css similarity index 100% rename from views/shared/javascripts/lity/lity.css rename to lity/lity.css diff --git a/views/shared/javascripts/lity/lity.js b/lity/lity.js similarity index 100% rename from views/shared/javascripts/lity/lity.js rename to lity/lity.js diff --git a/views/shared/javascripts/lity/lity.min.css b/lity/lity.min.css similarity index 100% rename from views/shared/javascripts/lity/lity.min.css rename to lity/lity.min.css diff --git a/views/shared/javascripts/lity/lity.min.js b/lity/lity.min.js similarity index 100% rename from views/shared/javascripts/lity/lity.min.js rename to lity/lity.min.js diff --git a/models/Table/ItemRelationsRelation.php b/models/Table/ItemRelationsRelation.php index 75cbe4b..859e50f 100644 --- a/models/Table/ItemRelationsRelation.php +++ b/models/Table/ItemRelationsRelation.php @@ -20,7 +20,7 @@ class Table_ItemRelationsRelation extends Omeka_Db_Table */ public function getSelect() { - $db = $this->_db; + $db = $this->getDb(); return parent::getSelect() ->join( array('item_relations_properties' => $db->ItemRelationsProperty), @@ -41,45 +41,27 @@ public function getSelect() /** * Find item relations by subject item ID. - * - * @param integer $subjectItemId - * @param boolean $onlyExistingObjectItems + * * @return array */ - public function findBySubjectItemId($subjectItemId, $onlyExistingObjectItems = true) + public function findBySubjectItemId($subjectItemId) { $db = $this->getDb(); $select = $this->getSelect() ->where('item_relations_relations.subject_item_id = ?', (int) $subjectItemId); - if ($onlyExistingObjectItems) { - $select->join( - array('items' => $db->Item), - 'items.id = item_relations_relations.object_item_id', - array() - ); - } return $this->fetchObjects($select); } - + /** * Find item relations by object item ID. - * - * @param integer $objectItemId - * @param boolean $onlyExistingSubjectItems + * * @return array */ - public function findByObjectItemId($objectItemId, $onlyExistingSubjectItems = true) + public function findByObjectItemId($objectItemId) { $db = $this->getDb(); $select = $this->getSelect() ->where('item_relations_relations.object_item_id = ?', (int) $objectItemId); - if ($onlyExistingSubjectItems) { - $select->join( - array('items' => $db->Item), - 'items.id = item_relations_relations.subject_item_id', - array() - ); - } return $this->fetchObjects($select); } } diff --git a/views/admin/common/item-relations-show.php b/views/admin/common/item-relations-show.php index 9155a52..05d9ed2 100644 --- a/views/admin/common/item-relations-show.php +++ b/views/admin/common/item-relations-show.php @@ -1,3 +1,4 @@ +

    - $item, - 'subjectRelations' => $subjectRelations, - 'objectRelations' => $objectRelations, - )); - endif; ?> + +
      + +
    • + + + + +
    • + + +
    • + + + + +
    • + +
    +
    diff --git a/views/admin/lookup/index.php b/views/admin/lookup/index.php new file mode 100644 index 0000000..866ddc2 --- /dev/null +++ b/views/admin/lookup/index.php @@ -0,0 +1,3 @@ +metadata); +?> diff --git a/views/admin/plugins/item-relations-config-form.php b/views/admin/plugins/item-relations-config-form.php deleted file mode 100644 index e08c13a..0000000 --- a/views/admin/plugins/item-relations-config-form.php +++ /dev/null @@ -1,122 +0,0 @@ -
    -
    -
    - formLabel('item_relations_allow_vocabularies', - __('Limit Relations to Vocabularies')); ?> -

    -
    -
    -

    - -

    -
    - '; - foreach ($vocabularies as $vocabulary) { - echo '
  • '; - echo $this->formCheckbox('item_relations_allow_vocabularies[]', $vocabulary->name, - array('checked' => in_array($vocabulary->name, $currentVocabularies) ? 'checked' : '')); - echo $vocabulary->name; - echo '
  • '; - } - echo ''; - ?> -
    -
    -
    -
    -
    - formLabel('item_relations_provide_relation_comments', - __('Provide comment field for relations')); ?> -
    -
    -

    - -

    - formCheckbox('item_relations_provide_relation_comments', - null, array('checked' => get_option('item_relations_provide_relation_comments'))); ?> -
    -
    -
    -
    -
    -
    - formLabel('item_relations_relation_format', - __('Relation Format')); ?> -
    -
    -

    - -

    - formSelect('item_relations_relation_format', - get_option('item_relations_relation_format'), null, array( - 'prefix_local_part' => __('prefix:localPart'), - 'label' => __('label'), - )); ?> -
    -
    -
    -
    - formLabel('item_relations_admin_sidebar_or_maincontent', - __('Display position in admin view')); ?> -
    -
    -

    - -

    - formSelect('item_relations_admin_sidebar_or_maincontent', - get_option('item_relations_admin_sidebar_or_maincontent'), null, array( - 'sidebar' => __('Side bar'), - 'maincontent' => __('Main content'), - )); ?> -
    -
    -
    -
    - formLabel('item_relations_public_append_to_items_show', - __('Append to Public Items Show')); ?> -
    -
    -

    - -

    - formCheckbox('item_relations_public_append_to_items_show', - null, array('checked' => get_option('item_relations_public_append_to_items_show'))); ?> -
    -
    -
    -
    - formLabel('item_relations_public_display_mode', - __('Public Display Mode')); ?> -
    -
    -

    - -

    - formSelect('item_relations_public_display_mode', - get_option('item_relations_public_display_mode'), null, array( - 'table' => __('As a table'), - 'list' => __('As a list'), - 'list-by-item-type' => __('By item type'), - )); ?> -
    -
    -
    diff --git a/views/admin/vocabularies/browse.php b/views/admin/vocabularies/browse.php index 13631d3..2620e71 100644 --- a/views/admin/vocabularies/browse.php +++ b/views/admin/vocabularies/browse.php @@ -1,12 +1,8 @@ - __('Browse Vocabularies'))); -?> + __('Browse Vocabularies'))); ?> - @@ -16,7 +12,6 @@ item_relations_vocabularies as $vocabulary): ?> - diff --git a/views/helpers/ItemRelationsForm.php b/views/helpers/ItemRelationsForm.php deleted file mode 100644 index 3d5484a..0000000 --- a/views/helpers/ItemRelationsForm.php +++ /dev/null @@ -1,76 +0,0 @@ -view; - $db = get_db(); - - // Prepare the list of subjects to avoid sql queries in the view. - $subjectRelations = ItemRelationsPlugin::prepareSubjectRelations($item); - $sql = "SELECT id FROM {$db->ItemRelationsProperty} WHERE label = ?"; - foreach ($subjectRelations as &$subjectRelation) { - // Get the default value to be selected in dropdown. - $subjectRelation['subject_id'] = $db->fetchOne($sql, array($subjectRelation['relation_text'])); - } - - // Prepare list of used item types for the select form. - $itemTypesList = array( - '-1' => '- ' . __('All') . ' -', - ); - $itemTypesList += $this->_getUsedItemTypes(); - - $html = $view->partial('common/item-relations-form.php', array( - 'item' => $item, - 'provideRelationComments' => get_option('item_relations_provide_relation_comments'), - 'formSelectProperties' => get_table_options('ItemRelationsProperty'), - 'subjectRelations' => $subjectRelations, - 'objectRelations' => ItemRelationsPlugin::prepareObjectRelations($item), - 'itemTypesList' => $itemTypesList, - )); - - $html .= ''; - $html .= ''; - $html .= js_tag('lity.min', $dir = 'javascripts/lity'); - $html .= ''; - $html .= js_tag('item-relations'); - - return $html; - } - - /** - * Get the list of used item types for select form. - * - * @return array - */ - protected function _getUsedItemTypes() - { - $db = get_db(); - - $itemTypesTable = $db->getTable('ItemType'); - $itemTypesAlias = $itemTypesTable->getTableAlias(); - - $select = $itemTypesTable->getSelect() - ->reset(Zend_Db_Select::COLUMNS) - ->from(array(), array($itemTypesAlias . '.id', $itemTypesAlias . '.name')) - ->joinInner(array('items' => $db->Item), "items.item_type_id = $itemTypesAlias.id", array()) - ->group($itemTypesAlias . '.id') - ->order($itemTypesAlias . '.name ASC'); - - $permissions = new Omeka_Db_Select_PublicPermissions('Items'); - $permissions->apply($select, 'items'); - - $itemTypes = $db->fetchPairs($select); - - return $itemTypes; - } -} diff --git a/views/public/common/item-relations-show.php b/views/public/common/item-relations-show.php index 76dee45..a771f98 100644 --- a/views/public/common/item-relations-show.php +++ b/views/public/common/item-relations-show.php @@ -1,13 +1,30 @@ +

    - +

    - $item, - 'subjectRelations' => $subjectRelations, - 'objectRelations' => $objectRelations, - )); - endif; ?> + +
    name, $allowedVocabularies) ? __('Yes') : __('No'); ?> id}")); ?>">name; ?> description; ?> custom ? 'n/a' : $vocabulary->namespace_prefix; ?>
    + + + + + + + + + + + + + + + + + + + + +
    Item:
    Item:
    + diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php deleted file mode 100644 index c627fbf..0000000 --- a/views/shared/common/item-relations-form.php +++ /dev/null @@ -1,104 +0,0 @@ -

    ' - . __('Browse Vocabularies') . ''; - echo __('Here you can relate this item to another item and delete existing relations.'); - echo ' ' . __('For descriptions of the relations, see the %s page.', $link); - echo ' ' . __('Invalid item IDs will be ignored.'); -?>

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    formSelect('item_relations_subject_property[' . $subjectRelation['item_relation_id'] . ']', - $subjectRelation['subject_id'], - array( - 'id' => 'item_relations_subject_property_' . $subjectRelation['item_relation_id'], - 'multiple' => false, - 'style' => 'width: 150px;', - ), - array_slice($formSelectProperties, 1)); - ?> '_blank'), 'show', $subjectRelation['object_item']); ?>
    '_blank'), 'show', $objectRelation['subject_item']); ?>
    - - - -
    -

    - - formSelect('new_relation_property_id', - null, array('multiple' => false), $formSelectProperties); ?>
    -

    - formSelect('new_relation_object_item_type_id', - null, array('multiple' => false), $itemTypesList); ?>

    - -

    : -

    - - - - -
    -

    - -

    :

    - - - - -
    -
      -
    • <
    • -
    • >
    • -
    - -
    -
      - - -
      -

      : formText('relation_comment', null, array('size' => 10, 'maxlength' => 60)); ?>

      - - - -
      diff --git a/views/shared/common/item-relations-show-list-by-item-type.php b/views/shared/common/item-relations-show-list-by-item-type.php deleted file mode 100644 index 325d00f..0000000 --- a/views/shared/common/item-relations-show-list-by-item-type.php +++ /dev/null @@ -1,70 +0,0 @@ -item_type_id; - $subjectRelationsByObjectType[$typeId][] = $subjectRelation; - } - $objectRelationsBySubjectType = array(); - foreach ($objectRelations as $objectRelation) { - $typeId = (integer) $objectRelation['subject_item']->item_type_id; - $objectRelationsBySubjectType[$typeId][] = $objectRelation; - } - // Prepare the list of types with one query. - $itemTypes = array(); - foreach (get_records('ItemType', array(), 0) as $itemType) { - $itemTypes[$itemType->id] = $itemType; - } -?> -

      - -

      - -
        - $relations): ?> -
      • name) : __('No Item Type'); ?> -
          - -
        • - - [] - -
        • - -
        -
      • - -
      - - -

      - -

      - -

        - $relations): ?> -
      • name) : __('No Item Type'); ?> -
          - -
        • - - [] - -
        • - -
        -
      • - -
      - diff --git a/views/shared/common/item-relations-show-list.php b/views/shared/common/item-relations-show-list.php deleted file mode 100644 index 2688ae1..0000000 --- a/views/shared/common/item-relations-show-list.php +++ /dev/null @@ -1,27 +0,0 @@ - -
        - -
      • - - - - -
      • - - -
      • - - - - -
      • - -
      diff --git a/views/shared/common/item-relations-show-table.php b/views/shared/common/item-relations-show-table.php deleted file mode 100644 index ff3292c..0000000 --- a/views/shared/common/item-relations-show-table.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
      diff --git a/views/shared/css/item-relations.css b/views/shared/css/item-relations.css deleted file mode 100644 index 98cc848..0000000 --- a/views/shared/css/item-relations.css +++ /dev/null @@ -1,15 +0,0 @@ -.pg_disabled { - visibility: hidden; -} -.hidden { - display: none; -} -ul#lookup-results li { - cursor: pointer; -} -ul#lookup-results li:active { - background-color: #cccccc; -} -ul#lookup-results li:hover { - background-color: #f3f3e7; -} From 87a0a51f4db44d8f1b7c5cedd604c56898cfa3c2 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Mon, 7 Dec 2015 13:43:14 +0100 Subject: [PATCH 34/66] Huge update: Support for multiple user-defined vocabularies, including add/edit/delete / plus Transifex based i18n --- ItemRelationsPlugin.php | 104 +-- controllers/VocabulariesController.php | 241 ++++-- item_relations_form.php | 82 +- languages/de_DE.mo | Bin 31928 -> 32694 bytes languages/de_DE.po | 631 +++++++++----- languages/template.pot | 802 ++++++++++++------ views/admin/common/item-relations-show.php | 67 +- views/admin/vocabularies/add.php | 13 + views/admin/vocabularies/browse.php | 3 + views/admin/vocabularies/delete.php | 32 + views/admin/vocabularies/show.php | 76 +- views/public/common/item-relations-show.php | 64 +- .../common/item-relations-advanced-search.php | 4 +- 13 files changed, 1398 insertions(+), 721 deletions(-) create mode 100644 views/admin/vocabularies/add.php create mode 100644 views/admin/vocabularies/delete.php diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 5d532a7..90fe9cb 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -271,8 +271,8 @@ public function hookPublicItemsShow() { $item = get_current_record('item'); echo common('item-relations-show', array( - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item) + 'thisItemId' => $item->id, + 'allRelations' => self::prepareAllRelations($item), )); } } @@ -290,8 +290,8 @@ public function hookAdminItemsShow($args) $item = $args['item']; echo common('item-relations-show', array( - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item) + 'thisItemId' => $item->id, + 'allRelations' => self::prepareAllRelations($item), )); endif; @@ -310,8 +310,8 @@ public function hookAdminItemsShowSidebar($args) $item = $args['item']; echo common('item-relations-show', array( - 'subjectRelations' => self::prepareSubjectRelations($item), - 'objectRelations' => self::prepareObjectRelations($item) + 'thisItemId' => $item->id, + 'allRelations' => self::prepareAllRelations($item), )); endif; @@ -573,8 +573,7 @@ public function filterAdminItemsFormTabs($tabs, $args) $item = $args['item']; $formSelectProperties = get_table_options('ItemRelationsProperty'); - $subjectRelations = self::prepareSubjectRelations($item); - $objectRelations = self::prepareObjectRelations($item); + $allRelations = self::prepareAllRelations($item); ob_start(); include 'item_relations_form.php'; @@ -586,56 +585,61 @@ public function filterAdminItemsFormTabs($tabs, $args) } /** -* Prepare subject item relations for display. +* Prepare all item relations (subject & object) for display. * * @param Item $item * @return array */ -public static function prepareSubjectRelations(Item $item) +public static function prepareAllRelations(Item $item) { - $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id); - $subjectRelations = array(); - - foreach ($subjects as $subject) { - if (!($item = get_record_by_id('item', $subject->object_item_id))) { - continue; + if (!isset($item->id)) { return array(); } + + $db = get_db(); + $query = "SELECT *, irr.id irrid, irp.description irpdesc". + " FROM `$db->ItemRelationsRelations` irr". + " JOIN `$db->ItemRelationsProperty` irp on irr.property_id = irp.id". + " JOIN `$db->ItemRelationsVocabulary` irv on irp.vocabulary_id = irv.id". + " WHERE irr.subject_item_id = $item->id". + " OR irr.object_item_id = $item->id". + " ORDER BY irv.name ASC, irp.vocabulary_id ASC". + ""; + # echo "
      $query
      "; + $partners = $db->fetchAll($query); + # echo "
      $query:\n" . print_r($partners,true) . "
      "; + + $relations = array(); + + foreach($partners as $partner) { + $otherItemType = ( $item->id == $partner["subject_item_id"] ? "object" : "subject" ); + $otherItem = get_record_by_id('item', $partner[$otherItemType."_item_id"]); + # echo "
      ".$otherItem->id." = $otherItemType
      "; + if ($otherItem) { + $relation = array( + 'item_relation_id' => $partner["irrid"], + 'relation_comment' => $partner["relation_comment"], + 'relation_text' => $partner["label"], + 'relation_property' => $partner["property_id"], + 'relation_description' => $partner["irpdesc"], + 'vocabulary_id' => $partner["vocabulary_id"], + 'vocabulary' => $partner["name"], + 'vocabulary_desc' => $partner["description"], + 'subject_item_id' => $partner["subject_item_id"], + 'object_item_id' => $partner["object_item_id"], + ); + if ($otherItemType=="subject") { + $relation['subject_item_title'] = self::getItemTitle($otherItem); + $relation['object_item_title'] = self::getItemTitle($item); + } + else { + $relation['subject_item_title'] = self::getItemTitle($item); + $relation['object_item_title'] = self::getItemTitle($otherItem); + } + $relations[] = $relation; } - $subjectRelations[] = array( - 'item_relation_id' => $subject->id, - 'object_item_id' => $subject->object_item_id, - 'relation_comment' => $subject->relation_comment, - 'object_item_title' => self::getItemTitle($item), - 'relation_text' => $subject->getPropertyText(), - 'relation_description' => $subject->property_description - ); } - return $subjectRelations; -} -/** -* Prepare object item relations for display. -* -* @param Item $item -* @return array -*/ -public static function prepareObjectRelations(Item $item) -{ - $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id); - $objectRelations = array(); - foreach ($objects as $object) { - if (!($item = get_record_by_id('item', $object->subject_item_id))) { - continue; - } - $objectRelations[] = array( - 'item_relation_id' => $object->id, - 'subject_item_id' => $object->subject_item_id, - 'relation_comment' => $object->relation_comment, - 'subject_item_title' => self::getItemTitle($item), - 'relation_text' => $object->getPropertyText(), - 'relation_description' => $object->property_description - ); - } - return $objectRelations; + # echo "
      " . print_r($relations, true) . "
      "; + return $relations; } /** diff --git a/controllers/VocabulariesController.php b/controllers/VocabulariesController.php index ee0653d..5486b68 100644 --- a/controllers/VocabulariesController.php +++ b/controllers/VocabulariesController.php @@ -1,107 +1,162 @@ _helper->db->setDefaultModelName('ItemRelationsVocabulary'); + /** + * Initialize the controller before each request. + * + * Set ItemRelationsVocabulary as the model for the controller. + */ + public function init() + { + $this->_helper->db->setDefaultModelName('ItemRelationsVocabulary'); + } + + /** + * + * create action + */ + public function createAction() + { + if ($this->getRequest()->isPost()) { + $vocabularyName = $this->_getParam('vocabulary_name'); + $vocabularyDescription = $this->_getParam('vocabulary_description'); + $db = get_db(); + $select = "SELECT name FROM `$db->ItemRelationsVocabulary` WHERE `name` = ?"; + $result = $db->fetchAll($select, array(addslashes($vocabularyName))); + if ($result) + { + $this->_helper->flashMessenger(__('The vocabulary name already exists. Please choose a different one.'), 'error'); + } + else + { + if ($vocabularyName){ + $db->query("INSERT INTO `{$db->ItemRelationsVocabulary}` (`name`, `description`, `custom`) VALUES (?, ?, ?)", array( + addslashes($vocabularyName), + addslashes($vocabularyDescription), + 1 + )); + $this->_helper->flashMessenger(__('The vocabulary is successfully added.'), 'success'); + } + else{ + $this->_helper->flashMessenger(__('The vocabulary cannot be added.'), 'error'); + } + } + $this->_helper->redirector('browse'); + return; } + } + /** + * Save action. + */ + public function saveAction() + { + if ($this->getRequest()->isPost()) { + $vocabularyName = $this->_getParam('vocabulary_name'); + $vocabularyDescription = $this->_getParam('vocabulary_description'); + $vocabularyId = intval($this->_getParam('vocabulary_id')); + if (($vocabularyName) and ($vocabularyId)){ + $db = get_db(); + $sql = "UPDATE `$db->ItemRelationsVocabulary` set name = ?, description = ? where id = $vocabularyId"; + $db->query($sql, array(addslashes($vocabularyName) ,addslashes($vocabularyDescription))); + $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); + } + else { + $this->_helper->flashMessenger(__('The vocabulary name cannot be empty.'), 'error'); + } + + $this->_helper->redirector('browse'); + return; - /** - * Dummy add action. - * - * Vocabularies cannot be added through the UI. - */ - public function addAction() - { - throw new Omeka_Controller_Exception_404; } + } + /** + * Delete action. + */ + public function deleteAction() + { - /** - * Edit action. - */ - public function editAction() - { - $vocabulary = $this->_helper->db->findById(); - - // Only custom vocabularies can be edited. - if (!$vocabulary->custom) { - throw new Omeka_Controller_Exception_404; - } - - // Handle edit vocabulary form. - if ($this->getRequest()->isPost()) { - $this->_handleEditVocabularyForm($vocabulary->id); - - // Redirect to browse. - $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); - $this->_helper->redirector('browse'); - return; - } - - $properties = $vocabulary->getProperties(); - $this->view->properties = $properties; + } + /** + * Edit action. + */ + public function editAction() + { + $vocabulary = $this->_helper->db->findById(); + + // Only custom vocabularies can be edited. + if (!$vocabulary->custom) { + throw new Omeka_Controller_Exception_404; } - /** - * Actually alter and save the vocabulary with the request data. - * - * @param int $vocabularyId - */ - protected function _handleEditVocabularyForm($vocabularyId) - { - // Edit existing properties. - $propertyDescriptions = $this->_getParam('property_description'); - foreach ($propertyDescriptions as $propertyId => $propertyDescription) { - $property = $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId); - $property->description = $propertyDescription; - $property->save(); - } - - // Add new properties. - $newPropertyLabels = $this->_getParam('new_property_label'); - $newPropertyDescriptions = $this->_getParam('new_property_description'); - foreach ($newPropertyLabels as $key => $newPropertyLabel) { - $newPropertyLabel = trim($newPropertyLabel); - $newPropertyDescription = trim($newPropertyDescriptions[$key]); - - // Labels are required. - if (!$newPropertyLabel) { - continue; - } - - // Labels must be unique. - if ($this->_helper->db->getTable('ItemRelationsProperty')->findByLabel($newPropertyLabel)) { - continue; - } - - $newProperty = new ItemRelationsProperty; - $newProperty->vocabulary_id = $vocabularyId; - $newProperty->local_part = ''; // cannot be NULL - $newProperty->label = $newPropertyLabel; - $newProperty->description = $newPropertyDescription; - $newProperty->save(); - } - - // Delete existing properties. - $propertyDeletes = $this->_getParam('property_delete'); - foreach ($propertyDeletes as $propertyId => $propertyDelete) { - if ($propertyDelete) { - $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId)->delete(); - } - } + // Handle edit vocabulary form. + if ($this->getRequest()->isPost()) { + $this->_handleEditVocabularyForm($vocabulary->id); + + // Redirect to browse. + $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); + $this->_helper->redirector('browse'); + return; + } + + $properties = $vocabulary->getProperties(); + $this->view->properties = $properties; + } + + /** + * Actually alter and save the vocabulary with the request data. + * + * @param int $vocabularyId + */ + protected function _handleEditVocabularyForm($vocabularyId) + { + // Edit existing properties. + $propertyDescriptions = $this->_getParam('property_description'); + foreach ($propertyDescriptions as $propertyId => $propertyDescription) { + $property = $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId); + $property->description = $propertyDescription; + $property->save(); + } + + // Add new properties. + $newPropertyLabels = $this->_getParam('new_property_label'); + $newPropertyDescriptions = $this->_getParam('new_property_description'); + foreach ($newPropertyLabels as $key => $newPropertyLabel) { + $newPropertyLabel = trim($newPropertyLabel); + $newPropertyDescription = trim($newPropertyDescriptions[$key]); + + // Labels are required. + if (!$newPropertyLabel) { + continue; + } + + // Labels must be unique. + if ($this->_helper->db->getTable('ItemRelationsProperty')->findByLabel($newPropertyLabel)) { + continue; + } + + $newProperty = new ItemRelationsProperty; + $newProperty->vocabulary_id = $vocabularyId; + $newProperty->local_part = ''; // cannot be NULL + $newProperty->label = $newPropertyLabel; + $newProperty->description = $newPropertyDescription; + $newProperty->save(); + } + + // Delete existing properties. + $propertyDeletes = $this->_getParam('property_delete'); + foreach ($propertyDeletes as $propertyId => $propertyDelete) { + if ($propertyDelete) { + $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId)->delete(); + } } + } } diff --git a/item_relations_form.php b/item_relations_form.php index f026b0c..cba0699 100644 --- a/item_relations_form.php +++ b/item_relations_form.php @@ -21,30 +21,62 @@ - - - - ItemRelationsProperty} where label = '$subject'"; - $subject_id = $db->fetchOne($sql); //default value to be selected in dropdown - echo get_view()->formSelect('item_relations_subject_property['.$subjectRelation['item_relation_id'].']', $subject_id , array( 'id' => 'item_relations_subject_property_'.$subjectRelation['item_relation_id'] , 'multiple' => false, 'style' => 'width: 150px;'), array_slice($formSelectProperties,1)); - ?> - - - - - - - - - - - - - - + id; + $colspan = ($provideRelationComments ? 4 : 3); + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation["vocabulary_id"]) { + echo "" + ."" + .$relation["vocabulary"] + .""; + $lastVocab = $relation["vocabulary_id"]; + } + $subjectRelation = ( $relation['subject_item_id']==$thisItemId ); + $objectRelation = ( $relation['object_item_id']==$thisItemId ); + echo ""; + echo "" . + ( $subjectRelation ? __('This Item') + : "". + $relation['subject_item_title'] . "" + ) . + ""; + echo ""; + if ($subjectRelation) { + echo get_view()->formSelect('item_relations_subject_property['.$relation['item_relation_id'].']', + $relation['relation_property'], + array( 'id' => 'item_relations_subject_property_'.$relation['item_relation_id'], + 'multiple' => false, + 'style' => 'width: 150px;'), + array_slice($formSelectProperties,1)); + } + else { echo "" . $relation['relation_text'] . ""; } + echo ""; + echo "" . + ( $objectRelation ? __('This Item') + : "". + $relation['object_item_title'] . "" + ). + ""; + if ($provideRelationComments) { + echo ""; + if ($subjectRelation) { ?> + + "; + } + ?> + + "; + } + /* */ + ?> @@ -115,8 +147,10 @@ + + '; $html .= js_tag('item-relations'); diff --git a/views/public/common/item-relations-show.php b/views/public/common/item-relations-show.php index 76dee45..88e936e 100644 --- a/views/public/common/item-relations-show.php +++ b/views/public/common/item-relations-show.php @@ -1,13 +1,25 @@ +

      - +

      $item, 'subjectRelations' => $subjectRelations, 'objectRelations' => $objectRelations, + 'allRelations' => $allRelations, )); endif; ?>
      diff --git a/views/shared/common/item-relations-advanced-search.php b/views/shared/common/item-relations-advanced-search.php index de6b8da..8a7aaaa 100644 --- a/views/shared/common/item-relations-advanced-search.php +++ b/views/shared/common/item-relations-advanced-search.php @@ -3,12 +3,12 @@ ?>
      - formLabel('item_relations_item_relation', __('Item Relations')); ?> + formLabel('item_relations_property_id', __('Item Relations')); ?>

      - - - - formSelect('item_relations_subject_property[' . $subjectRelation['item_relation_id'] . ']', - $subjectRelation['subject_id'], - array( - 'id' => 'item_relations_subject_property_' . $subjectRelation['item_relation_id'], - 'multiple' => false, - 'style' => 'width: 150px;', - ), - array_slice($formSelectProperties, 1)); - ?> - '_blank'), 'show', $subjectRelation['object_item']); ?> - - - - - - - - - '_blank'), 'show', $objectRelation['subject_item']); ?> - - - - - - - - - + id; + $colspan = ($provideRelationComments ? 4 : 3); + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation["vocabulary_id"]) { + echo "" + ."" + .$relation["vocabulary"] + .""; + $lastVocab = $relation["vocabulary_id"]; + } + $subjectRelation = ( $relation['subject_item_id']==$thisItemId ); + $objectRelation = ( $relation['object_item_id']==$thisItemId ); + echo ""; + echo "" . + ( $subjectRelation ? __('This Item') + : "". + $relation['subject_item_title'] . "" + ) . + ""; + echo ""; + if ($subjectRelation) { + echo get_view()->formSelect('item_relations_subject_property['.$relation['item_relation_id'].']', + $relation['relation_property'], + array( 'id' => 'item_relations_subject_property_'.$relation['item_relation_id'], + 'multiple' => false, + 'style' => 'width: 150px;'), + array_slice($formSelectProperties,1)); + } + else { echo "" . $relation['relation_text'] . ""; } + echo ""; + echo "" . + ( $objectRelation ? __('This Item') + : "". + $relation['object_item_title'] . "" + ). + ""; + if ($provideRelationComments) { + echo ""; + if ($subjectRelation) { ?> + + "; + } + ?> + + "; + } + /* */ + ?> + . - - - - - - + + + + diff --git a/views/shared/common/item-relations-show-list.php b/views/shared/common/item-relations-show-list.php index 2688ae1..5314b07 100644 --- a/views/shared/common/item-relations-show-list.php +++ b/views/shared/common/item-relations-show-list.php @@ -1,27 +1,31 @@ - -

        - -
      • - - - - -
      • - - -
      • - - - - -
      • - -
      +id; + + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation["vocabulary_id"]) { + if ($lastVocab != -1) { echo ""; } + echo "
      " + ."" + .$relation["vocabulary"] + ."
        "; + $lastVocab = $relation["vocabulary_id"]; + } + echo "
      • "; + echo ( $relation['subject_item_id']==$thisItemId ? __('This Item') + : "". + $relation['subject_item_title'] . "" + ); + echo " " . $relation['relation_text'] . " "; + echo ( $relation['object_item_id']==$thisItemId ? __('This Item') + : "". + $relation['object_item_title'] . "" + ); + if ( ($provideRelationComments) and ($relation['relation_comment']) ) { + echo " (".$relation['relation_comment'].")"; + } + echo "
      • "; + } # foreach + echo "
      "; +?> diff --git a/views/shared/common/item-relations-show-table.php b/views/shared/common/item-relations-show-table.php index ff3292c..7ff2cd0 100644 --- a/views/shared/common/item-relations-show-table.php +++ b/views/shared/common/item-relations-show-table.php @@ -1,23 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - -
      + id; + + echo ""; + $colspan = ($provideRelationComments ? 4 : 3); + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation["vocabulary_id"]) { + echo ""; + $lastVocab = $relation["vocabulary_id"]; + } + echo ""; + echo ""; + echo ""; + echo ""; + if ($provideRelationComments) { + echo ""; + } + echo ""; + } # foreach + echo "
      " + ."" + .$relation["vocabulary"] + ."
      " . + ( $relation['subject_item_id']==$thisItemId ? __('This Item') + : "". + $relation['subject_item_title'] . "" + ) . + "" . $relation['relation_text'] . "" . + ( $relation['object_item_id']==$thisItemId ? __('This Item') + : "". + $relation['object_item_title'] . "" + ). + "(".$relation['relation_comment'].")
      "; +?> From 28e0ac33070339c973483f17c3e8bfaea972daec Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 14 Dec 2015 00:00:00 +0100 Subject: [PATCH 36/66] Fixed config form. --- views/admin/plugins/item-relations-config-form.php | 1 - 1 file changed, 1 deletion(-) diff --git a/views/admin/plugins/item-relations-config-form.php b/views/admin/plugins/item-relations-config-form.php index 24cfd42..b849ff3 100644 --- a/views/admin/plugins/item-relations-config-form.php +++ b/views/admin/plugins/item-relations-config-form.php @@ -3,7 +3,6 @@
      formLabel('item_relations_allow_vocabularies', __('Limit Relations to Vocabularies')); ?> -

      From bb1815bd950c38d23d37743484703a25f4e01e04 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 26 Jan 2016 11:29:08 +0100 Subject: [PATCH 37/66] (Yet unsuccessful) experiments with addSearchText() to be able to search for relationship comments through full-text-search --- ItemRelationsPlugin.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 752a112..ff9e16a 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -428,6 +428,29 @@ public function hookAfterSaveItem($args) } } } + + // +#+#+# saving relation comments into the search index does not work consistently like that. :-( + // $provideRelationComments = get_option('item_relations_provide_relation_comments'); + // if ($provideRelationComments) { + // $itemId = intval($args["record"]["id"]); + // $sql = "SELECT relation_comment". + // " FROM $db->ItemRelationsRelations". + // " WHERE subject_item_id = $itemId"; + // $rawComments = $db->fetchAll($sql); + // + // if ($rawComments) { + // $comments = array(); + // foreach($rawComments as $rawComment) { + // $comments[] = $rawComment["relation_comment"]; + // } + // if ($comments) { + // $item = get_record_by_id('Item', $itemId); + // $item->addSearchText(implode(" ", $comments)); + // $item->save(); + // } + // } + // } + } /** From fb6f443df22fb3335dcb155ddf94be4ae161ef67 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 2 Feb 2016 15:50:19 +0100 Subject: [PATCH 38/66] Add relation comments to search text works now --- ItemRelationsPlugin.php | 74 ++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index ff9e16a..ca43fd1 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -336,6 +336,26 @@ public function hookPublicItemsSearch() { self::_itemsSearch(); } + /** + * Manual implementation of addSearchItem() + */ + protected function myAddSearchText($item, $enrichedSearchTexts) { + // http://omeka.org/forums/topic/adding-item-search-text-from-a-plugin + //look up the existing search text + $searchText = $this->_db->getTable('SearchText')->findByRecord('Item', $item->id); + + // searchText should already exist, but if something goes wrong, create it + if (!$searchText) { + $searchText = new SearchText; + $searchText->record_type = 'Item'; + $searchText->record_id = $item->id; + $searchText->public = $item->public; + $searchText->title = metadata($item, array('Dublin Core', 'Title')); + } + $searchText->text .= ' ' . $enrichedSearchTexts; + $searchText->save(); + } + /** * Save the item relations after saving an item add/edit form. * @@ -343,13 +363,11 @@ public function hookPublicItemsSearch() { */ public function hookAfterSaveItem($args) { - if (!$args['post']) { - return; - } + $db = $this->_db; + if ($args['post']) { $record = $args['record']; $post = $args['post']; - $db = $this->_db; // Save item relations. if (isset($post['item_relations_property_id'])) { @@ -428,29 +446,31 @@ public function hookAfterSaveItem($args) } } } - - // +#+#+# saving relation comments into the search index does not work consistently like that. :-( - // $provideRelationComments = get_option('item_relations_provide_relation_comments'); - // if ($provideRelationComments) { - // $itemId = intval($args["record"]["id"]); - // $sql = "SELECT relation_comment". - // " FROM $db->ItemRelationsRelations". - // " WHERE subject_item_id = $itemId"; - // $rawComments = $db->fetchAll($sql); - // - // if ($rawComments) { - // $comments = array(); - // foreach($rawComments as $rawComment) { - // $comments[] = $rawComment["relation_comment"]; - // } - // if ($comments) { - // $item = get_record_by_id('Item', $itemId); - // $item->addSearchText(implode(" ", $comments)); - // $item->save(); - // } - // } - // } - + } # if ($args['post']) + + $itemId = intval(@$args["record"]["id"]); + if ($itemId) { + // saving relation comments into the search index + $provideRelationComments = get_option('item_relations_provide_relation_comments'); + if ($provideRelationComments) { + $sql = "SELECT relation_comment". + " FROM $db->ItemRelationsRelations". + " WHERE subject_item_id = $itemId"; + $rawComments = $db->fetchAll($sql); + + if ($rawComments) { + $comments = array(); + foreach($rawComments as $rawComment) { + $comments[] = $rawComment["relation_comment"]; + } + if ($comments) { + $item = get_record_by_id('Item', $itemId); + $enrichedSearchTexts = implode(" ", $comments); + SELF::myAddSearchText($item, $enrichedSearchTexts); + } + } + } + } } /** From 47c202495797ce9b406350ed3ed63c2fa758c37d Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Wed, 10 Feb 2016 18:36:02 +0100 Subject: [PATCH 39/66] Relationship titles are now editable as well / + report existing titles when creating / editing / PLUS: i18n URL update (GitHub / Transifex) --- controllers/VocabulariesController.php | 33 +++++-- languages/de_DE.mo | Bin 34373 -> 34555 bytes languages/de_DE.po | 112 ++++++++++++----------- languages/template.base.pot | 9 +- languages/template.pot | 121 +++++++++++++------------ views/admin/vocabularies/delete.php | 2 +- views/admin/vocabularies/edit.php | 2 +- views/admin/vocabularies/show.php | 1 + 8 files changed, 153 insertions(+), 127 deletions(-) diff --git a/controllers/VocabulariesController.php b/controllers/VocabulariesController.php index 5486b68..5362c0e 100644 --- a/controllers/VocabulariesController.php +++ b/controllers/VocabulariesController.php @@ -67,12 +67,13 @@ public function saveAction() $db = get_db(); $sql = "UPDATE `$db->ItemRelationsVocabulary` set name = ?, description = ? where id = $vocabularyId"; $db->query($sql, array(addslashes($vocabularyName) ,addslashes($vocabularyDescription))); - $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); + $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); } else { $this->_helper->flashMessenger(__('The vocabulary name cannot be empty.'), 'error'); } + $this->_helper->redirector('browse'); return; @@ -99,16 +100,15 @@ public function editAction() // Handle edit vocabulary form. if ($this->getRequest()->isPost()) { - $this->_handleEditVocabularyForm($vocabulary->id); - // Redirect to browse. - $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); - $this->_helper->redirector('browse'); + $this->_handleEditVocabularyForm($vocabulary->id); + // Redirect to Show instead of browse. + $this->_helper->redirector('show', null, null, array('id'=>$vocabulary->id)); return; } - $properties = $vocabulary->getProperties(); $this->view->properties = $properties; + } /** @@ -120,12 +120,23 @@ protected function _handleEditVocabularyForm($vocabularyId) { // Edit existing properties. $propertyDescriptions = $this->_getParam('property_description'); + $propertyLabels = $this->_getParam('property_label'); + + // Edit property Descriptions foreach ($propertyDescriptions as $propertyId => $propertyDescription) { $property = $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId); $property->description = $propertyDescription; $property->save(); } + // Edit property Labels + foreach ($propertyLabels as $propertyId => $propertyLabel) { + $property = $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId); + + $property->label = $propertyLabel; + $property->save(); + } + // Add new properties. $newPropertyLabels = $this->_getParam('new_property_label'); $newPropertyDescriptions = $this->_getParam('new_property_description'); @@ -140,8 +151,9 @@ protected function _handleEditVocabularyForm($vocabularyId) // Labels must be unique. if ($this->_helper->db->getTable('ItemRelationsProperty')->findByLabel($newPropertyLabel)) { - continue; - } + $this->_helper->flashMessenger(__('Existing vocabulary properties cannot be added again.'), 'error'); + continue; + } $newProperty = new ItemRelationsProperty; $newProperty->vocabulary_id = $vocabularyId; @@ -149,6 +161,7 @@ protected function _handleEditVocabularyForm($vocabularyId) $newProperty->label = $newPropertyLabel; $newProperty->description = $newPropertyDescription; $newProperty->save(); + } // Delete existing properties. @@ -158,5 +171,9 @@ protected function _handleEditVocabularyForm($vocabularyId) $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId)->delete(); } } + + $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); + } + } diff --git a/languages/de_DE.mo b/languages/de_DE.mo index ff32fc2f98acd307909e197576bba3e283aee616..8d69a263edc35b86fc4e832fe5ed83cefa16401e 100644 GIT binary patch delta 6793 zcmZA53w+LHAII@)Y|JoY!)6Zmu(8b!&W9Yv$YFCn#1OZ+ZDZ~oElKWj79CJgArvZ) zLk%T|4pfgrh13&5C6XSUue`cme)s#juK)kO&j0_tm-m)bD0{Sm?_4ea zrwl34&zSnSq>3@mkpH8WYK<8mVN6$a;}Tqp^)P`C*@utTn2C|N0yD4_n_)1O&9NO0 zz;W0Fx8gu!eC7n1MpQJW_omnbCt()$!jCW?!x|XV1?OQZ9>AVhxuG$4VLA@Ng_wk= zuq{@h@gCR>+u&^MjIUz~{hMFOsNuFQW4dDzw#S{Q`m3l0;-j3E@M1U0TQCK$qOK=4 zcD`SL>6A-R?P$8{umg6&Y1jd`V+#G7@5uDWIHsS5({Uso#1Ysa+L+;3jGDn=RKvG$ zJhqQ<$}6!SPsDnKvg6PStJTR2;|0d+R&Bp5Ra3ldoWY%)iv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*QqC7Bb3@Xm>+RFp`Fo%3p5I+30@!W-wPjM1M2nCSxvMhzZJhG>XFyOD7~WjSNe$< z;Lh=*!+P1;7Vjc%pKGh#+f(_Y#M8=<#yhw_AK`Ny(UEw6PEaF?@ed04hse~9pyrn+* z*hcfI_@4MTp~a}AMRI}okSHQE_EQSsn%+2z2qxYp z++*s;0bX*ZD>f#6C*KK`l88P;xe6pd;!Wb8Dv-W%e>(r4@4z)Vl$Q|`h*iWV#C$@F zvk}LAiGPvT8+Q!hp3_WaNC6z2?qtnDOd!S*R|qBjdF8m1b^p0mZ%HM#xAQ9)yQ$(Y zX&U9O#Ac$9@Zvt~KzDNe0jWd>QlnCWmD?;f%#52TGDv&x6 zhlmcu2IB98QXLV_H4kHyD#!;CVPub}|5apSh|h^cLg^Oq0pXEJe;HGH&cU3qPQe4jP9oBtbB{gdV-?@fzB`TJb1m^W@fwjq+(}F#9w6Ft zlN0#o)S1FBL@Qg_6C2z7Y&=JtwdLkqf1dn(LSG&L);+ZiQt;NpcQRv!g_BH^qN^xG^1eE#~I_ZdPm3g zh>q, 2015 +# Gero Zahn , 2015-2016 msgid "" msgstr "" "Project-Id-Version: WeSa Omeka\n" -"Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" +"Report-Msgid-Bugs-To: http://github.com/GerZah/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" -"PO-Revision-Date: 2015-12-07 18:31+0100\n" -"Last-Translator: Gero Zahn \n" +"PO-Revision-Date: 2016-02-10 14:20+0100\n" +"Last-Translator: githanjalli \n" "Language-Team: German (Germany) (http://www.transifex.com/upb/wesa-omeka/language/de_DE/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -27,31 +27,31 @@ msgstr "Benutzerdefiniert" msgid "Custom vocabulary containing relations defined for this Omeka instance." msgstr "Benutzerdefiniertes Vokabular, das Beziehungen enthält, die für diese Omeka-Installation definiert wurden." -#: ItemRelationsPlugin.php:402 +#: ItemRelationsPlugin.php:405 msgid "There was an error in the item relation comments." msgstr "Es ist ein Fehler in den Objekt-Beziehungs-Kommentaren aufgetreten." -#: ItemRelationsPlugin.php:430 +#: ItemRelationsPlugin.php:433 msgid "There was an error in listing the item relation." msgstr "Es ist ein Fehler beim Auflisten der Objekt-Beziehungen aufgetreten." -#: ItemRelationsPlugin.php:523 ItemRelationsPlugin.php:575 views/admin/common/item-relations-show.php:7 views/public/common/item-relations-show.php:2 views/shared/common/item-relations-advanced-search.php:6 +#: ItemRelationsPlugin.php:551 ItemRelationsPlugin.php:603 views/admin/common/item-relations-show.php:18 views/public/common/item-relations-show.php:14 views/shared/common/item-relations-advanced-search.php:6 msgid "Item Relations" msgstr "Objekt-Beziehungen" -#: ItemRelationsPlugin.php:527 +#: ItemRelationsPlugin.php:555 msgid "Subjects" msgstr "Subjekt-Ressourcen" -#: ItemRelationsPlugin.php:529 views/shared/common/item-relations-advanced-search.php:32 views/shared/common/item-relations-form.php:13 +#: ItemRelationsPlugin.php:557 views/shared/common/item-relations-advanced-search.php:32 views/shared/common/item-relations-form.php:13 msgid "Object" msgstr "Objekt-Ressource" -#: ItemRelationsPlugin.php:534 +#: ItemRelationsPlugin.php:562 msgid "These Items" msgstr "Diese Objekte" -#: ItemRelationsPlugin.php:537 +#: ItemRelationsPlugin.php:565 msgid "Item ID" msgstr "Objekt-ID" @@ -67,7 +67,7 @@ msgstr "Das Vokabular wurde erfolgreich hinzugefügt." msgid "The vocabulary cannot be added." msgstr "Das Vokabular konnte nicht hinzugefügt werden." -#: controllers/VocabulariesController.php:70 controllers/VocabulariesController.php:105 +#: controllers/VocabulariesController.php:70 controllers/VocabulariesController.php:175 msgid "The vocabulary was successfully edited." msgstr "Das Vokabular wurde erfolgreich editiert." @@ -75,6 +75,10 @@ msgstr "Das Vokabular wurde erfolgreich editiert." msgid "The vocabulary name cannot be empty." msgstr "Der Vokabular-Name darf nicht leer gelassen werden." +#: controllers/VocabulariesController.php:154 +msgid "Existing vocabulary properties cannot be added again." +msgstr "Bereits existierende Vokabular-Eigenschaften können nicht erneut hinzugefügt werden." + #: formal_vocabularies.php:11 msgid "Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/" msgstr "Beziehungs-Definitionen gemäß DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/" @@ -947,7 +951,7 @@ msgstr "Eigenschaft, die einen Ausdruck repräsentiert, der übersetzt wird." msgid "[unknown]" msgstr "[unbekannt]" -#: views/admin/common/item-relations-show.php:10 views/public/common/item-relations-show.php:4 +#: views/admin/common/item-relations-show.php:21 views/public/common/item-relations-show.php:16 msgid "This item has no relations." msgstr "Dieses Objekt besitzt keine Beziehungen." @@ -967,89 +971,89 @@ msgstr "Markieren Sie die Vokabulare, die in Beziehungen verwendet werden könne msgid "If none is checked, all vocabularies will be allowed." msgstr "Wenn kein Vokabular markiert ist, sind alle zugelassen." -#: views/admin/plugins/item-relations-config-form.php:35 +#: views/admin/plugins/item-relations-config-form.php:42 msgid "Provide comment field for relations" msgstr "Kommentarfeld für Relationen anbieten" -#: views/admin/plugins/item-relations-config-form.php:40 +#: views/admin/plugins/item-relations-config-form.php:47 msgid "Check this if you want to be able to enter a comment to a relation." msgstr "Aktivieren Sie diese Einstellung, wenn Sie zu einer Relation einen Kommentar eingeben möchten." -#: views/admin/plugins/item-relations-config-form.php:48 +#: views/admin/plugins/item-relations-config-form.php:55 msgid "Display" msgstr "Anzeige" -#: views/admin/plugins/item-relations-config-form.php:52 +#: views/admin/plugins/item-relations-config-form.php:59 msgid "Relation Format" msgstr "Beziehungs-Format" -#: views/admin/plugins/item-relations-config-form.php:57 +#: views/admin/plugins/item-relations-config-form.php:64 msgid "Select the format of an item's relations that you would prefer to show. If one is unavailable the other will be used." msgstr "Wählen Sie das Format einer Objekt-Beziehung, die Sie vornehmlich anzeigen möchten. Ist eine davon nicht verfügbar, wird die andere verwendet." -#: views/admin/plugins/item-relations-config-form.php:63 +#: views/admin/plugins/item-relations-config-form.php:70 msgid "prefix:localPart" msgstr "Präfix:Lokaler Teil" -#: views/admin/plugins/item-relations-config-form.php:64 +#: views/admin/plugins/item-relations-config-form.php:71 msgid "label" msgstr "Bezeichnung" -#: views/admin/plugins/item-relations-config-form.php:71 +#: views/admin/plugins/item-relations-config-form.php:78 msgid "Display position in admin view" msgstr "Anzeigeposition in Admin-Ansicht" -#: views/admin/plugins/item-relations-config-form.php:76 +#: views/admin/plugins/item-relations-config-form.php:83 msgid "Select the position where you would prefer to display the relations in admin view: In the side bar in the lower right (default) or underneath the regular field values to the left." msgstr "Wählen Sie die Anzeigeposition, die Sie für die Beziehungen in der Admin-Ansicht bevorzugen: In der Seitenleiste unten rechts (Default) oder unterhalb der regulären Feldern auf der linken Seite." -#: views/admin/plugins/item-relations-config-form.php:82 +#: views/admin/plugins/item-relations-config-form.php:89 msgid "Side bar" msgstr "Seitenleiste" -#: views/admin/plugins/item-relations-config-form.php:83 +#: views/admin/plugins/item-relations-config-form.php:90 msgid "Main content" msgstr "Hauptinhalt" -#: views/admin/plugins/item-relations-config-form.php:90 -msgid "Append to Public Items Show" -msgstr "Auf der öffentlichen Seite anzeigen" - -#: views/admin/plugins/item-relations-config-form.php:95 -msgid "Check this if you want to display an item's relations on its public show page." -msgstr "Aktivieren Sie diese Einstellung, wenn Sie die Objekt-Beziehungen auf der öffentlichen Seite anzeigen wollen." - -#: views/admin/plugins/item-relations-config-form.php:105 -msgid "Public Display Mode" -msgstr "Öffentlicher Anzeigemodus" +#: views/admin/plugins/item-relations-config-form.php:97 +msgid "Admin Display Mode" +msgstr "Admin-Anzeigemodus" -#: views/admin/plugins/item-relations-config-form.php:110 -msgid "Set how to display the list of relations in the public view." -msgstr "Definieren Sie, wie die Beziehungsliste in der öffentlichen Ansicht angezeigt werden soll." +#: views/admin/plugins/item-relations-config-form.php:102 +msgid "Set how to display the list of relations in the admin view." +msgstr "Definieren Sie, wie die Beziehungsliste in der Admin-Ansicht angezeigt werden soll." -#: views/admin/plugins/item-relations-config-form.php:111 views/admin/plugins/item-relations-config-form.php:131 +#: views/admin/plugins/item-relations-config-form.php:103 views/admin/plugins/item-relations-config-form.php:138 msgid "Anyway, the view can be themed." msgstr "Die Darstellung ist in jedem Fall im Theme definierbar." -#: views/admin/plugins/item-relations-config-form.php:116 views/admin/plugins/item-relations-config-form.php:136 +#: views/admin/plugins/item-relations-config-form.php:108 views/admin/plugins/item-relations-config-form.php:143 msgid "As a table" msgstr "Als Tabelle" -#: views/admin/plugins/item-relations-config-form.php:117 views/admin/plugins/item-relations-config-form.php:137 +#: views/admin/plugins/item-relations-config-form.php:109 views/admin/plugins/item-relations-config-form.php:144 msgid "As a list" msgstr "Als Liste" -#: views/admin/plugins/item-relations-config-form.php:118 views/admin/plugins/item-relations-config-form.php:138 +#: views/admin/plugins/item-relations-config-form.php:110 views/admin/plugins/item-relations-config-form.php:145 msgid "By item type" msgstr "Nach Objekttyp" -#: views/admin/plugins/item-relations-config-form.php:125 -msgid "Admin Display Mode" -msgstr "Admin-Anzeigemodus" +#: views/admin/plugins/item-relations-config-form.php:117 +msgid "Append to Public Items Show" +msgstr "Auf der öffentlichen Seite anzeigen" -#: views/admin/plugins/item-relations-config-form.php:130 -msgid "Set how to display the list of relations in the admin view." -msgstr "Definieren Sie, wie die Beziehungsliste in der Admin-Ansicht angezeigt werden soll." +#: views/admin/plugins/item-relations-config-form.php:122 +msgid "Check this if you want to display an item's relations on its public show page." +msgstr "Aktivieren Sie diese Einstellung, wenn Sie die Objekt-Beziehungen auf der öffentlichen Seite anzeigen wollen." + +#: views/admin/plugins/item-relations-config-form.php:132 +msgid "Public Display Mode" +msgstr "Öffentlicher Anzeigemodus" + +#: views/admin/plugins/item-relations-config-form.php:137 +msgid "Set how to display the list of relations in the public view." +msgstr "Definieren Sie, wie die Beziehungsliste in der öffentlichen Ansicht angezeigt werden soll." #: views/admin/vocabularies/add.php:2 msgid "Add New Vocabulary" @@ -1063,7 +1067,7 @@ msgstr "Vokabular-Name" msgid "Vocabulary Description" msgstr "Vokabular-Beschreibung" -#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:19 +#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:20 msgid "Save Vocabulary" msgstr "Vokabular speichern" @@ -1087,7 +1091,7 @@ msgstr "Namensraum-Präfix" msgid "Namespace URI" msgstr "Namensraum-URI" -#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:22 +#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:23 msgid "Delete Vocabulary" msgstr "Vokabular löschen" @@ -1119,19 +1123,19 @@ msgstr "Eigenschaft hinzufügen" msgid "Vocabulary Properties" msgstr "Vokabular-Eigenschaften" -#: views/admin/vocabularies/show.php:16 +#: views/admin/vocabularies/show.php:17 msgid "Edit Vocabulary" msgstr "Vokabular editieren" -#: views/admin/vocabularies/show.php:24 +#: views/admin/vocabularies/show.php:25 msgid "This vocabulary has no properties." msgstr "Dieses Vokabular besitzt keine Eigenschaften." -#: views/admin/vocabularies/show.php:26 +#: views/admin/vocabularies/show.php:27 msgid "Why don't you add some?" msgstr "Möchten Sie einige hinzufügen?" -#: views/admin/vocabularies/show.php:33 +#: views/admin/vocabularies/show.php:34 msgid "Local Part" msgstr "Lokaler Teil" diff --git a/languages/template.base.pot b/languages/template.base.pot index 896a46d..ffdfd2e 100644 --- a/languages/template.base.pot +++ b/languages/template.base.pot @@ -7,13 +7,12 @@ msgid "" msgstr "" "Project-Id-Version: Item Relations\n" -"Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" +"Report-Msgid-Bugs-To: http://github.com/GerZah/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Last-Translator: Gero Zahn\n" +"Language-Team: English (https://www.transifex.com/upb/wesa-omeka/language/en/)\n" +"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" - diff --git a/languages/template.pot b/languages/template.pot index 2fa6000..021c942 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -7,12 +7,13 @@ msgid "" msgstr "" "Project-Id-Version: Item Relations\n" -"Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" +"Report-Msgid-Bugs-To: http://github.com/GerZah/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Last-Translator: Gero Zahn\n" +"Language-Team: English (https://www.transifex.com/upb/wesa-omeka/language/" +"en/)\n" +"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -25,36 +26,36 @@ msgstr "" msgid "Custom vocabulary containing relations defined for this Omeka instance." msgstr "" -#: ItemRelationsPlugin.php:402 +#: ItemRelationsPlugin.php:405 msgid "There was an error in the item relation comments." msgstr "" -#: ItemRelationsPlugin.php:430 +#: ItemRelationsPlugin.php:433 msgid "There was an error in listing the item relation." msgstr "" -#: ItemRelationsPlugin.php:523 ItemRelationsPlugin.php:575 -#: views/admin/common/item-relations-show.php:7 -#: views/public/common/item-relations-show.php:2 +#: ItemRelationsPlugin.php:551 ItemRelationsPlugin.php:603 +#: views/admin/common/item-relations-show.php:18 +#: views/public/common/item-relations-show.php:14 #: views/shared/common/item-relations-advanced-search.php:6 msgid "Item Relations" msgstr "" -#: ItemRelationsPlugin.php:527 +#: ItemRelationsPlugin.php:555 msgid "Subjects" msgstr "" -#: ItemRelationsPlugin.php:529 +#: ItemRelationsPlugin.php:557 #: views/shared/common/item-relations-advanced-search.php:32 #: views/shared/common/item-relations-form.php:13 msgid "Object" msgstr "" -#: ItemRelationsPlugin.php:534 +#: ItemRelationsPlugin.php:562 msgid "These Items" msgstr "" -#: ItemRelationsPlugin.php:537 +#: ItemRelationsPlugin.php:565 msgid "Item ID" msgstr "" @@ -71,7 +72,7 @@ msgid "The vocabulary cannot be added." msgstr "" #: controllers/VocabulariesController.php:70 -#: controllers/VocabulariesController.php:105 +#: controllers/VocabulariesController.php:175 msgid "The vocabulary was successfully edited." msgstr "" @@ -79,6 +80,10 @@ msgstr "" msgid "The vocabulary name cannot be empty." msgstr "" +#: controllers/VocabulariesController.php:154 +msgid "Existing vocabulary properties cannot be added again." +msgstr "" + #: formal_vocabularies.php:11 msgid "" "Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/" @@ -1029,8 +1034,8 @@ msgstr "" msgid "[unknown]" msgstr "" -#: views/admin/common/item-relations-show.php:10 -#: views/public/common/item-relations-show.php:4 +#: views/admin/common/item-relations-show.php:21 +#: views/public/common/item-relations-show.php:16 msgid "This item has no relations." msgstr "" @@ -1050,99 +1055,99 @@ msgstr "" msgid "If none is checked, all vocabularies will be allowed." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:35 +#: views/admin/plugins/item-relations-config-form.php:42 msgid "Provide comment field for relations" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:40 +#: views/admin/plugins/item-relations-config-form.php:47 msgid "Check this if you want to be able to enter a comment to a relation." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:48 +#: views/admin/plugins/item-relations-config-form.php:55 msgid "Display" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:52 +#: views/admin/plugins/item-relations-config-form.php:59 msgid "Relation Format" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:57 +#: views/admin/plugins/item-relations-config-form.php:64 msgid "" "Select the format of an item's relations that you would prefer to show. If " "one is unavailable the other will be used." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:63 +#: views/admin/plugins/item-relations-config-form.php:70 msgid "prefix:localPart" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:64 +#: views/admin/plugins/item-relations-config-form.php:71 msgid "label" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:71 +#: views/admin/plugins/item-relations-config-form.php:78 msgid "Display position in admin view" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:76 +#: views/admin/plugins/item-relations-config-form.php:83 msgid "" "Select the position where you would prefer to display the relations in admin " "view: In the side bar in the lower right (default) or underneath the regular " "field values to the left." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:82 +#: views/admin/plugins/item-relations-config-form.php:89 msgid "Side bar" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:83 +#: views/admin/plugins/item-relations-config-form.php:90 msgid "Main content" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:90 -msgid "Append to Public Items Show" +#: views/admin/plugins/item-relations-config-form.php:97 +msgid "Admin Display Mode" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:95 -msgid "" -"Check this if you want to display an item's relations on its public show " -"page." +#: views/admin/plugins/item-relations-config-form.php:102 +msgid "Set how to display the list of relations in the admin view." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:105 -msgid "Public Display Mode" +#: views/admin/plugins/item-relations-config-form.php:103 +#: views/admin/plugins/item-relations-config-form.php:138 +msgid "Anyway, the view can be themed." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:110 -msgid "Set how to display the list of relations in the public view." +#: views/admin/plugins/item-relations-config-form.php:108 +#: views/admin/plugins/item-relations-config-form.php:143 +msgid "As a table" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:111 -#: views/admin/plugins/item-relations-config-form.php:131 -msgid "Anyway, the view can be themed." +#: views/admin/plugins/item-relations-config-form.php:109 +#: views/admin/plugins/item-relations-config-form.php:144 +msgid "As a list" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:116 -#: views/admin/plugins/item-relations-config-form.php:136 -msgid "As a table" +#: views/admin/plugins/item-relations-config-form.php:110 +#: views/admin/plugins/item-relations-config-form.php:145 +msgid "By item type" msgstr "" #: views/admin/plugins/item-relations-config-form.php:117 -#: views/admin/plugins/item-relations-config-form.php:137 -msgid "As a list" +msgid "Append to Public Items Show" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:118 -#: views/admin/plugins/item-relations-config-form.php:138 -msgid "By item type" +#: views/admin/plugins/item-relations-config-form.php:122 +msgid "" +"Check this if you want to display an item's relations on its public show " +"page." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:125 -msgid "Admin Display Mode" +#: views/admin/plugins/item-relations-config-form.php:132 +msgid "Public Display Mode" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:130 -msgid "Set how to display the list of relations in the admin view." +#: views/admin/plugins/item-relations-config-form.php:137 +msgid "Set how to display the list of relations in the public view." msgstr "" #: views/admin/vocabularies/add.php:2 @@ -1157,7 +1162,7 @@ msgstr "" msgid "Vocabulary Description" msgstr "" -#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:19 +#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:20 msgid "Save Vocabulary" msgstr "" @@ -1182,7 +1187,7 @@ msgstr "" msgid "Namespace URI" msgstr "" -#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:22 +#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:23 msgid "Delete Vocabulary" msgstr "" @@ -1218,19 +1223,19 @@ msgstr "" msgid "Vocabulary Properties" msgstr "" -#: views/admin/vocabularies/show.php:16 +#: views/admin/vocabularies/show.php:17 msgid "Edit Vocabulary" msgstr "" -#: views/admin/vocabularies/show.php:24 +#: views/admin/vocabularies/show.php:25 msgid "This vocabulary has no properties." msgstr "" -#: views/admin/vocabularies/show.php:26 +#: views/admin/vocabularies/show.php:27 msgid "Why don't you add some?" msgstr "" -#: views/admin/vocabularies/show.php:33 +#: views/admin/vocabularies/show.php:34 msgid "Local Part" msgstr "" diff --git a/views/admin/vocabularies/delete.php b/views/admin/vocabularies/delete.php index de38a32..458bab8 100644 --- a/views/admin/vocabularies/delete.php +++ b/views/admin/vocabularies/delete.php @@ -26,7 +26,7 @@

      - +
      diff --git a/views/admin/vocabularies/edit.php b/views/admin/vocabularies/edit.php index f626d9e..6ecd94a 100644 --- a/views/admin/vocabularies/edit.php +++ b/views/admin/vocabularies/edit.php @@ -22,7 +22,7 @@ properties as $property): ?> - label; ?> + formTextarea("property_label[{$property->id}]",$property->label, array('cols' => 50, 'rows' => 2)); ?> formTextarea("property_description[{$property->id}]", $property->description, array('cols' => 50, 'rows' => 2)); ?> formCheckbox("property_delete[{$property->id}]") ?> diff --git a/views/admin/vocabularies/show.php b/views/admin/vocabularies/show.php index 88b5d8b..2e3b6d4 100644 --- a/views/admin/vocabularies/show.php +++ b/views/admin/vocabularies/show.php @@ -2,6 +2,7 @@ echo head(array('title' => __('Vocabulary Properties'))); $vocabulary = $this->item_relations_vocabulary; $properties = $vocabulary->getProperties(); +echo flash(); ?>
      From af91950d5fd91b9abdf27aaa1960846cce609ba2 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Thu, 11 Feb 2016 13:54:10 +0100 Subject: [PATCH 40/66] manual merge of "Backport" branch into "master" branch --- ItemRelationsPlugin.php | 1398 +++++++++-------- README.md | 88 ++ config_form.php | 55 - controllers/LookupController.php | 18 +- controllers/VocabulariesController.php | 33 +- item_relations_form.php | 158 -- item_relations_styles.css | 7 - languages/de_DE.mo | Bin 32694 -> 34555 bytes languages/de_DE.po | 323 ++-- languages/template.base.pot | 9 +- languages/template.pot | 336 ++-- models/Table/ItemRelationsRelation.php | 30 +- views/admin/common/item-relations-show.php | 59 +- views/admin/lookup/index.php | 3 - .../plugins/item-relations-config-form.php | 149 ++ views/admin/vocabularies/browse.php | 7 +- views/admin/vocabularies/delete.php | 2 +- views/admin/vocabularies/edit.php | 2 +- views/admin/vocabularies/show.php | 1 + views/helpers/ItemRelationsForm.php | 70 + views/public/common/item-relations-show.php | 61 +- views/shared/common/item-relations-form.php | 127 ++ .../item-relations-show-list-by-item-type.php | 70 + .../common/item-relations-show-list.php | 31 + .../common/item-relations-show-table.php | 36 + views/shared/css/item-relations.css | 15 + .../shared/javascripts/item-relations.js | 0 .../shared/javascripts/lity}/lity.css | 0 .../shared/javascripts/lity}/lity.js | 0 .../shared/javascripts/lity}/lity.min.css | 0 .../shared/javascripts/lity}/lity.min.js | 0 31 files changed, 1877 insertions(+), 1211 deletions(-) create mode 100644 README.md delete mode 100644 config_form.php delete mode 100644 item_relations_form.php delete mode 100644 item_relations_styles.css delete mode 100644 views/admin/lookup/index.php create mode 100644 views/admin/plugins/item-relations-config-form.php create mode 100644 views/helpers/ItemRelationsForm.php create mode 100644 views/shared/common/item-relations-form.php create mode 100644 views/shared/common/item-relations-show-list-by-item-type.php create mode 100644 views/shared/common/item-relations-show-list.php create mode 100644 views/shared/common/item-relations-show-table.php create mode 100644 views/shared/css/item-relations.css rename item_relations_script.js => views/shared/javascripts/item-relations.js (100%) rename {lity => views/shared/javascripts/lity}/lity.css (100%) rename {lity => views/shared/javascripts/lity}/lity.js (100%) rename {lity => views/shared/javascripts/lity}/lity.min.css (100%) rename {lity => views/shared/javascripts/lity}/lity.min.js (100%) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 90fe9cb..ca43fd1 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -1,699 +1,801 @@ 1, - 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', // maincontent - 'item_relations_provide_relation_comments' => 0, - 'item_relations_relation_format' => 'prefix_local_part' - ); - - /** - * Install the plugin. - */ - public function hookInstall() - { - // Create tables. - $db = $this->_db; - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsVocabulary` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `description` text, - `namespace_prefix` varchar(100) NOT NULL, - `namespace_uri` varchar(200) DEFAULT NULL, - `custom` BOOLEAN NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsProperty` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `vocabulary_id` int(10) unsigned NOT NULL, - `local_part` varchar(100) NOT NULL, - `label` varchar(100) DEFAULT NULL, - `description` text, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - $sql = " - CREATE TABLE IF NOT EXISTS `$db->ItemRelationsRelation` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `subject_item_id` int(10) unsigned NOT NULL, - `property_id` int(10) unsigned NOT NULL, - `object_item_id` int(10) unsigned NOT NULL, - `relation_comment` varchar(60) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $db->query($sql); - - // Install the formal vocabularies and their properties. - self::hookInitialize(); // Make sure that the i18n file is already loaded - $formalVocabularies = include 'formal_vocabularies.php'; - foreach ($formalVocabularies as $formalVocabulary) { - $vocabulary = new ItemRelationsVocabulary; - $vocabulary->name = $formalVocabulary['name']; - $vocabulary->description = $formalVocabulary['description']; - $vocabulary->namespace_prefix = $formalVocabulary['namespace_prefix']; - $vocabulary->namespace_uri = $formalVocabulary['namespace_uri']; - $vocabulary->custom = 0; - $vocabulary->save(); - - $vocabularyId = $vocabulary->id; - - foreach ($formalVocabulary['properties'] as $formalProperty) { - $property = new ItemRelationsProperty; - $property->vocabulary_id = $vocabularyId; - $property->local_part = $formalProperty['local_part']; - $property->label = $formalProperty['label']; - $property->description = $formalProperty['description']; - $property->save(); - } - } + /** + * @var array Hooks for the plugin. + */ + protected $_hooks = array( + 'install', + 'uninstall', + 'upgrade', + 'config', + 'config_form', + 'define_acl', + 'initialize', + 'after_save_item', + 'after_delete_item', + 'admin_items_show', + 'admin_items_show_sidebar', + 'admin_items_search', + 'admin_items_batch_edit_form', + 'items_batch_edit_custom', + 'public_items_show', + 'public_items_search', + 'items_browse_sql', + ); + + /** + * @var array Filters for the plugin. + */ + protected $_filters = array( + 'admin_items_form_tabs', + 'admin_navigation_main', + 'item_relations_properties_select_options', + ); + + /** + * @var array Options and their default values. + */ + protected $_options = array( + 'item_relations_allow_vocabularies' => '[]', + 'item_relations_provide_relation_comments' => 0, + 'item_relations_relation_format' => 'prefix_local_part', + 'item_relations_admin_sidebar_or_maincontent' => 'sidebar', + 'item_relations_public_append_to_items_show' => 1, + 'item_relations_public_display_mode' => 'table', + 'item_relations_admin_display_mode' => 'table', + ); + + /** + * Install the plugin. + */ + public function hookInstall() + { + // Create tables. + $db = $this->_db; + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsVocabulary` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `description` text, + `namespace_prefix` varchar(100) NOT NULL, + `namespace_uri` varchar(200) DEFAULT NULL, + `custom` BOOLEAN NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsProperty` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vocabulary_id` int(10) unsigned NOT NULL, + `local_part` varchar(100) NOT NULL, + `label` varchar(100) DEFAULT NULL, + `description` text, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + $sql = " + CREATE TABLE IF NOT EXISTS `$db->ItemRelationsRelation` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `subject_item_id` int(10) unsigned NOT NULL, + `property_id` int(10) unsigned NOT NULL, + `object_item_id` int(10) unsigned NOT NULL, + `relation_comment` varchar(60) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + $db->query($sql); + + // Install the formal vocabularies and their properties. + self::hookInitialize(); // Make sure that the i18n file is already loaded + $formalVocabularies = include 'formal_vocabularies.php'; + foreach ($formalVocabularies as $formalVocabulary) { + $vocabulary = new ItemRelationsVocabulary; + $vocabulary->name = $formalVocabulary['name']; + $vocabulary->description = $formalVocabulary['description']; + $vocabulary->namespace_prefix = $formalVocabulary['namespace_prefix']; + $vocabulary->namespace_uri = $formalVocabulary['namespace_uri']; + $vocabulary->custom = 0; + $vocabulary->save(); + + $vocabularyId = $vocabulary->id; + + foreach ($formalVocabulary['properties'] as $formalProperty) { + $property = new ItemRelationsProperty; + $property->vocabulary_id = $vocabularyId; + $property->local_part = $formalProperty['local_part']; + $property->label = $formalProperty['label']; + $property->description = $formalProperty['description']; + $property->save(); + } + } - // Install a custom vocabulary. - $customVocabulary = new ItemRelationsVocabulary; - $customVocabulary->name = __('Custom'); - $customVocabulary->description = __('Custom vocabulary containing relations defined for this Omeka instance.'); - $customVocabulary->namespace_prefix = ''; // cannot be NULL - $customVocabulary->namespace_uri = null; - $customVocabulary->custom = 1; - $customVocabulary->save(); - - $this->_installOptions(); - } - - /** - * Uninstall the plugin. - */ - public function hookUninstall() - { - $db = $this->_db; - - // Drop the vocabularies table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsVocabulary`"; - $db->query($sql); - - // Drop the properties table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsProperty`"; - $db->query($sql); - - // Drop the relations table. - $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsRelation`"; - $db->query($sql); - - $this->_uninstallOptions(); - } - - /** - * Display the plugin configuration form. - */ - public static function hookConfigForm() - { - $publicAppendToItemsShow = get_option('item_relations_public_append_to_items_show'); - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - $provideRelationComments = get_option('item_relations_provide_relation_comments'); - $relationFormat = get_option('item_relations_relation_format'); - - require dirname(__FILE__) . '/config_form.php'; - } - - /** - * Handle the plugin configuration form. - */ - public static function hookConfig() - { - set_option('item_relations_public_append_to_items_show', - (int)(boolean) $_POST['item_relations_public_append_to_items_show']); - set_option('item_relations_admin_sidebar_or_maincontent', - $_POST['item_relations_admin_sidebar_or_maincontent']); - set_option('item_relations_provide_relation_comments', - (int)(boolean) $_POST['item_relations_provide_relation_comments']); - set_option('item_relations_relation_format', - $_POST['item_relations_relation_format']); - } - - /** - * Upgrade the plugin. - * - * @param array $args - */ - public function hookUpgrade($args) - { - $oldVersion = $args['old_version']; - $db = $this->_db; - if ($oldVersion <= '1.1') { - $sql = " - INSERT INTO `{$db->ItemRelationsProperty}` - (`vocabulary_id`, `local_part`, `label`, `description`) - VALUES - (1, 'abstract', 'Abstract', 'A summary of the resource.'), - (1, 'accessRights', 'Access Rights', 'Information about who can access the resource or an indication of its security status.'), - (1, 'accrualMethod', 'Accrual Method', 'The method by which items are added to a collection.'), - (1, 'accrualPeriodicity', 'Accrual Periodicity', 'The frequency with which items are added to a collection.'), - (1, 'accrualPolicy', 'Accrual Policy', 'The policy governing the addition of items to a collection.'), - (1, 'audience', 'Audience', 'A class of entity for whom the resource is intended or useful.'), - (1, 'contributor', 'Contributor', 'An entity responsible for making contributions to the resource.'), - (1, 'coverage', 'Coverage', 'The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.'), - (1, 'creator', 'Creator', 'An entity primarily responsible for making the resource.'), - (1, 'description', 'Description', 'An account of the resource.'), - (1, 'educationLevel', 'Audience Education Level', 'A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'), - (1, 'extent', 'Extent', 'The size or duration of the resource.'), - (1, 'format', 'Format', 'The file format, physical medium, or dimensions of the resource.'), - (1, 'instructionalMethod', 'Instructional Method', 'A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'), - (1, 'language', 'Language', 'A language of the resource.'), - (1, 'license', 'License', 'A legal document giving official permission to do something with the resource.'), - (1, 'mediator', 'Mediator', 'An entity that mediates access to the resource and for whom the resource is intended or useful.'), - (1, 'medium', 'Medium', 'The material or physical carrier of the resource.'), - (1, 'provenance', 'Provenance', 'A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.'), - (1, 'publisher', 'Publisher', 'An entity responsible for making the resource available.'), - (1, 'rights', 'Rights', 'Information about rights held in and over the resource.'), - (1, 'rightsHolder', 'Rights Holder', 'A person or organization owning or managing rights over the resource.'), - (1, 'spatial', 'Spatial Coverage', 'Spatial characteristics of the resource.'), - (1, 'subject', 'Subject', 'The topic of the resource.'), - (1, 'tableOfContents', 'Table Of Contents', 'A list of subunits of the resource.'), - (1, 'temporal', 'Temporal Coverage', 'Temporal characteristics of the resource.'), - (1, 'type', 'Type', 'The nature or genre of the resource.')"; - $db->query($sql); + // Install a custom vocabulary. + $customVocabulary = new ItemRelationsVocabulary; + $customVocabulary->name = __('Custom'); + $customVocabulary->description = __('Custom vocabulary containing relations defined for this Omeka instance.'); + $customVocabulary->namespace_prefix = ''; // cannot be NULL + $customVocabulary->namespace_uri = null; + $customVocabulary->custom = 1; + $customVocabulary->save(); + + $this->_installOptions(); } - if ($oldVersion <= '2.0') { - // Fix un-upgraded old table name if present. - $correctTableName = (bool) $db->fetchOne("SHOW TABLES LIKE '{$db->ItemRelationsRelation}'"); - if (!$correctTableName) { - $sql = "RENAME TABLE `{$db->prefix}item_relations_item_relations` TO `{$db->ItemRelationsRelation}`"; + /** + * Uninstall the plugin. + */ + public function hookUninstall() + { + $db = $this->_db; + + // Drop the vocabularies table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsVocabulary`"; $db->query($sql); - } + + // Drop the properties table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsProperty`"; + $db->query($sql); + + // Drop the relations table. + $sql = "DROP TABLE IF EXISTS `$db->ItemRelationsRelation`"; + $db->query($sql); + + $this->_uninstallOptions(); } - if ($oldVersion <= '2.21') { - // Insert relation_comment column - $sql = "ALTER TABLE `{$db->prefix}item_relations_relations` ADD `relation_comment` VARCHAR(60) NOT NULL DEFAULT '' AFTER `object_item_id`"; - $db->query($sql); + /** + * Display the plugin configuration form. + */ + public function hookConfigForm($args) + { + $view = get_view(); + echo $view->partial( + 'plugins/item-relations-config-form.php' + ); } - } - - /** - * Add the translations. - */ - public function hookInitialize() - { - add_translation_source(dirname(__FILE__) . '/languages'); - } - - /** - * Define the ACL. - * - * @param array $args - */ - public function hookDefineAcl($args) - { - $acl = $args['acl']; - - $indexResource = new Zend_Acl_Resource('ItemRelations_Index'); - $vocabResource = new Zend_Acl_Resource('ItemRelations_Vocabularies'); - $acl->add($indexResource); - $acl->add($vocabResource); - } - - /** - * Display item relations on the public items show page. - */ - public function hookPublicItemsShow() { - if (get_option('item_relations_public_append_to_items_show')) { - $item = get_current_record('item'); - - echo common('item-relations-show', array( - 'thisItemId' => $item->id, - 'allRelations' => self::prepareAllRelations($item), - )); + /** + * Handle the plugin configuration form. + */ + public function hookConfig($args) + { + $post = $args['post']; + foreach ($this->_options as $optionKey => $optionValue) { + if (in_array($optionKey, array( + 'item_relations_allow_vocabularies', + ))) { + $post[$optionKey] = json_encode($post[$optionKey]) ?: json_encode(array()); + } + if (isset($post[$optionKey])) { + set_option($optionKey, $post[$optionKey]); + } + } } - } - - /** - * Display item relations on the admin items show page underneath main content. - * - * @param Item $item - */ - public function hookAdminItemsShow($args) - { - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - if ($adminSidebarOrMaincontent == "maincontent"): - - $item = $args['item']; - - echo common('item-relations-show', array( - 'thisItemId' => $item->id, - 'allRelations' => self::prepareAllRelations($item), - )); - - endif; - } - - /** - * Display item relations on the admin items show page in the side bar in the lower right. - * - * @param Item $item - */ - public function hookAdminItemsShowSidebar($args) - { - $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); - if ($adminSidebarOrMaincontent != "maincontent"): - - $item = $args['item']; - - echo common('item-relations-show', array( - 'thisItemId' => $item->id, - 'allRelations' => self::prepareAllRelations($item), - )); - - endif; - } - - /** - * Display the item relations form on the advanced search page. - */ - protected function _ItemsSearch() - { - echo common('item-relations-advanced-search', array( - 'formSelectProperties' => get_table_options('ItemRelationsProperty')) - ); - } - - /** - * Display the item relations form on the admin advanced search page. - */ - public function hookAdminItemsSearch() { SELF::_itemsSearch(); } - - /** - * Display the item relations form on the public advanced search page. - */ - public function hookPublicItemsSearch() { SELF::_itemsSearch(); } - - /** - * Save the item relations after saving an item add/edit form. - * - * @param array $args - */ - public function hookAfterSaveItem($args) - { - if (!$args['post']) { - return; + + /** + * Upgrade the plugin. + * + * @param array $args + */ + public function hookUpgrade($args) + { + $oldVersion = $args['old_version']; + $db = $this->_db; + + if ($oldVersion <= '1.1') { + $sql = " + INSERT INTO `{$db->ItemRelationsProperty}` + (`vocabulary_id`, `local_part`, `label`, `description`) + VALUES + (1, 'abstract', 'Abstract', 'A summary of the resource.'), + (1, 'accessRights', 'Access Rights', 'Information about who can access the resource or an indication of its security status.'), + (1, 'accrualMethod', 'Accrual Method', 'The method by which items are added to a collection.'), + (1, 'accrualPeriodicity', 'Accrual Periodicity', 'The frequency with which items are added to a collection.'), + (1, 'accrualPolicy', 'Accrual Policy', 'The policy governing the addition of items to a collection.'), + (1, 'audience', 'Audience', 'A class of entity for whom the resource is intended or useful.'), + (1, 'contributor', 'Contributor', 'An entity responsible for making contributions to the resource.'), + (1, 'coverage', 'Coverage', 'The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.'), + (1, 'creator', 'Creator', 'An entity primarily responsible for making the resource.'), + (1, 'description', 'Description', 'An account of the resource.'), + (1, 'educationLevel', 'Audience Education Level', 'A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'), + (1, 'extent', 'Extent', 'The size or duration of the resource.'), + (1, 'format', 'Format', 'The file format, physical medium, or dimensions of the resource.'), + (1, 'instructionalMethod', 'Instructional Method', 'A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'), + (1, 'language', 'Language', 'A language of the resource.'), + (1, 'license', 'License', 'A legal document giving official permission to do something with the resource.'), + (1, 'mediator', 'Mediator', 'An entity that mediates access to the resource and for whom the resource is intended or useful.'), + (1, 'medium', 'Medium', 'The material or physical carrier of the resource.'), + (1, 'provenance', 'Provenance', 'A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.'), + (1, 'publisher', 'Publisher', 'An entity responsible for making the resource available.'), + (1, 'rights', 'Rights', 'Information about rights held in and over the resource.'), + (1, 'rightsHolder', 'Rights Holder', 'A person or organization owning or managing rights over the resource.'), + (1, 'spatial', 'Spatial Coverage', 'Spatial characteristics of the resource.'), + (1, 'subject', 'Subject', 'The topic of the resource.'), + (1, 'tableOfContents', 'Table Of Contents', 'A list of subunits of the resource.'), + (1, 'temporal', 'Temporal Coverage', 'Temporal characteristics of the resource.'), + (1, 'type', 'Type', 'The nature or genre of the resource.')"; + $db->query($sql); + } + + if ($oldVersion <= '2.0') { + // Fix un-upgraded old table name if present. + $correctTableName = (bool) $db->fetchOne("SHOW TABLES LIKE '{$db->ItemRelationsRelation}'"); + if (!$correctTableName) { + $sql = "RENAME TABLE `{$db->prefix}item_relations_item_relations` TO `{$db->ItemRelationsRelation}`"; + $db->query($sql); + } + } + + if ($oldVersion < '2.0.2.1') { + // Insert relation_comment column + $sql = "ALTER TABLE `{$db->prefix}item_relations_relations` ADD `relation_comment` VARCHAR(60) NOT NULL DEFAULT '' AFTER `object_item_id`"; + $db->query($sql); + } } - $record = $args['record']; - $post = $args['post']; - #echo "
      "; print_r($_POST); die("
      "); - $db = $this->_db; + /** + * Add the translations. + */ + public function hookInitialize() + { + add_translation_source(dirname(__FILE__) . '/languages'); + } - // Save item relations. - if (isset($post['item_relations_property_id'])) { - foreach ($post['item_relations_property_id'] as $key => $propertyId) { - self::insertItemRelation( - $record, - $propertyId, - $post['item_relations_item_relation_object_item_id'][$key], - $post['item_relations_item_relation_relation_comment'][$key] - ); + /** + * Define the ACL. + * + * @param array $args + */ + public function hookDefineAcl($args) + { + $acl = $args['acl']; + + $indexResource = new Zend_Acl_Resource('ItemRelations_Index'); + $vocabResource = new Zend_Acl_Resource('ItemRelations_Vocabularies'); + $acl->add($indexResource); + $acl->add($vocabResource); } - } - - // update the comment when the comment is edited in subject - if (isset($post['item_relations_item_relation_subject_comment'])) { - if (isset($post['item_relations_subject_comment'])) { - $comments = array(); - foreach($post['item_relations_item_relation_subject_comment'] as $key) { - $key = intval($key); - if ($key) { $comments[$key] = $post['item_relations_subject_comment'][$key]; } - } - $commentIds = implode(",", array_keys($comments)); - //Optimized the update query to avoid multiple execution - $sql = "UPDATE `$db->ItemRelationsRelation` set relation_comment = case id "; - foreach ($comments as $commentId => $comment) { - $sql .= sprintf(" when %d then '%s'", $commentId, addslashes($comment) ); - } - $sql .= " end where id in ($commentIds)"; - $db->query($sql); + /** + * Display item relations on the public items show page. + */ + public function hookPublicItemsShow() + { + if (get_option('item_relations_public_append_to_items_show')) { + $item = get_current_record('item'); + + echo common('item-relations-show', array('item' => $item)); + } } - else { - $this->_helper->flashMessenger(__('There was an error in the item relation comments.'), 'error'); + + /** + * Display item relations on the admin items show page underneath main content. + * + * @param Item $item + */ + public function hookAdminItemsShow($args) + { + $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); + if ($adminSidebarOrMaincontent == "maincontent") { + $item = $args['item']; + + echo common('item-relations-show', array('item' => $item)); + } } - } - - // update the relation when the relation is edited in subject - if (isset($post['item_relations_item_relation_subject_property'])) { - if (isset($post['item_relations_subject_property'])) { - $properties = array(); - foreach($post['item_relations_item_relation_subject_property'] as $key) { - $key = intval($key); - if ($key) { - $val = intval($post['item_relations_subject_property'][$key]); - if ($val) { $properties[$key] = $val; } + + /** + * Display item relations on the admin items show page in the side bar in the lower right. + * + * @param Item $item + */ + public function hookAdminItemsShowSidebar($args) + { + $adminSidebarOrMaincontent = get_option('item_relations_admin_sidebar_or_maincontent'); + if ($adminSidebarOrMaincontent != "maincontent") { + $item = $args['item']; + + echo common('item-relations-show', array('item' => $item)); } - } - $propertyIds = implode(",", array_keys($properties)); + } - //Optimized the update query to avoid multiple execution - $sql = "UPDATE `$db->ItemRelationsRelation` set property_id = case id "; - foreach ($properties as $propertyId => $property) { - $sql .= sprintf(" when %d then %d", $propertyId, $property); - } - $sql .= " end where id in ($propertyIds)"; - $db->query($sql); + /** + * Display the item relations form on the advanced search page. + */ + protected function _ItemsSearch() + { + echo common('item-relations-advanced-search', array( + 'formSelectProperties' => get_table_options('ItemRelationsProperty'), + )); } - else { - $this->_helper->flashMessenger(__('There was an error in listing the item relation.'), 'error'); + + /** + * Display the item relations form on the admin advanced search page. + */ + public function hookAdminItemsSearch() + { + self::_itemsSearch(); } - } - - // Delete item relations. - if (isset($post['item_relations_item_relation_delete'])) { - foreach ($post['item_relations_item_relation_delete'] as $itemRelationId) { - $itemRelation = $db->getTable('ItemRelationsRelation')->find($itemRelationId); - // When an item is related to itself, deleting both relations - // simultaneously will result in an error. Prevent this by - // checking if the item relation exists prior to deletion. - if ($itemRelation) { - $itemRelation->delete(); + + /** + * Display the item relations form on the public advanced search page. + */ + public function hookPublicItemsSearch() { + self::_itemsSearch(); + } + + /** + * Manual implementation of addSearchItem() + */ + protected function myAddSearchText($item, $enrichedSearchTexts) { + // http://omeka.org/forums/topic/adding-item-search-text-from-a-plugin + //look up the existing search text + $searchText = $this->_db->getTable('SearchText')->findByRecord('Item', $item->id); + + // searchText should already exist, but if something goes wrong, create it + if (!$searchText) { + $searchText = new SearchText; + $searchText->record_type = 'Item'; + $searchText->record_id = $item->id; + $searchText->public = $item->public; + $searchText->title = metadata($item, array('Dublin Core', 'Title')); } + $searchText->text .= ' ' . $enrichedSearchTexts; + $searchText->save(); } - } -} -/** -* Delete an item's relations after deleting that item. -* -* @param array $args -*/ -public function hookAfterDeleteItem($args) -{ + /** + * Save the item relations after saving an item add/edit form. + * + * @param array $args + */ + public function hookAfterSaveItem($args) + { + $db = $this->_db; + if ($args['post']) { + + $record = $args['record']; + $post = $args['post']; + + // Save item relations. + if (isset($post['item_relations_property_id'])) { + foreach ($post['item_relations_property_id'] as $key => $propertyId) { + self::insertItemRelation( + $record, + $propertyId, + $post['item_relations_item_relation_object_item_id'][$key], + $post['item_relations_item_relation_relation_comment'][$key] + ); + } + } - $db = $this->_db; + // update the comment when the comment is edited in subject + if (isset($post['item_relations_item_relation_subject_comment'])) { + if (isset($post['item_relations_subject_comment'])) { + $comments = array(); + foreach($post['item_relations_item_relation_subject_comment'] as $key) { + $key = intval($key); + if ($key) { + $comments[$key] = $post['item_relations_subject_comment'][$key]; + } + } + $commentIds = implode(',', array_keys($comments)); + + // Optimized the update query to avoid multiple execution. + $sql = "UPDATE `$db->ItemRelationsRelation` SET relation_comment = CASE id "; + foreach ($comments as $commentId => $comment) { + $sql .= sprintf(' WHEN %d THEN %s', $commentId, $db->quote($comment)); + } + $sql .= " END WHERE id IN ($commentIds)"; + $db->query($sql); + } + else { + $this->_helper->flashMessenger(__('There was an error in the item relation comments.'), 'error'); + } + } - $item_id = intval($args["record"]["id"]); + // Update the relation when the relation is edited in subject. + if (isset($post['item_relations_item_relation_subject_property'])) { + if (isset($post['item_relations_subject_property'])) { + $properties = array(); + foreach($post['item_relations_item_relation_subject_property'] as $key) { + $key = intval($key); + if ($key) { + $val = intval($post['item_relations_subject_property'][$key]); + if ($val) { + $properties[$key] = $val; + } + } + } + $propertyIds = implode(',', array_keys($properties)); + + // Optimized the update query to avoid multiple execution. + $sql = "UPDATE `$db->ItemRelationsRelation` SET property_id = CASE id "; + foreach ($properties as $propertyId => $property) { + $sql .= sprintf(' WHEN %d THEN %d', $propertyId, $property); + } + $sql .= " END WHERE id IN ($propertyIds)"; + $db->query($sql); + } + else { + $this->_helper->flashMessenger(__('There was an error in listing the item relation.'), 'error'); + } + } - if ($item_id) { - $sql = "delete from `$db->ItemRelationsRelation` where subject_item_id=$item_id or object_item_id=$item_id"; - $db->query($sql); - } + // Delete item relations. + if (isset($post['item_relations_item_relation_delete'])) { + foreach ($post['item_relations_item_relation_delete'] as $itemRelationId) { + $itemRelation = $db->getTable('ItemRelationsRelation')->find($itemRelationId); + // When an item is related to itself, deleting both relations + // simultaneously will result in an error. Prevent this by + // checking if the item relation exists prior to deletion. + if ($itemRelation) { + $itemRelation->delete(); + } + } + } + } # if ($args['post']) + + $itemId = intval(@$args["record"]["id"]); + if ($itemId) { + // saving relation comments into the search index + $provideRelationComments = get_option('item_relations_provide_relation_comments'); + if ($provideRelationComments) { + $sql = "SELECT relation_comment". + " FROM $db->ItemRelationsRelations". + " WHERE subject_item_id = $itemId"; + $rawComments = $db->fetchAll($sql); + + if ($rawComments) { + $comments = array(); + foreach($rawComments as $rawComment) { + $comments[] = $rawComment["relation_comment"]; + } + if ($comments) { + $item = get_record_by_id('Item', $itemId); + $enrichedSearchTexts = implode(" ", $comments); + SELF::myAddSearchText($item, $enrichedSearchTexts); + } + } + } + } + } -} + /** + * Delete an item's relations after deleting that item. + * + * @param array $args + */ + public function hookAfterDeleteItem($args) + { + $db = $this->_db; -/** -* Filter for an item relation after search page submission. -* -* @param array $args -*/ -public function hookItemsBrowseSql($args) -{ - $select = $args['select']; - $params = $args['params']; - - // Set the field on which to join. - if (isset($params['item_relations_clause_part']) - && $params['item_relations_clause_part'] == 'object' - ) { - $onField = 'object_item_id'; - } else { - $onField = 'subject_item_id'; - } - - $filter_relation=( isset($params['item_relations_property_id']) && is_numeric($params['item_relations_property_id']) ); - $filter_comment=( isset($params['item_relations_comment']) && (trim($params['item_relations_comment'])) ); - - if ( $filter_relation || $filter_comment ) { - - $db = $this->_db; - $select - ->join( - array('item_relations_relations' => $db->ItemRelationsRelation), - "item_relations_relations.$onField = items.id", - array() - ); - - if ($filter_relation) { - $select->where('item_relations_relations.property_id = ?', - $params['item_relations_property_id']); - } - - if ($filter_comment) { - $select->where('item_relations_relations.relation_comment LIKE ?', - "%".trim($params['item_relations_comment'])."%" ); - } + $item_id = intval($args["record"]["id"]); -} + if ($item_id) { + $sql = "delete from `$db->ItemRelationsRelation` where subject_item_id=$item_id or object_item_id=$item_id"; + $db->query($sql); + } + } -# echo "
      "; print_r($select); die("
      "); + /** + * Filter for an item relation after search page submission. + * + * @param array $args + */ + public function hookItemsBrowseSql($args) + { + $select = $args['select']; + $params = $args['params']; + + // Set the field on which to join. + if (isset($params['item_relations_clause_part']) + && $params['item_relations_clause_part'] == 'object' + ) { + $onField = 'object_item_id'; + } else { + $onField = 'subject_item_id'; + } -// $select->where('items.id = ?', 2); -} + $filter_relation = isset($params['item_relations_property_id']) + && is_numeric($params['item_relations_property_id']); + $filter_comment = isset($params['item_relations_comment']) + && (trim($params['item_relations_comment'])); + + if ($filter_relation || $filter_comment) { + + $db = $this->_db; + $select + ->join( + array('item_relations_relations' => $db->ItemRelationsRelation), + "item_relations_relations.$onField = items.id", + array() + ); + + if ($filter_relation) { + $select->where('item_relations_relations.property_id = ?', + $params['item_relations_property_id']); + } + + if ($filter_comment) { + $select->where('item_relations_relations.relation_comment LIKE ?', + "%" . trim($params['item_relations_comment']) . "%" ); + } + } -/** -* Add custom fields to the item batch edit form. -*/ -public function hookAdminItemsBatchEditForm() -{ - $formSelectProperties = get_table_options('ItemRelationsProperty'); - ?> -
      -

      - - - - - - - - - - - - - - - -
      formSelect('custom[item_relations_property_id]', null, array(), $formSelectProperties); ?> - - formText('custom[item_relations_item_relation_object_item_id]', null, array('size' => 6)); ?> -
      -
      - "; print_r($select); die(""); -/** -* Process the item batch edit form. -* -* @param array $args -*/ -public function hookItemsBatchEditCustom($args) -{ - $item = $args['item']; - $custom = $args['custom']; - - self::insertItemRelation( - $item, - $custom['item_relations_property_id'], - $custom['item_relations_item_relation_object_item_id'], - $custom['item_relations_item_relation_relation_comment'] -); -} + // $select->where('items.id = ?', 2); + } -/** -* Add the Item Relations link to the admin main navigation. -* -* @param array Navigation array. -* @return array Filtered navigation array. -*/ -public function filterAdminNavigationMain($nav) -{ - $nav[] = array( - 'label' => __('Item Relations'), - 'uri' => url('item-relations'), - 'resource' => 'ItemRelations_Index', - 'privilege' => 'index' - ); - return $nav; -} + /** + * Add custom fields to the item batch edit form. + */ + public function hookAdminItemsBatchEditForm() + { + $formSelectProperties = get_table_options('ItemRelationsProperty'); + ?> +
      +

      + + + + + + + + + + + + + + + +
      formSelect('custom[item_relations_property_id]', + null, array(), $formSelectProperties); ?> + formText('custom[item_relations_item_relation_object_item_id]', + null, array('size' => 6)); + ?>
      +
      + __('Item Relations'), + 'uri' => url('item-relations'), + 'resource' => 'ItemRelations_Index', + 'privilege' => 'index' + ); + return $nav; + } - $tabs['Item Relations'] = $content; - return $tabs; -} + /** + * Add the "Item Relations" tab to the admin items add/edit page. + * + * @return array + */ + public function filterAdminItemsFormTabs($tabs, $args) + { + $item = $args['item']; + $tabs['Item Relations'] = get_view()->itemRelationsForm($item); + return $tabs; + } -/** -* Prepare all item relations (subject & object) for display. -* -* @param Item $item -* @return array -*/ -public static function prepareAllRelations(Item $item) -{ - if (!isset($item->id)) { return array(); } - - $db = get_db(); - $query = "SELECT *, irr.id irrid, irp.description irpdesc". - " FROM `$db->ItemRelationsRelations` irr". - " JOIN `$db->ItemRelationsProperty` irp on irr.property_id = irp.id". - " JOIN `$db->ItemRelationsVocabulary` irv on irp.vocabulary_id = irv.id". - " WHERE irr.subject_item_id = $item->id". - " OR irr.object_item_id = $item->id". - " ORDER BY irv.name ASC, irp.vocabulary_id ASC". - ""; - # echo "
      $query
      "; - $partners = $db->fetchAll($query); - # echo "
      $query:\n" . print_r($partners,true) . "
      "; - - $relations = array(); - - foreach($partners as $partner) { - $otherItemType = ( $item->id == $partner["subject_item_id"] ? "object" : "subject" ); - $otherItem = get_record_by_id('item', $partner[$otherItemType."_item_id"]); - # echo "
      ".$otherItem->id." = $otherItemType
      "; - if ($otherItem) { - $relation = array( - 'item_relation_id' => $partner["irrid"], - 'relation_comment' => $partner["relation_comment"], - 'relation_text' => $partner["label"], - 'relation_property' => $partner["property_id"], - 'relation_description' => $partner["irpdesc"], - 'vocabulary_id' => $partner["vocabulary_id"], - 'vocabulary' => $partner["name"], - 'vocabulary_desc' => $partner["description"], - 'subject_item_id' => $partner["subject_item_id"], - 'object_item_id' => $partner["object_item_id"], - ); - if ($otherItemType=="subject") { - $relation['subject_item_title'] = self::getItemTitle($otherItem); - $relation['object_item_title'] = self::getItemTitle($item); - } - else { - $relation['subject_item_title'] = self::getItemTitle($item); - $relation['object_item_title'] = self::getItemTitle($otherItem); + /** + * Add the "Item Relations" tab to the admin items add/edit page. + * + * @return array + */ + public function filterItemRelationsPropertiesSelectOptions($selectOptions) + { + $allowedVocabularies = json_decode(get_option('item_relations_allow_vocabularies')); + if (!empty($allowedVocabularies)) { + $selectOptions = array_intersect_key($selectOptions, array_flip($allowedVocabularies)); + } + return $selectOptions; + } + + /** + * Prepare subject item relations for display. + * + * @param Item $item + * @return array + */ + public static function prepareSubjectRelations(Item $item) + { + $subjects = get_db()->getTable('ItemRelationsRelation')->findBySubjectItemId($item->id, true); + $subjectRelations = array(); + foreach ($subjects as $subject) { + $objectItem = get_record_by_id('Item', $subject->object_item_id); + $subjectRelations[] = array( + 'item_relation_id' => $subject->id, + 'object_item' => $objectItem, + 'object_item_title' => self::getItemTitle($objectItem), + 'relation_comment' => $subject->relation_comment, + 'relation_text' => $subject->getPropertyText(), + 'relation_description' => $subject->property_description, + ); + } + return $subjectRelations; + } + + /** + * Prepare object item relations for display. + * + * @param Item $item + * @return array + */ + public static function prepareObjectRelations(Item $item) + { + $objects = get_db()->getTable('ItemRelationsRelation')->findByObjectItemId($item->id, true); + $objectRelations = array(); + foreach ($objects as $object) { + $subjectItem = get_record_by_id('Item', $object->subject_item_id); + $objectRelations[] = array( + 'item_relation_id' => $object->id, + 'subject_item' => $subjectItem, + 'subject_item_title' => self::getItemTitle($subjectItem), + 'relation_comment' => $object->relation_comment, + 'relation_text' => $object->getPropertyText(), + 'relation_description' => $object->property_description, + ); + } + return $objectRelations; + } + + /** + * Prepare all item relations (subject & object) for display. + * ... Should (could?) replace prepareSubjectRelations + prepareObjectRelations entirely + * ... Currently, the two are necessary for (new) show relations by show-list-by-item-type + * + * @param Item $item + * @return array + */ + public static function prepareAllRelations(Item $item) + { + if (!isset($item->id)) { return array(); } + + $db = get_db(); + $query = "SELECT *, irr.id irrid, irp.description irpdesc". + " FROM `$db->ItemRelationsRelations` irr". + " JOIN `$db->ItemRelationsProperty` irp on irr.property_id = irp.id". + " JOIN `$db->ItemRelationsVocabulary` irv on irp.vocabulary_id = irv.id". + " WHERE irr.subject_item_id = $item->id". + " OR irr.object_item_id = $item->id". + " ORDER BY irv.name ASC, irp.vocabulary_id ASC". + ""; + # echo "
      $query
      "; + $partners = $db->fetchAll($query); + # echo "
      $query:\n" . print_r($partners,true) . "
      "; + + $relations = array(); + + foreach($partners as $partner) { + $otherItemType = ( $item->id == $partner["subject_item_id"] ? "object" : "subject" ); + $otherItem = get_record_by_id('item', $partner[$otherItemType."_item_id"]); + # echo "
      ".$otherItem->id." = $otherItemType
      "; + if ($otherItem) { + $relation = array( + 'item_relation_id' => $partner["irrid"], + 'relation_comment' => $partner["relation_comment"], + 'relation_text' => $partner["label"], + 'relation_property' => $partner["property_id"], + 'relation_description' => $partner["irpdesc"], + 'vocabulary_id' => $partner["vocabulary_id"], + 'vocabulary' => $partner["name"], + 'vocabulary_desc' => $partner["description"], + 'subject_item_id' => $partner["subject_item_id"], + 'object_item_id' => $partner["object_item_id"], + ); + if ($otherItemType=="subject") { + $relation['subject_item_title'] = self::getItemTitle($otherItem); + $relation['object_item_title'] = self::getItemTitle($item); + } + else { + $relation['subject_item_title'] = self::getItemTitle($item); + $relation['object_item_title'] = self::getItemTitle($otherItem); + } + $relations[] = $relation; + } } - $relations[] = $relation; + + # echo "
      " . print_r($relations, true) . "
      "; + return $relations; } - } - # echo "
      " . print_r($relations, true) . "
      "; - return $relations; -} + /** + * Return a item's title. + * + * @param Item $item The item. + * @return string + */ + public static function getItemTitle($item) + { + $title = metadata($item, array('Dublin Core', 'Title'), array('no_filter' => true)); + if (!trim($title)) { + $title = '#' . $item->id; + } + return $title; + } -/** -* Return a item's title. -* -* @param Item $item The item. -* @return string -*/ -public static function getItemTitle($item) -{ - $title = metadata($item, array('Dublin Core', 'Title'), array('no_filter' => true)); - if (!trim($title)) { - $title = '#' . $item->id; - } - return $title; -} + /** + * Insert an item relation. + * + * @param Item|int $subjectItem + * @param int $propertyId + * @param Item|int $objectItem + * @return bool True: success; false: unsuccessful + */ + public static function insertItemRelation($subjectItem, $propertyId, $objectItem, $relationComment) + { + // Only numeric property IDs are valid. + if (!is_numeric($propertyId)) { + return false; + } -/** -* Insert an item relation. -* -* @param Item|int $subjectItem -* @param int $propertyId -* @param Item|int $objectItem -* @return bool True: success; false: unsuccessful -*/ -public static function insertItemRelation($subjectItem, $propertyId, $objectItem, $relationComment) -{ - // Only numeric property IDs are valid. - if (!is_numeric($propertyId)) { - return false; - } - - // Set the subject item. - if (!($subjectItem instanceOf Item)) { - $subjectItem = get_db()->getTable('Item')->find($subjectItem); - } - - // Set the object item. - if (!($objectItem instanceOf Item)) { - $objectItem = get_db()->getTable('Item')->find($objectItem); - } - - // Don't save the relation if the subject or object items don't exist. - if (!$subjectItem || !$objectItem) { - return false; - } - - $itemRelation = new ItemRelationsRelation; - $itemRelation->subject_item_id = $subjectItem->id; - $itemRelation->property_id = $propertyId; - $itemRelation->object_item_id = $objectItem->id; - $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); - $itemRelation->save(); - - return true; -} + $db = get_db(); + + // Set the subject item. + if (!($subjectItem instanceOf Item)) { + $subjectItem = $db->getTable('Item')->find($subjectItem); + } + + // Set the object item. + if (!($objectItem instanceOf Item)) { + $objectItem = $db->getTable('Item')->find($objectItem); + } + + // Don't save the relation if the subject or object items don't exist. + if (!$subjectItem || !$objectItem) { + return false; + } + + $itemRelation = new ItemRelationsRelation; + $itemRelation->subject_item_id = $subjectItem->id; + $itemRelation->property_id = $propertyId; + $itemRelation->object_item_id = $objectItem->id; + $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); + $itemRelation->save(); + + return true; + } } diff --git a/README.md b/README.md new file mode 100644 index 0000000..be6aa99 --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +Item Relations (plugin for Omeka) +================================= + +[Item Relations] is a plugin for [Omeka] that lets you define relations between +items. For example, you can make one item a part of another item, where +"part of" is the relation. You can also make one item a "reproduction of" or a +"translation of" another item. + +We've bundled the plugin with common relations derived from several formal +vocabularies, like Dublin Core and FRBR. You can use these or you could populate +a custom vocabulary with the relations needed in your archive. You could, for +example, define custom relations like "is parent of", "is better than", and +"fits within". + +See http://omeka.org/codex/Plugins/ItemRelations for more info. + +This fork adds a quick visual selector and made the item relations themable. + + +Installation +------------ + +Uncompress files and rename plugin folder "ItemRelations". + +Then install it like any other Omeka plugin and follow the config instructions. + + +Warning +------- + +Use it at your own risk. + +It's always recommended to backup your files and database regularly so you can +roll back if needed. + + +Troubleshooting +--------------- + +See online [plugin issues] and [fork issues]. + + +License +------- + +This plugin is published under [GNU/GPL]. + +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, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +Contact +------- + +Current maintainers: + +* [Center for History & New Media] +* [GerZah] +* Daniel Berthereau (see [Daniel-KM]) + + +Copyright +--------- + +* Copyright Center for History and New Media, 2011-2015 +* Copyright GerZah, 2015 +* Copyright Daniel Berthereau, 2015 + + +[Item Relations]: https://github.com/omeka/plugin-ItemRelations +[Omeka]: https://omeka.org +[plugin issues]: https://github.com/omeka/plugin-ItemRelations/issues +[fork issues]: https://github.com/Daniel-KM/ItemRelations/issues +[GNU/GPL]: https://www.gnu.org/licenses/gpl-3.0.html +[Center for History & New Media]: http://chnm.gmu.edu +[GerZah]: https://github.com/GerZah +[Daniel-KM]: https://github.com/Daniel-KM "Daniel Berthereau" diff --git a/config_form.php b/config_form.php deleted file mode 100644 index 1e19c31..0000000 --- a/config_form.php +++ /dev/null @@ -1,55 +0,0 @@ -
      -
      - formLabel('item_relations_public_append_to_items_show', __('Append to Public Items Show')); ?> -
      -
      -

      - -

      - formCheckbox('item_relations_public_append_to_items_show', null, array('checked' => $publicAppendToItemsShow)); ?> -
      -
      -
      -
      - formLabel('item_relations_admin_sidebar_or_maincontent', __('Display position in admin view')); ?> -
      -
      -

      - -

      - formSelect('item_relations_admin_sidebar_or_maincontent', $adminSidebarOrMaincontent, null, array('sidebar' => __('Side bar'), 'maincontent' => __('Main content'))); ?> -
      -
      -
      -
      - formLabel('item_relations_provide_relation_comments', __('Provide comment field for relations')); ?> -
      -
      -

      - -

      - formCheckbox('item_relations_provide_relation_comments', null, array('checked' => $provideRelationComments)); ?> -
      -
      -
      -
      - formLabel('item_relations_relation_format', __('Relation Format')); ?> -
      -
      -

      - -

      - formSelect('item_relations_relation_format', $relationFormat, null, array('prefix_local_part' => __('prefix:localPart'), 'label' => __('label'))); ?> -
      -
      diff --git a/controllers/LookupController.php b/controllers/LookupController.php index a4eca05..f6a6613 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -11,7 +11,10 @@ */ class ItemRelations_LookupController extends Omeka_Controller_AbstractActionController { - public function indexAction() { + public function indexAction() + { + $db = get_db(); + if (!$this->_hasParam('partial')) { $this->_setParam('partial', ''); } @@ -31,7 +34,7 @@ public function indexAction() { $partial = preg_replace('/[^ \.,\!\?\p{L}\p{N}\p{Mc}]/ui', '', $this->_getParam('partial')); $where_text = ''; if (strlen($partial) > 0) { - $where_text = "AND text RLIKE '$partial'"; + $where_text = 'AND text RLIKE ' . $db->quote($partial); } $item_type = intval($this->_getParam('item_type')); @@ -63,14 +66,13 @@ public function indexAction() { break; } - $title = 50; - $db = get_db(); + $titleId = 50; $query = <<Item} items LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) -WHERE elementtexts.element_id = $title +WHERE elementtexts.element_id = $titleId $where_item_type $where_text GROUP BY elementtexts.record_id @@ -88,7 +90,7 @@ public function indexAction() { FROM {$db->Item} items LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) -WHERE elementtexts.element_id = $title +WHERE elementtexts.element_id = $titleId $where_item_type $where_text GROUP BY elementtexts.record_id @@ -106,9 +108,11 @@ public function indexAction() { ); } - $this->view->metadata = array( + $metadata = array( 'count' => $m_count, 'items' => $m_items, ); + + $this->_helper->json($metadata); } } diff --git a/controllers/VocabulariesController.php b/controllers/VocabulariesController.php index 5486b68..5362c0e 100644 --- a/controllers/VocabulariesController.php +++ b/controllers/VocabulariesController.php @@ -67,12 +67,13 @@ public function saveAction() $db = get_db(); $sql = "UPDATE `$db->ItemRelationsVocabulary` set name = ?, description = ? where id = $vocabularyId"; $db->query($sql, array(addslashes($vocabularyName) ,addslashes($vocabularyDescription))); - $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); + $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); } else { $this->_helper->flashMessenger(__('The vocabulary name cannot be empty.'), 'error'); } + $this->_helper->redirector('browse'); return; @@ -99,16 +100,15 @@ public function editAction() // Handle edit vocabulary form. if ($this->getRequest()->isPost()) { - $this->_handleEditVocabularyForm($vocabulary->id); - // Redirect to browse. - $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); - $this->_helper->redirector('browse'); + $this->_handleEditVocabularyForm($vocabulary->id); + // Redirect to Show instead of browse. + $this->_helper->redirector('show', null, null, array('id'=>$vocabulary->id)); return; } - $properties = $vocabulary->getProperties(); $this->view->properties = $properties; + } /** @@ -120,12 +120,23 @@ protected function _handleEditVocabularyForm($vocabularyId) { // Edit existing properties. $propertyDescriptions = $this->_getParam('property_description'); + $propertyLabels = $this->_getParam('property_label'); + + // Edit property Descriptions foreach ($propertyDescriptions as $propertyId => $propertyDescription) { $property = $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId); $property->description = $propertyDescription; $property->save(); } + // Edit property Labels + foreach ($propertyLabels as $propertyId => $propertyLabel) { + $property = $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId); + + $property->label = $propertyLabel; + $property->save(); + } + // Add new properties. $newPropertyLabels = $this->_getParam('new_property_label'); $newPropertyDescriptions = $this->_getParam('new_property_description'); @@ -140,8 +151,9 @@ protected function _handleEditVocabularyForm($vocabularyId) // Labels must be unique. if ($this->_helper->db->getTable('ItemRelationsProperty')->findByLabel($newPropertyLabel)) { - continue; - } + $this->_helper->flashMessenger(__('Existing vocabulary properties cannot be added again.'), 'error'); + continue; + } $newProperty = new ItemRelationsProperty; $newProperty->vocabulary_id = $vocabularyId; @@ -149,6 +161,7 @@ protected function _handleEditVocabularyForm($vocabularyId) $newProperty->label = $newPropertyLabel; $newProperty->description = $newPropertyDescription; $newProperty->save(); + } // Delete existing properties. @@ -158,5 +171,9 @@ protected function _handleEditVocabularyForm($vocabularyId) $this->_helper->db->getTable('ItemRelationsProperty')->find($propertyId)->delete(); } } + + $this->_helper->flashMessenger(__('The vocabulary was successfully edited.'), 'success'); + } + } diff --git a/item_relations_form.php b/item_relations_form.php deleted file mode 100644 index cba0699..0000000 --- a/item_relations_form.php +++ /dev/null @@ -1,158 +0,0 @@ -

      - ' - . __('Browse Vocabularies') . ''; - - echo __('Here you can relate this item to another item and delete existing ' - . 'relations. For descriptions of the relations, see the %s page. Invalid ' - . 'item IDs will be ignored.', $link -); -$provideRelationComments = get_option('item_relations_provide_relation_comments'); -?> -

      - - - - - - - - - - - - id; - $colspan = ($provideRelationComments ? 4 : 3); - $lastVocab = -1; - foreach ($allRelations as $relation) { - if ($lastVocab != $relation["vocabulary_id"]) { - echo ""; - $lastVocab = $relation["vocabulary_id"]; - } - $subjectRelation = ( $relation['subject_item_id']==$thisItemId ); - $objectRelation = ( $relation['object_item_id']==$thisItemId ); - echo ""; - echo ""; - echo ""; - echo ""; - if ($provideRelationComments) { - echo " - "; - } - /* */ - ?> - - - - - - - - -
      " - ."" - .$relation["vocabulary"] - ."
      " . - ( $subjectRelation ? __('This Item') - : "". - $relation['subject_item_title'] . "" - ) . - ""; - if ($subjectRelation) { - echo get_view()->formSelect('item_relations_subject_property['.$relation['item_relation_id'].']', - $relation['relation_property'], - array( 'id' => 'item_relations_subject_property_'.$relation['item_relation_id'], - 'multiple' => false, - 'style' => 'width: 150px;'), - array_slice($formSelectProperties,1)); - } - else { echo "" . $relation['relation_text'] . ""; } - echo "" . - ( $objectRelation ? __('This Item') - : "". - $relation['object_item_title'] . "" - ). - ""; - if ($subjectRelation) { ?> - - "; - } - ?> -
      - - - - Item_Types} ORDER BY name"; - $itemtypes = $db->fetchAll($sql); - $m = array( - '-1' => "- ".__('All')." -", - ); - foreach ($itemtypes as $type) { - $m[$type['id']] = $type['name']; - } - ?> -
      -

      - - - formSelect('new_relation_property_id', null, array('multiple' => false), $formSelectProperties); ?>
      - -

      - formSelect('new_relation_object_item_type_id', null, array('multiple' => false), $m); ?>

      - -

      - : -

      - - - - - -
      -

      - -

      :

      - - - - - -
      -
        -
      • <
      • -
      • >
      • -
      -
      - -
        -
      - - - -
      -

      : formText('relation_comment', null, array('size' => 10, 'maxlength' => 60)); ?>

      - - - - - -
      - - - - - - - - diff --git a/item_relations_styles.css b/item_relations_styles.css deleted file mode 100644 index 61b48e4..0000000 --- a/item_relations_styles.css +++ /dev/null @@ -1,7 +0,0 @@ -.pg_disabled { - visibility: hidden; -} - -.hidden { - display: none; -} diff --git a/languages/de_DE.mo b/languages/de_DE.mo index 8cb194b86bfb87da4a6f864569582ccf63cabe6b..8d69a263edc35b86fc4e832fe5ed83cefa16401e 100644 GIT binary patch delta 8102 zcmb8z33yc1-N*40NZ4fyVP9@oC1hg@f@~om`ywE+3X{xDGBBA*W+q`#83oxC>oQiY zRYWVGPIwp2 z$0YW_<`iCx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GKITrP@*+jJIhsqx$hgQN-3_A2>^WU9h;fP6yQkU`|m_8Nt+NGf@lbRf|r zjKSsM4`elIPPE1B?yL_*9PW4B{?{oQUcbVyOxqavEj^lGtw{jmUlQ7PAJYkeS zDRI5af1~?zF8`L~(JsF?<#@1vUZ0`C6$@v0^0IuNrjN~xkM7thI<}*`V|+q_Y`Lpl;mfX78WPC`+ABC-D9$H3f$eNQJhODWlGkJqOy{hvVz>`qO5FB z@#Mndf|zWN|K9$)8dk{9_xJ}+n^eJ->YJD!cG-28FL+LbKYsQam;aYJ%Uu2r^WLlIk6U;o F_, 2015 +# Gero Zahn , 2015-2016 msgid "" msgstr "" "Project-Id-Version: WeSa Omeka\n" -"Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" +"Report-Msgid-Bugs-To: http://github.com/GerZah/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" -"PO-Revision-Date: 2015-12-01 15:53+0100\n" -"Last-Translator: Gero Zahn \n" +"PO-Revision-Date: 2016-02-10 14:20+0100\n" +"Last-Translator: githanjalli \n" "Language-Team: German (Germany) (http://www.transifex.com/upb/wesa-omeka/language/de_DE/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,90 +19,42 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.8.6\n" -#: ItemRelationsPlugin.php:122 +#: ItemRelationsPlugin.php:127 msgid "Custom" msgstr "Benutzerdefiniert" -#: ItemRelationsPlugin.php:123 +#: ItemRelationsPlugin.php:128 msgid "Custom vocabulary containing relations defined for this Omeka instance." msgstr "Benutzerdefiniertes Vokabular, das Beziehungen enthält, die für diese Omeka-Installation definiert wurden." -#: ItemRelationsPlugin.php:387 +#: ItemRelationsPlugin.php:405 msgid "There was an error in the item relation comments." msgstr "Es ist ein Fehler in den Objekt-Beziehungs-Kommentaren aufgetreten." -#: ItemRelationsPlugin.php:413 +#: ItemRelationsPlugin.php:433 msgid "There was an error in listing the item relation." msgstr "Es ist ein Fehler beim Auflisten der Objekt-Beziehungen aufgetreten." -#: ItemRelationsPlugin.php:507 ItemRelationsPlugin.php:558 views/admin/common/item-relations-show.php:8 views/public/common/item-relations-show.php:3 views/shared/common/item-relations-advanced-search.php:6 +#: ItemRelationsPlugin.php:551 ItemRelationsPlugin.php:603 views/admin/common/item-relations-show.php:18 views/public/common/item-relations-show.php:14 views/shared/common/item-relations-advanced-search.php:6 msgid "Item Relations" msgstr "Objekt-Beziehungen" -#: ItemRelationsPlugin.php:511 +#: ItemRelationsPlugin.php:555 msgid "Subjects" msgstr "Subjekt-Ressourcen" -#: ItemRelationsPlugin.php:513 item_relations_form.php:18 views/shared/common/item-relations-advanced-search.php:32 +#: ItemRelationsPlugin.php:557 views/shared/common/item-relations-advanced-search.php:32 views/shared/common/item-relations-form.php:13 msgid "Object" msgstr "Objekt-Ressource" -#: ItemRelationsPlugin.php:518 +#: ItemRelationsPlugin.php:562 msgid "These Items" msgstr "Diese Objekte" -#: ItemRelationsPlugin.php:521 +#: ItemRelationsPlugin.php:565 msgid "Item ID" msgstr "Objekt-ID" -#: config_form.php:3 -msgid "Append to Public Items Show" -msgstr "Auf der öffentlichen Seite anzeigen" - -#: config_form.php:8 -msgid "Check this if you want to display an item's relations on its public show page." -msgstr "Aktivieren Sie diese Einstellung, wenn Sie die Objekt-Beziehungen auf der öffentlichen Seite anzeigen wollen." - -#: config_form.php:17 -msgid "Display position in admin view" -msgstr "Anzeigeposition in Admin-Ansicht" - -#: config_form.php:22 -msgid "Select the position where you would prefer to display the relations in admin view: In the side bar in the lower right (default) or underneath the regular field values to the left." -msgstr "Wählen Sie die Anzeigeposition, die Sie für die Beziehungen in der Admin-Ansicht bevorzugen: In der Seitenleiste unten rechts (Default) oder unterhalb der regulären Feldern auf der linken Seite." - -#: config_form.php:26 -msgid "Side bar" -msgstr "Seitenleiste" - -#: config_form.php:26 -msgid "Main content" -msgstr "Hauptinhalt" - -#: config_form.php:31 -msgid "Provide comment field for relations" -msgstr "Kommentarfeld für Relationen anbieten" - -#: config_form.php:36 -msgid "Check this if you want to be able to enter a comment to a relation." -msgstr "Aktivieren Sie diese Einstellung, wenn Sie zu einer Relation einen Kommentar eingeben möchten." - -#: config_form.php:44 -msgid "Relation Format" -msgstr "Beziehungs-Format" - -#: config_form.php:49 -msgid "Select the format of an item's relations that you would prefer to show. If one is unavailable the other will be used." -msgstr "Wählen Sie das Format einer Objekt-Beziehung, die Sie vornehmlich anzeigen möchten. Ist eine davon nicht verfügbar, wird die andere verwendet." - -#: config_form.php:53 -msgid "prefix:localPart" -msgstr "Präfix:Lokaler Teil" - -#: config_form.php:53 -msgid "label" -msgstr "Bezeichnung" - #: controllers/VocabulariesController.php:37 msgid "The vocabulary name already exists. Please choose a different one." msgstr "Der Vokabular-Name existiert bereits. Bitte wählen Sie einen anderen." @@ -115,7 +67,7 @@ msgstr "Das Vokabular wurde erfolgreich hinzugefügt." msgid "The vocabulary cannot be added." msgstr "Das Vokabular konnte nicht hinzugefügt werden." -#: controllers/VocabulariesController.php:70 controllers/VocabulariesController.php:105 +#: controllers/VocabulariesController.php:70 controllers/VocabulariesController.php:175 msgid "The vocabulary was successfully edited." msgstr "Das Vokabular wurde erfolgreich editiert." @@ -123,6 +75,10 @@ msgstr "Das Vokabular wurde erfolgreich editiert." msgid "The vocabulary name cannot be empty." msgstr "Der Vokabular-Name darf nicht leer gelassen werden." +#: controllers/VocabulariesController.php:154 +msgid "Existing vocabulary properties cannot be added again." +msgstr "Bereits existierende Vokabular-Eigenschaften können nicht erneut hinzugefügt werden." + #: formal_vocabularies.php:11 msgid "Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/" msgstr "Beziehungs-Definitionen gemäß DCMI Metadata Terms: http://dublincore.org/documents/dcmi-terms/" @@ -991,66 +947,113 @@ msgstr "Eigenschaft, die eine Übersetzung eines Ausdrucks repräsentiert." msgid "A property representing an expression that is translated." msgstr "Eigenschaft, die einen Ausdruck repräsentiert, der übersetzt wird." -#: item_relations_form.php:4 views/admin/vocabularies/browse.php:1 -msgid "Browse Vocabularies" -msgstr "Vokabular durchsuchen" +#: models/ItemRelationsProperty.php:62 +msgid "[unknown]" +msgstr "[unbekannt]" -#: item_relations_form.php:6 -#, php-format -msgid "Here you can relate this item to another item and delete existing relations. For descriptions of the relations, see the %s page. Invalid item IDs will be ignored." -msgstr "Hier können Sie ein Objekt mit einem anderen Objekt in Beziehung setzen oder bestehende Beziehungen löschen. Für die Beschreibungen der Beziehungen, lesen Sie bitte unter %s weiter. Unzulässige Objekt-IDs werden ignoriert." +#: views/admin/common/item-relations-show.php:21 views/public/common/item-relations-show.php:16 +msgid "This item has no relations." +msgstr "Dieses Objekt besitzt keine Beziehungen." -#: item_relations_form.php:16 views/shared/common/item-relations-advanced-search.php:31 -msgid "Subject " -msgstr "Subjekt-Ressource" +#: views/admin/plugins/item-relations-config-form.php:1 +msgid "Input" +msgstr "Eingabe" -#: item_relations_form.php:41 item_relations_form.php:58 item_relations_form.php:81 item_relations_form.php:106 views/admin/common/item-relations-show.php:25 views/admin/common/item-relations-show.php:30 views/public/common/item-relations-show.php:22 views/public/common/item-relations-show.php:29 -msgid "This Item" -msgstr "Dieses Objekt" +#: views/admin/plugins/item-relations-config-form.php:5 +msgid "Limit Relations to Vocabularies" +msgstr "Beziehungen auf Vokabulare beschränken" -#: item_relations_form.php:85 -msgid "[n/a]" -msgstr "[n.v.]" +#: views/admin/plugins/item-relations-config-form.php:11 +msgid "Check the vocabularies that can be used to set relations." +msgstr "Markieren Sie die Vokabulare, die in Beziehungen verwendet werden können." -#: item_relations_form.php:90 -msgid "Add a Relation" -msgstr "Eine Beziehung hinzufügen" +#: views/admin/plugins/item-relations-config-form.php:12 +msgid "If none is checked, all vocabularies will be allowed." +msgstr "Wenn kein Vokabular markiert ist, sind alle zugelassen." -#: item_relations_form.php:97 -msgid "All" -msgstr "Alle" +#: views/admin/plugins/item-relations-config-form.php:42 +msgid "Provide comment field for relations" +msgstr "Kommentarfeld für Relationen anbieten" -#: item_relations_form.php:113 -msgid "Item Sort" -msgstr "Objektsortierung" +#: views/admin/plugins/item-relations-config-form.php:47 +msgid "Check this if you want to be able to enter a comment to a relation." +msgstr "Aktivieren Sie diese Einstellung, wenn Sie zu einer Relation einen Kommentar eingeben möchten." -#: item_relations_form.php:116 -msgid "Most recently updated" -msgstr "Kürzlich bearbeitet" +#: views/admin/plugins/item-relations-config-form.php:55 +msgid "Display" +msgstr "Anzeige" -#: item_relations_form.php:119 -msgid "Alphabetically" -msgstr "Alphabetisch" +#: views/admin/plugins/item-relations-config-form.php:59 +msgid "Relation Format" +msgstr "Beziehungs-Format" -#: item_relations_form.php:123 -msgid "Object Title" -msgstr "Objekt-Titel" +#: views/admin/plugins/item-relations-config-form.php:64 +msgid "Select the format of an item's relations that you would prefer to show. If one is unavailable the other will be used." +msgstr "Wählen Sie das Format einer Objekt-Beziehung, die Sie vornehmlich anzeigen möchten. Ist eine davon nicht verfügbar, wird die andere verwendet." -#: item_relations_form.php:126 -msgid "Partial Object Title" -msgstr "Teilweiser Objekt-Titel" +#: views/admin/plugins/item-relations-config-form.php:70 +msgid "prefix:localPart" +msgstr "Präfix:Lokaler Teil" -#: item_relations_form.php:147 -msgid "Add Relation" -msgstr "Beziehung hinzufügen" +#: views/admin/plugins/item-relations-config-form.php:71 +msgid "label" +msgstr "Bezeichnung" -#: models/ItemRelationsProperty.php:62 -msgid "[unknown]" -msgstr "[unbekannt]" +#: views/admin/plugins/item-relations-config-form.php:78 +msgid "Display position in admin view" +msgstr "Anzeigeposition in Admin-Ansicht" -#: views/admin/common/item-relations-show.php:11 views/public/common/item-relations-show.php:6 -msgid "This item has no relations." -msgstr "Dieses Objekt besitzt keine Beziehungen." +#: views/admin/plugins/item-relations-config-form.php:83 +msgid "Select the position where you would prefer to display the relations in admin view: In the side bar in the lower right (default) or underneath the regular field values to the left." +msgstr "Wählen Sie die Anzeigeposition, die Sie für die Beziehungen in der Admin-Ansicht bevorzugen: In der Seitenleiste unten rechts (Default) oder unterhalb der regulären Feldern auf der linken Seite." + +#: views/admin/plugins/item-relations-config-form.php:89 +msgid "Side bar" +msgstr "Seitenleiste" + +#: views/admin/plugins/item-relations-config-form.php:90 +msgid "Main content" +msgstr "Hauptinhalt" + +#: views/admin/plugins/item-relations-config-form.php:97 +msgid "Admin Display Mode" +msgstr "Admin-Anzeigemodus" + +#: views/admin/plugins/item-relations-config-form.php:102 +msgid "Set how to display the list of relations in the admin view." +msgstr "Definieren Sie, wie die Beziehungsliste in der Admin-Ansicht angezeigt werden soll." + +#: views/admin/plugins/item-relations-config-form.php:103 views/admin/plugins/item-relations-config-form.php:138 +msgid "Anyway, the view can be themed." +msgstr "Die Darstellung ist in jedem Fall im Theme definierbar." + +#: views/admin/plugins/item-relations-config-form.php:108 views/admin/plugins/item-relations-config-form.php:143 +msgid "As a table" +msgstr "Als Tabelle" + +#: views/admin/plugins/item-relations-config-form.php:109 views/admin/plugins/item-relations-config-form.php:144 +msgid "As a list" +msgstr "Als Liste" + +#: views/admin/plugins/item-relations-config-form.php:110 views/admin/plugins/item-relations-config-form.php:145 +msgid "By item type" +msgstr "Nach Objekttyp" + +#: views/admin/plugins/item-relations-config-form.php:117 +msgid "Append to Public Items Show" +msgstr "Auf der öffentlichen Seite anzeigen" + +#: views/admin/plugins/item-relations-config-form.php:122 +msgid "Check this if you want to display an item's relations on its public show page." +msgstr "Aktivieren Sie diese Einstellung, wenn Sie die Objekt-Beziehungen auf der öffentlichen Seite anzeigen wollen." + +#: views/admin/plugins/item-relations-config-form.php:132 +msgid "Public Display Mode" +msgstr "Öffentlicher Anzeigemodus" + +#: views/admin/plugins/item-relations-config-form.php:137 +msgid "Set how to display the list of relations in the public view." +msgstr "Definieren Sie, wie die Beziehungsliste in der öffentlichen Ansicht angezeigt werden soll." #: views/admin/vocabularies/add.php:2 msgid "Add New Vocabulary" @@ -1064,23 +1067,31 @@ msgstr "Vokabular-Name" msgid "Vocabulary Description" msgstr "Vokabular-Beschreibung" -#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:19 +#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:20 msgid "Save Vocabulary" msgstr "Vokabular speichern" -#: views/admin/vocabularies/browse.php:4 +#: views/admin/vocabularies/browse.php:3 views/shared/common/item-relations-form.php:3 +msgid "Browse Vocabularies" +msgstr "Vokabular durchsuchen" + +#: views/admin/vocabularies/browse.php:7 msgid "Add Vocabulary" msgstr "Vokabular hinzufügen" -#: views/admin/vocabularies/browse.php:11 +#: views/admin/vocabularies/browse.php:12 +msgid "Allowed" +msgstr "Zugelassen" + +#: views/admin/vocabularies/browse.php:15 msgid "Namespace Prefix" msgstr "Namensraum-Präfix" -#: views/admin/vocabularies/browse.php:12 +#: views/admin/vocabularies/browse.php:16 msgid "Namespace URI" msgstr "Namensraum-URI" -#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:22 +#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:23 msgid "Delete Vocabulary" msgstr "Vokabular löschen" @@ -1112,22 +1123,26 @@ msgstr "Eigenschaft hinzufügen" msgid "Vocabulary Properties" msgstr "Vokabular-Eigenschaften" -#: views/admin/vocabularies/show.php:16 +#: views/admin/vocabularies/show.php:17 msgid "Edit Vocabulary" msgstr "Vokabular editieren" -#: views/admin/vocabularies/show.php:24 +#: views/admin/vocabularies/show.php:25 msgid "This vocabulary has no properties." msgstr "Dieses Vokabular besitzt keine Eigenschaften." -#: views/admin/vocabularies/show.php:26 +#: views/admin/vocabularies/show.php:27 msgid "Why don't you add some?" msgstr "Möchten Sie einige hinzufügen?" -#: views/admin/vocabularies/show.php:33 +#: views/admin/vocabularies/show.php:34 msgid "Local Part" msgstr "Lokaler Teil" +#: views/helpers/ItemRelationsForm.php:20 +msgid "All" +msgstr "Alle" + #: views/shared/common/item-relations-advanced-search.php:11 msgid "Filter this search for items with the selected relation. For example, when selecting \"Subject\" items with the \"hasPart\" relation, the search will return all items that have parts. When selecting \"Object\" items with the same relation, the search will return all items that are parts of other items." msgstr "Diese Suche auf Objekte mit einer bestimmten Beziehung begrenzen. Wenn Sie z.B. eine „Subjekt-Ressource” mit der „Enthält Teil”-Beziehung auswählen, wird diese Suche alle Objekte auflisten, die Teile enthalten. Wenn Sie eine „Objekt-Ressource“ mit derselben Beziehung auswählen, wird die Suche alle Objekte auflisten, die Teile anderer Objekte sind." @@ -1135,3 +1150,77 @@ msgstr "Diese Suche auf Objekte mit einer bestimmten Beziehung begrenzen. Wenn S #: views/shared/common/item-relations-advanced-search.php:22 msgid "Filter this search for items being \"Subject\" (or \"Object\", respectively) in relations that contain a certain text portion in their comments." msgstr "Diese Suche auf Objekte einschränken, die „Subjekt-Ressource” (bzw. „Objekt-Ressource”) in Beziehungen sind, die einen bestimmten Text in ihren Kommentaren enthalten." + +#: views/shared/common/item-relations-advanced-search.php:31 views/shared/common/item-relations-form.php:11 +msgid "Subject " +msgstr "Subjekt-Ressource" + +#: views/shared/common/item-relations-form.php:4 +msgid "Here you can relate this item to another item and delete existing relations." +msgstr "Hier können Sie ein Objekt mit einem anderen Objekt in Beziehung setzen oder bestehende Beziehungen löschen." + +#: views/shared/common/item-relations-form.php:5 +#, php-format +msgid "For descriptions of the relations, see the %s page." +msgstr "Für die Beschreibungen der Beziehungen, lesen Sie bitte unter %s weiter." + +#: views/shared/common/item-relations-form.php:6 +msgid "Invalid item IDs will be ignored." +msgstr "Invalid item IDs will be ignored." + +#: views/shared/common/item-relations-form.php:38 views/shared/common/item-relations-form.php:55 views/shared/common/item-relations-form.php:78 views/shared/common/item-relations-form.php:91 views/shared/common/item-relations-show-list.php:16 views/shared/common/item-relations-show-list.php:21 views/shared/common/item-relations-show-table.php:18 +#: views/shared/common/item-relations-show-table.php:25 +msgid "This Item" +msgstr "Dieses Objekt" + +#: views/shared/common/item-relations-form.php:82 +msgid "[n/a]" +msgstr "[n.v.]" + +#: views/shared/common/item-relations-form.php:87 +msgid "Add a Relation" +msgstr "Eine Beziehung hinzufügen" + +#: views/shared/common/item-relations-form.php:98 +msgid "Item Sort" +msgstr "Objektsortierung" + +#: views/shared/common/item-relations-form.php:101 +msgid "Most recently updated" +msgstr "Kürzlich bearbeitet" + +#: views/shared/common/item-relations-form.php:103 +msgid "Alphabetically" +msgstr "Alphabetisch" + +#: views/shared/common/item-relations-form.php:107 +msgid "Object Title" +msgstr "Objekt-Titel" + +#: views/shared/common/item-relations-form.php:109 +msgid "Partial Object Title" +msgstr "Teilweiser Objekt-Titel" + +#: views/shared/common/item-relations-form.php:126 +msgid "Add Relation" +msgstr "Beziehung hinzufügen" + +#: views/shared/common/item-relations-show-list-by-item-type.php:20 +msgid "Relation from this item" +msgstr "Beziehungen ausgehend von diesem Objekt" + +#: views/shared/common/item-relations-show-list-by-item-type.php:22 +msgid "This item has no relation to other records." +msgstr "Dieses Objekt steht in keiner Beziehung zu anderen Objekten." + +#: views/shared/common/item-relations-show-list-by-item-type.php:27 views/shared/common/item-relations-show-list-by-item-type.php:53 +msgid "No Item Type" +msgstr "Ohne Objekttyp" + +#: views/shared/common/item-relations-show-list-by-item-type.php:46 +msgid "Relations to this item" +msgstr "Beziehungen auf dieses Objekt" + +#: views/shared/common/item-relations-show-list-by-item-type.php:48 +msgid "No record is related to this item." +msgstr "Kein Objekt steht in Beziehung zu diesem Objekt." diff --git a/languages/template.base.pot b/languages/template.base.pot index 896a46d..ffdfd2e 100644 --- a/languages/template.base.pot +++ b/languages/template.base.pot @@ -7,13 +7,12 @@ msgid "" msgstr "" "Project-Id-Version: Item Relations\n" -"Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" +"Report-Msgid-Bugs-To: http://github.com/GerZah/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Last-Translator: Gero Zahn\n" +"Language-Team: English (https://www.transifex.com/upb/wesa-omeka/language/en/)\n" +"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" - diff --git a/languages/template.pot b/languages/template.pot index 041b07a..021c942 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -7,111 +7,58 @@ msgid "" msgstr "" "Project-Id-Version: Item Relations\n" -"Report-Msgid-Bugs-To: http://github.com/omeka/plugin-ItemRelations/issues\n" +"Report-Msgid-Bugs-To: http://github.com/GerZah/plugin-ItemRelations/issues\n" "POT-Creation-Date: 2014-01-13 12:59-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Last-Translator: Gero Zahn\n" +"Language-Team: English (https://www.transifex.com/upb/wesa-omeka/language/" +"en/)\n" +"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ItemRelationsPlugin.php:122 +#: ItemRelationsPlugin.php:127 msgid "Custom" msgstr "" -#: ItemRelationsPlugin.php:123 +#: ItemRelationsPlugin.php:128 msgid "Custom vocabulary containing relations defined for this Omeka instance." msgstr "" -#: ItemRelationsPlugin.php:387 +#: ItemRelationsPlugin.php:405 msgid "There was an error in the item relation comments." msgstr "" -#: ItemRelationsPlugin.php:413 +#: ItemRelationsPlugin.php:433 msgid "There was an error in listing the item relation." msgstr "" -#: ItemRelationsPlugin.php:507 ItemRelationsPlugin.php:558 -#: views/admin/common/item-relations-show.php:8 -#: views/public/common/item-relations-show.php:3 +#: ItemRelationsPlugin.php:551 ItemRelationsPlugin.php:603 +#: views/admin/common/item-relations-show.php:18 +#: views/public/common/item-relations-show.php:14 #: views/shared/common/item-relations-advanced-search.php:6 msgid "Item Relations" msgstr "" -#: ItemRelationsPlugin.php:511 +#: ItemRelationsPlugin.php:555 msgid "Subjects" msgstr "" -#: ItemRelationsPlugin.php:513 item_relations_form.php:18 +#: ItemRelationsPlugin.php:557 #: views/shared/common/item-relations-advanced-search.php:32 +#: views/shared/common/item-relations-form.php:13 msgid "Object" msgstr "" -#: ItemRelationsPlugin.php:518 +#: ItemRelationsPlugin.php:562 msgid "These Items" msgstr "" -#: ItemRelationsPlugin.php:521 +#: ItemRelationsPlugin.php:565 msgid "Item ID" msgstr "" -#: config_form.php:3 -msgid "Append to Public Items Show" -msgstr "" - -#: config_form.php:8 -msgid "" -"Check this if you want to display an item's relations on its public show " -"page." -msgstr "" - -#: config_form.php:17 -msgid "Display position in admin view" -msgstr "" - -#: config_form.php:22 -msgid "" -"Select the position where you would prefer to display the relations in admin " -"view: In the side bar in the lower right (default) or underneath the regular " -"field values to the left." -msgstr "" - -#: config_form.php:26 -msgid "Side bar" -msgstr "" - -#: config_form.php:26 -msgid "Main content" -msgstr "" - -#: config_form.php:31 -msgid "Provide comment field for relations" -msgstr "" - -#: config_form.php:36 -msgid "Check this if you want to be able to enter a comment to a relation." -msgstr "" - -#: config_form.php:44 -msgid "Relation Format" -msgstr "" - -#: config_form.php:49 -msgid "" -"Select the format of an item's relations that you would prefer to show. If " -"one is unavailable the other will be used." -msgstr "" - -#: config_form.php:53 -msgid "prefix:localPart" -msgstr "" - -#: config_form.php:53 -msgid "label" -msgstr "" - #: controllers/VocabulariesController.php:37 msgid "The vocabulary name already exists. Please choose a different one." msgstr "" @@ -125,7 +72,7 @@ msgid "The vocabulary cannot be added." msgstr "" #: controllers/VocabulariesController.php:70 -#: controllers/VocabulariesController.php:105 +#: controllers/VocabulariesController.php:175 msgid "The vocabulary was successfully edited." msgstr "" @@ -133,6 +80,10 @@ msgstr "" msgid "The vocabulary name cannot be empty." msgstr "" +#: controllers/VocabulariesController.php:154 +msgid "Existing vocabulary properties cannot be added again." +msgstr "" + #: formal_vocabularies.php:11 msgid "" "Relations defined by DCMI Metadata Terms: http://dublincore.org/documents/" @@ -1079,75 +1030,124 @@ msgstr "" msgid "A property representing an expression that is translated." msgstr "" -#: item_relations_form.php:4 views/admin/vocabularies/browse.php:1 -msgid "Browse Vocabularies" +#: models/ItemRelationsProperty.php:62 +msgid "[unknown]" msgstr "" -#: item_relations_form.php:6 -#, php-format +#: views/admin/common/item-relations-show.php:21 +#: views/public/common/item-relations-show.php:16 +msgid "This item has no relations." +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:1 +msgid "Input" +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:5 +msgid "Limit Relations to Vocabularies" +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:11 +msgid "Check the vocabularies that can be used to set relations." +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:12 +msgid "If none is checked, all vocabularies will be allowed." +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:42 +msgid "Provide comment field for relations" +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:47 +msgid "Check this if you want to be able to enter a comment to a relation." +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:55 +msgid "Display" +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:59 +msgid "Relation Format" +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:64 msgid "" -"Here you can relate this item to another item and delete existing relations. " -"For descriptions of the relations, see the %s page. Invalid item IDs will be " -"ignored." +"Select the format of an item's relations that you would prefer to show. If " +"one is unavailable the other will be used." msgstr "" -#: item_relations_form.php:16 -#: views/shared/common/item-relations-advanced-search.php:31 -msgid "Subject " +#: views/admin/plugins/item-relations-config-form.php:70 +msgid "prefix:localPart" msgstr "" -#: item_relations_form.php:41 item_relations_form.php:58 -#: item_relations_form.php:81 item_relations_form.php:106 -#: views/admin/common/item-relations-show.php:25 -#: views/admin/common/item-relations-show.php:30 -#: views/public/common/item-relations-show.php:22 -#: views/public/common/item-relations-show.php:29 -msgid "This Item" +#: views/admin/plugins/item-relations-config-form.php:71 +msgid "label" msgstr "" -#: item_relations_form.php:85 -msgid "[n/a]" +#: views/admin/plugins/item-relations-config-form.php:78 +msgid "Display position in admin view" msgstr "" -#: item_relations_form.php:90 -msgid "Add a Relation" +#: views/admin/plugins/item-relations-config-form.php:83 +msgid "" +"Select the position where you would prefer to display the relations in admin " +"view: In the side bar in the lower right (default) or underneath the regular " +"field values to the left." msgstr "" -#: item_relations_form.php:97 -msgid "All" +#: views/admin/plugins/item-relations-config-form.php:89 +msgid "Side bar" msgstr "" -#: item_relations_form.php:113 -msgid "Item Sort" +#: views/admin/plugins/item-relations-config-form.php:90 +msgid "Main content" msgstr "" -#: item_relations_form.php:116 -msgid "Most recently updated" +#: views/admin/plugins/item-relations-config-form.php:97 +msgid "Admin Display Mode" msgstr "" -#: item_relations_form.php:119 -msgid "Alphabetically" +#: views/admin/plugins/item-relations-config-form.php:102 +msgid "Set how to display the list of relations in the admin view." msgstr "" -#: item_relations_form.php:123 -msgid "Object Title" +#: views/admin/plugins/item-relations-config-form.php:103 +#: views/admin/plugins/item-relations-config-form.php:138 +msgid "Anyway, the view can be themed." msgstr "" -#: item_relations_form.php:126 -msgid "Partial Object Title" +#: views/admin/plugins/item-relations-config-form.php:108 +#: views/admin/plugins/item-relations-config-form.php:143 +msgid "As a table" msgstr "" -#: item_relations_form.php:147 -msgid "Add Relation" +#: views/admin/plugins/item-relations-config-form.php:109 +#: views/admin/plugins/item-relations-config-form.php:144 +msgid "As a list" msgstr "" -#: models/ItemRelationsProperty.php:62 -msgid "[unknown]" +#: views/admin/plugins/item-relations-config-form.php:110 +#: views/admin/plugins/item-relations-config-form.php:145 +msgid "By item type" msgstr "" -#: views/admin/common/item-relations-show.php:11 -#: views/public/common/item-relations-show.php:6 -msgid "This item has no relations." +#: views/admin/plugins/item-relations-config-form.php:117 +msgid "Append to Public Items Show" +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:122 +msgid "" +"Check this if you want to display an item's relations on its public show " +"page." +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:132 +msgid "Public Display Mode" +msgstr "" + +#: views/admin/plugins/item-relations-config-form.php:137 +msgid "Set how to display the list of relations in the public view." msgstr "" #: views/admin/vocabularies/add.php:2 @@ -1162,23 +1162,32 @@ msgstr "" msgid "Vocabulary Description" msgstr "" -#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:19 +#: views/admin/vocabularies/add.php:11 views/admin/vocabularies/show.php:20 msgid "Save Vocabulary" msgstr "" -#: views/admin/vocabularies/browse.php:4 +#: views/admin/vocabularies/browse.php:3 +#: views/shared/common/item-relations-form.php:3 +msgid "Browse Vocabularies" +msgstr "" + +#: views/admin/vocabularies/browse.php:7 msgid "Add Vocabulary" msgstr "" -#: views/admin/vocabularies/browse.php:11 +#: views/admin/vocabularies/browse.php:12 +msgid "Allowed" +msgstr "" + +#: views/admin/vocabularies/browse.php:15 msgid "Namespace Prefix" msgstr "" -#: views/admin/vocabularies/browse.php:12 +#: views/admin/vocabularies/browse.php:16 msgid "Namespace URI" msgstr "" -#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:22 +#: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:23 msgid "Delete Vocabulary" msgstr "" @@ -1214,22 +1223,26 @@ msgstr "" msgid "Vocabulary Properties" msgstr "" -#: views/admin/vocabularies/show.php:16 +#: views/admin/vocabularies/show.php:17 msgid "Edit Vocabulary" msgstr "" -#: views/admin/vocabularies/show.php:24 +#: views/admin/vocabularies/show.php:25 msgid "This vocabulary has no properties." msgstr "" -#: views/admin/vocabularies/show.php:26 +#: views/admin/vocabularies/show.php:27 msgid "Why don't you add some?" msgstr "" -#: views/admin/vocabularies/show.php:33 +#: views/admin/vocabularies/show.php:34 msgid "Local Part" msgstr "" +#: views/helpers/ItemRelationsForm.php:20 +msgid "All" +msgstr "" + #: views/shared/common/item-relations-advanced-search.php:11 msgid "" "Filter this search for items with the selected relation. For example, when " @@ -1244,3 +1257,86 @@ msgid "" "Filter this search for items being \"Subject\" (or \"Object\", respectively) " "in relations that contain a certain text portion in their comments." msgstr "" + +#: views/shared/common/item-relations-advanced-search.php:31 +#: views/shared/common/item-relations-form.php:11 +msgid "Subject " +msgstr "" + +#: views/shared/common/item-relations-form.php:4 +msgid "" +"Here you can relate this item to another item and delete existing relations." +msgstr "" + +#: views/shared/common/item-relations-form.php:5 +#, php-format +msgid "For descriptions of the relations, see the %s page." +msgstr "" + +#: views/shared/common/item-relations-form.php:6 +msgid "Invalid item IDs will be ignored." +msgstr "" + +#: views/shared/common/item-relations-form.php:38 +#: views/shared/common/item-relations-form.php:55 +#: views/shared/common/item-relations-form.php:78 +#: views/shared/common/item-relations-form.php:91 +#: views/shared/common/item-relations-show-list.php:16 +#: views/shared/common/item-relations-show-list.php:21 +#: views/shared/common/item-relations-show-table.php:18 +#: views/shared/common/item-relations-show-table.php:25 +msgid "This Item" +msgstr "" + +#: views/shared/common/item-relations-form.php:82 +msgid "[n/a]" +msgstr "" + +#: views/shared/common/item-relations-form.php:87 +msgid "Add a Relation" +msgstr "" + +#: views/shared/common/item-relations-form.php:98 +msgid "Item Sort" +msgstr "" + +#: views/shared/common/item-relations-form.php:101 +msgid "Most recently updated" +msgstr "" + +#: views/shared/common/item-relations-form.php:103 +msgid "Alphabetically" +msgstr "" + +#: views/shared/common/item-relations-form.php:107 +msgid "Object Title" +msgstr "" + +#: views/shared/common/item-relations-form.php:109 +msgid "Partial Object Title" +msgstr "" + +#: views/shared/common/item-relations-form.php:126 +msgid "Add Relation" +msgstr "" + +#: views/shared/common/item-relations-show-list-by-item-type.php:20 +msgid "Relation from this item" +msgstr "" + +#: views/shared/common/item-relations-show-list-by-item-type.php:22 +msgid "This item has no relation to other records." +msgstr "" + +#: views/shared/common/item-relations-show-list-by-item-type.php:27 +#: views/shared/common/item-relations-show-list-by-item-type.php:53 +msgid "No Item Type" +msgstr "" + +#: views/shared/common/item-relations-show-list-by-item-type.php:46 +msgid "Relations to this item" +msgstr "" + +#: views/shared/common/item-relations-show-list-by-item-type.php:48 +msgid "No record is related to this item." +msgstr "" diff --git a/models/Table/ItemRelationsRelation.php b/models/Table/ItemRelationsRelation.php index 859e50f..75cbe4b 100644 --- a/models/Table/ItemRelationsRelation.php +++ b/models/Table/ItemRelationsRelation.php @@ -20,7 +20,7 @@ class Table_ItemRelationsRelation extends Omeka_Db_Table */ public function getSelect() { - $db = $this->getDb(); + $db = $this->_db; return parent::getSelect() ->join( array('item_relations_properties' => $db->ItemRelationsProperty), @@ -41,27 +41,45 @@ public function getSelect() /** * Find item relations by subject item ID. - * + * + * @param integer $subjectItemId + * @param boolean $onlyExistingObjectItems * @return array */ - public function findBySubjectItemId($subjectItemId) + public function findBySubjectItemId($subjectItemId, $onlyExistingObjectItems = true) { $db = $this->getDb(); $select = $this->getSelect() ->where('item_relations_relations.subject_item_id = ?', (int) $subjectItemId); + if ($onlyExistingObjectItems) { + $select->join( + array('items' => $db->Item), + 'items.id = item_relations_relations.object_item_id', + array() + ); + } return $this->fetchObjects($select); } - + /** * Find item relations by object item ID. - * + * + * @param integer $objectItemId + * @param boolean $onlyExistingSubjectItems * @return array */ - public function findByObjectItemId($objectItemId) + public function findByObjectItemId($objectItemId, $onlyExistingSubjectItems = true) { $db = $this->getDb(); $select = $this->getSelect() ->where('item_relations_relations.object_item_id = ?', (int) $objectItemId); + if ($onlyExistingSubjectItems) { + $select->join( + array('items' => $db->Item), + 'items.id = item_relations_relations.subject_item_id', + array() + ); + } return $this->fetchObjects($select); } } diff --git a/views/admin/common/item-relations-show.php b/views/admin/common/item-relations-show.php index ac48547..94406fe 100644 --- a/views/admin/common/item-relations-show.php +++ b/views/admin/common/item-relations-show.php @@ -1,42 +1,31 @@ -
      - >> - " . __('This item has no relations.') . "

      "; - } # if - else { - $lastVocab = -1; - foreach ($allRelations as $relation) { - if ($lastVocab != $relation["vocabulary_id"]) { - if ($lastVocab != -1) { echo ""; } - echo "
      " - ."" - .$relation["vocabulary"] - ."
        "; - $lastVocab = $relation["vocabulary_id"]; - } - echo "
      • "; - echo ( $relation['subject_item_id']==$thisItemId ? __('This Item') - : "". - $relation['subject_item_title'] . "" - ); - echo " " . $relation['relation_text'] . " "; - echo ( $relation['object_item_id']==$thisItemId ? __('This Item') - : "". - $relation['object_item_title'] . "" - ); - if ( ($provideRelationComments) and ($relation['relation_comment']) ) { - echo " (".$relation['relation_comment'].")"; - } - echo "
      • "; - } # foreach - echo "
      "; - } # else - ?> + >> +
      + +

      + $item, + 'subjectRelations' => $subjectRelations, + 'objectRelations' => $objectRelations, + 'allRelations' => $allRelations, + )); + endif; ?> +
      diff --git a/views/admin/lookup/index.php b/views/admin/lookup/index.php deleted file mode 100644 index 866ddc2..0000000 --- a/views/admin/lookup/index.php +++ /dev/null @@ -1,3 +0,0 @@ -metadata); -?> diff --git a/views/admin/plugins/item-relations-config-form.php b/views/admin/plugins/item-relations-config-form.php new file mode 100644 index 0000000..24cfd42 --- /dev/null +++ b/views/admin/plugins/item-relations-config-form.php @@ -0,0 +1,149 @@ +
      +
      +
      + formLabel('item_relations_allow_vocabularies', + __('Limit Relations to Vocabularies')); ?> +

      +
      +
      +

      + +

      +
      + '; + foreach ($vocabularies as $vocabulary) { + echo '
    • '; + echo $this->formCheckbox('item_relations_allow_vocabularies[]', $vocabulary->name, + array('checked' => in_array($vocabulary->name, $currentVocabularies) ? 'checked' : '', + 'id' => 'item_relations_vocab_id_'.$vocabulary->id, + ) + ); + echo " " . + $this->formLabel('item_relations_vocab_id_'.$vocabulary->id, + $vocabulary->name, + array( "style" => "float:none;" ) + ); + echo '
    • '; + } + echo ''; + ?> +
      +
      +
      +
      +
      + formLabel('item_relations_provide_relation_comments', + __('Provide comment field for relations')); ?> +
      +
      +

      + +

      + formCheckbox('item_relations_provide_relation_comments', + null, array('checked' => get_option('item_relations_provide_relation_comments'))); ?> +
      +
      +
      +
      +
      +
      + formLabel('item_relations_relation_format', + __('Relation Format')); ?> +
      +
      +

      + +

      + formSelect('item_relations_relation_format', + get_option('item_relations_relation_format'), null, array( + 'prefix_local_part' => __('prefix:localPart'), + 'label' => __('label'), + )); ?> +
      +
      +
      +
      + formLabel('item_relations_admin_sidebar_or_maincontent', + __('Display position in admin view')); ?> +
      +
      +

      + +

      + formSelect('item_relations_admin_sidebar_or_maincontent', + get_option('item_relations_admin_sidebar_or_maincontent'), null, array( + 'sidebar' => __('Side bar'), + 'maincontent' => __('Main content'), + )); ?> +
      +
      +
      +
      + formLabel('item_relations_admin_display_mode', + __('Admin Display Mode')); ?> +
      +
      +

      + +

      + formSelect('item_relations_admin_display_mode', + get_option('item_relations_admin_display_mode'), null, array( + 'table' => __('As a table'), + 'list' => __('As a list'), + 'list-by-item-type' => __('By item type'), + )); ?> +
      +
      +
      +
      + formLabel('item_relations_public_append_to_items_show', + __('Append to Public Items Show')); ?> +
      +
      +

      + +

      + formCheckbox('item_relations_public_append_to_items_show', + null, array('checked' => get_option('item_relations_public_append_to_items_show'))); ?> +
      +
      +
      +
      + formLabel('item_relations_public_display_mode', + __('Public Display Mode')); ?> +
      +
      +

      + +

      + formSelect('item_relations_public_display_mode', + get_option('item_relations_public_display_mode'), null, array( + 'table' => __('As a table'), + 'list' => __('As a list'), + 'list-by-item-type' => __('By item type'), + )); ?> +
      +
      +
      diff --git a/views/admin/vocabularies/browse.php b/views/admin/vocabularies/browse.php index e8fd731..8cadf9e 100644 --- a/views/admin/vocabularies/browse.php +++ b/views/admin/vocabularies/browse.php @@ -1,4 +1,7 @@ - __('Browse Vocabularies'))); ?> + __('Browse Vocabularies'))); +?>
      @@ -6,6 +9,7 @@ + @@ -15,6 +19,7 @@ item_relations_vocabularies as $vocabulary): ?> + diff --git a/views/admin/vocabularies/delete.php b/views/admin/vocabularies/delete.php index de38a32..458bab8 100644 --- a/views/admin/vocabularies/delete.php +++ b/views/admin/vocabularies/delete.php @@ -26,7 +26,7 @@
      - +
      diff --git a/views/admin/vocabularies/edit.php b/views/admin/vocabularies/edit.php index f626d9e..6ecd94a 100644 --- a/views/admin/vocabularies/edit.php +++ b/views/admin/vocabularies/edit.php @@ -22,7 +22,7 @@ properties as $property): ?> - + diff --git a/views/admin/vocabularies/show.php b/views/admin/vocabularies/show.php index 88b5d8b..2e3b6d4 100644 --- a/views/admin/vocabularies/show.php +++ b/views/admin/vocabularies/show.php @@ -2,6 +2,7 @@ echo head(array('title' => __('Vocabulary Properties'))); $vocabulary = $this->item_relations_vocabulary; $properties = $vocabulary->getProperties(); +echo flash(); ?> diff --git a/views/helpers/ItemRelationsForm.php b/views/helpers/ItemRelationsForm.php new file mode 100644 index 0000000..a08b037 --- /dev/null +++ b/views/helpers/ItemRelationsForm.php @@ -0,0 +1,70 @@ +view; + $db = get_db(); + + // Prepare list of used item types for the select form. + $itemTypesList = array( + '-1' => '- ' . __('All') . ' -', + ); + $itemTypesList += $this->_getUsedItemTypes(); + + $html = $view->partial('common/item-relations-form.php', array( + 'item' => $item, + 'provideRelationComments' => get_option('item_relations_provide_relation_comments'), + 'formSelectProperties' => get_table_options('ItemRelationsProperty'), + 'allRelations' => ItemRelationsPlugin::prepareAllRelations($item), + 'itemTypesList' => $itemTypesList, + )); + + if (!defined("LITYLOADED")) { + $html .= ''; + $html .= js_tag('lity.min', $dir = 'javascripts/lity'); + DEFINE("LITYLOADED", 1); + } + $html .= ''; + $html .= ''; + $html .= js_tag('item-relations'); + + return $html; + } + + /** + * Get the list of used item types for select form. + * + * @return array + */ + protected function _getUsedItemTypes() + { + $db = get_db(); + + $itemTypesTable = $db->getTable('ItemType'); + $itemTypesAlias = $itemTypesTable->getTableAlias(); + + $select = $itemTypesTable->getSelect() + ->reset(Zend_Db_Select::COLUMNS) + ->from(array(), array($itemTypesAlias . '.id', $itemTypesAlias . '.name')) + ->joinInner(array('items' => $db->Item), "items.item_type_id = $itemTypesAlias.id", array()) + ->group($itemTypesAlias . '.id') + ->order($itemTypesAlias . '.name ASC'); + + $permissions = new Omeka_Db_Select_PublicPermissions('Items'); + $permissions->apply($select, 'items'); + + $itemTypes = $db->fetchPairs($select); + + return $itemTypes; + } +} diff --git a/views/public/common/item-relations-show.php b/views/public/common/item-relations-show.php index 9cdb06d..88e936e 100644 --- a/views/public/common/item-relations-show.php +++ b/views/public/common/item-relations-show.php @@ -1,42 +1,25 @@ - +

      - " . __('This item has no relations.') . "

      "; - } # if - else { - echo "
      name, $allowedVocabularies) ? __('Yes') : __('No'); ?> id}")); ?>">name; ?> description; ?> custom ? 'n/a' : $vocabulary->namespace_prefix; ?>
      label; ?>formTextarea("property_label[{$property->id}]",$property->label, array('cols' => 50, 'rows' => 2)); ?> formTextarea("property_description[{$property->id}]", $property->description, array('cols' => 50, 'rows' => 2)); ?> formCheckbox("property_delete[{$property->id}]") ?>
      "; - $colspan = ($provideRelationComments ? 4 : 3); - $lastVocab = -1; - foreach ($allRelations as $relation) { - if ($lastVocab != $relation["vocabulary_id"]) { - echo ""; - $lastVocab = $relation["vocabulary_id"]; - } - echo ""; - echo ""; - echo ""; - echo ""; - if ( ($provideRelationComments) and ($relation['relation_comment']) ) { - echo ""; - } - echo ""; - } # foreach - } # else - echo "
      " - ."" - .$relation["vocabulary"] - ."
      " . - ( $relation['subject_item_id']==$thisItemId ? __('This Item') - : "". - $relation['subject_item_title'] . "" - ) . - "" . $relation['relation_text'] . "" . - ( $relation['object_item_id']==$thisItemId ? __('This Item') - : "". - $relation['object_item_title'] . "" - ). - "(".$relation['relation_comment'].")
      "; - ?> + +

      + $item, + 'subjectRelations' => $subjectRelations, + 'objectRelations' => $objectRelations, + 'allRelations' => $allRelations, + )); + endif; ?>
      diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php new file mode 100644 index 0000000..94617ad --- /dev/null +++ b/views/shared/common/item-relations-form.php @@ -0,0 +1,127 @@ +

      ' + . __('Browse Vocabularies') . ''; + echo __('Here you can relate this item to another item and delete existing relations.'); + echo ' ' . __('For descriptions of the relations, see the %s page.', $link); + echo ' ' . __('Invalid item IDs will be ignored.'); +?>

      + + + + + + + + + + + + + + id; + $colspan = ($provideRelationComments ? 4 : 3); + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation["vocabulary_id"]) { + echo ""; + $lastVocab = $relation["vocabulary_id"]; + } + $subjectRelation = ( $relation['subject_item_id']==$thisItemId ); + $objectRelation = ( $relation['object_item_id']==$thisItemId ); + echo ""; + echo ""; + echo ""; + echo ""; + if ($provideRelationComments) { + echo " + "; + } + /* */ + ?> + + + + + + + + +
      " + ."" + .$relation["vocabulary"] + ."
      " . + ( $subjectRelation ? __('This Item') + : "". + $relation['subject_item_title'] . "" + ) . + ""; + if ($subjectRelation) { + echo get_view()->formSelect('item_relations_subject_property['.$relation['item_relation_id'].']', + $relation['relation_property'], + array( 'id' => 'item_relations_subject_property_'.$relation['item_relation_id'], + 'multiple' => false, + 'style' => 'width: 150px;'), + array_slice($formSelectProperties,1)); + } + else { echo "" . $relation['relation_text'] . ""; } + echo "" . + ( $objectRelation ? __('This Item') + : "". + $relation['object_item_title'] . "" + ). + ""; + if ($subjectRelation) { ?> + + "; + } + ?> +
      + + + +
      +

      + + formSelect('new_relation_property_id', + null, array('multiple' => false), $formSelectProperties); ?>
      +

      + formSelect('new_relation_object_item_type_id', + null, array('multiple' => false), $itemTypesList); ?>

      + +

      : +

      + + + + +
      +

      + +

      :

      + + + + +
      +
        +
      • <
      • +
      • >
      • +
      + +
      +
        + + +
        +

        : formText('relation_comment', null, array('size' => 10, 'maxlength' => 60)); ?>

        + + + +
        diff --git a/views/shared/common/item-relations-show-list-by-item-type.php b/views/shared/common/item-relations-show-list-by-item-type.php new file mode 100644 index 0000000..325d00f --- /dev/null +++ b/views/shared/common/item-relations-show-list-by-item-type.php @@ -0,0 +1,70 @@ +item_type_id; + $subjectRelationsByObjectType[$typeId][] = $subjectRelation; + } + $objectRelationsBySubjectType = array(); + foreach ($objectRelations as $objectRelation) { + $typeId = (integer) $objectRelation['subject_item']->item_type_id; + $objectRelationsBySubjectType[$typeId][] = $objectRelation; + } + // Prepare the list of types with one query. + $itemTypes = array(); + foreach (get_records('ItemType', array(), 0) as $itemType) { + $itemTypes[$itemType->id] = $itemType; + } +?> +

        + +

        + +
          + $relations): ?> +
        • name) : __('No Item Type'); ?> +
            + +
          • + + [] + +
          • + +
          +
        • + +
        + + +

        + +

        + +

          + $relations): ?> +
        • name) : __('No Item Type'); ?> +
            + +
          • + + [] + +
          • + +
          +
        • + +
        + diff --git a/views/shared/common/item-relations-show-list.php b/views/shared/common/item-relations-show-list.php new file mode 100644 index 0000000..5314b07 --- /dev/null +++ b/views/shared/common/item-relations-show-list.php @@ -0,0 +1,31 @@ +id; + + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation["vocabulary_id"]) { + if ($lastVocab != -1) { echo ""; } + echo "
        " + ."" + .$relation["vocabulary"] + ."
          "; + $lastVocab = $relation["vocabulary_id"]; + } + echo "
        • "; + echo ( $relation['subject_item_id']==$thisItemId ? __('This Item') + : "". + $relation['subject_item_title'] . "" + ); + echo " " . $relation['relation_text'] . " "; + echo ( $relation['object_item_id']==$thisItemId ? __('This Item') + : "". + $relation['object_item_title'] . "" + ); + if ( ($provideRelationComments) and ($relation['relation_comment']) ) { + echo " (".$relation['relation_comment'].")"; + } + echo "
        • "; + } # foreach + echo "
        "; +?> diff --git a/views/shared/common/item-relations-show-table.php b/views/shared/common/item-relations-show-table.php new file mode 100644 index 0000000..7ff2cd0 --- /dev/null +++ b/views/shared/common/item-relations-show-table.php @@ -0,0 +1,36 @@ + id; + + echo ""; + $colspan = ($provideRelationComments ? 4 : 3); + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation["vocabulary_id"]) { + echo ""; + $lastVocab = $relation["vocabulary_id"]; + } + echo ""; + echo ""; + echo ""; + echo ""; + if ($provideRelationComments) { + echo ""; + } + echo ""; + } # foreach + echo "
        " + ."" + .$relation["vocabulary"] + ."
        " . + ( $relation['subject_item_id']==$thisItemId ? __('This Item') + : "". + $relation['subject_item_title'] . "" + ) . + "" . $relation['relation_text'] . "" . + ( $relation['object_item_id']==$thisItemId ? __('This Item') + : "". + $relation['object_item_title'] . "" + ). + "(".$relation['relation_comment'].")
        "; +?> diff --git a/views/shared/css/item-relations.css b/views/shared/css/item-relations.css new file mode 100644 index 0000000..98cc848 --- /dev/null +++ b/views/shared/css/item-relations.css @@ -0,0 +1,15 @@ +.pg_disabled { + visibility: hidden; +} +.hidden { + display: none; +} +ul#lookup-results li { + cursor: pointer; +} +ul#lookup-results li:active { + background-color: #cccccc; +} +ul#lookup-results li:hover { + background-color: #f3f3e7; +} diff --git a/item_relations_script.js b/views/shared/javascripts/item-relations.js similarity index 100% rename from item_relations_script.js rename to views/shared/javascripts/item-relations.js diff --git a/lity/lity.css b/views/shared/javascripts/lity/lity.css similarity index 100% rename from lity/lity.css rename to views/shared/javascripts/lity/lity.css diff --git a/lity/lity.js b/views/shared/javascripts/lity/lity.js similarity index 100% rename from lity/lity.js rename to views/shared/javascripts/lity/lity.js diff --git a/lity/lity.min.css b/views/shared/javascripts/lity/lity.min.css similarity index 100% rename from lity/lity.min.css rename to views/shared/javascripts/lity/lity.min.css diff --git a/lity/lity.min.js b/views/shared/javascripts/lity/lity.min.js similarity index 100% rename from lity/lity.min.js rename to views/shared/javascripts/lity/lity.min.js From 882a6dba49f925c4aefcf27d1ee0862804524caf Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 41/66] Fixed ajax query to limit element texts to items ones. --- controllers/LookupController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/LookupController.php b/controllers/LookupController.php index f6a6613..a5cb3a6 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -71,7 +71,7 @@ public function indexAction() SELECT count(*) AS count FROM {$db->Item} items LEFT JOIN {$db->Element_Texts} elementtexts -ON (items.id = elementtexts.record_id) +ON (items.id = elementtexts.record_id) AND (elementtexts.record_type = 'Item') WHERE elementtexts.element_id = $titleId $where_item_type $where_text @@ -89,7 +89,7 @@ public function indexAction() SELECT items.id AS id, text FROM {$db->Item} items LEFT JOIN {$db->Element_Texts} elementtexts -ON (items.id = elementtexts.record_id) +ON (items.id = elementtexts.record_id) AND (elementtexts.record_type = 'Item') WHERE elementtexts.element_id = $titleId $where_item_type $where_text From fdf1c28cfe6075215257464b93b7cfbf79b07227 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 42/66] Simplified the main form. --- views/shared/common/item-relations-form.php | 233 ++++++++++++-------- 1 file changed, 146 insertions(+), 87 deletions(-) diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index 94617ad..d471811 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -18,110 +18,169 @@ - id; - $colspan = ($provideRelationComments ? 4 : 3); - $lastVocab = -1; - foreach ($allRelations as $relation) { - if ($lastVocab != $relation["vocabulary_id"]) { - echo "" - ."" - .$relation["vocabulary"] - .""; - $lastVocab = $relation["vocabulary_id"]; - } - $subjectRelation = ( $relation['subject_item_id']==$thisItemId ); - $objectRelation = ( $relation['object_item_id']==$thisItemId ); - echo ""; - echo "" . - ( $subjectRelation ? __('This Item') - : "". - $relation['subject_item_title'] . "" - ) . - ""; - echo ""; + id; + $colspan = ($provideRelationComments ? 4 : 3); + $lastVocab = -1; + foreach ($allRelations as $relation) { + if ($lastVocab != $relation['vocabulary_id']) { + echo "" + . "" + . $relation['vocabulary'] + . ""; + $lastVocab = $relation['vocabulary_id']; + } + $subjectRelation = $relation['subject_item_id'] == $thisItemId; + $objectRelation = $relation['object_item_id'] == $thisItemId; + echo ''; + echo '' + . ($subjectRelation + ? __('This Item') + : '' . $relation['subject_item_title'] . '' + ) + . ''; + echo ''; if ($subjectRelation) { - echo get_view()->formSelect('item_relations_subject_property['.$relation['item_relation_id'].']', - $relation['relation_property'], - array( 'id' => 'item_relations_subject_property_'.$relation['item_relation_id'], - 'multiple' => false, - 'style' => 'width: 150px;'), - array_slice($formSelectProperties,1)); + echo $this->formSelect('item_relations_subject_property[' . $relation['item_relation_id'] . ']', + $relation['relation_property'], + array( + 'id' => 'item_relations_subject_property_' . $relation['item_relation_id'], + 'multiple' => false, + 'style' => 'width: 150px;', + ), + array_slice($formSelectProperties, 1)); + } + else { + echo '' . $relation['relation_text'] . ''; } - else { echo "" . $relation['relation_text'] . ""; } - echo ""; - echo "" . - ( $objectRelation ? __('This Item') - : "". - $relation['object_item_title'] . "" - ). - ""; - if ($provideRelationComments) { - echo ""; - if ($subjectRelation) { ?> - - "; - } - ?> + echo ''; + echo '' + . ($objectRelation + ? __('This Item') + : '' . $relation['object_item_title'] . '' + ) + . ''; + if ($provideRelationComments) { + echo ''; + if ($subjectRelation) { ?> + + '; + } ?> "; - } - /* */ - ?> - + echo ''; + } ?> + . - - - + + + -
        -

        - - formSelect('new_relation_property_id', - null, array('multiple' => false), $formSelectProperties); ?>
        -

        - formSelect('new_relation_object_item_type_id', - null, array('multiple' => false), $itemTypesList); ?>

        +
        +
        +
        + formLabel('new_relation_property_id', __('This Subject')); ?> +
        +
        + id) ? metadata('item', array('Dublin Core', 'Title')) : __('[New Record]'); ?> +
        +
        +
        +
        + formLabel('new_relation_property_id', __('Is Related By')); ?> +
        +
        + formSelect('new_relation_property_id', + null, array('multiple' => false), $formSelectProperties); ?> +
        +
        +
        +
        + formLabel('object_title', __('With Object')); ?> +
        +
        + +
        +
        -

        : -

        - - - - -
        -

        + +
        +
        + formLabel('relation_comment', __('Comment')); ?> +
        +
        + formText('relation_comment', null); ?> +
        +
        + -

        :

        - - -
        -
          -
        • <
        • -
        • >
        • -
        +
        + +
        -
        -
          +
          +

          +
          +
          +
          + formLabel('new_relation_object_item_type_id', __('By Item Types')); ?> +
          +
          + formSelect('new_relation_object_item_type_id', + null, array('multiple' => false), $itemTypesList); ?> +
          +
          - -
          -

          : formText('relation_comment', null, array('size' => 10, 'maxlength' => 60)); ?>

          - +
          +
          + formLabel('partial_object_title', __('By Partial Title')); ?> +
          +
          + formText('partial_object_title', null, array('size' => 10, 'maxlength' => 60)); ?> +
          +
          + +
          +
          + formLabel('new_relation_item_sort', __('Sort By')); ?> +
          +
          +
          + + +
          +
          + + +
          +
          +
          + +
          +
          +
            +
            - +
            +
            +
              +
            • <
            • +
            • >
            • +
            +
            +
            From 6bd04efc28ad640c95bdcb5e808cac47380ed74a Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 43/66] Added a drop-down to select relations by collection. --- controllers/LookupController.php | 11 +++++++++++ views/shared/common/item-relations-form.php | 9 +++++++++ views/shared/javascripts/item-relations.js | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/controllers/LookupController.php b/controllers/LookupController.php index a5cb3a6..bffcdb9 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -21,6 +21,9 @@ public function indexAction() if (!$this->_hasParam('item_type')) { $this->_setParam('item_type', -1); } + if (!$this->_hasParam('collection')) { + $this->_setParam('collection', -1); + } if (!$this->_hasParam('sort')) { $this->_setParam('sort', 'mod_desc'); } @@ -43,6 +46,12 @@ public function indexAction() $where_item_type = "AND items.item_type_id = $item_type"; } + $collection = intval($this->_getParam('collection')); + $where_collection = ''; + if ($collection > 0) { + $where_collection = "AND items.collection_id = $collection"; + } + $per_page = intval($this->_getParam('per_page')); $page = intval($this->_getParam('page')); $offset = $page * $per_page; @@ -74,6 +83,7 @@ public function indexAction() ON (items.id = elementtexts.record_id) AND (elementtexts.record_type = 'Item') WHERE elementtexts.element_id = $titleId $where_item_type +$where_collection $where_text GROUP BY elementtexts.record_id QCOUNT; @@ -92,6 +102,7 @@ public function indexAction() ON (items.id = elementtexts.record_id) AND (elementtexts.record_type = 'Item') WHERE elementtexts.element_id = $titleId $where_item_type +$where_collection $where_text GROUP BY elementtexts.record_id $order_clause diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index d471811..ead6029 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -144,6 +144,15 @@ null, array('multiple' => false), $itemTypesList); ?>
            +
            +
            + formLabel('new_relation_object_collection_id', __('By Collection')); ?> +
            +
            + formSelect('new_relation_object_collection_id', + null, array('multiple' => false), get_table_options('Collection')); ?> +
            +
            diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 0aa677a..1319bab 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -5,12 +5,14 @@ jQuery(document).ready(function () { function resetOptions() { options['partial'] = ''; options['item_type'] = -1; + options['collection'] = -1; options['sort'] = 'mod_desc'; options['page'] = 0; options['per_page'] = 15; options = { partial: '', item_type: -1, + collection: -1, sort: 'mod_desc', page: 0, per_page: 15, @@ -24,6 +26,7 @@ jQuery(document).ready(function () { function updateChoices() { options['partial'] = $('#partial_object_title').val(); options['item_type'] = $('#new_relation_object_item_type_id').val(); + options['collection'] = $('#new_relation_object_collection_id').val(); if ($('input[name=itemsListSort]:checked').val() === 'timestamp') { options['sort'] = 'mod_desc'; } @@ -122,6 +125,10 @@ jQuery(document).ready(function () { updateChoices(); }); + $('#new_relation_object_collection_id').change(function () { + updateChoices(); + }); + $('#new_selectObjectSortTimestamp').click(function () { updateChoices(); }); From 91fdf31698328866639d22fe889ce819de08ae7d Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 44/66] Added link to selected record. --- views/shared/common/item-relations-form.php | 12 +++++++++--- views/shared/css/item-relations.css | 4 ++++ views/shared/javascripts/item-relations.js | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index ead6029..08124ea 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -90,11 +90,14 @@
            -
            +
            formLabel('new_relation_property_id', __('This Subject')); ?>
            +
            + id) ? __('[New]') : '#' . $item->id; ?> +
            - id) ? metadata('item', array('Dublin Core', 'Title')) : __('[New Record]'); ?> + id) ? '' : metadata('item', array('Dublin Core', 'Title')); ?>
            @@ -107,9 +110,12 @@
            -
            +
            formLabel('object_title', __('With Object')); ?>
            +
            + +
            diff --git a/views/shared/css/item-relations.css b/views/shared/css/item-relations.css index 98cc848..65eff51 100644 --- a/views/shared/css/item-relations.css +++ b/views/shared/css/item-relations.css @@ -1,3 +1,7 @@ +.subject-id, +.object-id { + font-style: italic; +} .pg_disabled { visibility: hidden; } diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 1319bab..ded8212 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -104,6 +104,7 @@ jQuery(document).ready(function () { $('#lookup-results').on('click', 'li', function () { $('#new_relation_object_item_id').val($(this).attr('data-value')); + $('#object_id').html('#' + $(this).attr('data-value') + ''); $('#object_title').html($(this).html()); }); From 711d50a7e7d863aed4f9cf9c290ca02c46979b94 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 45/66] Disallowed relation to itself. --- controllers/LookupController.php | 11 +++++++++++ views/shared/common/item-relations-form.php | 2 +- views/shared/javascripts/item-relations.js | 7 +------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/controllers/LookupController.php b/controllers/LookupController.php index bffcdb9..aa0fec9 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -15,6 +15,9 @@ public function indexAction() { $db = get_db(); + if (!$this->_hasParam('subject_id')) { + $this->_setParam('subject_id', -1); + } if (!$this->_hasParam('partial')) { $this->_setParam('partial', ''); } @@ -34,6 +37,12 @@ public function indexAction() $this->_setParam('per_page', 15); } + $subject_id = intval($this->_getParam('subject_id')); + $where_subject_id = ''; + if ($subject_id > 0) { + $where_subject_id = "AND items.id != $subject_id"; + } + $partial = preg_replace('/[^ \.,\!\?\p{L}\p{N}\p{Mc}]/ui', '', $this->_getParam('partial')); $where_text = ''; if (strlen($partial) > 0) { @@ -82,6 +91,7 @@ public function indexAction() LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) AND (elementtexts.record_type = 'Item') WHERE elementtexts.element_id = $titleId +$where_subject_id $where_item_type $where_collection $where_text @@ -101,6 +111,7 @@ public function indexAction() LEFT JOIN {$db->Element_Texts} elementtexts ON (items.id = elementtexts.record_id) AND (elementtexts.record_type = 'Item') WHERE elementtexts.element_id = $titleId +$where_subject_id $where_item_type $where_collection $where_text diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index 08124ea..57f2d0e 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -94,7 +94,7 @@ formLabel('new_relation_property_id', __('This Subject')); ?>
            - id) ? __('[New]') : '#' . $item->id; ?> + id) ? '' : 'data-subject-id="' . $item->id . '"'; ?>>id) ? __('[New]') : '#' . $item->id; ?>
            id) ? '' : metadata('item', array('Dublin Core', 'Title')); ?> diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index ded8212..ed239c2 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -3,13 +3,8 @@ jQuery(document).ready(function () { var options = {}; function resetOptions() { - options['partial'] = ''; - options['item_type'] = -1; - options['collection'] = -1; - options['sort'] = 'mod_desc'; - options['page'] = 0; - options['per_page'] = 15; options = { + subject_id: $('#subject_id').attr('data-subject-id'), partial: '', item_type: -1, collection: -1, From c514a19a2687259dfd7bf26624978b982b9c5876 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 46/66] Improved button to add a relation. --- views/shared/common/item-relations-form.php | 11 +- views/shared/javascripts/item-relations.js | 126 ++++++++++++-------- 2 files changed, 83 insertions(+), 54 deletions(-) diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index 57f2d0e..de24392 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -134,8 +134,15 @@ -
            - +
            +
            + +
            +
            +
            + +
            +
            diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index ed239c2..03510b5 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -2,6 +2,10 @@ jQuery(document).ready(function () { var $ = jQuery; var options = {}; + resetOptions(); + updateChoices(); + updateAddButton(); + function resetOptions() { options = { subject_id: $('#subject_id').attr('data-subject-id'), @@ -15,9 +19,6 @@ jQuery(document).ready(function () { }; } - resetOptions(); - updateChoices(); - function updateChoices() { options['partial'] = $('#partial_object_title').val(); options['item_type'] = $('#new_relation_object_item_type_id').val(); @@ -69,18 +70,61 @@ jQuery(document).ready(function () { }); } + function updateAddButton() { + var addButton = $('#add-relation'); + if ($('#new_relation_property_id').val() && $('#new_relation_object_item_id').val()) { + addButton.removeProp('disabled'); + addButton.removeAttr('disabled'); + } + else { + addButton.prop('disabled', true); + addButton.attr('disabled', true); + } + } + + $("select[id^='item_relations_subject_property_']").change(function(e) { + e.preventDefault(); + var id = this.id; + var suffix = this.id.match(/\d+/); + $("#item_relations_subject_property_"+suffix).siblings('span').remove(); + $("#item_relations_subject_property_"+suffix).parent().append(''+ + '' + +''); + }); + + $('#new_relation_property_id').change(function () { + updateAddButton(); + }); + + $("input[id^='item_relations_subject_comment_']").change(function(e) { + e.preventDefault(); + var provideSubjectComments = ($("input[id^='item_relations_subject_comment_']").length > 0); + if (provideSubjectComments) { + var id = $(this).attr('id'); + var suffix = this.id.match(/\d+/); + $("#item_relations_subject_comment_"+suffix).siblings('span').remove(); + $("#item_relations_subject_comment_"+suffix).parent().append(''+ + '' + +''); + } + }); + $('#add-relation').click(function () { + if ($('#add-relation').prop('disabled')) { + return false; + } + var oldRow = $('.item-relations-entry').last(); var newRow = oldRow.clone(); - var provideRelationComments = ($('#relation_comment').length > 0); + var provideRelationComments = ($('#relation_comment').length > 0); newRow.toggleClass('hidden'); newRow.find('.item-relations-property').html($('#new_relation_property_id').find(':selected').html()); var new_url = newRow.find('.item-relations-object a').attr('href'); newRow.find('.item-relations-object a').attr('href', new_url + $('#new_relation_object_item_id').val()); newRow.find('.item-relations-object a').text($('#object_title').text()); - if (provideRelationComments) { - newRow.find('.item-relations-comment').text($('#relation_comment').val()); - } + if (provideRelationComments) { + newRow.find('.item-relations-comment').text($('#relation_comment').val()); + } var hidden = []; hidden.push(''); - if (provideRelationComments) { - hidden.push(''); - } + if (provideRelationComments) { + hidden.push(''); + } newRow.find('.item-relations-hidden').html(hidden.join('')); oldRow.before(newRow); }); - $('#lookup-results').on('click', 'li', function () { - $('#new_relation_object_item_id').val($(this).attr('data-value')); - $('#object_id').html('#' + $(this).attr('data-value') + ''); - $('#object_title').html($(this).html()); - }); - - $('#selector-previous-page').click(function () { - if (0 < options['page']) { - options['page']--; - updateChoices(); - } - }); - - $('#selector-next-page').click(function () { - if (options['page'] < options['max_page']) { - options['page']++; - updateChoices(); - } - }); - $('#new_relation_object_item_type_id').change(function () { updateChoices(); }); @@ -137,26 +161,24 @@ jQuery(document).ready(function () { updateChoices(); }); - $("input[id^='item_relations_subject_comment_']").change(function(e) { - e.preventDefault(); - var provideSubjectComments = ($("input[id^='item_relations_subject_comment_']").length > 0); - if (provideSubjectComments) { - var id = $(this).attr('id'); - var suffix = this.id.match(/\d+/); - $("#item_relations_subject_comment_"+suffix).siblings('span').remove(); - $("#item_relations_subject_comment_"+suffix).parent().append(''+ - '' - +''); - } + $('#lookup-results').on('click', 'li', function () { + $('#new_relation_object_item_id').val($(this).attr('data-value')); + $('#object_id').html('#' + $(this).attr('data-value') + ''); + $('#object_title').html($(this).html()); + updateAddButton(); }); - $("select[id^='item_relations_subject_property_']").change(function(e) { - e.preventDefault(); - var id = this.id; - var suffix = this.id.match(/\d+/); - $("#item_relations_subject_property_"+suffix).siblings('span').remove(); - $("#item_relations_subject_property_"+suffix).parent().append(''+ - '' - +''); + $('#selector-previous-page').click(function () { + if (0 < options['page']) { + options['page']--; + updateChoices(); + } + }); + + $('#selector-next-page').click(function () { + if (options['page'] < options['max_page']) { + options['page']++; + updateChoices(); + } }); -} ); +}); From c5e8d8a5c4fa4aa6a569e2320a4632a3b0132d79 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 47/66] Improved management of newly created relations. --- views/shared/common/item-relations-form.php | 27 ++++- views/shared/css/item-relations.css | 3 + views/shared/javascripts/item-relations.js | 108 +++++++++++++++----- 3 files changed, 106 insertions(+), 32 deletions(-) diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index de24392..a502287 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -76,12 +76,31 @@ '; } ?> - + + + + + + - + + formSelect('item_relations_subject_property[]', + null, + array( + 'multiple' => false, + 'style' => 'width: 150px;', + ), + array_slice($formSelectProperties, 1)); + ?> + . - - + + + + + + diff --git a/views/shared/css/item-relations.css b/views/shared/css/item-relations.css index 65eff51..525bb27 100644 --- a/views/shared/css/item-relations.css +++ b/views/shared/css/item-relations.css @@ -2,6 +2,9 @@ .object-id { font-style: italic; } +tr.new { + background-color: #f3f3e7; +} .pg_disabled { visibility: hidden; } diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 03510b5..bdd015e 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -2,9 +2,24 @@ jQuery(document).ready(function () { var $ = jQuery; var options = {}; - resetOptions(); - updateChoices(); - updateAddButton(); + init(); + + function init() { + resetOptions(); + + $('#new_relation_object_item_id').val(''); + $('#object_id').html(''); + $('#object_title').html('' + '[Search and Select Below]' + ''); + $('#new_relation_property_id').val(''); + $('#relation_comment').val(''); + $('#new_relation_object_item_type_id').val(-1); + $('#new_relation_object_collection_id').val(''); + $('#partial_object_title').val(''); + $('input[name=itemsListSort]:checked').val('timestamp'); + + updateChoices(); + updateAddButton(); + } function resetOptions() { options = { @@ -82,18 +97,33 @@ jQuery(document).ready(function () { } } + function updateNewRelationHiddenProperty() { + var entry = $(this).closest('tr.item-relations-entry'); + var hiddenInput = entry.find(".item-relations-hidden input[name='item_relations_property_id[]']"); + hiddenInput.val($(this).val()); + }; + + function updateNewRelationHiddenComment() { + var entry = $(this).closest('tr.item-relations-entry'); + var hiddenInput = entry.find(".item-relations-hidden input[name='item_relations_item_relation_relation_comment[]']"); + hiddenInput.val($(this).val()); + }; + + function deleteNewRelation() { + $(this).closest('tr.item-relations-entry').remove(); + return false; + }; + + /* Edit existing relations. */ + $("select[id^='item_relations_subject_property_']").change(function(e) { e.preventDefault(); var id = this.id; var suffix = this.id.match(/\d+/); - $("#item_relations_subject_property_"+suffix).siblings('span').remove(); - $("#item_relations_subject_property_"+suffix).parent().append(''+ - '' - +''); - }); - - $('#new_relation_property_id').change(function () { - updateAddButton(); + $("#item_relations_subject_property_" + suffix).siblings('span').remove(); + $("#item_relations_subject_property_" + suffix).parent().append('' + + '' + + ''); }); $("input[id^='item_relations_subject_comment_']").change(function(e) { @@ -102,29 +132,46 @@ jQuery(document).ready(function () { if (provideSubjectComments) { var id = $(this).attr('id'); var suffix = this.id.match(/\d+/); - $("#item_relations_subject_comment_"+suffix).siblings('span').remove(); - $("#item_relations_subject_comment_"+suffix).parent().append(''+ - '' - +''); + $("#item_relations_subject_comment_" + suffix).siblings('span').remove(); + $("#item_relations_subject_comment_" + suffix).parent().append('' + + '' + + ''); } }); + /* Add new relations. */ + $('#add-relation').click(function () { if ($('#add-relation').prop('disabled')) { return false; } + // Set visible row. var oldRow = $('.item-relations-entry').last(); var newRow = oldRow.clone(); var provideRelationComments = ($('#relation_comment').length > 0); newRow.toggleClass('hidden'); - newRow.find('.item-relations-property').html($('#new_relation_property_id').find(':selected').html()); + newRow.find("select[name='item_relations_subject_property[]']").val($('#new_relation_property_id').val()); var new_url = newRow.find('.item-relations-object a').attr('href'); newRow.find('.item-relations-object a').attr('href', new_url + $('#new_relation_object_item_id').val()); newRow.find('.item-relations-object a').text($('#object_title').text()); if (provideRelationComments) { - newRow.find('.item-relations-comment').text($('#relation_comment').val()); + newRow.find("input[name='item_relations_subject_comment[]']").val($('#relation_comment').val()); } + + // Set hidden row for data. + var hidden = _createHiddenNewRelation(); + newRow.find('.item-relations-hidden').html(hidden); + oldRow.before(newRow); + + $(".delete-new-relation").bind('click', deleteNewRelation); + $("select[name='item_relations_subject_property[]'").bind('change', updateNewRelationHiddenProperty); + $("input[name='item_relations_subject_comment[]'").bind('change', updateNewRelationHiddenComment); + + init(); + }); + + function _createHiddenNewRelation() { var hidden = []; hidden.push(''); - if (provideRelationComments) { + if ($('#relation_comment').length > 0) { hidden.push(''); } - newRow.find('.item-relations-hidden').html(hidden.join('')); - oldRow.before(newRow); - }); + return hidden.join(''); + }; + + /* Search and select an object to create a new relation. */ $('#new_relation_object_item_type_id').change(function () { updateChoices(); @@ -161,13 +209,6 @@ jQuery(document).ready(function () { updateChoices(); }); - $('#lookup-results').on('click', 'li', function () { - $('#new_relation_object_item_id').val($(this).attr('data-value')); - $('#object_id').html('#' + $(this).attr('data-value') + ''); - $('#object_title').html($(this).html()); - updateAddButton(); - }); - $('#selector-previous-page').click(function () { if (0 < options['page']) { options['page']--; @@ -181,4 +222,15 @@ jQuery(document).ready(function () { updateChoices(); } }); + + $('#lookup-results').on('click', 'li', function () { + $('#new_relation_object_item_id').val($(this).attr('data-value')); + $('#object_id').html('#' + $(this).attr('data-value') + ''); + $('#object_title').html($(this).html()); + updateAddButton(); + }); + + $('#new_relation_property_id').change(function () { + updateAddButton(); + }); }); From 841b25e8a183c4ecb5a82475c10f116f3379f30a Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 48/66] Added a button to create a new record directly. --- views/shared/common/item-relations-form.php | 10 +++++++++- views/shared/javascripts/item-relations.js | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index a502287..8b689b1 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -164,9 +164,17 @@
            -
            +

            +
            +
            + +
            +
            + +
            +
            formLabel('new_relation_object_item_type_id', __('By Item Types')); ?> diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index bdd015e..12fab58 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -189,6 +189,10 @@ jQuery(document).ready(function () { /* Search and select an object to create a new relation. */ + $('#refresh-results').click(function () { + updateChoices(); + }); + $('#new_relation_object_item_type_id').change(function () { updateChoices(); }); From daf8118218bddffe2a908764106c25e1f058d056 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Mar 2016 00:00:00 +0100 Subject: [PATCH 49/66] Released version 2.0.2.2. --- README.md | 2 +- plugin.ini | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index be6aa99..bb7c10c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Copyright * Copyright Center for History and New Media, 2011-2015 * Copyright GerZah, 2015 -* Copyright Daniel Berthereau, 2015 +* Copyright Daniel Berthereau, 2015-2016 [Item Relations]: https://github.com/omeka/plugin-ItemRelations diff --git a/plugin.ini b/plugin.ini index ed9d7ec..6c80805 100644 --- a/plugin.ini +++ b/plugin.ini @@ -2,10 +2,10 @@ name="Item Relations" author="Roy Rosenzweig Center for History and New Media" description="Allows administrators to define relations between items." -link="http://omeka.org/codex/Plugins/ItemRelations" -support_link="http://omeka.org/forums/forum/plugins" +link="https://omeka.org/codex/Plugins/ItemRelations" +support_link="https://omeka.org/forums/forum/plugins" license="GPLv3" omeka_minimum_version="2.0" -omeka_target_version="2.0" -version="2.0.2.1" +omeka_target_version="2.4" +version="2.0.2.2" tags="item,relation,rdf" From 6dc63cfcff0a2bd175c94e038271a42c99757d93 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 22 Mar 2016 11:27:42 +0100 Subject: [PATCH 50/66] Updated i18n / fixed untranslatable string in .js / "Create a new Relation" instead of "Record" --- languages/de_DE.mo | Bin 34555 -> 35140 bytes languages/de_DE.po | 137 ++++++++++++++++++++++++++--------------- languages/template.pot | 129 ++++++++++++++++++++++++-------------- 3 files changed, 172 insertions(+), 94 deletions(-) diff --git a/languages/de_DE.mo b/languages/de_DE.mo index 8d69a263edc35b86fc4e832fe5ed83cefa16401e..c2f8190cb896520770f438a016b9fe29d0fdf617 100644 GIT binary patch delta 7422 zcmZwL33yc1-N*40$U?%NK-giz7Pf>ykR^mIticc=37~+IF}aYC$pj`7R%K)nRIn&< ztI!rG0u^m-2ds*3E1+Usk=BLPs!*0!X)B8Yg8lyH9<9F5dmjGzoOABEXS?U#M6W$q z=hgLfLMIZVA2p zrr{Dy#SgI?-oSiJWspudA8#=xWS%6`fr@k3857zWGYfm;XnYLk;xQb86WSXy64&4; zd=Cd>Gdh`w6R|gL#+&ec%)vO1G5v5nW@8A4GroD5j5@xKBXDqvF$3^!RQ+yL2N!TC z_U~xSFs#AhxEpiuGLFDOEH4k2p!#_OHK10P1w(KkF2v!CZ+=f^0)B-z) z3ZBBrnBCP~!Fp832e25wv*lv;dpzYQus?o|gRnLGKM9La3)+Tb@g#;uk?Gal-Ku%0 z0k`8gyn(qmwuigYhjA+9L#PS%=;@YM;O&%;VlfWtWsD!6#1f28b01+P>TI0A+te{b1ITssZ0XD*7)O}U9yaE#`uear=th=oH zu_@ONWw8Hhc#?{`_%+7iHQTUmANN!zBInGcqn_Oa)EQW1%dg{1%HN^Rz|6kJY{1RP zCYT|-A{}rJ@*p2MJ?jh{ ziE}U?e~b0;IyT36UI|U81IA(~kBkmOAvVPgs0lrb+KCrXD}M!(@e^!}myv%amXoHA zvT-er#O_hX97N`7u5wbeih@~9|e`s#2KYQPUsr~DF5!8G2T z7+i_X@B!qFG`~Xaz+Tiq@1l0*Flx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dTaRm4PPaW6P;{bGyE5^)|N#(o9~Uh*Gw)^K%^5&tB5a&&xwx-^=}@BOT-Cc1+jlh{s-Q-QRFh^DPE7=shBIVv3`Ldida zyHr7{=A-o|>HWTr=tu-`(^PCv%qNuG#7b}OuaCsPvflq8o}*mBc2-RO7?DjZCY0VL z77}_tR3jD<-uIp-CutUnDtfmya*#M*pgtU%Nu?zjhrhq*f2D?+cb zZA4q*6GCadgZHx{pS5ZISzC7nesq^TcP~DaCWQhmuk+;xQtK zx*-@%l&4?GB$OBM3!;RWMEpUlAioOc)_MOW zREfe3;%VX(5y_XI!VuyRq12S9L0lj@5R(ZP@eL8@X|~ z#pEzwcU\n" +"PO-Revision-Date: 2016-03-22 11:23+0100\n" +"Last-Translator: Gero Zahn \n" "Language-Team: German (Germany) (http://www.transifex.com/upb/wesa-omeka/language/de_DE/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de_DE\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.8.6\n" +"X-Generator: Poedit 1.8.7\n" #: ItemRelationsPlugin.php:127 msgid "Custom" @@ -963,95 +963,95 @@ msgstr "Eingabe" msgid "Limit Relations to Vocabularies" msgstr "Beziehungen auf Vokabulare beschränken" -#: views/admin/plugins/item-relations-config-form.php:11 +#: views/admin/plugins/item-relations-config-form.php:10 msgid "Check the vocabularies that can be used to set relations." msgstr "Markieren Sie die Vokabulare, die in Beziehungen verwendet werden können." -#: views/admin/plugins/item-relations-config-form.php:12 +#: views/admin/plugins/item-relations-config-form.php:11 msgid "If none is checked, all vocabularies will be allowed." msgstr "Wenn kein Vokabular markiert ist, sind alle zugelassen." -#: views/admin/plugins/item-relations-config-form.php:42 +#: views/admin/plugins/item-relations-config-form.php:41 msgid "Provide comment field for relations" msgstr "Kommentarfeld für Relationen anbieten" -#: views/admin/plugins/item-relations-config-form.php:47 +#: views/admin/plugins/item-relations-config-form.php:46 msgid "Check this if you want to be able to enter a comment to a relation." msgstr "Aktivieren Sie diese Einstellung, wenn Sie zu einer Relation einen Kommentar eingeben möchten." -#: views/admin/plugins/item-relations-config-form.php:55 +#: views/admin/plugins/item-relations-config-form.php:54 msgid "Display" msgstr "Anzeige" -#: views/admin/plugins/item-relations-config-form.php:59 +#: views/admin/plugins/item-relations-config-form.php:58 msgid "Relation Format" msgstr "Beziehungs-Format" -#: views/admin/plugins/item-relations-config-form.php:64 +#: views/admin/plugins/item-relations-config-form.php:63 msgid "Select the format of an item's relations that you would prefer to show. If one is unavailable the other will be used." msgstr "Wählen Sie das Format einer Objekt-Beziehung, die Sie vornehmlich anzeigen möchten. Ist eine davon nicht verfügbar, wird die andere verwendet." -#: views/admin/plugins/item-relations-config-form.php:70 +#: views/admin/plugins/item-relations-config-form.php:69 msgid "prefix:localPart" msgstr "Präfix:Lokaler Teil" -#: views/admin/plugins/item-relations-config-form.php:71 +#: views/admin/plugins/item-relations-config-form.php:70 msgid "label" msgstr "Bezeichnung" -#: views/admin/plugins/item-relations-config-form.php:78 +#: views/admin/plugins/item-relations-config-form.php:77 msgid "Display position in admin view" msgstr "Anzeigeposition in Admin-Ansicht" -#: views/admin/plugins/item-relations-config-form.php:83 +#: views/admin/plugins/item-relations-config-form.php:82 msgid "Select the position where you would prefer to display the relations in admin view: In the side bar in the lower right (default) or underneath the regular field values to the left." msgstr "Wählen Sie die Anzeigeposition, die Sie für die Beziehungen in der Admin-Ansicht bevorzugen: In der Seitenleiste unten rechts (Default) oder unterhalb der regulären Feldern auf der linken Seite." -#: views/admin/plugins/item-relations-config-form.php:89 +#: views/admin/plugins/item-relations-config-form.php:88 msgid "Side bar" msgstr "Seitenleiste" -#: views/admin/plugins/item-relations-config-form.php:90 +#: views/admin/plugins/item-relations-config-form.php:89 msgid "Main content" msgstr "Hauptinhalt" -#: views/admin/plugins/item-relations-config-form.php:97 +#: views/admin/plugins/item-relations-config-form.php:96 msgid "Admin Display Mode" msgstr "Admin-Anzeigemodus" -#: views/admin/plugins/item-relations-config-form.php:102 +#: views/admin/plugins/item-relations-config-form.php:101 msgid "Set how to display the list of relations in the admin view." msgstr "Definieren Sie, wie die Beziehungsliste in der Admin-Ansicht angezeigt werden soll." -#: views/admin/plugins/item-relations-config-form.php:103 views/admin/plugins/item-relations-config-form.php:138 +#: views/admin/plugins/item-relations-config-form.php:102 views/admin/plugins/item-relations-config-form.php:137 msgid "Anyway, the view can be themed." msgstr "Die Darstellung ist in jedem Fall im Theme definierbar." -#: views/admin/plugins/item-relations-config-form.php:108 views/admin/plugins/item-relations-config-form.php:143 +#: views/admin/plugins/item-relations-config-form.php:107 views/admin/plugins/item-relations-config-form.php:142 msgid "As a table" msgstr "Als Tabelle" -#: views/admin/plugins/item-relations-config-form.php:109 views/admin/plugins/item-relations-config-form.php:144 +#: views/admin/plugins/item-relations-config-form.php:108 views/admin/plugins/item-relations-config-form.php:143 msgid "As a list" msgstr "Als Liste" -#: views/admin/plugins/item-relations-config-form.php:110 views/admin/plugins/item-relations-config-form.php:145 +#: views/admin/plugins/item-relations-config-form.php:109 views/admin/plugins/item-relations-config-form.php:144 msgid "By item type" msgstr "Nach Objekttyp" -#: views/admin/plugins/item-relations-config-form.php:117 +#: views/admin/plugins/item-relations-config-form.php:116 msgid "Append to Public Items Show" msgstr "Auf der öffentlichen Seite anzeigen" -#: views/admin/plugins/item-relations-config-form.php:122 +#: views/admin/plugins/item-relations-config-form.php:121 msgid "Check this if you want to display an item's relations on its public show page." msgstr "Aktivieren Sie diese Einstellung, wenn Sie die Objekt-Beziehungen auf der öffentlichen Seite anzeigen wollen." -#: views/admin/plugins/item-relations-config-form.php:132 +#: views/admin/plugins/item-relations-config-form.php:131 msgid "Public Display Mode" msgstr "Öffentlicher Anzeigemodus" -#: views/admin/plugins/item-relations-config-form.php:137 +#: views/admin/plugins/item-relations-config-form.php:136 msgid "Set how to display the list of relations in the public view." msgstr "Definieren Sie, wie die Beziehungsliste in der öffentlichen Ansicht angezeigt werden soll." @@ -1168,43 +1168,82 @@ msgstr "Für die Beschreibungen der Beziehungen, lesen Sie bitte unter %s weiter msgid "Invalid item IDs will be ignored." msgstr "Invalid item IDs will be ignored." -#: views/shared/common/item-relations-form.php:38 views/shared/common/item-relations-form.php:55 views/shared/common/item-relations-form.php:78 views/shared/common/item-relations-form.php:91 views/shared/common/item-relations-show-list.php:16 views/shared/common/item-relations-show-list.php:21 views/shared/common/item-relations-show-table.php:18 -#: views/shared/common/item-relations-show-table.php:25 +#: views/shared/common/item-relations-form.php:38 views/shared/common/item-relations-form.php:59 views/shared/common/item-relations-form.php:85 views/shared/common/item-relations-show-list.php:16 views/shared/common/item-relations-show-list.php:21 views/shared/common/item-relations-show-table.php:18 views/shared/common/item-relations-show-table.php:25 msgid "This Item" msgstr "Dieses Objekt" -#: views/shared/common/item-relations-form.php:82 -msgid "[n/a]" -msgstr "[n.v.]" +#: views/shared/common/item-relations-form.php:81 +msgid "New Relations" +msgstr "Neue Beziehungen" + +#: views/shared/common/item-relations-form.php:103 +msgid "Delete now" +msgstr "Jetzt löschen" -#: views/shared/common/item-relations-form.php:87 +#: views/shared/common/item-relations-form.php:108 msgid "Add a Relation" msgstr "Eine Beziehung hinzufügen" -#: views/shared/common/item-relations-form.php:98 -msgid "Item Sort" -msgstr "Objektsortierung" +#: views/shared/common/item-relations-form.php:113 +msgid "This Subject" +msgstr "Diese Subjekt-Resource" + +#: views/shared/common/item-relations-form.php:116 +msgid "[New]" +msgstr "[Neu]" + +#: views/shared/common/item-relations-form.php:124 +msgid "Is Related By" +msgstr "steht in Beziehung" + +#: views/shared/common/item-relations-form.php:133 +msgid "With Object" +msgstr "mit Objekt-Resource" -#: views/shared/common/item-relations-form.php:101 +#: views/shared/common/item-relations-form.php:139 +msgid "[Search and Select Below]" +msgstr "[Unten suchen und auswählen]" + +#: views/shared/common/item-relations-form.php:158 +msgid "Add this Relation" +msgstr "Diese Beziehung hinzufügen" + +#: views/shared/common/item-relations-form.php:168 +msgid "Search and Select a Record" +msgstr "Objekt suchen und auswählen" + +#: views/shared/common/item-relations-form.php:172 +msgid "Create a new Relation" +msgstr "Neue Beziehung erstellen" + +#: views/shared/common/item-relations-form.php:175 +msgid "Refresh" +msgstr "Aktualisieren" + +#: views/shared/common/item-relations-form.php:180 +msgid "By Item Types" +msgstr "Nach Objekttyp" + +#: views/shared/common/item-relations-form.php:189 +msgid "By Collection" +msgstr "Nach Sammlung" + +#: views/shared/common/item-relations-form.php:199 +msgid "By Partial Title" +msgstr "Nach teilweisem Objekt-Titel" + +#: views/shared/common/item-relations-form.php:208 +msgid "Sort By" +msgstr "Sortieren nach" + +#: views/shared/common/item-relations-form.php:213 msgid "Most recently updated" msgstr "Kürzlich bearbeitet" -#: views/shared/common/item-relations-form.php:103 +#: views/shared/common/item-relations-form.php:217 msgid "Alphabetically" msgstr "Alphabetisch" -#: views/shared/common/item-relations-form.php:107 -msgid "Object Title" -msgstr "Objekt-Titel" - -#: views/shared/common/item-relations-form.php:109 -msgid "Partial Object Title" -msgstr "Teilweiser Objekt-Titel" - -#: views/shared/common/item-relations-form.php:126 -msgid "Add Relation" -msgstr "Beziehung hinzufügen" - #: views/shared/common/item-relations-show-list-by-item-type.php:20 msgid "Relation from this item" msgstr "Beziehungen ausgehend von diesem Objekt" diff --git a/languages/template.pot b/languages/template.pot index 021c942..f04a7f2 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -1047,106 +1047,106 @@ msgstr "" msgid "Limit Relations to Vocabularies" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:11 +#: views/admin/plugins/item-relations-config-form.php:10 msgid "Check the vocabularies that can be used to set relations." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:12 +#: views/admin/plugins/item-relations-config-form.php:11 msgid "If none is checked, all vocabularies will be allowed." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:42 +#: views/admin/plugins/item-relations-config-form.php:41 msgid "Provide comment field for relations" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:47 +#: views/admin/plugins/item-relations-config-form.php:46 msgid "Check this if you want to be able to enter a comment to a relation." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:55 +#: views/admin/plugins/item-relations-config-form.php:54 msgid "Display" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:59 +#: views/admin/plugins/item-relations-config-form.php:58 msgid "Relation Format" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:64 +#: views/admin/plugins/item-relations-config-form.php:63 msgid "" "Select the format of an item's relations that you would prefer to show. If " "one is unavailable the other will be used." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:70 +#: views/admin/plugins/item-relations-config-form.php:69 msgid "prefix:localPart" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:71 +#: views/admin/plugins/item-relations-config-form.php:70 msgid "label" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:78 +#: views/admin/plugins/item-relations-config-form.php:77 msgid "Display position in admin view" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:83 +#: views/admin/plugins/item-relations-config-form.php:82 msgid "" "Select the position where you would prefer to display the relations in admin " "view: In the side bar in the lower right (default) or underneath the regular " "field values to the left." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:89 +#: views/admin/plugins/item-relations-config-form.php:88 msgid "Side bar" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:90 +#: views/admin/plugins/item-relations-config-form.php:89 msgid "Main content" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:97 +#: views/admin/plugins/item-relations-config-form.php:96 msgid "Admin Display Mode" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:102 +#: views/admin/plugins/item-relations-config-form.php:101 msgid "Set how to display the list of relations in the admin view." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:103 -#: views/admin/plugins/item-relations-config-form.php:138 +#: views/admin/plugins/item-relations-config-form.php:102 +#: views/admin/plugins/item-relations-config-form.php:137 msgid "Anyway, the view can be themed." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:108 -#: views/admin/plugins/item-relations-config-form.php:143 +#: views/admin/plugins/item-relations-config-form.php:107 +#: views/admin/plugins/item-relations-config-form.php:142 msgid "As a table" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:109 -#: views/admin/plugins/item-relations-config-form.php:144 +#: views/admin/plugins/item-relations-config-form.php:108 +#: views/admin/plugins/item-relations-config-form.php:143 msgid "As a list" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:110 -#: views/admin/plugins/item-relations-config-form.php:145 +#: views/admin/plugins/item-relations-config-form.php:109 +#: views/admin/plugins/item-relations-config-form.php:144 msgid "By item type" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:117 +#: views/admin/plugins/item-relations-config-form.php:116 msgid "Append to Public Items Show" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:122 +#: views/admin/plugins/item-relations-config-form.php:121 msgid "" "Check this if you want to display an item's relations on its public show " "page." msgstr "" -#: views/admin/plugins/item-relations-config-form.php:132 +#: views/admin/plugins/item-relations-config-form.php:131 msgid "Public Display Mode" msgstr "" -#: views/admin/plugins/item-relations-config-form.php:137 +#: views/admin/plugins/item-relations-config-form.php:136 msgid "Set how to display the list of relations in the public view." msgstr "" @@ -1278,9 +1278,8 @@ msgid "Invalid item IDs will be ignored." msgstr "" #: views/shared/common/item-relations-form.php:38 -#: views/shared/common/item-relations-form.php:55 -#: views/shared/common/item-relations-form.php:78 -#: views/shared/common/item-relations-form.php:91 +#: views/shared/common/item-relations-form.php:59 +#: views/shared/common/item-relations-form.php:85 #: views/shared/common/item-relations-show-list.php:16 #: views/shared/common/item-relations-show-list.php:21 #: views/shared/common/item-relations-show-table.php:18 @@ -1288,36 +1287,76 @@ msgstr "" msgid "This Item" msgstr "" -#: views/shared/common/item-relations-form.php:82 -msgid "[n/a]" +#: views/shared/common/item-relations-form.php:81 +msgid "New Relations" msgstr "" -#: views/shared/common/item-relations-form.php:87 +#: views/shared/common/item-relations-form.php:103 +msgid "Delete now" +msgstr "" + +#: views/shared/common/item-relations-form.php:108 msgid "Add a Relation" msgstr "" -#: views/shared/common/item-relations-form.php:98 -msgid "Item Sort" +#: views/shared/common/item-relations-form.php:113 +msgid "This Subject" msgstr "" -#: views/shared/common/item-relations-form.php:101 -msgid "Most recently updated" +#: views/shared/common/item-relations-form.php:116 +msgid "[New]" msgstr "" -#: views/shared/common/item-relations-form.php:103 -msgid "Alphabetically" +#: views/shared/common/item-relations-form.php:124 +msgid "Is Related By" +msgstr "" + +#: views/shared/common/item-relations-form.php:133 +msgid "With Object" +msgstr "" + +#: views/shared/common/item-relations-form.php:139 +msgid "[Search and Select Below]" +msgstr "" + +#: views/shared/common/item-relations-form.php:158 +msgid "Add this Relation" +msgstr "" + +#: views/shared/common/item-relations-form.php:168 +msgid "Search and Select a Record" +msgstr "" + +#: views/shared/common/item-relations-form.php:172 +msgid "Create a new Relation" +msgstr "" + +#: views/shared/common/item-relations-form.php:175 +msgid "Refresh" msgstr "" -#: views/shared/common/item-relations-form.php:107 -msgid "Object Title" +#: views/shared/common/item-relations-form.php:180 +msgid "By Item Types" msgstr "" -#: views/shared/common/item-relations-form.php:109 -msgid "Partial Object Title" +#: views/shared/common/item-relations-form.php:189 +msgid "By Collection" msgstr "" -#: views/shared/common/item-relations-form.php:126 -msgid "Add Relation" +#: views/shared/common/item-relations-form.php:199 +msgid "By Partial Title" +msgstr "" + +#: views/shared/common/item-relations-form.php:208 +msgid "Sort By" +msgstr "" + +#: views/shared/common/item-relations-form.php:213 +msgid "Most recently updated" +msgstr "" + +#: views/shared/common/item-relations-form.php:217 +msgid "Alphabetically" msgstr "" #: views/shared/common/item-relations-show-list-by-item-type.php:20 From 25032f880d742dc3a1335135b3c4d286afd5f820 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 22 Mar 2016 11:28:18 +0100 Subject: [PATCH 51/66] Updated i18n / fixed untranslatable string in .js / "Create a new Relation" instead of "Record" ^2 ;-) --- ItemRelationsPlugin.php | 3 +++ views/shared/common/item-relations-form.php | 2 +- views/shared/javascripts/item-relations.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index ca43fd1..5ba2dd1 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -616,6 +616,9 @@ public function filterAdminNavigationMain($nav) public function filterAdminItemsFormTabs($tabs, $args) { $item = $args['item']; + echo ""; $tabs['Item Relations'] = get_view()->itemRelationsForm($item); return $tabs; } diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index 8b689b1..e077df1 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -169,7 +169,7 @@
            - +
            diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 12fab58..a2daf54 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -9,7 +9,7 @@ jQuery(document).ready(function () { $('#new_relation_object_item_id').val(''); $('#object_id').html(''); - $('#object_title').html('' + '[Search and Select Below]' + ''); + $('#object_title').html('' + itemRelationsSearchAndSelect + ''); $('#new_relation_property_id').val(''); $('#relation_comment').val(''); $('#new_relation_object_item_type_id').val(-1); From ecbeaa08e9fffd5b3cc6c70cf19b4e1ea634d0d0 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 22 Mar 2016 17:25:10 +0100 Subject: [PATCH 52/66] Tiny bugfix for "Most Recently" and "Alphabetically" radio button labels (wrong IDs) --- views/shared/common/item-relations-form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index e077df1..a01fff2 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -210,11 +210,11 @@
            - +
            - +
            From 9d64508c484318d1d1c5a62845e612526f457ab3 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 22 Mar 2016 17:34:50 +0100 Subject: [PATCH 53/66] D'oh! Revert erroneous fix ("Add new Record" vs. "Add new Relation") to "Add Item" / incl. i18n --- languages/de_DE.mo | Bin 35140 -> 35134 bytes languages/de_DE.po | 14 +++++++------- languages/template.pot | 10 +++++----- views/shared/common/item-relations-form.php | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/languages/de_DE.mo b/languages/de_DE.mo index c2f8190cb896520770f438a016b9fe29d0fdf617..56a77183957286419886a73aabc6d66d54c2bd82 100644 GIT binary patch delta 4129 zcmXZe3sl$T9mnx6e=Z^_AmCs9n+ReGhRVhSbOniGq8TjjmnL)J1wqq+l_YpPuI&kFV!``99C{`}4=$ zfzI85_A8O$fo9fsqFFW$!x)@__hA{T{yB`p-(Vkn6;tsj2Jt*5;0@%T1@hcD1-OfR z5oSf0oxxo4z4>muu>}^kSPCWxhFVw|mf!+>3ZKUu z%(};wFGfY^SEwWT00-m8I1jDRtO4fZVhnea*gztu$era2s2#oTeG9dNGpGU2VF*9P zI*h*8tOM(jJ=laPW~|B9pvGy#(RdiOfe%oT>A_6qx9cR-FjVZ!KwY|QZy{!pFUNav z6LS3a27U`~;dgM%RI^dI6t$2oco!Z+UCK}JP8>1KtOZLj#QgRli4hdsL^VhuzKm&; zQTfd{3SYo6_$O4zzd$V@eY(56bFeS@WvDY=jatA)9EPnp5<4-77cqhP?JE+xG_m)& zvr0w1hCCdH#Tbo`;85I%n&_vfcE3Pf)#G`$AHtH_qV;?N><+D)}EcE5eeR&nCeI3SPGittFsP=ni5Pwb3>I>RX zD|`iY`;VjQ&w4+^DDoG)SA6*=7(@9rpYO$3^8ZD(k1ln_p%$Kix`cyEiN98uNr5`# zp;lProrQ|b0$;zvm#;&;hI&lGr%;!6A8NdI)J8f{?f#5vcOG@rS5fmsg=e}@B%&4& zLRDm-&U%8cFGUSF2Q@(jY6ojE4mFO-e~f)`kI%QFHqee*;BnOWfA{6#e~<_S%s#^k zDz4pcb^yy~n+?HRI3D94FdK{apx*x~T#C*3ZS27bm|SM|L!64)_-o|bWA9=HCY8Ha zlZP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H1Bu-$PBd`^RU`m<&H)9Hh60g9{ScjVUaqN!U zJPN@S_MvvrgnHk{Q9D14*W+auN6ju+Z3R=KmOvK^n$7!fkuR-07EvTQ^U-2cpie(*)dEr5u315XhvSRGY_Xkl& zR*mavw*i^kT))U>s1Ez;{Wnq2J3WtN&y1=)5s7y4Yj_3q>I^#1Gbjg0l$1v`1_Ezu0LgEE~ zCyjUzweqBD`$LqD+W8DrW-72BuEJ{zb@h$T&s_Z(&!QHneBS`WPzxwUecz1A$S#bMw_baHo5V+d5^SV$_ zLm%qar=TY2?-~qu_4%lFg{ZTgjzPE()vpTGZxsgOW>^2DtA7r4M;fpbzK3kUGe;<> z!&OcBY2wGzYh(h&?L$ymlJySobe>N%;d8mbtLuG6lDr0l6)pP#K zC}>CPP!nuHrL5l7??rVu?7p|S?`Kd)cNLQ`cCF1oCThZb7vF>0c?rhh64U}W>U$A| zXDDcb-Kb0QmTS\n" "Language-Team: German (Germany) (http://www.transifex.com/upb/wesa-omeka/language/de_DE/)\n" "MIME-Version: 1.0\n" @@ -55,6 +55,10 @@ msgstr "Diese Objekte" msgid "Item ID" msgstr "Objekt-ID" +#: ItemRelationsPlugin.php:620 views/shared/common/item-relations-form.php:139 +msgid "[Search and Select Below]" +msgstr "[Unten suchen und auswählen]" + #: controllers/VocabulariesController.php:37 msgid "The vocabulary name already exists. Please choose a different one." msgstr "Der Vokabular-Name existiert bereits. Bitte wählen Sie einen anderen." @@ -1200,10 +1204,6 @@ msgstr "steht in Beziehung" msgid "With Object" msgstr "mit Objekt-Resource" -#: views/shared/common/item-relations-form.php:139 -msgid "[Search and Select Below]" -msgstr "[Unten suchen und auswählen]" - #: views/shared/common/item-relations-form.php:158 msgid "Add this Relation" msgstr "Diese Beziehung hinzufügen" @@ -1213,8 +1213,8 @@ msgid "Search and Select a Record" msgstr "Objekt suchen und auswählen" #: views/shared/common/item-relations-form.php:172 -msgid "Create a new Relation" -msgstr "Neue Beziehung erstellen" +msgid "Create a new Item" +msgstr "Neues Objekt erstellen" #: views/shared/common/item-relations-form.php:175 msgid "Refresh" diff --git a/languages/template.pot b/languages/template.pot index f04a7f2..507ef1e 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -59,6 +59,10 @@ msgstr "" msgid "Item ID" msgstr "" +#: ItemRelationsPlugin.php:620 views/shared/common/item-relations-form.php:139 +msgid "[Search and Select Below]" +msgstr "" + #: controllers/VocabulariesController.php:37 msgid "The vocabulary name already exists. Please choose a different one." msgstr "" @@ -1315,10 +1319,6 @@ msgstr "" msgid "With Object" msgstr "" -#: views/shared/common/item-relations-form.php:139 -msgid "[Search and Select Below]" -msgstr "" - #: views/shared/common/item-relations-form.php:158 msgid "Add this Relation" msgstr "" @@ -1328,7 +1328,7 @@ msgid "Search and Select a Record" msgstr "" #: views/shared/common/item-relations-form.php:172 -msgid "Create a new Relation" +msgid "Create a new Item" msgstr "" #: views/shared/common/item-relations-form.php:175 diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index a01fff2..423423a 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -169,7 +169,7 @@
            - +
            From 02ac6fc0cd2340275e11108e7aa38c120a7ca38e Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Wed, 23 Mar 2016 00:00:00 +0100 Subject: [PATCH 54/66] Updated list of item types and collections dynamically in the form. --- ItemRelationsPlugin.php | 3 -- controllers/LookupController.php | 52 +++++++++++++++++++++ views/helpers/ItemRelationsForm.php | 39 ++-------------- views/shared/common/item-relations-form.php | 4 +- views/shared/javascripts/item-relations.js | 30 ++++++++++++ 5 files changed, 88 insertions(+), 40 deletions(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 5ba2dd1..ca43fd1 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -616,9 +616,6 @@ public function filterAdminNavigationMain($nav) public function filterAdminItemsFormTabs($tabs, $args) { $item = $args['item']; - echo ""; $tabs['Item Relations'] = get_view()->itemRelationsForm($item); return $tabs; } diff --git a/controllers/LookupController.php b/controllers/LookupController.php index aa0fec9..8c56191 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -137,4 +137,56 @@ public function indexAction() $this->_helper->json($metadata); } + + public function listItemTypesAction() + { + $itemTypesList = array( + '' => '- ' . __('All') . ' -', + ); + $itemTypesList += $this->_getUsedItemTypes(); + // Convert to a pseudo-associative array to keep order of ids. + $json = array( + 'id' => array_keys($itemTypesList), + 'label' => array_values($itemTypesList), + ); + $this->_helper->json($json); + } + + public function listCollectionsAction() + { + $collections = get_table_options('Collection'); + // Convert to a pseudo-associative array to keep order of ids. + $json = array( + 'id' => array_keys($collections), + 'label' => array_values($collections), + ); + $this->_helper->json($json); + } + + /** + * Get the list of used item types for select form. + * + * @return array + */ + protected function _getUsedItemTypes() + { + $db = get_db(); + + $itemTypesTable = $db->getTable('ItemType'); + $itemTypesAlias = $itemTypesTable->getTableAlias(); + + $select = $itemTypesTable->getSelect() + ->reset(Zend_Db_Select::COLUMNS) + ->from(array(), array($itemTypesAlias . '.id', $itemTypesAlias . '.name')) + ->joinInner(array('items' => $db->Item), "items.item_type_id = $itemTypesAlias.id", array()) + ->group($itemTypesAlias . '.id') + ->order($itemTypesAlias . '.name ASC'); + + $permissions = new Omeka_Db_Select_PublicPermissions('Items'); + $permissions->apply($select, 'items'); + + $itemTypes = $db->fetchPairs($select); + + return $itemTypes; + } } diff --git a/views/helpers/ItemRelationsForm.php b/views/helpers/ItemRelationsForm.php index a08b037..768347c 100644 --- a/views/helpers/ItemRelationsForm.php +++ b/views/helpers/ItemRelationsForm.php @@ -15,18 +15,11 @@ public function itemRelationsForm($item) $view = $this->view; $db = get_db(); - // Prepare list of used item types for the select form. - $itemTypesList = array( - '-1' => '- ' . __('All') . ' -', - ); - $itemTypesList += $this->_getUsedItemTypes(); - $html = $view->partial('common/item-relations-form.php', array( 'item' => $item, 'provideRelationComments' => get_option('item_relations_provide_relation_comments'), 'formSelectProperties' => get_table_options('ItemRelationsProperty'), 'allRelations' => ItemRelationsPlugin::prepareAllRelations($item), - 'itemTypesList' => $itemTypesList, )); if (!defined("LITYLOADED")) { @@ -35,36 +28,12 @@ public function itemRelationsForm($item) DEFINE("LITYLOADED", 1); } $html .= ''; - $html .= ''; + $html .= ''; $html .= js_tag('item-relations'); return $html; } - - /** - * Get the list of used item types for select form. - * - * @return array - */ - protected function _getUsedItemTypes() - { - $db = get_db(); - - $itemTypesTable = $db->getTable('ItemType'); - $itemTypesAlias = $itemTypesTable->getTableAlias(); - - $select = $itemTypesTable->getSelect() - ->reset(Zend_Db_Select::COLUMNS) - ->from(array(), array($itemTypesAlias . '.id', $itemTypesAlias . '.name')) - ->joinInner(array('items' => $db->Item), "items.item_type_id = $itemTypesAlias.id", array()) - ->group($itemTypesAlias . '.id') - ->order($itemTypesAlias . '.name ASC'); - - $permissions = new Omeka_Db_Select_PublicPermissions('Items'); - $permissions->apply($select, 'items'); - - $itemTypes = $db->fetchPairs($select); - - return $itemTypes; - } } diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index 423423a..eb2315b 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -181,7 +181,7 @@
            formSelect('new_relation_object_item_type_id', - null, array('multiple' => false), $itemTypesList); ?> + null, array('multiple' => false), array()); ?>
            @@ -190,7 +190,7 @@
            formSelect('new_relation_object_collection_id', - null, array('multiple' => false), get_table_options('Collection')); ?> + null, array('multiple' => false), array()); ?>
            diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index a2daf54..213a12f 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -83,6 +83,36 @@ jQuery(document).ready(function () { } } }); + + // Update the list of item types. + $.ajax({ + url: url + 'list-item-types', + dataType: 'json', + success: function (data) { + _loadList('select#new_relation_object_item_type_id', data); + } + }); + + // Update the list of collections. + $.ajax({ + url: url + 'list-collections', + dataType: 'json', + success: function (data) { + _loadList('select#new_relation_object_collection_id', data); + } + }); + } + + function _loadList(element, data) { + var currentValue = $(element).val(); + $(element).empty(); + $.each(data['id'], function(i, id) { + $(element).append( + $('') + .val(id) + .html(data['label'][i])); + }); + $(element).val(currentValue); } function updateAddButton() { From 0eebac5285bfaa598beab1b3fbbae04e3942222e Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Wed, 23 Mar 2016 11:28:37 +0100 Subject: [PATCH 55/66] Updated README (cokernel contributed at https://github.com/omeka/plugin-ItemRelations/pull/11) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb7c10c..c01b396 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ Contact Current maintainers: * [Center for History & New Media] -* [GerZah] +* Gero Zahn (see [GerZah]) +* Michael Slone (see [cokernel]) * Daniel Berthereau (see [Daniel-KM]) @@ -74,7 +75,8 @@ Copyright --------- * Copyright Center for History and New Media, 2011-2015 -* Copyright GerZah, 2015 +* Copyright Michael Slone, 2015 +* Copyright Gero Zahn, 2015-2016 * Copyright Daniel Berthereau, 2015-2016 From fa945f4877d43cc093dcb34230837640e3967b55 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Wed, 23 Mar 2016 11:30:42 +0100 Subject: [PATCH 56/66] Updated link to cokernel --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c01b396..964a181 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Current maintainers: * [Center for History & New Media] * Gero Zahn (see [GerZah]) -* Michael Slone (see [cokernel]) +* Michael Slone (see [cokernel](https://github.com/cokernel)) * Daniel Berthereau (see [Daniel-KM]) From 38ea4da2d24e79be62ef660a0c7dc244a702b6fd Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 2 May 2016 00:00:00 +0200 Subject: [PATCH 57/66] Fixed batch edit with a new relation. --- ItemRelationsPlugin.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index ca43fd1..6ace63b 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -555,6 +555,7 @@ public function hookAdminItemsBatchEditForm() + @@ -562,9 +563,13 @@ public function hookAdminItemsBatchEditForm() formSelect('custom[item_relations_property_id]', null, array(), $formSelectProperties); ?> - - formText('custom[item_relations_item_relation_object_item_id]', - null, array('size' => 6)); + formText('custom[item_relations_item_relation_object_item_id]', + null, array('size' => 4, 'placeholder' => __('Item ID'))); + ?> + formText('custom[item_relations_item_relation_relation_comment]', + null, array('size' => 12)); ?> @@ -793,7 +798,7 @@ public static function insertItemRelation($subjectItem, $propertyId, $objectItem $itemRelation->subject_item_id = $subjectItem->id; $itemRelation->property_id = $propertyId; $itemRelation->object_item_id = $objectItem->id; - $itemRelation->relation_comment = ( $relationComment ? $relationComment : ""); + $itemRelation->relation_comment = strlen($relationComment)? $relationComment : ''; $itemRelation->save(); return true; From e88723ae32941276650a7e2295f5cb1d3f0f773c Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Mon, 9 May 2016 15:26:12 +0200 Subject: [PATCH 58/66] =?UTF-8?q?BatchEdit=20issue=20=E2=80=93=20wouldn't?= =?UTF-8?q?=20honor=20the=20"provide=5Frelation=5Fcomments"=20configuratio?= =?UTF-8?q?n=20switch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ItemRelationsPlugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ItemRelationsPlugin.php b/ItemRelationsPlugin.php index 6ace63b..c93a359 100644 --- a/ItemRelationsPlugin.php +++ b/ItemRelationsPlugin.php @@ -546,6 +546,7 @@ public function hookItemsBrowseSql($args) public function hookAdminItemsBatchEditForm() { $formSelectProperties = get_table_options('ItemRelationsProperty'); + $provideRelationComments = get_option('item_relations_provide_relation_comments'); ?>

            @@ -555,7 +556,9 @@ public function hookAdminItemsBatchEditForm() + + @@ -567,10 +570,12 @@ public function hookAdminItemsBatchEditForm() echo get_view()->formText('custom[item_relations_item_relation_object_item_id]', null, array('size' => 4, 'placeholder' => __('Item ID'))); ?> + formText('custom[item_relations_item_relation_relation_comment]', null, array('size' => 12)); ?> + From ae98e8487f390e08adffd4d45626b3e87c37603c Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 5 Jul 2016 15:56:43 +0200 Subject: [PATCH 59/66] =?UTF-8?q?Added=20an=20ID=20filter=20field=20?= =?UTF-8?q?=E2=80=93=20to=20limit=20results=20based=20on=20item=20ID=20(/r?= =?UTF-8?q?anges)=20/=20plus:=20AJAX=20timer=20delay=20to=20prevent=20firi?= =?UTF-8?q?ng=20requests=20on=20every=20keystroke?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/LookupController.php | 19 ++++ languages/de_DE.mo | Bin 35134 -> 36017 bytes languages/de_DE.po | 116 +++++++++++++++++--- languages/template.pot | 113 +++++++++++++++++-- views/shared/common/item-relations-form.php | 14 ++- views/shared/javascripts/item-relations.js | 15 +++ 6 files changed, 246 insertions(+), 31 deletions(-) diff --git a/controllers/LookupController.php b/controllers/LookupController.php index 8c56191..9201fec 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -13,6 +13,7 @@ class ItemRelations_LookupController extends Omeka_Controller_AbstractActionCont { public function indexAction() { + // error_log(microtime()); $db = get_db(); if (!$this->_hasParam('subject_id')) { @@ -21,6 +22,9 @@ public function indexAction() if (!$this->_hasParam('partial')) { $this->_setParam('partial', ''); } + if (!$this->_hasParam('id_limit')) { + $this->_setParam('id_limit', ''); + } if (!$this->_hasParam('item_type')) { $this->_setParam('item_type', -1); } @@ -49,6 +53,19 @@ public function indexAction() $where_text = 'AND text RLIKE ' . $db->quote($partial); } + $where_id_limit = ''; + if (preg_match("/\s*(\d+)(?:-(\d+))?\s*/", $this->_getParam('id_limit'), $matches)) { + $fromId = $matches[1]; + $toId = @$matches[2]; + if (!$toId) { $toId = $fromId; } + if ($fromId > $toId) { + $tmpId = $toId; + $toId = $fromId; + $fromId = $tmpId; + } + $where_id_limit = "AND items.id BETWEEN $fromId AND $toId"; + } + $item_type = intval($this->_getParam('item_type')); $where_item_type = ''; if ($item_type > 0) { @@ -95,6 +112,7 @@ public function indexAction() $where_item_type $where_collection $where_text +$where_id_limit GROUP BY elementtexts.record_id QCOUNT; $m_count = count($db->fetchAll($query)); @@ -115,6 +133,7 @@ public function indexAction() $where_item_type $where_collection $where_text +$where_id_limit GROUP BY elementtexts.record_id $order_clause LIMIT $per_page diff --git a/languages/de_DE.mo b/languages/de_DE.mo index 56a77183957286419886a73aabc6d66d54c2bd82..4310cedd5ea783264ec1b88dc40f965dbc7ee6f9 100644 GIT binary patch delta 7801 zcmYk=33wIN-N*5hkdTG21p*;}T=uX85-_ZRBm_c25_ZC(U>1fXklet{4HytE0(B{f z)r%Gos0&p=c(p`*-%4e9X#o}Mf>orYVyxC$DvF?}75e?%IrL$k=YK!voH;XRoteO) zhr@rfEj;ko_=ragM^TtDU2sFJF-J*XXs=RZzUpkuSo|6{VJel9@Kx&>97_Hhq>Aa= z)tGshgMD!qCgX9Oj2E#dj=ja0DaHg$8HsKb9Kc@qE-u3FZ~`vi6Hw)=aU34R zv3LzLaSXl9!quqrhfvpt^){vub5QsB1**Z5I0_^C7&8L1FpKt01BoJh1q(2md7FbX zu^9K`ER0|tHG+Al8$XC8c*5qB`x!Hddrn4^E8&Bh0 z3`=GHD@ojz%6j7Ou^lF+8S^*}L~XV=kwKczF&f(rF{ULZVJl2VT{qn33oxGiJe#kv z-euj0Z8^Vv2=gCLVjl&~@GwT+=LPMYix&mQ6oNNJ%w$^pT#)*CpO2c zs5QTiIXIGyFd0{)26hTt;Ct4)0%}UGpejbO!_@QEs2gXXHcgJrZ$#C97&U<1 zs2e|zy8a+)#*SeJY{J&~J<>N5!?bbVfXO7WiGp107iP?9WERa&3_}g4@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OvgKwNKzRaDgG?Ug5=u>VfyA8s>7;c7?jUM&UFXlA*736? z6?JeAkxjfq3?=pwH;A6Zzldc-Ady8pNWYTdV`=Ua?TOb2r76Ut{u~F@Dx#hIALE;! zsJKET=pqy8jcJ6JP>LbGBQ6u;iPl6nB7(LFgi=NPo0Bya$QO{;t69!oKTn!{(t%#)rFO4}(G~?P?oK4gt z-xYTfN|h+5==py}VG=QoXhNmZSR#=8MhqeJF{w%U0DeNeK&&7}5F?5CL=d5rNo*(j zs_=j5Kjih*JVgZ4*CG5~`@e+vJCQ>?LMSzG_~YkFa+SI1EnD*trV~ljy^s3nJV^7% zyhOZCv>?_K9g(gv`gp zbfOngjkZd|iP6NDDv(-GzW`g|hv*7m-dl8qq?!Ci9QU5D7U>BkSC0s=U7aA$|1LDY z<6uImIdRvYn+XNaamYg-?V-6>bM!ZlPIIf93&G$<6){L zZ6jt9ZxhXk$B9wIKZx7J%Y;91&m5agwmxO;he<>Rv5!!SC!QsKAPR}a#PiyW=5$n- zf>ICSG2%z!91%`b;rbZ-mZ(7}wIeF|bIy-zP(suqo_4DI|C_1``F|5H5*LX&^rh62 z*hOsBi&UG4=fXIgOenAl0%ry2*d!yH>M&)Y7DnY8H&1SeQS>)n}sVQ0N|B zr9qGN?wu!e|+H~KG zX)6PKY3VluyvZ3Ad_6M)1HFSX(|v0)_XT;!WR370&FT|WA+cG@maZ1bZ4wikB((4~ z@6jb7FgetFDm&h{F+0HJ+d8pUfXhD\n" "Language-Team: German (Germany) (http://www.transifex.com/upb/wesa-omeka/language/de_DE/)\n" "MIME-Version: 1.0\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Language: de_DE\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.8.7\n" +"X-Generator: Poedit 1.8.8\n" #: ItemRelationsPlugin.php:127 msgid "Custom" @@ -35,29 +35,37 @@ msgstr "Es ist ein Fehler in den Objekt-Beziehungs-Kommentaren aufgetreten." msgid "There was an error in listing the item relation." msgstr "Es ist ein Fehler beim Auflisten der Objekt-Beziehungen aufgetreten." -#: ItemRelationsPlugin.php:551 ItemRelationsPlugin.php:603 views/admin/common/item-relations-show.php:18 views/public/common/item-relations-show.php:14 views/shared/common/item-relations-advanced-search.php:6 +#: ItemRelationsPlugin.php:552 ItemRelationsPlugin.php:613 views/admin/common/item-relations-show.php:18 views/public/common/item-relations-show.php:14 views/shared/common/item-relations-advanced-search.php:6 msgid "Item Relations" msgstr "Objekt-Beziehungen" -#: ItemRelationsPlugin.php:555 +#: ItemRelationsPlugin.php:556 msgid "Subjects" msgstr "Subjekt-Ressourcen" -#: ItemRelationsPlugin.php:557 views/shared/common/item-relations-advanced-search.php:32 views/shared/common/item-relations-form.php:13 +#: ItemRelationsPlugin.php:557 formal_vocabularies.php:17 views/shared/common/item-relations-form.php:12 +msgid "Relation" +msgstr "Beziehung" + +#: ItemRelationsPlugin.php:558 views/shared/common/item-relations-advanced-search.php:32 views/shared/common/item-relations-form.php:13 msgid "Object" msgstr "Objekt-Ressource" -#: ItemRelationsPlugin.php:562 +#: ItemRelationsPlugin.php:560 views/shared/common/item-relations-form.php:15 views/shared/common/item-relations-form.php:146 +msgid "Comment" +msgstr "Kommentar" + +#: ItemRelationsPlugin.php:566 msgid "These Items" msgstr "Diese Objekte" -#: ItemRelationsPlugin.php:565 +#: ItemRelationsPlugin.php:571 msgid "Item ID" msgstr "Objekt-ID" -#: ItemRelationsPlugin.php:620 views/shared/common/item-relations-form.php:139 -msgid "[Search and Select Below]" -msgstr "[Unten suchen und auswählen]" +#: controllers/LookupController.php:158 +msgid "All" +msgstr "Alle" #: controllers/VocabulariesController.php:37 msgid "The vocabulary name already exists. Please choose a different one." @@ -195,6 +203,10 @@ msgstr "Erfordert" msgid "A related resource that is required by the described resource to support its function, delivery, or coherence." msgstr "Verwandte Ressource, für die die bezeichnete Ressource für deren Funktion, Lieferung oder ihre Kohärenz erfordert ist." +#: formal_vocabularies.php:87 +msgid "Source" +msgstr "Quelle" + #: formal_vocabularies.php:88 msgid "A related resource from which the described resource is derived." msgstr "Verwandte Ressource, aus der die bezeichnete Ressource abgeleitet ist." @@ -247,18 +259,34 @@ msgstr "Zielgruppe" msgid "A class of entity for whom the resource is intended or useful." msgstr "Eine Klasse von Personen oder Organisationen, für die die Ressource gedacht bzw. nützlich ist." +#: formal_vocabularies.php:122 +msgid "Contributor" +msgstr "Mitarbeiter" + #: formal_vocabularies.php:123 msgid "An entity responsible for making contributions to the resource." msgstr "Eine Person oder Organisation, die verantwortlich ist für die Mitwirkung an dieser Ressource." +#: formal_vocabularies.php:127 +msgid "Coverage" +msgstr "Abdeckung" + #: formal_vocabularies.php:128 msgid "The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant." msgstr "Das räumliche oder zeitliche Rahmen der Ressource, die räumliche Anwendbarkeit der Ressource, oder der Zuständigkeitsbereich, für die die Ressource relevant ist." +#: formal_vocabularies.php:132 +msgid "Creator" +msgstr "Urheber" + #: formal_vocabularies.php:133 msgid "An entity primarily responsible for making the resource." msgstr "Die Person oder Organisation, die hauptverantwortlich für die Erstellung der Ressource ist." +#: formal_vocabularies.php:137 views/admin/vocabularies/browse.php:14 views/admin/vocabularies/edit.php:18 views/admin/vocabularies/show.php:36 +msgid "Description" +msgstr "Beschreibung" + #: formal_vocabularies.php:138 msgid "An account of the resource." msgstr "Ein Bericht über die Ressource." @@ -279,6 +307,10 @@ msgstr "Umfang" msgid "The size or duration of the resource." msgstr "Die Größe oder die Zeitdauer der Ressource." +#: formal_vocabularies.php:152 +msgid "Format" +msgstr "Format" + #: formal_vocabularies.php:153 msgid "The file format, physical medium, or dimensions of the resource." msgstr "Das Dateiformat, das physische Medium oder die räumlichen Ausmaße der Ressource." @@ -291,6 +323,10 @@ msgstr "Lehrmethode" msgid "A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support." msgstr "Ein Prozess, der dazu verwendet wird, Wissen, Einstellungen und Fertigkeiten hervorzubringen, zu dessen Unterstützung die bezeichnete Ressource entwickelt wurde." +#: formal_vocabularies.php:162 +msgid "Language" +msgstr "Sprache" + #: formal_vocabularies.php:163 msgid "A language of the resource." msgstr "Die Sprache der Ressource." @@ -327,10 +363,18 @@ msgstr "Herkunft" msgid "A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation." msgstr "Eine Aussage über jedwede Änderung der Eigentümerschaft der Ressource seit ihrer Erstellung, die Bedeutung für ihre Authentizität, Richtigkeit und Deutung besitzt." +#: formal_vocabularies.php:187 +msgid "Publisher" +msgstr "Verleger" + #: formal_vocabularies.php:188 msgid "An entity responsible for making the resource available." msgstr "Eine Person oder Organisation, die verantwortlich für die Verfügbarkeit der Ressource ist." +#: formal_vocabularies.php:192 +msgid "Rights" +msgstr "Rechte" + #: formal_vocabularies.php:193 msgid "Information about rights held in and over the resource." msgstr "Informationen über die Rechte, die im Rahmen oder hinsichtlich der Ressource gehalten werden." @@ -351,6 +395,10 @@ msgstr "Räumlicher Umfang" msgid "Spatial characteristics of the resource." msgstr "Räumliche Charakteristiken der Ressource." +#: formal_vocabularies.php:207 +msgid "Subject" +msgstr "Subjekt-Ressource" + #: formal_vocabularies.php:208 msgid "The topic of the resource." msgstr "Das Thema der Ressource." @@ -371,6 +419,10 @@ msgstr "Zeitlicher Umfang" msgid "Temporal characteristics of the resource." msgstr "Zeitliche Charakteristiken der Ressource." +#: formal_vocabularies.php:222 +msgid "Type" +msgstr "Typ" + #: formal_vocabularies.php:223 msgid "The nature or genre of the resource." msgstr "Die Art oder das Genre der Ressource." @@ -1087,6 +1139,10 @@ msgstr "Vokabular hinzufügen" msgid "Allowed" msgstr "Zugelassen" +#: views/admin/vocabularies/browse.php:13 +msgid "Name" +msgstr "Name" + #: views/admin/vocabularies/browse.php:15 msgid "Namespace Prefix" msgstr "Namensraum-Präfix" @@ -1095,6 +1151,14 @@ msgstr "Namensraum-Präfix" msgid "Namespace URI" msgstr "Namensraum-URI" +#: views/admin/vocabularies/browse.php:22 +msgid "Yes" +msgstr "Ja" + +#: views/admin/vocabularies/browse.php:22 +msgid "No" +msgstr "Nein" + #: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:23 msgid "Delete Vocabulary" msgstr "Vokabular löschen" @@ -1119,10 +1183,22 @@ msgstr "Benutzerdefiniertes Vokabular editieren" msgid "Here you can add, edit, and delete properties in your custom vocabulary. Property labels must be unique. You cannot edit property labels once they have been created, so make sure they are spelled correctly and convey the exact relation you want them to convey." msgstr "Hier können Sie Eigenschaften in das benutzerdefinierte Vokabular hinzufügen, sowie bestehende editieren oder löschen. Die Eigenschafts-Bezeichnungen müssen eindeutig sein. Sie können die Eigenschafts-Bezeichnungen nach dem Anlegen nicht mehr nachträglich editieren. Stellen Sie daher bitte sicher, dass diese fehlerfrei geschrieben sind und die zu definierende Beziehung exakt beschreiben." +#: views/admin/vocabularies/edit.php:17 views/admin/vocabularies/show.php:35 +msgid "Label" +msgstr "Bezeichnung" + +#: views/admin/vocabularies/edit.php:19 views/shared/common/item-relations-form.php:17 +msgid "Delete" +msgstr "Löschen" + #: views/admin/vocabularies/edit.php:37 msgid "Add a Property" msgstr "Eigenschaft hinzufügen" +#: views/admin/vocabularies/edit.php:41 +msgid "Save Changes" +msgstr "Änderungen speichern" + #: views/admin/vocabularies/show.php:2 msgid "Vocabulary Properties" msgstr "Vokabular-Eigenschaften" @@ -1143,9 +1219,9 @@ msgstr "Möchten Sie einige hinzufügen?" msgid "Local Part" msgstr "Lokaler Teil" -#: views/helpers/ItemRelationsForm.php:20 -msgid "All" -msgstr "Alle" +#: views/helpers/ItemRelationsForm.php:33 views/shared/common/item-relations-form.php:139 +msgid "[Search and Select Below]" +msgstr "[Unten suchen und auswählen]" #: views/shared/common/item-relations-advanced-search.php:11 msgid "Filter this search for items with the selected relation. For example, when selecting \"Subject\" items with the \"hasPart\" relation, the search will return all items that have parts. When selecting \"Object\" items with the same relation, the search will return all items that are parts of other items." @@ -1208,6 +1284,10 @@ msgstr "mit Objekt-Resource" msgid "Add this Relation" msgstr "Diese Beziehung hinzufügen" +#: views/shared/common/item-relations-form.php:162 +msgid "Cancel" +msgstr "Abbrechen" + #: views/shared/common/item-relations-form.php:168 msgid "Search and Select a Record" msgstr "Objekt suchen und auswählen" @@ -1232,15 +1312,19 @@ msgstr "Nach Sammlung" msgid "By Partial Title" msgstr "Nach teilweisem Objekt-Titel" -#: views/shared/common/item-relations-form.php:208 +#: views/shared/common/item-relations-form.php:206 +msgid "Limit Item IDs (“x” or “x-y”)" +msgstr "Objekt-IDs beschr. („x“ oder „x-y“)" + +#: views/shared/common/item-relations-form.php:216 msgid "Sort By" msgstr "Sortieren nach" -#: views/shared/common/item-relations-form.php:213 +#: views/shared/common/item-relations-form.php:221 msgid "Most recently updated" msgstr "Kürzlich bearbeitet" -#: views/shared/common/item-relations-form.php:217 +#: views/shared/common/item-relations-form.php:225 msgid "Alphabetically" msgstr "Alphabetisch" diff --git a/languages/template.pot b/languages/template.pot index 507ef1e..5f70167 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -34,33 +34,43 @@ msgstr "" msgid "There was an error in listing the item relation." msgstr "" -#: ItemRelationsPlugin.php:551 ItemRelationsPlugin.php:603 +#: ItemRelationsPlugin.php:552 ItemRelationsPlugin.php:613 #: views/admin/common/item-relations-show.php:18 #: views/public/common/item-relations-show.php:14 #: views/shared/common/item-relations-advanced-search.php:6 msgid "Item Relations" msgstr "" -#: ItemRelationsPlugin.php:555 +#: ItemRelationsPlugin.php:556 msgid "Subjects" msgstr "" -#: ItemRelationsPlugin.php:557 +#: ItemRelationsPlugin.php:557 formal_vocabularies.php:17 +#: views/shared/common/item-relations-form.php:12 +msgid "Relation" +msgstr "" + +#: ItemRelationsPlugin.php:558 #: views/shared/common/item-relations-advanced-search.php:32 #: views/shared/common/item-relations-form.php:13 msgid "Object" msgstr "" -#: ItemRelationsPlugin.php:562 +#: ItemRelationsPlugin.php:560 views/shared/common/item-relations-form.php:15 +#: views/shared/common/item-relations-form.php:146 +msgid "Comment" +msgstr "" + +#: ItemRelationsPlugin.php:566 msgid "These Items" msgstr "" -#: ItemRelationsPlugin.php:565 +#: ItemRelationsPlugin.php:571 msgid "Item ID" msgstr "" -#: ItemRelationsPlugin.php:620 views/shared/common/item-relations-form.php:139 -msgid "[Search and Select Below]" +#: controllers/LookupController.php:158 +msgid "All" msgstr "" #: controllers/VocabulariesController.php:37 @@ -226,6 +236,10 @@ msgid "" "function, delivery, or coherence." msgstr "" +#: formal_vocabularies.php:87 +msgid "Source" +msgstr "" + #: formal_vocabularies.php:88 msgid "A related resource from which the described resource is derived." msgstr "" @@ -280,20 +294,37 @@ msgstr "" msgid "A class of entity for whom the resource is intended or useful." msgstr "" +#: formal_vocabularies.php:122 +msgid "Contributor" +msgstr "" + #: formal_vocabularies.php:123 msgid "An entity responsible for making contributions to the resource." msgstr "" +#: formal_vocabularies.php:127 +msgid "Coverage" +msgstr "" + #: formal_vocabularies.php:128 msgid "" "The spatial or temporal topic of the resource, the spatial applicability of " "the resource, or the jurisdiction under which the resource is relevant." msgstr "" +#: formal_vocabularies.php:132 +msgid "Creator" +msgstr "" + #: formal_vocabularies.php:133 msgid "An entity primarily responsible for making the resource." msgstr "" +#: formal_vocabularies.php:137 views/admin/vocabularies/browse.php:14 +#: views/admin/vocabularies/edit.php:18 views/admin/vocabularies/show.php:36 +msgid "Description" +msgstr "" + #: formal_vocabularies.php:138 msgid "An account of the resource." msgstr "" @@ -316,6 +347,10 @@ msgstr "" msgid "The size or duration of the resource." msgstr "" +#: formal_vocabularies.php:152 +msgid "Format" +msgstr "" + #: formal_vocabularies.php:153 msgid "The file format, physical medium, or dimensions of the resource." msgstr "" @@ -330,6 +365,10 @@ msgid "" "described resource is designed to support." msgstr "" +#: formal_vocabularies.php:162 +msgid "Language" +msgstr "" + #: formal_vocabularies.php:163 msgid "A language of the resource." msgstr "" @@ -373,10 +412,18 @@ msgid "" "interpretation." msgstr "" +#: formal_vocabularies.php:187 +msgid "Publisher" +msgstr "" + #: formal_vocabularies.php:188 msgid "An entity responsible for making the resource available." msgstr "" +#: formal_vocabularies.php:192 +msgid "Rights" +msgstr "" + #: formal_vocabularies.php:193 msgid "Information about rights held in and over the resource." msgstr "" @@ -397,6 +444,10 @@ msgstr "" msgid "Spatial characteristics of the resource." msgstr "" +#: formal_vocabularies.php:207 +msgid "Subject" +msgstr "" + #: formal_vocabularies.php:208 msgid "The topic of the resource." msgstr "" @@ -417,6 +468,10 @@ msgstr "" msgid "Temporal characteristics of the resource." msgstr "" +#: formal_vocabularies.php:222 +msgid "Type" +msgstr "" + #: formal_vocabularies.php:223 msgid "The nature or genre of the resource." msgstr "" @@ -1183,6 +1238,10 @@ msgstr "" msgid "Allowed" msgstr "" +#: views/admin/vocabularies/browse.php:13 +msgid "Name" +msgstr "" + #: views/admin/vocabularies/browse.php:15 msgid "Namespace Prefix" msgstr "" @@ -1191,6 +1250,14 @@ msgstr "" msgid "Namespace URI" msgstr "" +#: views/admin/vocabularies/browse.php:22 +msgid "Yes" +msgstr "" + +#: views/admin/vocabularies/browse.php:22 +msgid "No" +msgstr "" + #: views/admin/vocabularies/delete.php:2 views/admin/vocabularies/show.php:23 msgid "Delete Vocabulary" msgstr "" @@ -1219,10 +1286,23 @@ msgid "" "exact relation you want them to convey." msgstr "" +#: views/admin/vocabularies/edit.php:17 views/admin/vocabularies/show.php:35 +msgid "Label" +msgstr "" + +#: views/admin/vocabularies/edit.php:19 +#: views/shared/common/item-relations-form.php:17 +msgid "Delete" +msgstr "" + #: views/admin/vocabularies/edit.php:37 msgid "Add a Property" msgstr "" +#: views/admin/vocabularies/edit.php:41 +msgid "Save Changes" +msgstr "" + #: views/admin/vocabularies/show.php:2 msgid "Vocabulary Properties" msgstr "" @@ -1243,8 +1323,9 @@ msgstr "" msgid "Local Part" msgstr "" -#: views/helpers/ItemRelationsForm.php:20 -msgid "All" +#: views/helpers/ItemRelationsForm.php:33 +#: views/shared/common/item-relations-form.php:139 +msgid "[Search and Select Below]" msgstr "" #: views/shared/common/item-relations-advanced-search.php:11 @@ -1323,6 +1404,10 @@ msgstr "" msgid "Add this Relation" msgstr "" +#: views/shared/common/item-relations-form.php:162 +msgid "Cancel" +msgstr "" + #: views/shared/common/item-relations-form.php:168 msgid "Search and Select a Record" msgstr "" @@ -1347,15 +1432,19 @@ msgstr "" msgid "By Partial Title" msgstr "" -#: views/shared/common/item-relations-form.php:208 +#: views/shared/common/item-relations-form.php:206 +msgid "Limit Item IDs (“x” or “x-y”)" +msgstr "" + +#: views/shared/common/item-relations-form.php:216 msgid "Sort By" msgstr "" -#: views/shared/common/item-relations-form.php:213 +#: views/shared/common/item-relations-form.php:221 msgid "Most recently updated" msgstr "" -#: views/shared/common/item-relations-form.php:217 +#: views/shared/common/item-relations-form.php:225 msgid "Alphabetically" msgstr "" diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index eb2315b..0639117 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -198,9 +198,17 @@
            formLabel('partial_object_title', __('By Partial Title')); ?>
            -
            - formText('partial_object_title', null, array('size' => 10, 'maxlength' => 60)); ?> -
            +
            + formText('partial_object_title', null, array('size' => 10, 'maxlength' => 60)); ?> +
            +
            +
            + formLabel('id_limit', __('Limit Item IDs (“x” or “x-y”)')); ?> +
            +
            + formText('id_limit', null, array('size' => 10, 'maxlength' => 60)); ?> +
            +
            diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 213a12f..92bcff1 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -15,6 +15,7 @@ jQuery(document).ready(function () { $('#new_relation_object_item_type_id').val(-1); $('#new_relation_object_collection_id').val(''); $('#partial_object_title').val(''); + $('#id_limit').val(''); $('input[name=itemsListSort]:checked').val('timestamp'); updateChoices(); @@ -34,8 +35,18 @@ jQuery(document).ready(function () { }; } + var updateTimer = null; + function updateChoices() { + if (updateTimer != null) { clearTimeout(updateTimer); } + updateTimer = setTimeout(updateChoicesCore, 1000); + } + + function updateChoicesCore() { + clearTimeout(updateTimer); updateTimer = null; + options['partial'] = $('#partial_object_title').val(); + options['id_limit'] = $('#id_limit').val(); options['item_type'] = $('#new_relation_object_item_type_id').val(); options['collection'] = $('#new_relation_object_collection_id').val(); if ($('input[name=itemsListSort]:checked').val() === 'timestamp') { @@ -243,6 +254,10 @@ jQuery(document).ready(function () { updateChoices(); }); + $('#id_limit').on('input', function () { + updateChoices(); + }); + $('#selector-previous-page').click(function () { if (0 < options['page']) { options['page']--; From 9ebfb2e9e9fc859dbcaa14ee700366b973c33835 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 5 Jul 2016 16:12:42 +0200 Subject: [PATCH 60/66] Tiny modification to prevent a race condition when initializing the relation popup form --- views/shared/javascripts/item-relations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 92bcff1..50ab174 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -2,6 +2,8 @@ jQuery(document).ready(function () { var $ = jQuery; var options = {}; + var updateTimer = null; + init(); function init() { @@ -35,8 +37,6 @@ jQuery(document).ready(function () { }; } - var updateTimer = null; - function updateChoices() { if (updateTimer != null) { clearTimeout(updateTimer); } updateTimer = setTimeout(updateChoicesCore, 1000); From 23e3a57f790fa4ba87383c4e02c9095cc36e900c Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 5 Jul 2016 16:33:00 +0200 Subject: [PATCH 61/66] Missing initialization for id filter (doesn't seem to have been too important, though) --- views/shared/javascripts/item-relations.js | 1 + 1 file changed, 1 insertion(+) diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 50ab174..b954b38 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -28,6 +28,7 @@ jQuery(document).ready(function () { options = { subject_id: $('#subject_id').attr('data-subject-id'), partial: '', + id_limit: '', item_type: -1, collection: -1, sort: 'mod_desc', From e5f1ffd923f63a25bff5d108075357d22f8722de Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 5 Jul 2016 17:02:31 +0200 Subject: [PATCH 62/66] Fix broken pagination (would switch URLs) plus a couple of performance tweaks --- views/shared/javascripts/item-relations.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index b954b38..7d06701 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -44,7 +44,7 @@ jQuery(document).ready(function () { } function updateChoicesCore() { - clearTimeout(updateTimer); updateTimer = null; + if (updateTimer != null) { clearTimeout(updateTimer); updateTimer = null; } options['partial'] = $('#partial_object_title').val(); options['id_limit'] = $('#id_limit').val(); @@ -232,7 +232,7 @@ jQuery(document).ready(function () { /* Search and select an object to create a new relation. */ $('#refresh-results').click(function () { - updateChoices(); + updateChoicesCore(); }); $('#new_relation_object_item_type_id').change(function () { @@ -244,11 +244,11 @@ jQuery(document).ready(function () { }); $('#new_selectObjectSortTimestamp').click(function () { - updateChoices(); + updateChoicesCore(); }); $('#new_selectObjectSortName').click(function () { - updateChoices(); + updateChoicesCore(); }); $('#partial_object_title').on('input', function () { @@ -259,17 +259,19 @@ jQuery(document).ready(function () { updateChoices(); }); - $('#selector-previous-page').click(function () { + $('#selector-previous-page').click(function (e) { + e.preventDefault(); if (0 < options['page']) { options['page']--; - updateChoices(); + updateChoicesCore(); } }); - $('#selector-next-page').click(function () { + $('#selector-next-page').click(function (e) { + e.preventDefault(); if (options['page'] < options['max_page']) { options['page']++; - updateChoices(); + updateChoicesCore(); } }); From 9f0878cc822f47bd08a6926032289c5eae0d09e9 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Tue, 5 Jul 2016 18:53:50 +0200 Subject: [PATCH 63/66] =?UTF-8?q?"FrontPort"=20=E2=80=93=20i.e.=20the=20op?= =?UTF-8?q?posite=20of=20a=20backport=20from=20ItemReferences:=20added=20i?= =?UTF-8?q?tem=20IDs=20for=20better=20comprehensibility=20/=20+=20button?= =?UTF-8?q?=20URL=20change=20bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/shared/css/item-relations.css | 11 +++++++++ views/shared/javascripts/item-relations.js | 28 +++++++++++++++++----- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/views/shared/css/item-relations.css b/views/shared/css/item-relations.css index 525bb27..f619ffa 100644 --- a/views/shared/css/item-relations.css +++ b/views/shared/css/item-relations.css @@ -20,3 +20,14 @@ ul#lookup-results li:active { ul#lookup-results li:hover { background-color: #f3f3e7; } + +span.relListItemId { + display: inline-block; + text-align: right; + vertical-align: bottom; + overflow: hidden; + margin-right: 1em; + width: 4em; + font-size: 80%; + color: #aaa; +} diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index 7d06701..c961dfc 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -73,7 +73,10 @@ jQuery(document).ready(function () { /* options */ $('#lookup-results').find('li').remove(); for (i = 0; i < data['items'].length; ++i) { - items.push('
          • ' + data['items'][i]['label'] + '
          • '); + // items.push('
          • ' + data['items'][i]['label'] + '
          • '); + items.push('
          • ' + + '#' + data['items'][i]['value'] + " " + + data['items'][i]['label'] + '
          • '); } $('#lookup-results').append(items.join('')); @@ -231,7 +234,8 @@ jQuery(document).ready(function () { /* Search and select an object to create a new relation. */ - $('#refresh-results').click(function () { + $('#refresh-results').click(function (e) { + e.preventDefault(); updateChoicesCore(); }); @@ -259,7 +263,7 @@ jQuery(document).ready(function () { updateChoices(); }); - $('#selector-previous-page').click(function (e) { + $('#selector-previous-page a').click(function (e) { e.preventDefault(); if (0 < options['page']) { options['page']--; @@ -267,7 +271,7 @@ jQuery(document).ready(function () { } }); - $('#selector-next-page').click(function (e) { + $('#selector-next-page a').click(function (e) { e.preventDefault(); if (options['page'] < options['max_page']) { options['page']++; @@ -277,12 +281,24 @@ jQuery(document).ready(function () { $('#lookup-results').on('click', 'li', function () { $('#new_relation_object_item_id').val($(this).attr('data-value')); - $('#object_id').html('#' + $(this).attr('data-value') + ''); - $('#object_title').html($(this).html()); + $('#object_id').html( + '#' + + $(this).attr('data-value') + + '' + ); + var htmlSansSpan = $(this).html(); + htmlSansSpan = htmlSansSpan.substr(htmlSansSpan.indexOf("")+8); + $('#object_title').html( + '' + + htmlSansSpan + + '' + ); updateAddButton(); }); $('#new_relation_property_id').change(function () { updateAddButton(); }); + + $('#cancel-relation').click(function(e) { e.preventDefault(); }); }); From a90bed93584412f569660048d33db6a28c1d9dd2 Mon Sep 17 00:00:00 2001 From: Gero Zahn Date: Wed, 6 Jul 2016 19:07:08 +0200 Subject: [PATCH 64/66] item-relations-show-table.php i.e. the table view of all relations now features collapsible categories / incl. i18n update --- languages/de_DE.mo | Bin 36017 -> 36118 bytes languages/de_DE.po | 14 +++++-- languages/template.pot | 14 +++++-- .../common/item-relations-show-table.php | 20 +++++++-- .../item-relations-vocab-toggle.js | 39 ++++++++++++++++++ 5 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 views/shared/javascripts/item-relations-vocab-toggle.js diff --git a/languages/de_DE.mo b/languages/de_DE.mo index 4310cedd5ea783264ec1b88dc40f965dbc7ee6f9..12b5cd7f1a9c1508b2e4778114e2cd03b8e05c97 100644 GIT binary patch delta 6636 zcmZA533N_p9>?(~k&um$$ciko2th65HUrn1q+H z6a%A-iNlfjfH5w!fJ8I}pJF`T!Z8>|VLr~oNAZ2^h3PTIrnOQ zP}j#M7}FmsQTKTR)!ID-5Etiafg#?;~hti`ulE#)}w? z-BOKt1^c5m+t8L$WYxCQ%octBk9_Y(Dt;NO2WSInZVl)my-ES)T z;&K-WKN71^Bin@G_($}@4=@-Hp+nvxLIiEU6lPeI-I5!9xswD~Ql^LL^K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>UVgM`B%jxTab+|@`b1om7{k1C{zP8FaYPF z3m2m5-G@3wYfue5i7tHEmcN0jw;Q!-Kft!w;;|LJM?H83{m|zj=Y?%i<>9Ekk%Ss~ z9;!q6sQP6#KN#KQ$Dl?&#afS=fjdyoH=>^N+;1zaK%M)w=*G?H!q-tf--T-M5NgJb z+VUSzBRY?2AaI2{}XVm?EsP|Ra`(sh>orS?TAH#I^m)QdEwF3TXg+5g1!5{HNIPnwt zeMG8maB(n9H`4lG-LLHHq#-9PvN$uM>YG zo*_;Xy7WQ1e({@Piixj?w+LOUh;p9qf^QN7NzX%F$B7K`tdRMD_=Pw~+)P9!abpdM zeuS>y376Lu)z|+LsdR5;RD8#5>J*S$LNpRRh-Av5@l)^8sEo9}Botlq_1Dg zNrZXlM0a(aAa#JK@NSHb_DS@<8J(Ec%hs%-d^M3qz7?M$$_ZV;-kg~B-msVsAwJxl zN=crA(!}J;q_m076ZJ$p;t}E&LRV++yqI|Z7E*tB*TiIu9>5#Yb%U#`ZCmMV{b8@k zSZeQWBHfNOzd_gjVWTRc zwbQF)2g-lNLR^Svi7H!{6C{N-x0fs3gScl%5oyMr1MqM zx-yC0)SZUWn2MVTezVPwgs-\n" "Language-Team: German (Germany) (http://www.transifex.com/upb/wesa-omeka/language/de_DE/)\n" "MIME-Version: 1.0\n" @@ -63,7 +63,7 @@ msgstr "Diese Objekte" msgid "Item ID" msgstr "Objekt-ID" -#: controllers/LookupController.php:158 +#: controllers/LookupController.php:163 msgid "All" msgstr "Alle" @@ -1248,7 +1248,7 @@ msgstr "Für die Beschreibungen der Beziehungen, lesen Sie bitte unter %s weiter msgid "Invalid item IDs will be ignored." msgstr "Invalid item IDs will be ignored." -#: views/shared/common/item-relations-form.php:38 views/shared/common/item-relations-form.php:59 views/shared/common/item-relations-form.php:85 views/shared/common/item-relations-show-list.php:16 views/shared/common/item-relations-show-list.php:21 views/shared/common/item-relations-show-table.php:18 views/shared/common/item-relations-show-table.php:25 +#: views/shared/common/item-relations-form.php:38 views/shared/common/item-relations-form.php:59 views/shared/common/item-relations-form.php:85 views/shared/common/item-relations-show-list.php:16 views/shared/common/item-relations-show-list.php:21 views/shared/common/item-relations-show-table.php:30 views/shared/common/item-relations-show-table.php:37 msgid "This Item" msgstr "Dieses Objekt" @@ -1347,3 +1347,11 @@ msgstr "Beziehungen auf dieses Objekt" #: views/shared/common/item-relations-show-list-by-item-type.php:48 msgid "No record is related to this item." msgstr "Kein Objekt steht in Beziehung zu diesem Objekt." + +#: views/shared/common/item-relations-show-table.php:5 +msgid "Show / Hide" +msgstr "Ein- / ausblenden" + +#: views/shared/common/item-relations-show-table.php:6 +msgid "Show / Hide All" +msgstr "Alle ein- / ausblenden" diff --git a/languages/template.pot b/languages/template.pot index 5f70167..baf1e12 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -69,7 +69,7 @@ msgstr "" msgid "Item ID" msgstr "" -#: controllers/LookupController.php:158 +#: controllers/LookupController.php:163 msgid "All" msgstr "" @@ -1367,8 +1367,8 @@ msgstr "" #: views/shared/common/item-relations-form.php:85 #: views/shared/common/item-relations-show-list.php:16 #: views/shared/common/item-relations-show-list.php:21 -#: views/shared/common/item-relations-show-table.php:18 -#: views/shared/common/item-relations-show-table.php:25 +#: views/shared/common/item-relations-show-table.php:30 +#: views/shared/common/item-relations-show-table.php:37 msgid "This Item" msgstr "" @@ -1468,3 +1468,11 @@ msgstr "" #: views/shared/common/item-relations-show-list-by-item-type.php:48 msgid "No record is related to this item." msgstr "" + +#: views/shared/common/item-relations-show-table.php:5 +msgid "Show / Hide" +msgstr "" + +#: views/shared/common/item-relations-show-table.php:6 +msgid "Show / Hide All" +msgstr "" diff --git a/views/shared/common/item-relations-show-table.php b/views/shared/common/item-relations-show-table.php index 7ff2cd0..98ead07 100644 --- a/views/shared/common/item-relations-show-table.php +++ b/views/shared/common/item-relations-show-table.php @@ -2,18 +2,30 @@ $provideRelationComments = get_option('item_relations_provide_relation_comments'); $thisItemId = $item-> id; - echo ""; + $relVocabShowHide = __("Show / Hide"); + $relVocabShowHideAll = __("Show / Hide All"); + echo " + + "; + + $jsFile = WEB_PLUGIN."/ItemRelations/views/shared/javascripts/item-relations-vocab-toggle.js"; + echo ""; + + echo "
            "; $colspan = ($provideRelationComments ? 4 : 3); $lastVocab = -1; foreach ($allRelations as $relation) { if ($lastVocab != $relation["vocabulary_id"]) { - echo ""; - $lastVocab = $relation["vocabulary_id"]; } - echo ""; + echo ""; echo "" + ); + + $("#relVocabShowHideAllBtn").click(function(e){ + e.preventDefault(); + allShowHide = !allShowHide; + if (allShowHide) { $(".relVocabRow").show() } else { $(".relVocabRow").hide(); } + }); + +}); From 786da1d2117466b13e86d25a10bf65bde7245ed6 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 11 Jul 2016 00:00:00 +0200 Subject: [PATCH 65/66] Reindented code. --- controllers/LookupController.php | 54 ++-- views/shared/common/item-relations-form.php | 238 +++++++++--------- .../common/item-relations-show-table.php | 77 +++--- views/shared/css/item-relations.css | 16 +- .../item-relations-vocab-toggle.js | 63 +++-- views/shared/javascripts/item-relations.js | 33 ++- 6 files changed, 249 insertions(+), 232 deletions(-) diff --git a/controllers/LookupController.php b/controllers/LookupController.php index 9201fec..ac42fa3 100644 --- a/controllers/LookupController.php +++ b/controllers/LookupController.php @@ -16,29 +16,29 @@ public function indexAction() // error_log(microtime()); $db = get_db(); - if (!$this->_hasParam('subject_id')) { - $this->_setParam('subject_id', -1); + if (!$this->hasParam('subject_id')) { + $this->setParam('subject_id', -1); } - if (!$this->_hasParam('partial')) { - $this->_setParam('partial', ''); + if (!$this->hasParam('partial')) { + $this->setParam('partial', ''); } - if (!$this->_hasParam('id_limit')) { - $this->_setParam('id_limit', ''); + if (!$this->hasParam('id_limit')) { + $this->setParam('id_limit', ''); } - if (!$this->_hasParam('item_type')) { - $this->_setParam('item_type', -1); + if (!$this->hasParam('item_type')) { + $this->setParam('item_type', -1); } - if (!$this->_hasParam('collection')) { - $this->_setParam('collection', -1); + if (!$this->hasParam('collection')) { + $this->setParam('collection', -1); } - if (!$this->_hasParam('sort')) { - $this->_setParam('sort', 'mod_desc'); + if (!$this->hasParam('sort')) { + $this->setParam('sort', 'mod_desc'); } - if (!$this->_hasParam('page')) { - $this->_setParam('page', 0); + if (!$this->hasParam('page')) { + $this->setParam('page', 0); } - if (!$this->_hasParam('per_page')) { - $this->_setParam('per_page', 15); + if (!$this->hasParam('per_page')) { + $this->setParam('per_page', 15); } $subject_id = intval($this->_getParam('subject_id')); @@ -54,16 +54,18 @@ public function indexAction() } $where_id_limit = ''; - if (preg_match("/\s*(\d+)(?:-(\d+))?\s*/", $this->_getParam('id_limit'), $matches)) { - $fromId = $matches[1]; - $toId = @$matches[2]; - if (!$toId) { $toId = $fromId; } - if ($fromId > $toId) { - $tmpId = $toId; - $toId = $fromId; - $fromId = $tmpId; - } - $where_id_limit = "AND items.id BETWEEN $fromId AND $toId"; + if (preg_match('/\s*(\d+)(?:-(\d+))?\s*/', $this->getParam('id_limit'), $matches)) { + $fromId = (integer) $matches[1]; + $toId = (integer) @$matches[2]; + if (!$toId) { + $toId = $fromId; + } + if ($fromId > $toId) { + $tmpId = $toId; + $toId = $fromId; + $fromId = $tmpId; + } + $where_id_limit = "AND items.id BETWEEN $fromId AND $toId"; } $item_type = intval($this->_getParam('item_type')); diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index 0639117..be9b246 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -22,7 +22,9 @@ $thisItemId = $item->id; $colspan = ($provideRelationComments ? 4 : 3); $lastVocab = -1; - foreach ($allRelations as $relation) { + foreach ($allRelations as $relation) { ?> + + '; echo ''; } ?> + '; } ?> '; +} # foreach ?> +
            " + $lastVocab = $relation["vocabulary_id"]; + echo "
            " ."" .$relation["vocabulary"] ."
            " . ( $relation['subject_item_id']==$thisItemId ? __('This Item') : "". diff --git a/views/shared/javascripts/item-relations-vocab-toggle.js b/views/shared/javascripts/item-relations-vocab-toggle.js new file mode 100644 index 0000000..bba90c0 --- /dev/null +++ b/views/shared/javascripts/item-relations-vocab-toggle.js @@ -0,0 +1,39 @@ +jQuery(document).ready(function () { + var $ = jQuery; + + $(".relVocabHead").each(function(element) { + var curVocab = $(this).data("vocab"); + var rowClass = "relVocab_"+curVocab; + var rowCount = $("."+rowClass).size(); + $("th", this).append( + " "+ + "["+relVocabShowHide +" ("+rowCount+")]"+ + "" + ); + // $("."+rowClass).toggle(); + }); + + $(".relVocabShowHideBtn").click(function(e) { + e.preventDefault(); + var curVocab = $(this).data("vocab"); + var rowClass = "relVocab_"+curVocab; + $("."+rowClass).toggle(); + }); + + var allShowHide = false; + $(".relVocabRow").hide(); + + var colspan = $(".relVocabHead th").first().attr('colSpan'); + $("#relVocabTable tbody").prepend( + "
            "+ + "["+relVocabShowHideAll+"]"+ + "
            " . "" @@ -32,7 +34,6 @@ } $subjectRelation = $relation['subject_item_id'] == $thisItemId; $objectRelation = $relation['object_item_id'] == $thisItemId; - echo '
            ' . ($subjectRelation ? __('This Item') @@ -73,8 +74,8 @@ echo '
            @@ -107,137 +108,146 @@ -
            -
            -
            - formLabel('new_relation_property_id', __('This Subject')); ?> -
            -
            - id) ? '' : 'data-subject-id="' . $item->id . '"'; ?>>id) ? __('[New]') : '#' . $item->id; ?> -
            -
            - id) ? '' : metadata('item', array('Dublin Core', 'Title')); ?> -
            -
            -
            -
            - formLabel('new_relation_property_id', __('Is Related By')); ?> -
            -
            - formSelect('new_relation_property_id', - null, array('multiple' => false), $formSelectProperties); ?> -
            -
            -
            -
            - formLabel('object_title', __('With Object')); ?> -
            -
            - +
            +
            +
            +
            + formLabel('new_relation_property_id', __('This Subject')); ?> +
            +
            + id) ? '' : 'data-subject-id="' . $item->id . '"'; ?>>id) ? __('[New]') : '#' . $item->id; ?> +
            +
            + id) ? '' : metadata('item', array('Dublin Core', 'Title')); ?> +
            -
            - + +
            +
            + formLabel('new_relation_property_id', __('Is Related By')); ?> +
            +
            + formSelect('new_relation_property_id', + null, array('multiple' => false), $formSelectProperties); ?> +
            -
            - -
            -
            - formLabel('relation_comment', __('Comment')); ?> +
            +
            + formLabel('object_title', __('With Object')); ?> +
            +
            + +
            +
            + +
            -
            - formText('relation_comment', null); ?> + + +
            +
            + formLabel('relation_comment', __('Comment')); ?> +
            +
            + formText('relation_comment', null); ?> +
            -
            - + - + -
            -
            - -
            -
            -
            - +
            +
            + +
            +
            +
            + +
            -
            -
            -

            -
            -
            -
            - -
            -
            - -
            -
            -
            -
            - formLabel('new_relation_object_item_type_id', __('By Item Types')); ?> +
            +

            -
            - formSelect('new_relation_object_item_type_id', - null, array('multiple' => false), array()); ?> -
            -
            -
            -
            - formLabel('new_relation_object_collection_id', __('By Collection')); ?> +
            +
            + +
            +
            + +
            -
            - formSelect('new_relation_object_collection_id', - null, array('multiple' => false), array()); ?> + +
            +
            + formLabel('new_relation_object_item_type_id', __('By Item Types')); ?> +
            +
            + formSelect('new_relation_object_item_type_id', + null, array('multiple' => false), array()); ?> +
            -
            -
            -
            - formLabel('partial_object_title', __('By Partial Title')); ?> +
            +
            + formLabel('new_relation_object_collection_id', __('By Collection')); ?> +
            +
            + formSelect('new_relation_object_collection_id', + null, array('multiple' => false), array()); ?> +
            -
            - formText('partial_object_title', null, array('size' => 10, 'maxlength' => 60)); ?> -
            -
            -
            - formLabel('id_limit', __('Limit Item IDs (“x” or “x-y”)')); ?> -
            -
            - formText('id_limit', null, array('size' => 10, 'maxlength' => 60)); ?> -
            -
            -
            -
            -
            - formLabel('new_relation_item_sort', __('Sort By')); ?> +
            +
            +
            + formLabel('partial_object_title', __('By Partial Title')); ?> +
            +
            + formText('partial_object_title', null, array('size' => 10, 'maxlength' => 60)); ?> +
            +
            + +
            +
            + formLabel('id_limit', __('Limit Item IDs (“x” or “x-y”)')); ?> +
            +
            + formText('id_limit', null, array('size' => 10, 'maxlength' => 60)); ?> +
            +
            -
            -
            - - -
            -
            - - + +
            +
            + formLabel('new_relation_item_sort', __('Sort By')); ?> +
            +
            +
            + +
            -
            -
            +
            + + +
            +
            +
            -
            -
            -
              -
              +
              +
              +
                +
                -
                -
                -
                  -
                • <
                • -
                • >
                • -
                +
                +
                +
                  +
                • <
                • +
                • >
                • +
                +
                diff --git a/views/shared/common/item-relations-show-table.php b/views/shared/common/item-relations-show-table.php index 98ead07..c6ecf26 100644 --- a/views/shared/common/item-relations-show-table.php +++ b/views/shared/common/item-relations-show-table.php @@ -1,48 +1,47 @@ id; +$provideRelationComments = get_option('item_relations_provide_relation_comments'); +$colspan = ($provideRelationComments ? 4 : 3); +$lastVocab = -1; +$thisItemId = $item-> id; - $relVocabShowHide = __("Show / Hide"); - $relVocabShowHideAll = __("Show / Hide All"); - echo " - - "; - - $jsFile = WEB_PLUGIN."/ItemRelations/views/shared/javascripts/item-relations-vocab-toggle.js"; - echo ""; - - echo ""; - $colspan = ($provideRelationComments ? 4 : 3); - $lastVocab = -1; - foreach ($allRelations as $relation) { +$relVocabShowHide = __("Show / Hide"); +$relVocabShowHideAll = __("Show / Hide All"); +?> + + +
                +"; + $lastVocab = $relation["vocabulary_id"]; + echo ""; } echo ""; - echo ""; + echo "'; echo ""; - echo ""; + echo "'; if ($provideRelationComments) { - echo ""; + echo ""; } - echo ""; - } # foreach - echo "
                " - ."" - .$relation["vocabulary"] - ."
                " + . "" + . $relation["vocabulary"] + . "
                " . - ( $relation['subject_item_id']==$thisItemId ? __('This Item') - : "". - $relation['subject_item_title'] . "" - ) . - "" + . ($relation['subject_item_id'] == $thisItemId + ? __('This Item') + : "" . $relation['subject_item_title'] . "" + ) + . '" . $relation['relation_text'] . "" . - ( $relation['object_item_id']==$thisItemId ? __('This Item') - : "". - $relation['object_item_title'] . "" - ). - "" + . ($relation['object_item_id'] == $thisItemId + ? __('This Item') + : "" . $relation['object_item_title'] . "" + ) + . '(".$relation['relation_comment'].")(" . $relation['relation_comment'] . ")
                "; + echo '
                diff --git a/views/shared/css/item-relations.css b/views/shared/css/item-relations.css index f619ffa..8270bfc 100644 --- a/views/shared/css/item-relations.css +++ b/views/shared/css/item-relations.css @@ -22,12 +22,12 @@ ul#lookup-results li:hover { } span.relListItemId { - display: inline-block; - text-align: right; - vertical-align: bottom; - overflow: hidden; - margin-right: 1em; - width: 4em; - font-size: 80%; - color: #aaa; + display: inline-block; + text-align: right; + vertical-align: bottom; + overflow: hidden; + margin-right: 1em; + width: 4em; + font-size: 80%; + color: #aaa; } diff --git a/views/shared/javascripts/item-relations-vocab-toggle.js b/views/shared/javascripts/item-relations-vocab-toggle.js index bba90c0..eee580b 100644 --- a/views/shared/javascripts/item-relations-vocab-toggle.js +++ b/views/shared/javascripts/item-relations-vocab-toggle.js @@ -1,39 +1,38 @@ jQuery(document).ready(function () { - var $ = jQuery; + var $ = jQuery; - $(".relVocabHead").each(function(element) { - var curVocab = $(this).data("vocab"); - var rowClass = "relVocab_"+curVocab; - var rowCount = $("."+rowClass).size(); - $("th", this).append( - " "+ - "["+relVocabShowHide +" ("+rowCount+")]"+ - "" - ); - // $("."+rowClass).toggle(); - }); - - $(".relVocabShowHideBtn").click(function(e) { - e.preventDefault(); - var curVocab = $(this).data("vocab"); - var rowClass = "relVocab_"+curVocab; - $("."+rowClass).toggle(); - }); + $(".relVocabHead").each(function(element) { + var curVocab = $(this).data("vocab"); + var rowClass = "relVocab_"+curVocab; + var rowCount = $("."+rowClass).size(); + $("th", this).append( + " "+ + "["+relVocabShowHide +" ("+rowCount+")]"+ + "" + ); + // $("."+rowClass).toggle(); + }); - var allShowHide = false; - $(".relVocabRow").hide(); + $(".relVocabShowHideBtn").click(function(e) { + e.preventDefault(); + var curVocab = $(this).data("vocab"); + var rowClass = "relVocab_"+curVocab; + $("."+rowClass).toggle(); + }); - var colspan = $(".relVocabHead th").first().attr('colSpan'); - $("#relVocabTable tbody").prepend( - ""+ - "["+relVocabShowHideAll+"]"+ - "" - ); + var allShowHide = false; + $(".relVocabRow").hide(); - $("#relVocabShowHideAllBtn").click(function(e){ - e.preventDefault(); - allShowHide = !allShowHide; - if (allShowHide) { $(".relVocabRow").show() } else { $(".relVocabRow").hide(); } - }); + var colspan = $(".relVocabHead th").first().attr('colSpan'); + $("#relVocabTable tbody").prepend( + ""+ + "["+relVocabShowHideAll+"]"+ + "" + ); + $("#relVocabShowHideAllBtn").click(function(e){ + e.preventDefault(); + allShowHide = !allShowHide; + if (allShowHide) { $(".relVocabRow").show() } else { $(".relVocabRow").hide(); } + }); }); diff --git a/views/shared/javascripts/item-relations.js b/views/shared/javascripts/item-relations.js index c961dfc..405c536 100644 --- a/views/shared/javascripts/item-relations.js +++ b/views/shared/javascripts/item-relations.js @@ -39,12 +39,17 @@ jQuery(document).ready(function () { } function updateChoices() { - if (updateTimer != null) { clearTimeout(updateTimer); } - updateTimer = setTimeout(updateChoicesCore, 1000); + if (updateTimer != null) { + clearTimeout(updateTimer); + } + updateTimer = setTimeout(updateChoicesCore, 1000); } function updateChoicesCore() { - if (updateTimer != null) { clearTimeout(updateTimer); updateTimer = null; } + if (updateTimer != null) { + clearTimeout(updateTimer); + updateTimer = null; + } options['partial'] = $('#partial_object_title').val(); options['id_limit'] = $('#id_limit').val(); @@ -74,9 +79,9 @@ jQuery(document).ready(function () { $('#lookup-results').find('li').remove(); for (i = 0; i < data['items'].length; ++i) { // items.push('
              • ' + data['items'][i]['label'] + '
              • '); - items.push('
              • ' + - '#' + data['items'][i]['value'] + " " + - data['items'][i]['label'] + '
              • '); + items.push('
              • ' + + '#' + data['items'][i]['value'] + " " + + data['items'][i]['label'] + '
              • '); } $('#lookup-results').append(items.join('')); @@ -282,16 +287,16 @@ jQuery(document).ready(function () { $('#lookup-results').on('click', 'li', function () { $('#new_relation_object_item_id').val($(this).attr('data-value')); $('#object_id').html( - '#' + - $(this).attr('data-value') + - '' + '#' + + $(this).attr('data-value') + + '' ); var htmlSansSpan = $(this).html(); htmlSansSpan = htmlSansSpan.substr(htmlSansSpan.indexOf("")+8); $('#object_title').html( - '' + - htmlSansSpan + - '' + '' + + htmlSansSpan + + '' ); updateAddButton(); }); @@ -300,5 +305,7 @@ jQuery(document).ready(function () { updateAddButton(); }); - $('#cancel-relation').click(function(e) { e.preventDefault(); }); + $('#cancel-relation').click(function(e) { + e.preventDefault(); + }); }); From 43e8411c5b9b524cad6f61fe4c4f82db4e893d91 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 11 Jul 2016 00:00:00 +0200 Subject: [PATCH 66/66] Fixed class of the form. --- views/shared/common/item-relations-form.php | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/views/shared/common/item-relations-form.php b/views/shared/common/item-relations-form.php index be9b246..5a9c0b0 100644 --- a/views/shared/common/item-relations-form.php +++ b/views/shared/common/item-relations-form.php @@ -126,14 +126,14 @@
                formLabel('new_relation_property_id', __('Is Related By')); ?>
                -
                +
                formSelect('new_relation_property_id', null, array('multiple' => false), $formSelectProperties); ?>
                -
                +
                formLabel('object_title', __('With Object')); ?>
                @@ -157,7 +157,7 @@ -
                +
                @@ -168,15 +168,17 @@
                -
                -

                -
                -
                -
                - +
                +
                +

                -
                - +
                +
                + +
                +
                + +