Exemplo n.º 1
0
 public function getName()
 {
     global $CATALOG_TRANSLATION;
     if ($CATALOG_TRANSLATION === true) {
         return LangUtil::getSpecimenName($this->specimenTypeId);
     } else {
         return $this->name;
     }
 }
Exemplo n.º 2
0
 public function get_specimen_catalog()
 {
     global $CATALOG_TRANSLATION;
     if ($_SESSION['level'] < 2 || $_SESSION['level'] > 4) {
         $user = get_user_by_id($_SESSION['user_id']);
         $lab_config_id = $user->labConfigId;
     }
     if ($lab_config_id == null) {
         $lab_config_id = get_lab_config_id_admin($_SESSION['user_id']);
     }
     $saved_db = DbUtil::switchToLabConfig($lab_config_id);
     $query_stypes = "SELECT specimen_type_id, name FROM specimen_type WHERE disabled=0 ORDER BY name";
     $resultset = query_associative_all($query_stypes, $row_count);
     $retval = array();
     if ($resultset) {
         foreach ($resultset as $record) {
             if ($CATALOG_TRANSLATION === true) {
                 $retval[$record['specimen_type_id']] = LangUtil::getSpecimenName($record['specimen_type_id']);
             } else {
                 $retval[$record['specimen_type_id']] = $record['name'];
             }
         }
     }
     DbUtil::switchRestore($saved_db);
     $catalog = $retval;
     if (count($catalog) > 0) {
         $ret = $catalog;
     } else {
         $ret = 0;
     }
     return $ret;
 }