Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to expose MANRS, reseller and resold tags in JSON Export #674

Closed
listerr opened this issue Oct 7, 2020 · 2 comments
Closed

Option to expose MANRS, reseller and resold tags in JSON Export #674

listerr opened this issue Oct 7, 2020 · 2 comments

Comments

@listerr
Copy link
Contributor

listerr commented Oct 7, 2020

Is your feature request related to a problem? Please describe.

We would like to update our website to show the MANRS label for members who have joined the MANRS programme, and
also it would be useful in other places to be able to see if a member is a reseller or resold in the JSON export.

Describe the solution you'd like

There is an existing switch to show customer tags:

https://ixp.example.com/api/v4/member-export/ixf/0.7?withtags=1

Perhaps this could be implemented as an additional tag, or a similar option e.g. ?withmanrs=1

Describe alternatives you've considered

  • Is there a way to do this using the member template/skin documented at
    https://docs.ixpmanager.org/features/member-export/ ?

  • A script to identify all MANRS / resold / reseller members and add a member tag to them, therefore they can be found
    with the ?withtags=1, but this obviously means duplicating data.

Thanks,

Rob

@listerr
Copy link
Contributor Author

listerr commented Oct 7, 2020

Actually, this turned out to be fairly easy to do with the skin, as the functions are already there in /database/Entities/Customer.php.

Based on the example : resources/skins/example/content/members/3/json-example.foil.php
I copied this to our skin and added the following lines:

    $data[ $c->getId() ]['in_manrs']         = $c->getInManrs();
    $data[ $c->getId() ]['is_resold']        = $c->isResoldCustomer();
    $data[ $c->getId() ]['is_reseller']      = $c->getIsReseller();

So this just spits out JSON with those fields included for each member.

@barryo barryo closed this as completed in edf5d97 Sep 16, 2021
@barryo
Copy link
Member

barryo commented Sep 16, 2021

This is now implemented and documented here.

I've kept this all under the withtags=1 mechanism and within the ixpmanager section as it is not part of the IX-F Export Schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants