OpenVPMS site administration

Complete

This book acts as repository for useful information about the administration of the openVPMS.org site.

It is not intended to be a complete site administration manual, but rather a repository for useful information that should make it easier for present and future members of the administration team to understand how things work and how to do things.

This book is not intended to be accessible via the standard menu system.

Site Functions

Complete

The site supports the following functions:

Forums  - there are three: Users, Implementors, and Developers

Books - there are a number of these. The most important are the Context Sensitive Help, the Developer's Handbook, the Implementors Handbook, and this one,  OpenVPMS site administration. There are also a Users Handbook, Navigation, Features books - the content of these is functionally being replaced by that in the Context Sensitive Help book. Book management requires the 'Documentation manager' role.

Projects - this is functionally a tailored forum that supports project specific discussion and enables the project development and funding status to be displayed.  It supports a simple pledging mechanism (enabling a user to send an email to op_funding[at]boroniavet.com[dot]au pledging money to the project), and a donation mechanism (enabling the user to contribute money to the project). To create and edit projects one must have the 'Project manager' role.  Note that the funding tracking is done externally (currently by Peter Gooey) and is not automated - ie there is no system which totals the pledges and donations to a project and updates the funding status.

Subscriptions - this enables users to pay their subscriptions.  It provides automatic notification of subscription expiry.  See also http://www.openvpms.org/openvpms-site-administration/store-ubercart and http://www.openvpms.org/openvpms-site-administration/store-manager-tasks

Donations - this enables users to make a general donation. It uses the same Ubercart e-commerce module as the Subscriptions facility. Note that the donation mechanism in the Project facility simply generates a donation with a note indicating which project is being donated to. 

Store manager tasks

Complete

This section documents the tasks of the Store manager.

Expired Subscriptions

Complete

You can find users who have expired subscriptions by using the 'Subscribers' entry in the Admin menu.

This allows you to select users who have one role, but not another.

By default it is set to display users who have the role Subscribed but not the role Subscriber. However, you can use it to users who have any role but not another.

If you set the 'Not' role to <Any> then  the 'not' condition is ignored.

Expiry Dates

Complete

There are two dates that are used to drive our subscription system:

The Subscription Date - this is the date the subscription was first purchased. For old subscribers it needs to be set manually. For subscribers who purchase their first subscription through the system, it is set automatically when they do so.

The Subscription date is passed to the Keygen utility and it uses this and the current date to figure out when the subscription key should expire.  The day and month can be got from the Subscription date, but the year has to be calculated. Provided that the current date (ie the day on which the payment for the subscription renewal is received) is between two months prior to the subscription anniversary, and 10 months after, then the key expiry date will be calculated correctly.

The same process occurs when the zero cost 'Subscription Key' product is "purchased" - ie the generated key will have an expiry date derived from the Subscription Date and the current date.

The Subscriber Role Expiry Date - we use this to send out a reminder 1 month prior to the subscription's expiry. 'Role expiry' is a feature of the standard Ubercart e-commerce system that we use.  When the customer purchases an Annual Subscription, then if they do not currently have this Subscriber role (either because this is their first subscription purchase, or because the role expired) they are given the role and it is set to expire in 12 months.  It they do have the role, then 12 months is added to its expiry date.

Note that when the zero cost 'Subscription Key' product is "purchased" it does NOT affect the Subscriber role.

The Role Expiry Date is set to the anniversary of the Subscription Date.  This is achieved by modifying the standard role expiry code to add an expiry type of 'Subscription date', and having code that recognises this expiry type and sets the appropriate date.

This implies that the Annual Subscription product - see http://www.openvpms.org/node/656/edit/features - MUST have its features set as follows:

and the Global expiration - see http://www.openvpms.org/admin/store/settings/products/edit/features - must be as follows:

 

 

Finding users

Complete

If you need to access a specific user, you can call them up via http://www.openvpms.org/users/xxx where xxx is the user's login name.

However, it may be easier to find then via http://www.openvpms.org/admin/user/user/list (or via User Management|users|List in the top menu)

Initially this shows everybody as follows:

But you can list by role – ie if you click the role radio button and select Subscriber from the pull-down and then press Filter you get:

On this screen, you can add a second selection condition (say Role = FiftyPercenter) and then press the Refine button, you will see only users who are Subscribers and FiftyPercenters.  Pressing the Reset button removes all the selection conditions.

Note that the Role Expiration tab show when user’s roles expire – as below.  Note that this shows ALL expiring roles, not just those of the users that you have selected on the List tab.

You can click on any on the Username links to call up that user.

Generating a subscription key

Complete

In the normal case, a user buys an Annual Subscription and the system automatically generates and emails their subscription key when their payment is received (ie immediately for PayPal payments or when the order is marked as payment-received by the store manager).

However, it may be necessary to generate a key separately.

To do this the store manager generates a order for the user for the product 'Subscription Key'.  This is a zero cost product.

The process is as follows:

Use Store Administration|Orders|Create Order (ie http://www.openvpms.org/admin/store/orders/create) which will display:

Use the 'Search for an existing customer' link to select the customer (or if necessary create a new customer), and then click the 'Create order' button.

This will display:

Use the 'Select from address book' button to select the customer's address. The fields that we need and the first and last names and the Practice Name - the rest do not matter in this case.  We also do not need the ABN number.

Further down the screen:

Select the payment method 'Free order', then press the Add product button, click on 'Subscription Key' and then press the Select button.

This will give:

Click the 'Add to order' button which will give:

If you want you can click on the 'Add an admin comment' link to add one, else click the 'Submit changes' button.

This will give:

Now click the View tab to get:

Down the bottom change the Order status from 'Pending' to 'Payment received' and click the Update button.

This will give:

The process is now complete and the subscriber will receive their key via email.

Manage Orders

Complete

Orders paid via PayPal will 'auto-complete' on successful return from PayPal, and the user's subscription status will be updated and their subscription key emailed to them.

However, orders paid by cheque or bank transfer need to be updated from Pending to Payment Received status when the money has been received. This will trigger the update of the user's subscription status and will email their subscription key, and set the payment status to Complete.

This is most easily done via http://www.openvpms.org/admin/store/orders (or using Store administration|Orders|View orders in the top menu).

This will show a display like the following:

By default, the 'Active Orders' are shown. You can also select Pending and other states.

To process a Pending order, click the left-most icon in the Actions column (view order).  You will see something like:

 

You can click the Receive Cheque link (at the top right) to indicate that the cheque has been received.  This will result in the following screen:

Assuming that you do not want to add a comment, and that the cheque was for the full value, you can simply click the Receive cheque button at the bottom.

This will set the order status to Completed and return you to the order view screen as shown below:

If the payment method was bank transfer rather than cheque, then the process is exactly the same.

Note that if you now check the 'Send e-mail notification..' box and then press the Update button, an email will be sent to the user saying that their order is now complete.

You can then click the Orders part of the breadcrumb at the top of the screen to return you to the orders listing.

 

Manually set Initial Subscription date

Complete

To manually set the Initial Subscription date, you need to edit the user's profile.

You do this via http://www.openvpms.org/users/xxxx where xxxx is the user's login name.  However, you may not know this.

The easiest way is to use the Who Bought What report to display the subscription purchases, and then click on the user's name. Note that if you click on the Email column heading, it will sort by email address and hopefully, all the subscription purchases by the one practive will be grouped together.

Clicking on the user's name will bring up the user screen as follows:

Click the Edit tab and then the Subscription Information sub-tab to bring up the following:

If the Initial Subscription date has never been set it will show today's date.  Set the date as appropriate and then click the Save button.

Orders in Checkout status

Complete

Occasionally, users may have an order that they have entered, but not submitted.

This leaves the order with status 'In Checkout'. You can find these on the Orders screen (Store Administration|Orders|View Orders - http://www.openvpms.org/admin/store/orders/view ) by setting the status selection to In Checkout.  Note that the default 'Active Orders' selection does NOT include 'In Checkout' orders.

For these orders, you need to do one of three things:

if you have received the money, then you need to use the Received payment link on the order (just as you do when you receive the money for an order in Pending status).

If you have not received the money and this is a recent order, then you need to email the user and ask what is going on.  They will be able to examine the order using the My Cart link or by going to http://www.openvpms.org/cart

If the user does not want to proceed, then you can simply view the order and change its status to Cancelled and add a suitable Admin comment.

NOTE: Before you email the user, check that there is not another order for the same item(s) with the same date that has been Completed (or is Pending). In this case we have a duplicate and we can set the status of the 'In Checkout' order to Cancelled with an Admin comment like 'Cancelled by PG - duplicate of completd order'

Price changes

Complete

If/when the subscription amount changes the following pages need updating:

http://www.openvpms.org/yearly-openvpms-subscription-1-fte-vet

http://www.openvpms.org/admin/store/uc_discounts/list

Note that the discount needs to be set so that the subscription component is discounted by 50%, but not the development levy.  ie if the total T = S + L (where S is the subscription and L the devlopment levy) then the discount is (S/2)/T

http://www.openvpms.org/admin/store/ca/uc_role_notify_grant/edit/actions
http://www.openvpms.org/admin/store/ca/uc_role_notify_renew/edit/actions
(In both the above change Dev.levy amount in email text)

http://www.openvpms.org/subscription

 

 

Set FiftyPercenter and Subscriber roles

Complete

The store manager needs to set the role FiftyPercenter for those users who should have it.

See also http://www.openvpms.org/openvpms-site-administration/store-ubercart/roles

Note that the store manager role explicitly has permission to set/unset the FiftyPercenter and Subscriber roles for any user.

To set/unset the FiftyPercenter role, access the user - see Finding Users - then edit the user and set/unset the role as desired. See  for example below.

Note that if you do set the Subscriber role (which is normally automatically set as the result of the user purchasing a subscription), then you will also need to set the Initial Subscription Date (accessed via the 'Subscription Information' tab), and the Subscriber role expiry date (accessed via the Ubercart roles block right at the bottom of the Account tab page).

 

 

Who Bought What

Complete

The Who Bought What report (accessed via Store administration|Reports|Who Bought What or http://www.openvpms.org/admin/store/reports/uc_who_bought_what ) is very useful.

You can select the products to be reported as follows:

Note that the 'Subscription Key' product will show the $0 orders created just to generate keys for customers, and thus provides a track of the cases where the key was sent out independently of the customer's purchase of an Annual Subscription.

The Development Project Donation shows donations to projects and can be used to track both payments and pledges (which will be shown with HowPay as 'other').

 

 

The Store - Ubercart

Complete

The e-commerce part of the site is implemented using the Ubercart module. The subsections discuss various aspects of the system.

Other modules

Complete

The standard functionality of Ubercart is extended using the following modules: 

Module Function
role_delegation to enable the store manager role to explicitly set/unset the Subscriber and FiftyPercenter roles for any user
uc_abn to support the use of ABNs
uc_bank_transfer to support payment by bank transfer
uc_discounts_alt to support discounts - specifically the 50% discount given to those with the role FiftyPercenter. Note that the sub-modules Codeless Discount Field and Product Price Alterer Field do not need to be enabled.
uc_donations to support donations
uc_extra_fields_pane to support the use of a Subscription date
uc_who_bought_what to enable the reporting of who bought what
uc_free_order to support the $0 cost Subscription Key product used to generate and email a subscription key
   

 

Roles

Complete

The 'roles' facility is important to the complete Drupal system in that it is used to control who does what.

As far as the Ubercart module is concerned, three things are important:

  1. For a person to control the Store module, they need to be given the role 'shop manager'
  2. We use Ubercart's ability to assign a role to the user who purchases a product to assist in the administration of OpenVPMS Subscriptions
  3. We use the Ubercart Alt Discount module's ability to set a discount if the user has a specific role

Thus, we have created the role 'Subscriber' (via http://www.openvpms.org/admin/user/roles ) which is assigned to the user when they purchase their subscription, is set to expire in 1 year, and has an 'expiry warning' time of 1 month (set via http://www.openvpms.org/admin/store/settings/products/edit/features ).

We have also created the role 'Subscribed'. This is also assigned to subscription purchasers, but never expires. Hence we can find users whose subscriptions have lapsed by looking for users with the role Subscribed but not Subscriber. [This is done using the View and Update Users screen - http://www.openvpms.org/admin/userlist ]

There is also the role Subscriber-Ex. This is used to flag ex-subscribers. No user should have the roles Subscribed and Subscriber-Ex at the same time. There is no programmed block against this, it is just illogical to do so.  Any user who used to be a subscriber, but no longer is (either because they are no longer an OpenVPMS user, if their practice's subscription is held under another name) should have their role Subscribed removed and Subscriber-Ex added. This is done manually by editing the user.

We have also created the following roles:

'FiftyPercenter':  This is manually assigned by the shop manager to any users who were early supporters of OpenVPMS and who are entitled to a 50% discount on their $300 subscription but pay the $150 development levy via the 'Early OpenVPMS Supporter' discount of 33.3333%. The store manager assigns the role via http://www.openvpms.org/users/xxxx (where xxxx is the user's login name) to access the user's profile and then editing this to set the role FiftyPercenter.

'Not For Profit (with clinic)': This is manually assigned to any organisation that is a) not for profit; b) runs a vet clinic open to all. This role gets the 'Not for profit clinic' discount of 33.3333%

'Not For Profit (no clinic)': This is manually assigned to any organisation that is a) not for profit; b) does not run a vet clinic open to outsiders. This role gets the 'Zero Cost' 100% discount.

'Developer': This is manually assigned to any person who is doing development amed at improving/expanding OpenVPMS. This role also gets the 'Zero Cost' 100% discount.

Note that via the role_delegation module, the store manager is explicitly given permission to set/unset the Subscriber, Subscribed, Subscriber-Ex and FiftyPercenter roles for any user.

If you do need to manually set the Subscriber role for some reason, do NOT just tick the Subscriber role, but rather, down the bottom of the page in the Ubercart roles section, add the Subscriber role with the appropriate expiry date.

 

Subscription date

Complete

In order to support subscription automation we need to keep a 'subscription date' in the the system.  In fact we keep the Initial Subscription date.  This has been done by adding an 'Initial Subscription' field to the user's profile (via http://www.openvpms.org/admin/user/profile ). Note that this field is hidden from the user and ie either set manually by a 'store manager' or by the system when the user first buys a subscription. This field is declared as a date and is actually held by as an array containing the day, month and year. 

We need the Initial Subscription date so that we can correctly set the expiry date, not to 12 months after the user purchases the subscription renewal, but rather to the anniversary of their initial purchase.

This is implemented by the 'Run Keygen' condition action code which sets the Subscription Date to the current date if it has not been previously set.  Note that since this code is run when payment is received, the Subscription Date is set to the date on which payment was received for the first subscription - and not the date on which the order was placed.

The code can be found at http://www.openvpms.org/admin/store/ca/2/edit/actions

Tailoring

Complete

This section records the tailoring done - so that things can be adjusted in the future if necessary. [Note that not everything is noted here - just the parts that are more difficult to find - mostly those parts that are not accessible via the top menu.]

Order Templates

The standard Ubercart order templates are held in
  /home/admin/www/sites/all/modules/ubercart/uc_order/templates

These are overidden by having modified versions in
  /home/admin/www/sites/all/themes/openv

The three files are:
  uc_order-admin.tpl.php
  uc_order-customer.tpl.php
  uc_order.tpl.php

Checks to Cheques

In the cheque payment module, the phrase "Checks should be made out to" is hard coded in the file /home/admin/www/sites/all/modules/ubercart/payment/uc_payment_pack/uc_payment_pack.module

Although there are mechanisms in Drupal to translate this, it was considered far simpler to just edit the file to change this to "Cheques should ....".

Role Expiry Date Format

In the ubercart roles module, in the file /home/admin/www/sites/all/modules/ubercart/uc_roles/uc_roles.module, and extra date format has been added to provide a d MMM YYYY date format. The modification signature is "TG 28/05/2015".

This format is used in the role expiry emails. (The standard 'small' format includes the time and this is not wanted.)

Role Expiry Type

In the same file (uc_roles.module) a 'Subscription date' (code 'sub') has been added. The modification signature is "TG 25/6/2015".

Role Expiry Date

In the same module, the file uc_roles.ca.inc, has been modified to calculate the role expiry date from the Subscription Date - provided that the Role Exiry Type is 'sub'. The modification signature is "TG 25/6/2015".

The logic used is the same as that in the keygen utility.  This ensures that the the Subscriber role has the same expiry date as the generated key.

Collapse discounts pane

By default, the discounts pane in the checkout window is shown uncollapsed as follows:

Since we do not use discount codes, and since the above may confuse users, the code has been modified to initially display the pane in its collapsed state as follows:

Note that testing has shown that if this pane is totally suppressed, then if there is a FiftyPercenter discount applicable, the amount calculations are wrong.

The only way to set this pane as initially collapsed is to modify the file /home/admin/www/sites/all/modules/uc_discounts_alt/uc_discounts/uc_discounts.module to add the following at the end of the uc_discounts_form_uc_cart_checkout_form_alter function:

/**
 * The following added by Tim G to set the uc_discounts pane to initially collapsed
 * suppressing the pane completely screws the discount calculation
 */
  $form['panes']['uc_discounts']['#collapsed'] = TRUE;

 

 

Who bought what

Complete

This module enables you to list all the purchases of a given product. You can sort the results by clicking on the appropriate column heading.  You can also export the data to a CSV file, either page at a time, or (by clicking the 'Show all records' link at the bottom) all records.

It is accessed either via the top menu via Store administration|Reports|Who Bought What or directly via http://www.openvpms.org/admin/store/reports/uc_who_bought_what

Note that the CSV file contains more data than is displayed on the screen.  In particular it shows the 'billing_company' (in column Z) - this should contain the name of the practice.

 

Debugging

Complete

If you are debugging php code (either in the 'execute php code' of conditional actions, or in modified modules) then the devel module is invaluable.

Install using 'drush dl devel' then 'drush en devel' (you only need to enable this module and not the other two in the download).

Then set the Devel module permissions for the administrator user only (via http://test.openvpms.org/admin/by-module - you are working in the test system aren't you).

We do not have this module installed in production so it needs to be installed on the test system after test is cloned from production.

Where you want debug output, use the dpm() call - eg as follows:

and the output appears in the message portion of the screen as follows:

NOTE - the dpm() calls cause errors if the devel module is not installed.  Hence these have to be removed from the code before moving it to production.

drush

Complete

drush is a command line tool for managing Drupal sites.  The following is not intended to be a drush manual, but simply a quick cheat-sheet for how to do various things.

The correct directory. For drush to work you have to be in an appropriate directory.  In our case, having logged in as admin, cd to www .  If you want to work on the test system (rather than the production system), cd to ~/public_html/test.openvpms.org .

Download a module. Use "drush dl <module_name>" - eg

  drush dl uc_extra_field_pane

Note that drush will grab the appropriate revision of the module.  You can then enable the module using "drush en <module_name>".  In some cases the download will infact contain more than one module, and in this case you have to enable each separately.

Sync database. Use "drush sql-sync  <from> <to>" - eg

  drush sql-sync @live @test

@live is the site alias for the production system, @test that for the test system

Site on/off-line. If you are going to do work on the system you should take it offline before starting work, and put it back online after.  This is done via the page

http://openvpms.org/?q=admin/settings/site-maintenance

or for the test system

http://test.openvpms.org/?q=admin/settings/site-maintenance

Update Drupal core. If you need to do this (say for a security update), then do as follows after setting the Site offline (see above):

First backup things - just in case:
The command is:

drush archive-dump --destination=/tmp/tg-archive.tar --tar-options="--exclude=.git"

Note that we are just archiving to a file in the /tmp directory - after all is updated and verified to be working, this file can and should be deleted.

Now the update(s). Here we do updates to the core, and then the cck and mollom modules using the commands:

drush up drupal
drush up cck
drusk up mollom

 

Then have a play to check things out, then put the site back online.

 

 

 

Mail aliases

Complete

We use a number of 'organisational' email addresses in the system as follows:

admin[at]openvpms[dot]org - the main administrator email address

subscriptions[at]openvpms[dot]org - the subscriptions and store manager (set via http://www.openvpms.org/admin/store/settings/store/edit but also embedded in various store content)

funding[at]openvpms[dot]org - pledge emails are sent to this address (set via http://www.openvpms.org/admin/content/node-type/development-project/fields in the text of the 'Project funding' field)

webmaster[at]openvpms[dot]org - feedback etc from the contact page (set via http://www.openvpms.org/admin/build/contact )

These address are mapped to real people using the postfix-vmail-mysql facility. The mappings are most easily modified via http://openvpms.org/phpmyadmin - this is protected via an htaccess username and password as well as the required mysql username and password.  For obvious reasons these are not listed here. The mappings are held in the database 'mail' in the table 'forwards'. Note that if you modify the mappings, it is sensible to restart the postfix service in order to ensure that the changes are effective. To do this login to the command line and do:

sudo service postfix restart

 

CSH books

Complete

The Context Sensitive Help (CSH) system uses a different book for each OpenVPMS version.  Each book must have the URL path documentation/csh/V/xxx where V is the version (eg 1.8) and xxx relates to the topic [and for pages to be invoked via Alt-F1] must match that in the help.properties file. The complete URL will be like http://www.openvpms.org/documentation/csh/1.8/topics

When development commences on a new version (say 1.9) then we need to clone the new version's text from the current one (say 1.8).  This is done as follows:

Note that you need the permission to create books - the Documentation Team and administrator roles have this.

Step 1. Make the book that you want to clone part of the Online Documentation book. This is necessary because you cannot use the duplicate operation on a complete book – only part of one. To do this edit its top page and change its outline from:

to

 

Step 2. Duplicate the book. Do this as follows:

1. Go to http://openvpms.org/admin/content/book
2. For the entry "Online Documentation", select "edit order and titles"
3. Click the hammer and spanner icon (Content operations) next to the documentation you want to copy.  E.g. Online Documentation (1.8)
4. Select Duplicate - a sub-window will show as follows:

5. After a while, you'll see the following:

Typically the duplicated tree will be expanded. To verify, hover the mouse over the page icon to determine which of them is the copy. E.g in the above, the first entry has Nid: 4981, whilst the second has Nid:6284. The second is therefore the copy.

6. Click the hammer and spanner icon (Content operations) on the copy, and select Rename and update the version no.
    E.g. Online Documentation (1.9)

7. Verify you can browse the new documentation. E.g.:
    http://openvpms.org/documentation/csh/1.9/topics

8. SQL verification: you can verify things as follows

select count(*) from url_alias where dst like "documentation/csh/1.8%" and not dst like  "documentation/csh/1.8%/feed";
select count(*) from url_alias where dst like "documentation/csh/1.9%" and not dst like  "documentation/csh/1.9%/feed";

Both queries should return the same number of rows (430 in the above example)

Step 3. Separate the books from the Online Documentation book (ie reverse Step 1 above). Do this by editing the outline of the top page of both the one you cloned (1.8 in the above example) and the cloned one to set the outline to <create new book> as follows:

 

Step 4. Check the Advanced Book Blocks configuration to make sure the required books are included.  Call up http://www.openvpms.org/admin/settings/advanced-book-blocks/configure/0

The items will be adisplayed with the lowest weight (-15) at the top. The Reset Weight checkbox resets the item's weight to -15. It is easiest just to adjust the weights as needed and press Save.

Note that we do not enable the Site Administration book - simply to hide it to keep normal people out.

 

Incomplete documents

Complete

Book pages can be flagged as incomplete by checking the 'Incomplete document' box at the top of the page, during editing.

This can be used to indicate that screen shots need to be updated.

The incomplete_documentation view can be used to get a list of pages that need to be updated.

 

Other site tailoring

Complete

This section contains notes on other tailoring/modifications.

Advanced Poll

Complete

The javascript code in /home/admin/public_html/openvpms.org/public/sites/all/modules/advpoll/advpoll-vote.js has one line commented out so as to allow the use of links in poll choices - as follows:

CKEditor profiles

Complete

The CKEditor profiles - see http://www.openvpms.org/admin/settings/ckeditor - have been adjusted.

The profiles are set as:

The Advanced profile is adjusted so that:

  1. The Advanced Content Filter is disabled so that tags are not filtered
  2. The HTML filter is disabled.  

 

The global profile role precedence is:

Visibility settings are:

The simplified toolbar is set as follows:

 

 

Download page

Complete

The page www.openvpms.org/download has some javascript embedding.  To see this edit the page and switch to Source mode - this will show:

When you update this page for a new release, you also need to update the sites/all/js/downloadDialog.js - which is as follows:

You need to edit this to point at the new release.

 

Modified Outline Designer module

Incomplete document

We use a modified version of the the Outline Designer module. The modification enables the copying of books to preserve relative URL references - required when we need to clone the CSH text for the next OpenVPMS release.

See also https://openvpms.atlassian.net/browse/STPA-27

Need to add more here to document the mods.

Mollom

Complete

The Mollom module (which provides spam blocking facilities) needs a subscription.

This is provided by Matt Young - the subscription provides for 3 domains and he only uses 2 and has allowed openvpms.org as the third.

Contact Matt for any Mollom related questions.

Subscription form

Complete

This note is here because it is not immediately obvious how the subscription arithmetic is done.

If you edit the subscription form page you see:

If you click the 'Switch to plain text editor' you see:

The added javascript is used to do the validation and calculation.

Outline/child page ordering

Complete

When pages have child pages (and many of ours do), then you need to be carefull with the outline facility.  If you use this to reorder things then it works by changing the weight of the page.  However, if you have a large number of child pages, then the 'reorder by drag and drop' facility gets confused because the weighting can only be from -15 to +15.

The solution is to adopt the following convention:

Since pages with equal weight get ordered by title, this arranges things nicely.

For eample with to child pages to http://www.openvpms.org/documentation/csh/1.9/admin/lookup we have as shown below with all the various lookups ordered by name with the three Confirm... 'extras' at the bottom.

Since the default weight for a new page is 0, this means that normally you do not have to set the weight, but only set 15 when adding an 'extras' page.

Project manager tasks

Complete

Users who have the role Project manager do the following things:

Create Project - do this via http://www.openvpms.org/node/add/development-project or, in the top menu, Content management|Create content|Development project. The initial content of the 'Project description' field contains instructions.

Edit Project - you will need to edit the project immediately after it is created in order to correctly set the contents of the mailto link in the 'Project funding' text. You will need to set the URL of the project (so copy it first before you start editing) and the project name.

Update Project - you will need to edit again to change the status and funding percentage.

Track Funding - the job of tracking the funding for the project is the person who receives the pledge emails sent to funding[at]openvpms[dot]org - they track the total pledged plus donated and update the status and funding percentage as appropriate - and also inform the developers when the funding reaches 100%.

The test system

Complete

We run a test system so that things can be tested and played with before being incorporated with the live production system.

The test system is accessed via http://test.openvpms.org - however because there is (intentionally) no DNS record for test.openvpms.org, it cannot be accessed unless you put test.openvpms.org in your local hosts file (which in windows is C:\Windows\System32\drivers\etc\hosts ).  The entry is:

174.143.255.21        test.openvpms.org

The test system uses the database 'drupal-test'.

Its files are held in /home/admin/wwwtest - which is a symlink to /home/admin/public_html/test.openvpms.org/public

Cloning the test system

Complete

If you wish to re-clone the test system from the production system you should do as follows: (remember to delete any old test-old.openvpms.org first - see below)

Login as admin
cd public_html
mv test.openvpms.org test-old.openvpms.org
mkdir test.openvpms.org
rsync -a --exclude '.git*' openvpms.org/* test.openvpms.org
[this will fail to copy some log files because of permission problems but these do not matter
and we are using rsync rather than cp so that we can exclude the git stuff]
cd ~/wwwtest/sites/default
cp ~/public_html/test-old.openvpms.org/public/sites/default/settings.php settings.php
drush sql-sync @live @test

What the above does is rename the test system to test-old, the copy the production system files to the new test system, and then ovewrite the new test systems settings.php from the old test system (which sets the required database name and site url).  Finally we copy the production database using the drush sql-sync command.

You now need to login to the test system set the Reroute Mail options.

 

 

When you are happy you can delete the old test system saved in test-old.openvpms.org using:

sudo rm -rf test-old.openvpms.org

Devel module

Complete

If you need to, you may want to install the devel module - see https://www.drupal.org/project/devel and https://api.drupal.org/api/devel/devel.module/6

We do not have this installed on production so it is not simply a matter of enabling it - it needs to be installed on the test system - and you will need to do this again if you re-clone test from production.

Mail re-routing

Complete

On the test system we enable the Reroute Email module. This is installed on production but not enabled.

To enable the mail re-routing use Site Configuration|Reroute Email|Settings or http://test.openvpms.org/admin/settings/reroute_email/settings

Set like the following:

You MUST enable rerouting - so notification and other emails are not sent out to users.  You SHOULD change the email address from its default of admin[at]openvpms[dot]org so that only the you (ie the person doing the testing) gets the re-routed emails.

keygen utility

Complete

The keygen utility is used to generate the subscription keys and email them off to the subscriber.  Normally it will be invoked automatically on the receipt of the payment for a subscription.  However, it can also be run manually. If you run it manually you can run it in either GUI or command line mode - but for the GUI mode you need to have an environment that supports this, ie a Windows or unix desktop system.

See here for its installation instructions.

Invoking keygen with the --help option will display the following:

 

To run in GUI mode, start with no arguments
To run in Command Line mode, provide arguments
If you cannot run the program in GUI mode, then you must use the --server option
 to set the mail host's parameters. These are saved in the keygen.properties
 file in the .openvpms directory in the current user's home directory.
 This file can be edited if you need to change the template data.

Command Line Usage: java org.openvpms.subscription.keygen.KeyGenerator
                (-o|--organisation) <organisation> (-s|--subscriber) <subscriber> (-e|--email) <email> [(-d|--date) <date>] [(-i|--iSubDate) <iSubDate>] [-v|--verbose] [--validateOnly] [-?|--help] [--server serverParam1,serverParam2,...,serverParamN ] [--bcc <bcc>]

  (-o|--organisation) <organisation>
        Organisation Name - eg -o "Bloggs Vet Services Inc"

  (-s|--subscriber) <subscriber>
        Subscriber Name - eg -s "Dr Joe Bloggs"

  (-e|--email) <email>
        Subscriber's email address

  [(-d|--date) <date>]
        Date subscription expires in dd/mm/yyyy format - default Today+1year
        Must be after today's date if specified (default: 07/11/2015)

  [(-i|--iSubDate) <iSubDate>]
        Initial subscription date in dd/mm/yyyy format
        - if specified, is used to calculate the expiry date

  [-v|--verbose]
        Displays verbose info to the console

  [--validateOnly]
        Only validate - no subscription will be emailed

  [-?|--help]
        Provides usage documentation

  [--server serverParam1,serverParam2,...,serverParamN ]
        Set the mail server parameters name, port, user, password - eg
        --server mail.bigpond.com,25,tg[at]bigpond[dot]com,tg1234

  [--bcc <bcc>]
        Set the bcc address - to clear use --bcc #
        
        If --server or -bcc are used, other options (except verbose) are ignored

 

keygen installation

Complete

The following is a copy of the keygen readme.txt.

On a linux server, keygen should be installed in /usr/local/bin/keygen
It needs to be here because the php code in the ubercart conditional action custom php code
for the 'Run Keygen' predicate contains the line:
 exec("cd /usr/local/bin/keygen/bin && ./keygen.sh ".$eargs, $output, $return);

Having installed it (by simply creating the /usr/local/bin/keygen directory and unzipping
the contents of keygen.zip into it) you can then do:

 cd /usr/local/bin/keygen/bin
 chmod 755 *.sh               [to set the scripts as executable]
 
then  
 ./keygen.sh --help

to see what to do.

You should then use the --server option to set the various SMTP parameters (see --help output).

This will create ~/.openvpms/keygen.properties

This then must be moved to the appropriate directory - it was created in your home directory - but
we need to put it the home directory of the user who is running apache - who is www-data - and
his home is /var/www

So we need to cd to /var/www and then mkdir .openvpms and copy keygen.properties into this and then
adjust the ownerships to www-data:www-data

If you need to play with keygen on a windows machine, you can unzip the package to any convenient
folder and then cd to its bin folder and then use keygen.bat

zztest user

Complete

There is a user zztest defined in the system.

This user can be used for testing.  His password is set to '******'.

Note that if you ever need to force the ordering system to think that zztest has no Subscription Date set, you can set the year of the Subscription Date to 1900 and the 'Run Keygen' conditional action code - see http://www.openvpms.org/admin/store/ca/2/edit/actions - will treat this as null Subscription Date.