TITLE:  Create institution addUserAsStaff() and addUserAsAdmin() wrapper
functions

BUG SUMMARY: We have an $institution->addUserAsMember() function that
adds a user to an institution it would be good to make a couple of
wrapper functions so that we can add them as institution staff or
institution admin role during the add member process

When we do something like:
$userid = 7;
$institution = 'test';

$user = new User();
$user->find_by_id($userid);

$institution = new Institution($institution);
$institution->addUserAsStaff($user);

==============================================

Commit hash: e168d22f5534d0e830ecbb535c096b4cbd1e6fdd
Environment tested: Master
Browser tested: Chrome
Theme used:  N/A

1) The following users exist (userid 1- 21)
2) Add the following code to the index.php file found in the htdocs folder.
         a) Add the code just above the if user is logged in function (line 29) 
         b) code to add is 
                $userid = 7;
                $institution = 'mynewinstitution';
                
                $user = new User();
                $user->find_by_id($userid);
                
                $institution = new Institution($institution);
                $institution->addUserAsStaff($user);
3) Site admin user is Logged in to site 

TEST STEPS: 
------------------------ 
1) Browse to the home page (wait for page to load)
2) Browse to Admin menu > Institutions > Staff 
4) Verify that Userid 7 has been added to the Institution staff  ✔
5) Change the $userid = 7; in the code on the index.php to = 8
6) Browse to Admin menu > Institutions > Staff 
7) Verify that Userid 8 has been added to the Institution staff  ✔

Catalyst QA ✔

NOTE: Remove the code from the index.php file

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1828309

Title:
  Create institution addUserAsStaff() and addUserAsAdmin() wrapper
  functions

Status in Mahara:
  In Progress

Bug description:
  We have an $institution->addUserAsMember() function that adds a user
  to an institution it would be good to make a couple of wrapper
  functions so that we can add them as institution staff or institution
  admin role during the add member process

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1828309/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to