public function init()
 {
     $auth = Zend_Auth::getInstance();
     $user = new User();
     $user->personId = (int) $auth->getIdentity()->personId;
     $user->populateWithPersonId();
     if (strlen($user->preferences) > 0) {
         $this->xmlPreferences = new SimpleXMLElement($user->preferences);
     }
     $this->user = $user;
 }
 public function editAction()
 {
     $ormId = (int) $this->_getParam("ormId");
     $enumerationId = (int) $this->_getParam("enumerationId");
     $this->view->enumerationId = $enumerationId;
     $enumerationsClosure = new EnumerationsClosure();
     $isRole = false;
     $depth = (int) $enumerationsClosure->getDepthById($enumerationId);
     if ($depth > 1) {
         $isRole = true;
     }
     if (!$isRole) {
         if ($depth === 0) {
             $this->view->message = __('Only team member role entries can be edited');
         } else {
             $this->view->message = __('There is nothing to edit on the team definition, add roles beneath it to link users to the team');
         }
     } else {
         $enumeration = new Enumeration();
         $enumeration->enumerationId = $enumerationId;
         $enumeration->populate();
         $enumerationsClosure = new EnumerationsClosure();
         $parentId = $enumerationsClosure->getParentById($enumerationId);
         $enumerationIterator = $enumerationsClosure->getAllDescendants($parentId, 1);
         $this->view->roleList = $enumerationIterator;
         $hasUserParent = false;
         // check if there is a non-user parent
         $depth = $enumerationsClosure->getDepthById($parentId);
         if ($depth > 1) {
             $hasUserParent = true;
         }
         $this->view->hasUserParent = $hasUserParent;
         $teamMember = new TeamMember();
         $teamMember->teamMemberId = $ormId;
         $teamMember->populate();
         $this->view->teamMember = $teamMember;
         $user = new User();
         $user->populateWithPersonId($teamMember->personId);
         $name = array();
         $name[$user->person_id] = '';
         if (strlen($user->username) > 0) {
             $name[$user->person_id] = $user->last_name . ', ' . $user->first_name . ' ' . substr($user->middle_name, 0, 1) . ' (' . $user->username . ")";
         }
         $this->view->defaultUser = $name;
     }
     $this->render();
 }
 protected function generateRegistry(SimpleXMLElement $xml)
 {
     $registry = $xml->addChild('registry');
     $user = new User();
     $user->personId = (int) $this->provider->personId;
     $user->populateWithPersonId();
     $building = new Building();
     $building->buildingId = $user->defaultBuildingId;
     $building->populate();
     $practice = $building->practice;
     /* XML Element: <registry-name>
      * Description: The registry name.
      * Data Element: Registry Name
      * Valid Values: Registry Name
      * Data Type: char(100)
      * Required: yes
      */
     $registry->addChild('registry-name', $practice->name);
     /* XML Element: <registry-id>
      * Description: Used to identify the registry. Use Registry's Corporate TIN number.
      * Data Element: Registry ID
      * Data Type: char(9)
      * Required: yes
      */
     $registry->addChild('registry-id', $practice->identifier);
     /* XML Element: <submission-method>
      * Description: Submission Method: (A-F)
      * 		A = 12 months, 80%, 3 or more measures
      * 		B = 6 months, 80%, 3 or more measures
      * 		C = 12 months, 30 consecutive, measure group
      * 		E = 12 months, 80%, measure group
      * 		F = 6 months, 80%, measure group
      * 		2010
      * 		A = 12 months, 80%, 3 or more measures
      * 		B = 6 months, 80%, 3 or more measures
      * 		G = 12 months, 30 patients, measure group
      * 		H = 12 months, 80%, min. of 15 patients, measure group
      * 		I = 6 months, 80%, min. of 8 patients, measure group
      * 		Note: Limit one xml file to a single submission method
      * Data Element: Submission Method
      * Valid Values: A,B,C,E,F
      * 		 (12 month reporting period = January 1, 2009 through December 31, 2009; 6 month reporting period = July 1, 2009 through December 31, 2009)
      * 		2010
      * 		 A,B,G,H,I
      * 		 (12 month reporting period = January 1, 2010 through December 31, 2010; 6 month reporting period = July 1, 2010 through December 31, 2010)
      * Data Type: char(1)
      * Required: yes
      */
     $registry->addChild('submission-method', 'A');
     return $registry;
 }
Example #4
0
 public static function getBuildingDefaultLocation($personId, $defaultLocationId = null)
 {
     // get default building given user's person id, if $defaultLocationId is defined then room is returned
     $user = new User();
     $user->personId = $personId;
     $user->populateWithPersonId();
     $user->populate();
     $building = null;
     $room = null;
     if (strlen($user->preferences) > 0) {
         $xmlPreferences = new SimpleXMLElement($user->preferences);
         $room = new Room();
         $room->roomId = (int) $xmlPreferences->currentLocation;
         if ($room->populate()) {
             $building = $room->building;
         }
     }
     if ($defaultLocationId === null) {
         if ($building === null) {
             $building = new Building();
             $building->buildingId = (int) $user->defaultBuildingId;
             $building->populate();
         }
         return $building;
     } else {
         if ($room === null) {
             $room = new Room();
             $room->roomId = (int) $defaultLocationId;
             $room->populate();
         }
         return $room;
     }
 }
 public function getUserDetailsAction()
 {
     $id = (int) $this->_getParam('id');
     $user = new User();
     $user->personId = $id;
     $user->populateWithPersonId();
     $data = $user->toArray();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }