Giter Club home page Giter Club logo

hh_relation_is_descriptor's Introduction

webtrees module hh_relation_is_descriptor

License: GPL v3

webtrees major version Latest Release

This webtrees custom module provides additional relation descriptors.

Contents

This Readme contains the following main sections

Description

This custom module provides additional relation descriptors.

Such a descriptor is a word or a phrase that states object 1's relation is object 2. For example, you would read the following GEDCOM code as "The person pointed to by the XREF @S1@ is the landlord of Joe Jacob":

0 INDI

1 NAME Joe /Jacob/

1 ASSO @S1@

2 RELA landlord

The module supports

  • INDI:ASSO:RELA (GEDCOM standard like in the example above)
  • INDI:*:ASSO:RELA (no standard GEDCOM, but supported by webtrees)
  • INDI:*:_ASSO:RELA (using a custom tag _ASSO like in INDI:BIRT:_ASSO)
  • FAM:*:_ASSO:RELA (using a custom tag _ASSO like in FAM:MARR:_ASSO).

Usage

To add your custom relation descriptors you have to modify the file ExtendedRelationIsDescriptor.php. Replace the example lines in the function valuesAddon() by your custom descriptors. The text values depend on the sex of the linked individual.

If you like to add translations for your custom relation descriptors you have to add them at the end of the file RelationIsDescriptorAddon.php.

Requirements

This module requires webtrees version 2.1. This module has the same requirements as webtrees#system-requirements.

This module was tested with webtrees 2.1.2 version.

Installation

This section documents installation instructions for this custom module.

  1. Download the latest release.
  2. Unzip the package on your local computer.
  3. Rename the folder to hh_relation_is_descriptor.
  4. Modify the functions in the above-mentioned files as you like (initial modification).
  5. Make a backup copy of your modifications.
  6. Transfer the modified folder to your webtrees/modules_v4 directory at your web server.
  7. Login to webtrees as administrator, go to Control Panel/Modules/Other, and find the module. It will be called "Custom Relation Descriptors". Check if it is enabled.

Upgrade

To upgrade to a new version of this custom module

  1. Downlad the files from the latest release.
  2. Unzip the package on your local computer.
  3. Rename the folder to hh_relation_is_descriptor.
  4. Modify the functions in the above-mentioned files as you like (based on your backup copy or based on the files at your webtrees server).
  5. Make a backup copy of your modifications.
  6. Transfer the modified folder to your webtrees/modules_v4 directory at your web server.
  7. Reload (refresh) your webtrees page in the browser.

Support

Issues: you can report errors raising an issue in this GitHub repository.

Forum: general webtrees support can be found at the webtrees forum

License

  • Copyright (C) 2022 Hermann Hartenthaler
  • webtrees - Copyright 2022 webtrees development team.

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

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

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


hh_relation_is_descriptor's People

Contributors

hartenthaler avatar thedutchjewel avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

zhoueysun

hh_relation_is_descriptor's Issues

ExtendedRelationIsDescriptor.php does not seem to work

First of all, thanks for the effort in creating this module!

I tested it with webtrees 2.0.19.

  1. I added three relations (twin, triplet, minister) in RelationIsDescriptorAddon.php, and their translations in ExtendedRelationIsDescriptor.php.
  2. Then I removed these relations from app/Elements/RelationIsDescriptor.php (where I had previously added them) and I disabled my translation module.

At that point, these relationships are not translated.

The translations do work when I add these relations back to app/Elements/RelationIsDescriptor.php. Therefore, it seems that ExtendedRelationIsDescriptor.php is not working.

Also, the relation type minister is not available in the associates drop-down menu because it's missing in app/GedcomCode/GedcomCodeRela.php:
afbeelding

trying to adapt your module to Elements/NameType.php

I was able to modify hh_relation_is_descriptor to my v.2.1.2. I want to extend the dropdown list for name types. It is used to extend NameType.php. I am not sure if this is how I should contact you. Please let me know if there is a more appropriate way to ask for help. At least is does not crash or get a fatal error. I just cannot make the NAME:TYPE dropdown list to show my extended version
hh_ChinAmNameType.zip
.

class definition is not correct

To define a class that extends the existing class RelationIsDescriptor, I tried the following but this is not correct.

class RelationIsDescriptorAddon extends AbstractModule implements RelationIsDescriptor, ModuleCustomInterface

Error message:
Hartenthaler\Webtrees\Module\RelationIsDescriptorAddon\RelationIsDescriptorAddon cannot implement Fisharebest\Webtrees\Elements\RelationIsDescriptor - it is not an interface

class RelationIsDescriptorAddon extends RelationIsDescriptor implements AbstractModule, ModuleCustomInterface
or
class RelationIsDescriptorAddon extends RelationIsDescriptor implements ElementInterface, ModuleCustomInterface
or
class RelationIsDescriptorAddon extends RelationIsDescriptor implements ModuleCustomInterface
are not working, too.

How should the class definition look like?

context sensitive translation

Translation of relation descriptors is context-sensitive (depending on the sex). But I don't know how to do this using the PHP I18N function.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.